From 0f1afec5a8906ae3f00d58ff2499ad7e7cfb577e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Apr 2023 18:43:58 +0200 Subject: [PATCH] [protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller --- BUILD | 10 +- CMakeLists.txt | 64 +- Makefile | 66 +- PYTHON-MANIFEST.in | 1 + WORKSPACE | 17 + bazel/grpc_deps.bzl | 27 +- build_handwritten.yaml | 4 +- cmake/upb.cmake | 2 +- config.m4 | 79 +- config.w32 | 79 +- examples/android/helloworld/app/build.gradle | 2 + examples/cpp/compression/Makefile | 8 +- examples/cpp/helloworld/Makefile | 22 +- .../cmake_externalproject/CMakeLists.txt | 18 + examples/cpp/load_balancing/Makefile | 8 +- examples/cpp/metadata/Makefile | 8 +- examples/cpp/route_guide/Makefile | 24 +- gRPC-C++.podspec | 204 +- gRPC-Core.podspec | 269 +- grpc.gemspec | 168 +- grpc.gyp | 67 +- include/grpcpp/impl/codegen/config_protobuf.h | 4 +- package.xml | 166 +- setup.py | 4 +- src/android/test/interop/app/build.gradle | 2 + src/compiler/BUILD | 1 + src/compiler/config_protobuf.h | 2 +- src/compiler/objective_c_generator.cc | 2 +- src/compiler/objective_c_generator_helpers.h | 2 +- src/compiler/objective_c_plugin.cc | 2 +- src/core/BUILD | 1 + .../backend_metrics/backend_metric_filter.cc | 2 +- .../filters/client_channel/backend_metric.cc | 3 +- .../health/health_check_client.cc | 2 +- .../lb_policy/grpclb/load_balancer_api.cc | 2 +- .../lb_policy/grpclb/load_balancer_api.h | 2 +- .../client_channel/lb_policy/rls/rls.cc | 2 +- .../upb-generated/envoy/admin/v3/certs.upb.c | 139 +- .../upb-generated/envoy/admin/v3/certs.upb.h | 527 +- .../envoy/admin/v3/clusters.upb.c | 181 +- .../envoy/admin/v3/clusters.upb.h | 660 +- .../envoy/admin/v3/config_dump.upb.c | 145 +- .../envoy/admin/v3/config_dump.upb.h | 533 +- .../envoy/admin/v3/config_dump_shared.upb.c | 563 +- .../envoy/admin/v3/config_dump_shared.upb.h | 2055 +++-- .../envoy/admin/v3/init_dump.upb.c | 47 +- .../envoy/admin/v3/init_dump.upb.h | 159 +- .../envoy/admin/v3/listeners.upb.c | 55 +- .../envoy/admin/v3/listeners.upb.h | 194 +- .../upb-generated/envoy/admin/v3/memory.upb.c | 41 +- .../upb-generated/envoy/admin/v3/memory.upb.h | 116 +- .../envoy/admin/v3/metrics.upb.c | 31 +- .../envoy/admin/v3/metrics.upb.h | 74 +- .../envoy/admin/v3/mutex_stats.upb.c | 31 +- .../envoy/admin/v3/mutex_stats.upb.h | 74 +- .../envoy/admin/v3/server_info.upb.c | 171 +- .../envoy/admin/v3/server_info.upb.h | 772 +- .../upb-generated/envoy/admin/v3/tap.upb.c | 33 +- .../upb-generated/envoy/admin/v3/tap.upb.h | 75 +- .../envoy/annotations/deprecation.upb.c | 41 +- .../envoy/annotations/deprecation.upb.h | 111 +- .../envoy/annotations/resource.upb.c | 39 +- .../envoy/annotations/resource.upb.h | 75 +- .../envoy/config/accesslog/v3/accesslog.upb.c | 345 +- .../envoy/config/accesslog/v3/accesslog.upb.h | 1073 ++- .../envoy/config/bootstrap/v3/bootstrap.upb.c | 623 +- .../envoy/config/bootstrap/v3/bootstrap.upb.h | 2524 ++++-- .../config/cluster/v3/circuit_breaker.upb.c | 115 +- .../config/cluster/v3/circuit_breaker.upb.h | 398 +- .../envoy/config/cluster/v3/cluster.upb.c | 805 +- .../envoy/config/cluster/v3/cluster.upb.h | 3021 ++++--- .../envoy/config/cluster/v3/filter.upb.c | 33 +- .../envoy/config/cluster/v3/filter.upb.h | 75 +- .../config/cluster/v3/outlier_detection.upb.c | 141 +- .../config/cluster/v3/outlier_detection.upb.h | 579 +- .../config/common/matcher/v3/matcher.upb.c | 401 +- .../config/common/matcher/v3/matcher.upb.h | 1290 +-- .../envoy/config/core/v3/address.upb.c | 219 +- .../envoy/config/core/v3/address.upb.h | 746 +- .../envoy/config/core/v3/backoff.upb.c | 35 +- .../envoy/config/core/v3/backoff.upb.h | 86 +- .../envoy/config/core/v3/base.upb.c | 573 +- .../envoy/config/core/v3/base.upb.h | 1691 ++-- .../envoy/config/core/v3/config_source.upb.c | 227 +- .../envoy/config/core/v3/config_source.upb.h | 845 +- .../config/core/v3/event_service_config.upb.c | 29 +- .../config/core/v3/event_service_config.upb.h | 63 +- .../envoy/config/core/v3/extension.upb.c | 33 +- .../envoy/config/core/v3/extension.upb.h | 75 +- .../config/core/v3/grpc_method_list.upb.c | 47 +- .../config/core/v3/grpc_method_list.upb.h | 159 +- .../envoy/config/core/v3/grpc_service.upb.c | 381 +- .../envoy/config/core/v3/grpc_service.upb.h | 1202 ++- .../envoy/config/core/v3/health_check.upb.c | 337 +- .../envoy/config/core/v3/health_check.upb.h | 1444 ++-- .../envoy/config/core/v3/http_uri.upb.c | 35 +- .../envoy/config/core/v3/http_uri.upb.h | 97 +- .../envoy/config/core/v3/protocol.upb.c | 497 +- .../envoy/config/core/v3/protocol.upb.h | 1671 ++-- .../envoy/config/core/v3/proxy_protocol.upb.c | 51 +- .../envoy/config/core/v3/proxy_protocol.upb.h | 147 +- .../envoy/config/core/v3/resolver.upb.c | 53 +- .../envoy/config/core/v3/resolver.upb.h | 155 +- .../envoy/config/core/v3/socket_option.upb.c | 59 +- .../envoy/config/core/v3/socket_option.upb.h | 197 +- .../core/v3/substitution_format_string.upb.c | 49 +- .../core/v3/substitution_format_string.upb.h | 193 +- .../config/core/v3/udp_socket_config.upb.c | 35 +- .../config/core/v3/udp_socket_config.upb.h | 88 +- .../envoy/config/endpoint/v3/endpoint.upb.c | 121 +- .../envoy/config/endpoint/v3/endpoint.upb.h | 363 +- .../endpoint/v3/endpoint_components.upb.c | 197 +- .../endpoint/v3/endpoint_components.upb.h | 649 +- .../config/endpoint/v3/load_report.upb.c | 177 +- .../config/endpoint/v3/load_report.upb.h | 703 +- .../config/listener/v3/api_listener.upb.c | 29 +- .../config/listener/v3/api_listener.upb.h | 61 +- .../envoy/config/listener/v3/listener.upb.c | 277 +- .../envoy/config/listener/v3/listener.upb.h | 1209 ++- .../listener/v3/listener_components.upb.c | 267 +- .../listener/v3/listener_components.upb.h | 1104 ++- .../config/listener/v3/quic_config.upb.c | 75 +- .../config/listener/v3/quic_config.upb.h | 269 +- .../listener/v3/udp_listener_config.upb.c | 57 +- .../listener/v3/udp_listener_config.upb.h | 128 +- .../config/metrics/v3/metrics_service.upb.c | 43 +- .../config/metrics/v3/metrics_service.upb.h | 116 +- .../envoy/config/metrics/v3/stats.upb.c | 205 +- .../envoy/config/metrics/v3/stats.upb.h | 685 +- .../envoy/config/overload/v3/overload.upb.c | 211 +- .../envoy/config/overload/v3/overload.upb.h | 678 +- .../envoy/config/rbac/v3/rbac.upb.c | 359 +- .../envoy/config/rbac/v3/rbac.upb.h | 1259 ++- .../envoy/config/route/v3/route.upb.c | 129 +- .../envoy/config/route/v3/route.upb.h | 674 +- .../config/route/v3/route_components.upb.c | 1857 +++-- .../config/route/v3/route_components.upb.h | 7298 +++++++++++------ .../envoy/config/route/v3/scoped_route.upb.c | 77 +- .../envoy/config/route/v3/scoped_route.upb.h | 233 +- .../envoy/config/tap/v3/common.upb.c | 325 +- .../envoy/config/tap/v3/common.upb.h | 1075 ++- .../envoy/config/trace/v3/datadog.upb.c | 31 +- .../envoy/config/trace/v3/datadog.upb.h | 74 +- .../envoy/config/trace/v3/dynamic_ot.upb.c | 33 +- .../envoy/config/trace/v3/dynamic_ot.upb.h | 75 +- .../envoy/config/trace/v3/http_tracer.upb.c | 51 +- .../envoy/config/trace/v3/http_tracer.upb.h | 117 +- .../envoy/config/trace/v3/lightstep.upb.c | 41 +- .../envoy/config/trace/v3/lightstep.upb.h | 134 +- .../envoy/config/trace/v3/opencensus.upb.c | 71 +- .../envoy/config/trace/v3/opencensus.upb.h | 321 +- .../envoy/config/trace/v3/opentelemetry.upb.c | 33 +- .../envoy/config/trace/v3/opentelemetry.upb.h | 75 +- .../envoy/config/trace/v3/service.upb.c | 29 +- .../envoy/config/trace/v3/service.upb.h | 61 +- .../envoy/config/trace/v3/skywalking.upb.c | 65 +- .../envoy/config/trace/v3/skywalking.upb.h | 178 +- .../envoy/config/trace/v3/trace.upb.c | 11 +- .../envoy/config/trace/v3/trace.upb.h | 35 +- .../envoy/config/trace/v3/xray.upb.c | 67 +- .../envoy/config/trace/v3/xray.upb.h | 185 +- .../envoy/config/trace/v3/zipkin.upb.c | 47 +- .../envoy/config/trace/v3/zipkin.upb.h | 145 +- .../clusters/aggregate/v3/cluster.upb.c | 25 +- .../clusters/aggregate/v3/cluster.upb.h | 79 +- .../filters/common/fault/v3/fault.upb.c | 97 +- .../filters/common/fault/v3/fault.upb.h | 258 +- .../filters/http/fault/v3/fault.upb.c | 117 +- .../filters/http/fault/v3/fault.upb.h | 488 +- .../filters/http/rbac/v3/rbac.upb.c | 69 +- .../filters/http/rbac/v3/rbac.upb.h | 194 +- .../filters/http/router/v3/router.upb.c | 61 +- .../filters/http/router/v3/router.upb.h | 274 +- .../v3/stateful_session.upb.c | 51 +- .../v3/stateful_session.upb.h | 122 +- .../v3/http_connection_manager.upb.c | 733 +- .../v3/http_connection_manager.upb.h | 3014 ++++--- .../stateful_session/cookie/v3/cookie.upb.c | 29 +- .../stateful_session/cookie/v3/cookie.upb.h | 61 +- .../v3/client_side_weighted_round_robin.upb.c | 55 +- .../v3/client_side_weighted_round_robin.upb.h | 190 +- .../common/v3/common.upb.c | 117 +- .../common/v3/common.upb.h | 331 +- .../ring_hash/v3/ring_hash.upb.c | 55 +- .../ring_hash/v3/ring_hash.upb.h | 197 +- .../wrr_locality/v3/wrr_locality.upb.c | 29 +- .../wrr_locality/v3/wrr_locality.upb.h | 61 +- .../transport_sockets/tls/v3/cert.upb.c | 11 +- .../transport_sockets/tls/v3/cert.upb.h | 25 +- .../transport_sockets/tls/v3/common.upb.c | 269 +- .../transport_sockets/tls/v3/common.upb.h | 1113 ++- .../transport_sockets/tls/v3/secret.upb.c | 89 +- .../transport_sockets/tls/v3/secret.upb.h | 251 +- .../transport_sockets/tls/v3/tls.upb.c | 287 +- .../transport_sockets/tls/v3/tls.upb.h | 1148 ++- .../tls/v3/tls_spiffe_validator_config.upb.c | 51 +- .../tls/v3/tls_spiffe_validator_config.upb.h | 141 +- .../envoy/service/discovery/v3/ads.upb.c | 17 +- .../envoy/service/discovery/v3/ads.upb.h | 32 +- .../service/discovery/v3/discovery.upb.c | 421 +- .../service/discovery/v3/discovery.upb.h | 1602 ++-- .../envoy/service/load_stats/v3/lrs.upb.c | 65 +- .../envoy/service/load_stats/v3/lrs.upb.h | 231 +- .../envoy/service/status/v3/csds.upb.c | 177 +- .../envoy/service/status/v3/csds.upb.h | 682 +- .../envoy/type/http/v3/cookie.upb.c | 35 +- .../envoy/type/http/v3/cookie.upb.h | 89 +- .../type/http/v3/path_transformation.upb.c | 65 +- .../type/http/v3/path_transformation.upb.h | 177 +- .../envoy/type/matcher/v3/filter_state.upb.c | 33 +- .../envoy/type/matcher/v3/filter_state.upb.h | 77 +- .../envoy/type/matcher/v3/http_inputs.upb.c | 81 +- .../envoy/type/matcher/v3/http_inputs.upb.h | 154 +- .../envoy/type/matcher/v3/metadata.upb.c | 57 +- .../envoy/type/matcher/v3/metadata.upb.h | 179 +- .../envoy/type/matcher/v3/node.upb.c | 35 +- .../envoy/type/matcher/v3/node.upb.h | 116 +- .../envoy/type/matcher/v3/number.upb.c | 33 +- .../envoy/type/matcher/v3/number.upb.h | 82 +- .../envoy/type/matcher/v3/path.upb.c | 29 +- .../envoy/type/matcher/v3/path.upb.h | 63 +- .../envoy/type/matcher/v3/regex.upb.c | 73 +- .../envoy/type/matcher/v3/regex.upb.h | 171 +- .../type/matcher/v3/status_code_input.upb.c | 23 +- .../type/matcher/v3/status_code_input.upb.h | 45 +- .../envoy/type/matcher/v3/string.upb.c | 63 +- .../envoy/type/matcher/v3/string.upb.h | 221 +- .../envoy/type/matcher/v3/struct.upb.c | 49 +- .../envoy/type/matcher/v3/struct.upb.h | 151 +- .../envoy/type/matcher/v3/value.upb.c | 75 +- .../envoy/type/matcher/v3/value.upb.h | 230 +- .../envoy/type/metadata/v3/metadata.upb.c | 107 +- .../envoy/type/metadata/v3/metadata.upb.h | 302 +- .../envoy/type/tracing/v3/custom_tag.upb.c | 125 +- .../envoy/type/tracing/v3/custom_tag.upb.h | 339 +- .../envoy/type/v3/hash_policy.upb.c | 55 +- .../envoy/type/v3/hash_policy.upb.h | 125 +- .../upb-generated/envoy/type/v3/http.upb.c | 11 +- .../upb-generated/envoy/type/v3/http.upb.h | 19 +- .../envoy/type/v3/http_status.upb.c | 25 +- .../envoy/type/v3/http_status.upb.h | 46 +- .../upb-generated/envoy/type/v3/percent.upb.c | 43 +- .../upb-generated/envoy/type/v3/percent.upb.h | 87 +- .../upb-generated/envoy/type/v3/range.upb.c | 65 +- .../upb-generated/envoy/type/v3/range.upb.h | 142 +- .../envoy/type/v3/ratelimit_strategy.upb.c | 55 +- .../envoy/type/v3/ratelimit_strategy.upb.h | 147 +- .../envoy/type/v3/ratelimit_unit.upb.c | 11 +- .../envoy/type/v3/ratelimit_unit.upb.h | 19 +- .../envoy/type/v3/semantic_version.upb.c | 31 +- .../envoy/type/v3/semantic_version.upb.h | 74 +- .../envoy/type/v3/token_bucket.upb.c | 37 +- .../envoy/type/v3/token_bucket.upb.h | 102 +- .../google/api/annotations.upb.c | 25 +- .../google/api/annotations.upb.h | 48 +- .../google/api/expr/v1alpha1/checked.upb.c | 381 +- .../google/api/expr/v1alpha1/checked.upb.h | 1284 ++- .../google/api/expr/v1alpha1/syntax.upb.c | 419 +- .../google/api/expr/v1alpha1/syntax.upb.h | 1365 +-- .../ext/upb-generated/google/api/http.upb.c | 103 +- .../ext/upb-generated/google/api/http.upb.h | 374 +- .../upb-generated/google/api/httpbody.upb.c | 35 +- .../upb-generated/google/api/httpbody.upb.h | 115 +- .../upb-generated/google/protobuf/any.upb.c | 29 +- .../upb-generated/google/protobuf/any.upb.h | 60 +- .../google/protobuf/descriptor.upb.c | 1212 ++- .../google/protobuf/descriptor.upb.h | 4339 ++++++---- .../google/protobuf/duration.upb.c | 29 +- .../google/protobuf/duration.upb.h | 60 +- .../upb-generated/google/protobuf/empty.upb.c | 17 +- .../upb-generated/google/protobuf/empty.upb.h | 32 +- .../google/protobuf/struct.upb.c | 101 +- .../google/protobuf/struct.upb.h | 297 +- .../google/protobuf/timestamp.upb.c | 29 +- .../google/protobuf/timestamp.upb.h | 60 +- .../google/protobuf/wrappers.upb.c | 137 +- .../google/protobuf/wrappers.upb.h | 262 +- .../ext/upb-generated/google/rpc/status.upb.c | 35 +- .../ext/upb-generated/google/rpc/status.upb.h | 115 +- .../ext/upb-generated/google/type/expr.upb.c | 37 +- .../ext/upb-generated/google/type/expr.upb.h | 88 +- .../proto/trace/v1/trace_config.upb.c | 93 +- .../proto/trace/v1/trace_config.upb.h | 246 +- .../src/proto/grpc/gcp/altscontext.upb.c | 67 +- .../src/proto/grpc/gcp/altscontext.upb.h | 179 +- .../src/proto/grpc/gcp/handshaker.upb.c | 359 +- .../src/proto/grpc/gcp/handshaker.upb.h | 1232 ++- .../grpc/gcp/transport_security_common.upb.c | 53 +- .../grpc/gcp/transport_security_common.upb.h | 125 +- .../src/proto/grpc/health/v1/health.upb.c | 39 +- .../src/proto/grpc/health/v1/health.upb.h | 73 +- .../src/proto/grpc/lb/v1/load_balancer.upb.c | 209 +- .../src/proto/grpc/lb/v1/load_balancer.upb.h | 584 +- .../src/proto/grpc/lookup/v1/rls.upb.c | 77 +- .../src/proto/grpc/lookup/v1/rls.upb.h | 198 +- .../src/proto/grpc/lookup/v1/rls_config.upb.c | 247 +- .../src/proto/grpc/lookup/v1/rls_config.upb.h | 975 ++- .../udpa/annotations/migrate.upb.c | 117 +- .../udpa/annotations/migrate.upb.h | 259 +- .../udpa/annotations/security.upb.c | 43 +- .../udpa/annotations/security.upb.h | 89 +- .../udpa/annotations/sensitive.upb.c | 21 +- .../udpa/annotations/sensitive.upb.h | 43 +- .../udpa/annotations/status.upb.c | 43 +- .../udpa/annotations/status.upb.h | 89 +- .../udpa/annotations/versioning.upb.c | 39 +- .../udpa/annotations/versioning.upb.h | 75 +- .../ext/upb-generated/validate/validate.upb.c | 1110 ++- .../ext/upb-generated/validate/validate.upb.h | 5583 ++++++++----- .../xds/annotations/v3/migrate.upb.c | 117 +- .../xds/annotations/v3/migrate.upb.h | 259 +- .../xds/annotations/v3/security.upb.c | 43 +- .../xds/annotations/v3/security.upb.h | 89 +- .../xds/annotations/v3/sensitive.upb.c | 21 +- .../xds/annotations/v3/sensitive.upb.h | 43 +- .../xds/annotations/v3/status.upb.c | 109 +- .../xds/annotations/v3/status.upb.h | 228 +- .../xds/annotations/v3/versioning.upb.c | 39 +- .../xds/annotations/v3/versioning.upb.h | 75 +- .../upb-generated/xds/core/v3/authority.upb.c | 25 +- .../upb-generated/xds/core/v3/authority.upb.h | 46 +- .../ext/upb-generated/xds/core/v3/cidr.upb.c | 33 +- .../ext/upb-generated/xds/core/v3/cidr.upb.h | 75 +- .../xds/core/v3/collection_entry.upb.c | 59 +- .../xds/core/v3/collection_entry.upb.h | 157 +- .../xds/core/v3/context_params.upb.c | 43 +- .../xds/core/v3/context_params.upb.h | 82 +- .../upb-generated/xds/core/v3/extension.upb.c | 33 +- .../upb-generated/xds/core/v3/extension.upb.h | 75 +- .../upb-generated/xds/core/v3/resource.upb.c | 37 +- .../upb-generated/xds/core/v3/resource.upb.h | 104 +- .../xds/core/v3/resource_locator.upb.c | 69 +- .../xds/core/v3/resource_locator.upb.h | 233 +- .../xds/core/v3/resource_name.upb.c | 41 +- .../xds/core/v3/resource_name.upb.h | 103 +- .../xds/data/orca/v3/orca_load_report.upb.c | 107 +- .../xds/data/orca/v3/orca_load_report.upb.h | 250 +- .../xds/service/orca/v3/orca.upb.c | 33 +- .../xds/service/orca/v3/orca.upb.h | 108 +- .../xds/type/matcher/v3/cel.upb.c | 29 +- .../xds/type/matcher/v3/cel.upb.h | 61 +- .../xds/type/matcher/v3/domain.upb.c | 51 +- .../xds/type/matcher/v3/domain.upb.h | 172 +- .../xds/type/matcher/v3/http_inputs.upb.c | 17 +- .../xds/type/matcher/v3/http_inputs.upb.h | 32 +- .../xds/type/matcher/v3/ip.upb.c | 55 +- .../xds/type/matcher/v3/ip.upb.h | 196 +- .../xds/type/matcher/v3/matcher.upb.c | 259 +- .../xds/type/matcher/v3/matcher.upb.h | 767 +- .../xds/type/matcher/v3/range.upb.c | 137 +- .../xds/type/matcher/v3/range.upb.h | 504 +- .../xds/type/matcher/v3/regex.upb.c | 39 +- .../xds/type/matcher/v3/regex.upb.h | 88 +- .../xds/type/matcher/v3/string.upb.c | 63 +- .../xds/type/matcher/v3/string.upb.h | 221 +- .../ext/upb-generated/xds/type/v3/cel.upb.c | 59 +- .../ext/upb-generated/xds/type/v3/cel.upb.h | 156 +- .../ext/upb-generated/xds/type/v3/range.upb.c | 65 +- .../ext/upb-generated/xds/type/v3/range.upb.h | 142 +- .../xds/type/v3/typed_struct.upb.c | 33 +- .../xds/type/v3/typed_struct.upb.h | 75 +- .../envoy/admin/v3/certs.upbdefs.c | 2 +- .../envoy/admin/v3/certs.upbdefs.h | 11 +- .../envoy/admin/v3/clusters.upbdefs.c | 2 +- .../envoy/admin/v3/clusters.upbdefs.h | 11 +- .../envoy/admin/v3/config_dump.upbdefs.c | 2 +- .../envoy/admin/v3/config_dump.upbdefs.h | 11 +- .../admin/v3/config_dump_shared.upbdefs.c | 2 +- .../admin/v3/config_dump_shared.upbdefs.h | 11 +- .../envoy/admin/v3/init_dump.upbdefs.c | 2 +- .../envoy/admin/v3/init_dump.upbdefs.h | 11 +- .../envoy/admin/v3/listeners.upbdefs.c | 2 +- .../envoy/admin/v3/listeners.upbdefs.h | 11 +- .../envoy/admin/v3/memory.upbdefs.c | 2 +- .../envoy/admin/v3/memory.upbdefs.h | 11 +- .../envoy/admin/v3/metrics.upbdefs.c | 2 +- .../envoy/admin/v3/metrics.upbdefs.h | 11 +- .../envoy/admin/v3/mutex_stats.upbdefs.c | 2 +- .../envoy/admin/v3/mutex_stats.upbdefs.h | 11 +- .../envoy/admin/v3/server_info.upbdefs.c | 2 +- .../envoy/admin/v3/server_info.upbdefs.h | 11 +- .../envoy/admin/v3/tap.upbdefs.c | 2 +- .../envoy/admin/v3/tap.upbdefs.h | 11 +- .../envoy/annotations/deprecation.upbdefs.c | 2 +- .../envoy/annotations/deprecation.upbdefs.h | 11 +- .../envoy/annotations/resource.upbdefs.c | 2 +- .../envoy/annotations/resource.upbdefs.h | 11 +- .../config/accesslog/v3/accesslog.upbdefs.c | 2 +- .../config/accesslog/v3/accesslog.upbdefs.h | 11 +- .../config/bootstrap/v3/bootstrap.upbdefs.c | 2 +- .../config/bootstrap/v3/bootstrap.upbdefs.h | 11 +- .../cluster/v3/circuit_breaker.upbdefs.c | 2 +- .../cluster/v3/circuit_breaker.upbdefs.h | 11 +- .../envoy/config/cluster/v3/cluster.upbdefs.c | 2 +- .../envoy/config/cluster/v3/cluster.upbdefs.h | 11 +- .../envoy/config/cluster/v3/filter.upbdefs.c | 2 +- .../envoy/config/cluster/v3/filter.upbdefs.h | 11 +- .../cluster/v3/outlier_detection.upbdefs.c | 2 +- .../cluster/v3/outlier_detection.upbdefs.h | 11 +- .../common/matcher/v3/matcher.upbdefs.c | 2 +- .../common/matcher/v3/matcher.upbdefs.h | 11 +- .../envoy/config/core/v3/address.upbdefs.c | 2 +- .../envoy/config/core/v3/address.upbdefs.h | 11 +- .../envoy/config/core/v3/backoff.upbdefs.c | 2 +- .../envoy/config/core/v3/backoff.upbdefs.h | 11 +- .../envoy/config/core/v3/base.upbdefs.c | 2 +- .../envoy/config/core/v3/base.upbdefs.h | 11 +- .../config/core/v3/config_source.upbdefs.c | 2 +- .../config/core/v3/config_source.upbdefs.h | 11 +- .../core/v3/event_service_config.upbdefs.c | 2 +- .../core/v3/event_service_config.upbdefs.h | 11 +- .../envoy/config/core/v3/extension.upbdefs.c | 2 +- .../envoy/config/core/v3/extension.upbdefs.h | 11 +- .../config/core/v3/grpc_method_list.upbdefs.c | 2 +- .../config/core/v3/grpc_method_list.upbdefs.h | 11 +- .../config/core/v3/grpc_service.upbdefs.c | 2 +- .../config/core/v3/grpc_service.upbdefs.h | 11 +- .../config/core/v3/health_check.upbdefs.c | 2 +- .../config/core/v3/health_check.upbdefs.h | 11 +- .../envoy/config/core/v3/http_uri.upbdefs.c | 2 +- .../envoy/config/core/v3/http_uri.upbdefs.h | 11 +- .../envoy/config/core/v3/protocol.upbdefs.c | 2 +- .../envoy/config/core/v3/protocol.upbdefs.h | 11 +- .../config/core/v3/proxy_protocol.upbdefs.c | 2 +- .../config/core/v3/proxy_protocol.upbdefs.h | 11 +- .../envoy/config/core/v3/resolver.upbdefs.c | 2 +- .../envoy/config/core/v3/resolver.upbdefs.h | 11 +- .../config/core/v3/socket_option.upbdefs.c | 2 +- .../config/core/v3/socket_option.upbdefs.h | 11 +- .../v3/substitution_format_string.upbdefs.c | 2 +- .../v3/substitution_format_string.upbdefs.h | 11 +- .../core/v3/udp_socket_config.upbdefs.c | 2 +- .../core/v3/udp_socket_config.upbdefs.h | 11 +- .../config/endpoint/v3/endpoint.upbdefs.c | 2 +- .../config/endpoint/v3/endpoint.upbdefs.h | 11 +- .../endpoint/v3/endpoint_components.upbdefs.c | 2 +- .../endpoint/v3/endpoint_components.upbdefs.h | 11 +- .../config/endpoint/v3/load_report.upbdefs.c | 2 +- .../config/endpoint/v3/load_report.upbdefs.h | 11 +- .../config/listener/v3/api_listener.upbdefs.c | 2 +- .../config/listener/v3/api_listener.upbdefs.h | 11 +- .../config/listener/v3/listener.upbdefs.c | 2 +- .../config/listener/v3/listener.upbdefs.h | 11 +- .../listener/v3/listener_components.upbdefs.c | 2 +- .../listener/v3/listener_components.upbdefs.h | 11 +- .../config/listener/v3/quic_config.upbdefs.c | 2 +- .../config/listener/v3/quic_config.upbdefs.h | 11 +- .../listener/v3/udp_listener_config.upbdefs.c | 2 +- .../listener/v3/udp_listener_config.upbdefs.h | 11 +- .../metrics/v3/metrics_service.upbdefs.c | 2 +- .../metrics/v3/metrics_service.upbdefs.h | 11 +- .../envoy/config/metrics/v3/stats.upbdefs.c | 2 +- .../envoy/config/metrics/v3/stats.upbdefs.h | 11 +- .../config/overload/v3/overload.upbdefs.c | 2 +- .../config/overload/v3/overload.upbdefs.h | 11 +- .../envoy/config/rbac/v3/rbac.upbdefs.c | 2 +- .../envoy/config/rbac/v3/rbac.upbdefs.h | 11 +- .../envoy/config/route/v3/route.upbdefs.c | 2 +- .../envoy/config/route/v3/route.upbdefs.h | 11 +- .../route/v3/route_components.upbdefs.c | 2 +- .../route/v3/route_components.upbdefs.h | 11 +- .../config/route/v3/scoped_route.upbdefs.c | 2 +- .../config/route/v3/scoped_route.upbdefs.h | 11 +- .../envoy/config/tap/v3/common.upbdefs.c | 2 +- .../envoy/config/tap/v3/common.upbdefs.h | 11 +- .../envoy/config/trace/v3/datadog.upbdefs.c | 2 +- .../envoy/config/trace/v3/datadog.upbdefs.h | 11 +- .../config/trace/v3/dynamic_ot.upbdefs.c | 2 +- .../config/trace/v3/dynamic_ot.upbdefs.h | 11 +- .../config/trace/v3/http_tracer.upbdefs.c | 2 +- .../config/trace/v3/http_tracer.upbdefs.h | 11 +- .../envoy/config/trace/v3/lightstep.upbdefs.c | 2 +- .../envoy/config/trace/v3/lightstep.upbdefs.h | 11 +- .../config/trace/v3/opencensus.upbdefs.c | 2 +- .../config/trace/v3/opencensus.upbdefs.h | 11 +- .../config/trace/v3/opentelemetry.upbdefs.c | 2 +- .../config/trace/v3/opentelemetry.upbdefs.h | 11 +- .../envoy/config/trace/v3/service.upbdefs.c | 2 +- .../envoy/config/trace/v3/service.upbdefs.h | 11 +- .../config/trace/v3/skywalking.upbdefs.c | 2 +- .../config/trace/v3/skywalking.upbdefs.h | 11 +- .../envoy/config/trace/v3/trace.upbdefs.c | 2 +- .../envoy/config/trace/v3/trace.upbdefs.h | 11 +- .../envoy/config/trace/v3/xray.upbdefs.c | 2 +- .../envoy/config/trace/v3/xray.upbdefs.h | 11 +- .../envoy/config/trace/v3/zipkin.upbdefs.c | 2 +- .../envoy/config/trace/v3/zipkin.upbdefs.h | 11 +- .../clusters/aggregate/v3/cluster.upbdefs.c | 2 +- .../clusters/aggregate/v3/cluster.upbdefs.h | 11 +- .../filters/common/fault/v3/fault.upbdefs.c | 2 +- .../filters/common/fault/v3/fault.upbdefs.h | 11 +- .../filters/http/fault/v3/fault.upbdefs.c | 2 +- .../filters/http/fault/v3/fault.upbdefs.h | 11 +- .../filters/http/rbac/v3/rbac.upbdefs.c | 2 +- .../filters/http/rbac/v3/rbac.upbdefs.h | 11 +- .../filters/http/router/v3/router.upbdefs.c | 2 +- .../filters/http/router/v3/router.upbdefs.h | 11 +- .../v3/stateful_session.upbdefs.c | 2 +- .../v3/stateful_session.upbdefs.h | 11 +- .../v3/http_connection_manager.upbdefs.c | 2 +- .../v3/http_connection_manager.upbdefs.h | 11 +- .../cookie/v3/cookie.upbdefs.c | 2 +- .../cookie/v3/cookie.upbdefs.h | 11 +- .../transport_sockets/tls/v3/cert.upbdefs.c | 2 +- .../transport_sockets/tls/v3/cert.upbdefs.h | 11 +- .../transport_sockets/tls/v3/common.upbdefs.c | 2 +- .../transport_sockets/tls/v3/common.upbdefs.h | 11 +- .../transport_sockets/tls/v3/secret.upbdefs.c | 2 +- .../transport_sockets/tls/v3/secret.upbdefs.h | 11 +- .../transport_sockets/tls/v3/tls.upbdefs.c | 2 +- .../transport_sockets/tls/v3/tls.upbdefs.h | 11 +- .../v3/tls_spiffe_validator_config.upbdefs.c | 2 +- .../v3/tls_spiffe_validator_config.upbdefs.h | 11 +- .../envoy/service/discovery/v3/ads.upbdefs.c | 2 +- .../envoy/service/discovery/v3/ads.upbdefs.h | 11 +- .../service/discovery/v3/discovery.upbdefs.c | 2 +- .../service/discovery/v3/discovery.upbdefs.h | 11 +- .../envoy/service/load_stats/v3/lrs.upbdefs.c | 2 +- .../envoy/service/load_stats/v3/lrs.upbdefs.h | 11 +- .../envoy/service/status/v3/csds.upbdefs.c | 2 +- .../envoy/service/status/v3/csds.upbdefs.h | 11 +- .../envoy/type/http/v3/cookie.upbdefs.c | 2 +- .../envoy/type/http/v3/cookie.upbdefs.h | 11 +- .../http/v3/path_transformation.upbdefs.c | 2 +- .../http/v3/path_transformation.upbdefs.h | 11 +- .../type/matcher/v3/filter_state.upbdefs.c | 2 +- .../type/matcher/v3/filter_state.upbdefs.h | 11 +- .../type/matcher/v3/http_inputs.upbdefs.c | 2 +- .../type/matcher/v3/http_inputs.upbdefs.h | 11 +- .../envoy/type/matcher/v3/metadata.upbdefs.c | 2 +- .../envoy/type/matcher/v3/metadata.upbdefs.h | 11 +- .../envoy/type/matcher/v3/node.upbdefs.c | 2 +- .../envoy/type/matcher/v3/node.upbdefs.h | 11 +- .../envoy/type/matcher/v3/number.upbdefs.c | 2 +- .../envoy/type/matcher/v3/number.upbdefs.h | 11 +- .../envoy/type/matcher/v3/path.upbdefs.c | 2 +- .../envoy/type/matcher/v3/path.upbdefs.h | 11 +- .../envoy/type/matcher/v3/regex.upbdefs.c | 2 +- .../envoy/type/matcher/v3/regex.upbdefs.h | 11 +- .../matcher/v3/status_code_input.upbdefs.c | 2 +- .../matcher/v3/status_code_input.upbdefs.h | 11 +- .../envoy/type/matcher/v3/string.upbdefs.c | 2 +- .../envoy/type/matcher/v3/string.upbdefs.h | 11 +- .../envoy/type/matcher/v3/struct.upbdefs.c | 2 +- .../envoy/type/matcher/v3/struct.upbdefs.h | 11 +- .../envoy/type/matcher/v3/value.upbdefs.c | 2 +- .../envoy/type/matcher/v3/value.upbdefs.h | 11 +- .../envoy/type/metadata/v3/metadata.upbdefs.c | 2 +- .../envoy/type/metadata/v3/metadata.upbdefs.h | 11 +- .../type/tracing/v3/custom_tag.upbdefs.c | 2 +- .../type/tracing/v3/custom_tag.upbdefs.h | 11 +- .../envoy/type/v3/hash_policy.upbdefs.c | 2 +- .../envoy/type/v3/hash_policy.upbdefs.h | 11 +- .../envoy/type/v3/http.upbdefs.c | 2 +- .../envoy/type/v3/http.upbdefs.h | 11 +- .../envoy/type/v3/http_status.upbdefs.c | 2 +- .../envoy/type/v3/http_status.upbdefs.h | 11 +- .../envoy/type/v3/percent.upbdefs.c | 2 +- .../envoy/type/v3/percent.upbdefs.h | 11 +- .../envoy/type/v3/range.upbdefs.c | 2 +- .../envoy/type/v3/range.upbdefs.h | 11 +- .../type/v3/ratelimit_strategy.upbdefs.c | 2 +- .../type/v3/ratelimit_strategy.upbdefs.h | 11 +- .../envoy/type/v3/ratelimit_unit.upbdefs.c | 2 +- .../envoy/type/v3/ratelimit_unit.upbdefs.h | 11 +- .../envoy/type/v3/semantic_version.upbdefs.c | 2 +- .../envoy/type/v3/semantic_version.upbdefs.h | 11 +- .../envoy/type/v3/token_bucket.upbdefs.c | 2 +- .../envoy/type/v3/token_bucket.upbdefs.h | 11 +- .../google/api/annotations.upbdefs.c | 2 +- .../google/api/annotations.upbdefs.h | 11 +- .../api/expr/v1alpha1/checked.upbdefs.c | 2 +- .../api/expr/v1alpha1/checked.upbdefs.h | 11 +- .../google/api/expr/v1alpha1/syntax.upbdefs.c | 2 +- .../google/api/expr/v1alpha1/syntax.upbdefs.h | 11 +- .../google/api/http.upbdefs.c | 2 +- .../google/api/http.upbdefs.h | 11 +- .../google/api/httpbody.upbdefs.c | 2 +- .../google/api/httpbody.upbdefs.h | 11 +- .../google/protobuf/any.upbdefs.c | 2 +- .../google/protobuf/any.upbdefs.h | 11 +- .../google/protobuf/descriptor.upbdefs.c | 587 +- .../google/protobuf/descriptor.upbdefs.h | 11 +- .../google/protobuf/duration.upbdefs.c | 2 +- .../google/protobuf/duration.upbdefs.h | 11 +- .../google/protobuf/empty.upbdefs.c | 2 +- .../google/protobuf/empty.upbdefs.h | 11 +- .../google/protobuf/struct.upbdefs.c | 2 +- .../google/protobuf/struct.upbdefs.h | 11 +- .../google/protobuf/timestamp.upbdefs.c | 2 +- .../google/protobuf/timestamp.upbdefs.h | 11 +- .../google/protobuf/wrappers.upbdefs.c | 2 +- .../google/protobuf/wrappers.upbdefs.h | 11 +- .../google/rpc/status.upbdefs.c | 2 +- .../google/rpc/status.upbdefs.h | 11 +- .../proto/trace/v1/trace_config.upbdefs.c | 2 +- .../proto/trace/v1/trace_config.upbdefs.h | 11 +- .../proto/grpc/lookup/v1/rls_config.upbdefs.c | 2 +- .../proto/grpc/lookup/v1/rls_config.upbdefs.h | 11 +- .../udpa/annotations/migrate.upbdefs.c | 2 +- .../udpa/annotations/migrate.upbdefs.h | 11 +- .../udpa/annotations/security.upbdefs.c | 2 +- .../udpa/annotations/security.upbdefs.h | 11 +- .../udpa/annotations/sensitive.upbdefs.c | 2 +- .../udpa/annotations/sensitive.upbdefs.h | 11 +- .../udpa/annotations/status.upbdefs.c | 2 +- .../udpa/annotations/status.upbdefs.h | 11 +- .../udpa/annotations/versioning.upbdefs.c | 2 +- .../udpa/annotations/versioning.upbdefs.h | 11 +- .../validate/validate.upbdefs.c | 2 +- .../validate/validate.upbdefs.h | 11 +- .../xds/annotations/v3/migrate.upbdefs.c | 2 +- .../xds/annotations/v3/migrate.upbdefs.h | 11 +- .../xds/annotations/v3/security.upbdefs.c | 2 +- .../xds/annotations/v3/security.upbdefs.h | 11 +- .../xds/annotations/v3/sensitive.upbdefs.c | 2 +- .../xds/annotations/v3/sensitive.upbdefs.h | 11 +- .../xds/annotations/v3/status.upbdefs.c | 2 +- .../xds/annotations/v3/status.upbdefs.h | 11 +- .../xds/annotations/v3/versioning.upbdefs.c | 2 +- .../xds/annotations/v3/versioning.upbdefs.h | 11 +- .../xds/core/v3/authority.upbdefs.c | 2 +- .../xds/core/v3/authority.upbdefs.h | 11 +- .../xds/core/v3/cidr.upbdefs.c | 2 +- .../xds/core/v3/cidr.upbdefs.h | 11 +- .../xds/core/v3/collection_entry.upbdefs.c | 2 +- .../xds/core/v3/collection_entry.upbdefs.h | 11 +- .../xds/core/v3/context_params.upbdefs.c | 2 +- .../xds/core/v3/context_params.upbdefs.h | 11 +- .../xds/core/v3/extension.upbdefs.c | 2 +- .../xds/core/v3/extension.upbdefs.h | 11 +- .../xds/core/v3/resource.upbdefs.c | 2 +- .../xds/core/v3/resource.upbdefs.h | 11 +- .../xds/core/v3/resource_locator.upbdefs.c | 2 +- .../xds/core/v3/resource_locator.upbdefs.h | 11 +- .../xds/core/v3/resource_name.upbdefs.c | 2 +- .../xds/core/v3/resource_name.upbdefs.h | 11 +- .../xds/type/matcher/v3/cel.upbdefs.c | 2 +- .../xds/type/matcher/v3/cel.upbdefs.h | 11 +- .../xds/type/matcher/v3/domain.upbdefs.c | 2 +- .../xds/type/matcher/v3/domain.upbdefs.h | 11 +- .../xds/type/matcher/v3/http_inputs.upbdefs.c | 2 +- .../xds/type/matcher/v3/http_inputs.upbdefs.h | 11 +- .../xds/type/matcher/v3/ip.upbdefs.c | 2 +- .../xds/type/matcher/v3/ip.upbdefs.h | 11 +- .../xds/type/matcher/v3/matcher.upbdefs.c | 2 +- .../xds/type/matcher/v3/matcher.upbdefs.h | 11 +- .../xds/type/matcher/v3/range.upbdefs.c | 2 +- .../xds/type/matcher/v3/range.upbdefs.h | 11 +- .../xds/type/matcher/v3/regex.upbdefs.c | 2 +- .../xds/type/matcher/v3/regex.upbdefs.h | 11 +- .../xds/type/matcher/v3/string.upbdefs.c | 2 +- .../xds/type/matcher/v3/string.upbdefs.h | 11 +- .../xds/type/v3/cel.upbdefs.c | 2 +- .../xds/type/v3/cel.upbdefs.h | 11 +- .../xds/type/v3/range.upbdefs.c | 2 +- .../xds/type/v3/range.upbdefs.h | 11 +- .../xds/type/v3/typed_struct.upbdefs.c | 2 +- .../xds/type/v3/typed_struct.upbdefs.h | 11 +- src/core/ext/xds/upb_utils.h | 2 +- src/core/ext/xds/xds_api.cc | 6 +- src/core/ext/xds/xds_api.h | 4 +- src/core/ext/xds/xds_client.cc | 2 +- src/core/ext/xds/xds_client.h | 2 +- src/core/ext/xds/xds_cluster.cc | 4 +- src/core/ext/xds/xds_cluster.h | 2 +- .../ext/xds/xds_cluster_specifier_plugin.cc | 4 +- .../ext/xds/xds_cluster_specifier_plugin.h | 4 +- src/core/ext/xds/xds_common_types.cc | 6 +- src/core/ext/xds/xds_endpoint.cc | 2 +- src/core/ext/xds/xds_endpoint.h | 2 +- src/core/ext/xds/xds_http_fault_filter.cc | 1 - src/core/ext/xds/xds_http_fault_filter.h | 2 +- src/core/ext/xds/xds_http_filters.h | 2 +- src/core/ext/xds/xds_http_rbac_filter.cc | 2 +- src/core/ext/xds/xds_http_rbac_filter.h | 2 +- .../xds/xds_http_stateful_session_filter.cc | 1 - .../xds/xds_http_stateful_session_filter.h | 2 +- src/core/ext/xds/xds_listener.cc | 4 +- src/core/ext/xds/xds_listener.h | 2 +- src/core/ext/xds/xds_resource_type.h | 4 +- src/core/ext/xds/xds_route_config.cc | 6 +- src/core/ext/xds/xds_route_config.h | 2 +- src/core/lib/gprpp/status_helper.cc | 4 +- .../authorization/cel_authorization_engine.cc | 3 +- src/cpp/common/alts_context.cc | 3 +- src/cpp/ext/gcp/observability_logging_sink.cc | 5 +- src/cpp/ext/proto_server_reflection.cc | 1 + src/cpp/server/channelz/channelz_service.cc | 3 + .../health/default_health_check_service.cc | 2 +- src/cpp/server/load_reporter/load_reporter.cc | 4 +- .../load_reporter_async_service_impl.cc | 3 +- src/cpp/server/orca/orca_service.cc | 2 +- src/csharp/build/dependencies.props | 2 +- .../!ProtoCompiler-gRPCCppPlugin.podspec | 2 +- .../!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/!ProtoCompiler.podspec | 2 +- .../examples/InterceptorSample/Podfile | 2 +- .../RemoteTestClient/RemoteTest.podspec | 8 +- src/objective-c/examples/Sample/Podfile | 2 +- src/objective-c/examples/SwiftSample/Podfile | 2 +- .../examples/watchOS-sample/Podfile | 4 +- src/python/grpcio/grpc_core_dependencies.py | 64 +- src/upb/gen_build_yaml.py | 166 +- templates/config.m4.template | 1 + templates/config.w32.template | 1 + templates/gRPC-Core.podspec.template | 1 + test/core/xds/xds_client_test.cc | 4 +- .../xds/xds_cluster_resource_type_test.cc | 2 +- test/core/xds/xds_common_types_test.cc | 5 +- .../xds/xds_endpoint_resource_type_test.cc | 2 +- test/core/xds/xds_http_filters_test.cc | 4 +- test/core/xds/xds_lb_policy_registry_test.cc | 5 +- .../xds/xds_listener_resource_type_test.cc | 2 +- .../xds_route_config_resource_type_test.cc | 3 +- test/distrib/bazel/python/BUILD | 10 + test/distrib/bazel/python/WORKSPACE | 17 + test/distrib/cpp/run_distrib_test_cmake.bat | 3 +- test/distrib/cpp/run_distrib_test_cmake.sh | 3 +- .../run_distrib_test_cmake_aarch64_cross.sh | 1 + .../run_distrib_test_cmake_as_submodule.sh | 2 +- .../run_distrib_test_cmake_fetchcontent.sh | 2 + .../cpp/run_distrib_test_cmake_pkgconfig.sh | 5 +- third_party/README.md | 6 +- third_party/protobuf | 2 +- third_party/protobuf.patch | 2 +- third_party/protobuf2.patch | 31 + third_party/upb/.bazelci/presubmit.yml | 8 +- third_party/upb/.bazelrc | 3 +- .../actions/setup-bazel-cache/action.yml | 21 + .../upb/.github/workflows/bazel_tests.yml | 81 +- third_party/upb/.github/workflows/cifuzz.yml | 2 +- .../upb/.github/workflows/clang_format.yml | 4 +- .../upb/.github/workflows/generate_files.yml | 20 +- .../upb/.github/workflows/mergeable.yml | 15 + .../upb/.github/workflows/python_tests.yml | 67 +- third_party/upb/BUILD | 1001 ++- third_party/upb/DESIGN.md | 2 +- third_party/upb/README.md | 10 +- third_party/upb/WORKSPACE | 59 +- third_party/upb/bazel/BUILD | 5 + third_party/upb/bazel/amalgamate.py | 97 +- third_party/upb/bazel/amalgamation.bzl | 85 + third_party/upb/bazel/build_defs.bzl | 61 +- third_party/upb/bazel/protobuf.patch | 46 +- third_party/upb/bazel/py_proto_library.bzl | 28 +- third_party/upb/bazel/system_python.bzl | 232 +- third_party/upb/bazel/upb_proto_library.bzl | 162 +- third_party/upb/bazel/workspace_deps.bzl | 42 +- third_party/upb/benchmarks/BUILD | 3 +- third_party/upb/benchmarks/benchmark.cc | 15 +- third_party/upb/benchmarks/build_defs.bzl | 2 +- third_party/upb/cmake/BUILD.bazel | 10 +- third_party/upb/cmake/CMakeLists.txt | 320 + third_party/upb/cmake/build_defs.bzl | 12 +- .../cmake/google/protobuf/descriptor.upb.c | 1130 +++ .../cmake/google/protobuf/descriptor.upb.h | 4742 +++++++++++ third_party/upb/cmake/make_cmakelists.py | 69 +- third_party/upb/cmake/push_auto_update.sh | 43 + third_party/upb/cmake/staleness_test.py | 2 +- third_party/upb/cmake/staleness_test_lib.py | 11 +- third_party/upb/docs/style-guide.md | 2 +- third_party/upb/docs/wrapping-upb.md | 12 +- .../upb/{upb/bindings => }/lua/BUILD.bazel | 12 +- third_party/upb/lua/README.md | 8 + third_party/upb/{upb/bindings => }/lua/def.c | 4 +- .../bindings => }/lua/lua_proto_library.bzl | 30 +- third_party/upb/{upb/bindings => }/lua/main.c | 6 +- third_party/upb/{upb/bindings => }/lua/msg.c | 26 +- .../upb/{upb/bindings => }/lua/test.proto | 0 .../upb/{upb/bindings => }/lua/test_upb.lua | 4 +- third_party/upb/{upb/bindings => }/lua/upb.c | 2 +- third_party/upb/{upb/bindings => }/lua/upb.h | 4 +- .../upb/{upb/bindings => }/lua/upb.lua | 0 .../upb/{upb/bindings => }/lua/upbc.cc | 8 +- third_party/upb/protos/BUILD | 99 + third_party/upb/protos/bazel/BUILD | 39 + .../upb/protos/bazel/upb_cc_proto_library.bzl | 322 + third_party/upb/protos/protos.cc | 108 + third_party/upb/protos/protos.h | 494 ++ third_party/upb/protos/protos_internal.h | 44 + .../upb/protos/protos_internal_test.cc | 55 + third_party/upb/protos_generator/BUILD | 81 + .../upb/protos_generator/gen_accessors.cc | 729 ++ .../upb/protos_generator/gen_accessors.h | 44 + third_party/upb/protos_generator/gen_enums.cc | 137 + third_party/upb/protos_generator/gen_enums.h | 44 + .../upb/protos_generator/gen_extensions.cc | 110 + .../upb/protos_generator/gen_extensions.h | 49 + .../upb/protos_generator/gen_messages.cc | 379 + .../upb/protos_generator/gen_messages.h | 47 + third_party/upb/protos_generator/gen_utils.cc | 278 + third_party/upb/protos_generator/gen_utils.h | 93 + third_party/upb/protos_generator/output.cc | 85 + third_party/upb/protos_generator/output.h | 171 + .../protos_generator/protoc-gen-upb-protos.cc | 303 + third_party/upb/protos_generator/tests/BUILD | 135 + .../protos_generator/tests/child_model.proto | 19 + .../protos_generator/tests/legacy-name.proto | 10 + .../protos_generator/tests/no_package.proto | 18 + .../tests/no_package_enum_user.proto | 11 + .../protos_generator/tests/test_enum.proto | 10 + .../tests/test_extension.proto | 12 + .../protos_generator/tests/test_generated.cc | 615 ++ .../protos_generator/tests/test_model.proto | 151 + third_party/upb/python/BUILD | 47 +- third_party/upb/python/convert.c | 65 +- third_party/upb/python/convert.h | 4 +- third_party/upb/python/descriptor.c | 73 +- third_party/upb/python/descriptor.h | 3 +- .../upb/python/descriptor_containers.c | 168 +- .../upb/python/descriptor_containers.h | 2 +- third_party/upb/python/descriptor_pool.c | 7 +- third_party/upb/python/extension_dict.c | 11 +- third_party/upb/python/map.c | 29 +- third_party/upb/python/map.h | 2 +- third_party/upb/python/message.c | 72 +- third_party/upb/python/message.h | 2 +- third_party/upb/python/pb_unit_tests/BUILD | 20 +- .../pb_unit_tests/descriptor_test_wrapper.py | 5 - .../message_factory_test_wrapper.py | 1 - .../pb_unit_tests/numpy_test_wrapper.py | 10 +- .../pb_unit_tests/pyproto_test_wrapper.bzl | 16 +- .../pb_unit_tests/reflection_test_wrapper.py | 3 + third_party/upb/python/protobuf.c | 2 +- third_party/upb/python/protobuf.h | 4 +- third_party/upb/python/py_extension.bzl | 9 +- third_party/upb/python/repeated.c | 6 +- third_party/upb/python/repeated.h | 2 +- third_party/upb/python/requirements.txt | 1 + third_party/upb/python/requirements_311.txt | 1 + third_party/upb/python/unknown_fields.c | 170 +- third_party/upb/third_party/utf8_range/BUILD | 19 - .../upb/third_party/utf8_range/LICENSE | 21 - .../upb/third_party/utf8_range/naive.c | 92 - .../upb/third_party/utf8_range/range2-neon.c | 157 - .../upb/third_party/utf8_range/range2-sse.c | 170 - .../upb/third_party/utf8_range/utf8_range.h | 9 - .../upb/upb/{upb_internal.h => alloc.h} | 12 +- third_party/upb/upb/arena.h | 197 +- third_party/upb/upb/array.h | 55 +- .../upb/upb/base/descriptor_constants.h | 80 + third_party/upb/upb/base/log2.h | 57 + third_party/upb/upb/{ => base}/status.c | 9 +- third_party/upb/upb/base/status.h | 66 + third_party/upb/upb/base/string_view.h | 75 + third_party/upb/upb/bindings/lua/README.md | 8 - third_party/upb/upb/collections.h | 4 +- third_party/upb/upb/{ => collections}/array.c | 99 +- third_party/upb/upb/collections/array.h | 85 + .../upb/upb/collections/array_internal.h | 134 + third_party/upb/upb/{ => collections}/map.c | 76 +- third_party/upb/upb/collections/map.h | 135 + .../upb/upb/collections/map_gencode_util.h | 78 + .../upb/upb/collections/map_internal.h | 170 + third_party/upb/upb/collections/map_sorter.c | 166 + .../upb/upb/collections/map_sorter_internal.h | 109 + .../upb/upb/{ => collections}/message_value.h | 25 +- third_party/upb/upb/collections/test.cc | 60 + third_party/upb/upb/conformance/BUILD | 161 + .../upb/{ => conformance}/conformance_upb.c | 17 +- .../conformance/conformance_upb_failures.txt | 2 + .../upb/upb/conformance_upb_failures.txt | 1 - third_party/upb/upb/decode.c | 1221 --- third_party/upb/upb/decode.h | 65 +- third_party/upb/upb/decode_fast.h | 123 +- third_party/upb/upb/def.c | 3269 -------- third_party/upb/upb/def.h | 388 +- third_party/upb/upb/def.hpp | 414 +- third_party/upb/upb/encode.h | 51 +- third_party/upb/upb/extension_registry.h | 55 +- .../upb/upb/{table.c => hash/common.c} | 158 +- third_party/upb/upb/hash/common.h | 199 + third_party/upb/upb/hash/int_table.h | 102 + third_party/upb/upb/hash/str_table.h | 161 + third_party/upb/upb/hash/test.cc | 258 + third_party/upb/upb/internal/table.h | 385 - third_party/upb/upb/io/BUILD | 98 + third_party/upb/upb/io/README.md | 4 + third_party/upb/upb/io/chunked_input_stream.c | 110 + .../chunked_input_stream.h} | 30 +- .../upb/upb/io/chunked_output_stream.c | 94 + .../chunked_output_stream.h} | 29 +- third_party/upb/upb/io/string.h | 167 + third_party/upb/upb/io/string_test.cc | 127 + third_party/upb/upb/io/tokenizer.c | 1019 +++ third_party/upb/upb/io/tokenizer.h | 153 + third_party/upb/upb/io/tokenizer_test.cc | 1253 +++ .../upb/upb/io/zero_copy_input_stream.h | 129 + .../upb/upb/io/zero_copy_output_stream.h | 130 + .../upb/upb/io/zero_copy_stream_test.cc | 290 + .../upb/upb/{json_decode.c => json/decode.c} | 161 +- third_party/upb/upb/json/decode.h | 52 + third_party/upb/upb/json/decode_test.cc | 91 + .../upb/upb/{json_encode.c => json/encode.c} | 116 +- third_party/upb/upb/json/encode.h | 70 + .../upb/{json_test.cc => json/encode_test.cc} | 9 +- .../upb/{json_test.proto => json/test.proto} | 2 + third_party/upb/upb/json_decode.h | 19 +- third_party/upb/upb/json_encode.h | 37 +- third_party/upb/upb/lex/atoi.c | 68 + third_party/upb/upb/lex/atoi.h | 53 + third_party/upb/upb/lex/atoi_test.cc | 109 + .../upb/upb/{upb.c => lex/round_trip.c} | 13 +- third_party/upb/upb/lex/round_trip.h | 55 + third_party/upb/upb/lex/strtod.c | 97 + .../strtod.h} | 22 +- third_party/upb/upb/lex/unicode.c | 57 + third_party/upb/upb/lex/unicode.h | 77 + third_party/upb/upb/map.h | 89 +- third_party/upb/upb/mem/alloc.c | 47 + third_party/upb/upb/mem/alloc.h | 98 + third_party/upb/upb/{ => mem}/arena.c | 71 +- third_party/upb/upb/mem/arena.h | 160 + .../{internal/upb.h => mem/arena_internal.h} | 34 +- third_party/upb/upb/message/accessors.c | 337 + third_party/upb/upb/message/accessors.h | 761 ++ third_party/upb/upb/message/accessors_test.cc | 803 ++ .../upb/upb/message/extension_internal.h | 83 + third_party/upb/upb/message/internal.h | 135 + third_party/upb/upb/message/message.c | 180 + third_party/upb/upb/message/message.h | 71 + .../upb/upb/{msg_test.cc => message/test.cc} | 217 +- .../{msg_test.proto => message/test.proto} | 5 + third_party/upb/upb/mini_descriptor.c | 255 - third_party/upb/upb/mini_table.h | 161 +- third_party/upb/upb/mini_table/common.c | 128 + third_party/upb/upb/mini_table/common.h | 146 + .../upb/upb/mini_table/common_internal.h | 122 + .../upb/{mini_table.c => mini_table/decode.c} | 873 +- third_party/upb/upb/mini_table/decode.h | 117 + third_party/upb/upb/mini_table/encode.c | 300 + .../upb/upb/mini_table/encode_internal.h | 110 + .../encode_internal.hpp} | 40 +- .../encode_test.cc} | 113 +- .../upb/upb/mini_table/enum_internal.h | 88 + .../upb/upb/mini_table/extension_internal.h | 47 + .../upb/{ => mini_table}/extension_registry.c | 41 +- .../upb/upb/mini_table/extension_registry.h | 101 + .../upb/upb/mini_table/field_internal.h | 183 + .../upb/upb/mini_table/file_internal.h | 47 + .../upb/upb/mini_table/message_internal.h | 132 + .../sub_internal.h} | 14 +- third_party/upb/upb/mini_table/types.h | 40 + third_party/upb/upb/mini_table_accessors.c | 397 - third_party/upb/upb/mini_table_accessors.h | 271 - .../upb/upb/mini_table_accessors_test.cc | 444 - third_party/upb/upb/msg.c | 368 - third_party/upb/upb/msg.h | 41 +- third_party/upb/upb/msg_internal.h | 807 +- .../upb/upb/{port_def.inc => port/def.inc} | 112 +- .../upb/{port_undef.inc => port/undef.inc} | 13 +- .../upb/{internal => port}/vsnprintf_compat.h | 12 +- third_party/upb/upb/reflection.c | 323 - third_party/upb/upb/reflection.h | 82 +- third_party/upb/upb/reflection.hpp | 10 +- third_party/upb/upb/reflection/common.h | 67 + third_party/upb/upb/reflection/def.h | 42 + third_party/upb/upb/reflection/def.hpp | 610 ++ third_party/upb/upb/reflection/def_builder.c | 357 + .../upb/upb/reflection/def_builder_internal.h | 157 + .../upb/upb/reflection/def_builder_test.cc | 86 + third_party/upb/upb/reflection/def_pool.c | 462 ++ third_party/upb/upb/reflection/def_pool.h | 108 + .../upb/upb/reflection/def_pool_internal.h | 77 + third_party/upb/upb/reflection/def_type.c | 50 + third_party/upb/upb/reflection/def_type.h | 81 + third_party/upb/upb/reflection/desc_state.c | 53 + .../upb/upb/reflection/desc_state_internal.h | 64 + third_party/upb/upb/reflection/enum_def.c | 310 + third_party/upb/upb/reflection/enum_def.h | 80 + .../upb/upb/reflection/enum_def_internal.h | 56 + .../upb/upb/reflection/enum_reserved_range.c | 84 + .../upb/upb/reflection/enum_reserved_range.h | 51 + .../reflection/enum_reserved_range_internal.h | 55 + .../upb/upb/reflection/enum_value_def.c | 144 + .../upb/upb/reflection/enum_value_def.h | 57 + .../upb/reflection/enum_value_def_internal.h | 57 + .../upb/upb/reflection/extension_range.c | 93 + .../upb/upb/reflection/extension_range.h | 55 + .../upb/reflection/extension_range_internal.h | 54 + third_party/upb/upb/reflection/field_def.c | 931 +++ third_party/upb/upb/reflection/field_def.h | 91 + .../upb/upb/reflection/field_def_internal.h | 76 + third_party/upb/upb/reflection/file_def.c | 370 + third_party/upb/upb/reflection/file_def.h | 77 + .../upb/upb/reflection/file_def_internal.h | 57 + third_party/upb/upb/reflection/message.c | 233 + third_party/upb/upb/reflection/message.h | 102 + third_party/upb/upb/reflection/message.hpp | 37 + third_party/upb/upb/reflection/message_def.c | 718 ++ third_party/upb/upb/reflection/message_def.h | 174 + .../upb/upb/reflection/message_def_internal.h | 63 + .../upb/reflection/message_reserved_range.c | 81 + .../upb/reflection/message_reserved_range.h | 51 + .../message_reserved_range_internal.h | 55 + third_party/upb/upb/reflection/method_def.c | 124 + third_party/upb/upb/reflection/method_def.h | 59 + .../upb/upb/reflection/method_def_internal.h | 53 + third_party/upb/upb/reflection/oneof_def.c | 206 + third_party/upb/upb/reflection/oneof_def.h | 66 + .../upb/upb/reflection/oneof_def_internal.h | 57 + third_party/upb/upb/reflection/service_def.c | 128 + third_party/upb/upb/reflection/service_def.h | 60 + .../upb/upb/reflection/service_def_internal.h | 53 + .../stage0/google/protobuf/descriptor.upb.c | 417 + .../stage0/google/protobuf/descriptor.upb.h | 4704 +++++++++++ third_party/upb/upb/status.h | 38 +- .../upb/{decode_internal.h => string_view.h} | 12 +- third_party/upb/upb/test/BUILD | 202 + third_party/upb/upb/{ => test}/empty.proto | 1 + third_party/upb/upb/test/fuzz_util.cc | 188 + third_party/upb/upb/test/fuzz_util.h | 81 + third_party/upb/upb/test/parse_text_proto.h | 37 + third_party/upb/upb/test/proto3_test.cc | 37 + third_party/upb/upb/test/proto3_test.proto | 22 + third_party/upb/upb/{ => test}/test.proto | 16 + third_party/upb/upb/{ => test}/test_cpp.cc | 26 +- third_party/upb/upb/{ => test}/test_cpp.proto | 0 .../upb/upb/{ => test}/test_generated_code.cc | 181 +- .../upb/upb/test/test_mini_table_oneof.cc | 64 + third_party/upb/upb/test_table.cc | 580 -- .../upb/upb/{text_encode.c => text/encode.c} | 144 +- third_party/upb/upb/text/encode.h | 69 + third_party/upb/upb/text_encode.h | 36 +- third_party/upb/upb/upb.h | 157 +- third_party/upb/upb/upb.hpp | 13 +- third_party/upb/upb/util/BUILD | 63 +- third_party/upb/upb/util/compare.c | 138 +- third_party/upb/upb/util/compare.h | 2 +- third_party/upb/upb/util/compare_test.cc | 4 +- third_party/upb/upb/util/def_to_proto.c | 345 +- third_party/upb/upb/util/def_to_proto.h | 2 +- .../upb/upb/util/def_to_proto_fuzz_test.cc | 26 + third_party/upb/upb/util/def_to_proto_test.cc | 151 +- third_party/upb/upb/util/def_to_proto_test.h | 117 + .../upb/upb/util/def_to_proto_test.proto | 5 + third_party/upb/upb/util/required_fields.c | 16 +- third_party/upb/upb/util/required_fields.h | 10 +- .../upb/upb/util/required_fields_test.cc | 4 +- third_party/upb/upb/wire/common_internal.h | 50 + third_party/upb/upb/wire/decode.c | 1315 +++ third_party/upb/upb/wire/decode.h | 94 + third_party/upb/upb/{ => wire}/decode_fast.c | 409 +- third_party/upb/upb/wire/decode_fast.h | 167 + .../decode.h => wire/decode_internal.h} | 136 +- third_party/upb/upb/{ => wire}/encode.c | 193 +- third_party/upb/upb/wire/encode.h | 79 + .../upb/upb/wire/eps_copy_input_stream.c | 39 + .../upb/upb/wire/eps_copy_input_stream.h | 425 + .../upb/wire/eps_copy_input_stream_test.cc | 334 + third_party/upb/upb/wire/reader.c | 67 + third_party/upb/upb/wire/reader.h | 227 + third_party/upb/upb/wire/swap_internal.h | 63 + third_party/upb/upb/wire/types.h | 41 + third_party/upb/upbc/BUILD | 225 +- third_party/upb/upbc/bootstrap_compiler.bzl | 166 + third_party/upb/upbc/code_generator_request.c | 142 +- third_party/upb/upbc/code_generator_request.h | 8 +- third_party/upb/upbc/common.cc | 32 +- third_party/upb/upbc/common.h | 47 +- third_party/upb/upbc/file_layout.cc | 139 + third_party/upb/upbc/file_layout.h | 123 + third_party/upb/upbc/keywords.cc | 149 + third_party/upb/upbc/keywords.h | 40 + third_party/upb/upbc/names.cc | 118 + third_party/upb/upbc/names.h | 63 + third_party/upb/upbc/plugin.h | 207 + third_party/upb/upbc/protoc-gen-upb.cc | 2046 ++--- third_party/upb/upbc/protoc-gen-upbdefs.cc | 145 +- third_party/upb/upbc/protoc-gen-upbdev.cc | 84 +- .../google/protobuf/compiler/plugin.upb.c | 68 + .../google/protobuf/compiler/plugin.upb.h | 585 ++ third_party/upb/upbc/subprocess.cc | 44 +- third_party/upb/upbc/upbc_so.c | 82 + third_party/upb/upbc/upbdev.c | 120 + third_party/upb/upbc/upbdev.h | 63 + .../extract_metadata_from_bazel_xml.py | 23 +- .../core/gen_upb_api_from_bazel_xml.py | 26 +- tools/distrib/fix_build_deps.py | 6 + tools/distrib/python/bazel_deps.sh | 3 +- tools/distrib/python/grpc_version.py | 2 +- .../python/grpcio_tools/grpc_version.py | 2 +- .../python/grpcio_tools/protoc_lib_deps.py | 427 +- tools/distrib/python/grpcio_tools/setup.py | 9 +- tools/distrib/python/make_grpcio_tools.py | 200 +- ...pc_binder_transport_apk_build_in_docker.sh | 1 + tools/run_tests/sanity/check_submodules.sh | 2 +- 1088 files changed, 112654 insertions(+), 52460 deletions(-) create mode 100644 third_party/protobuf2.patch create mode 100644 third_party/upb/.github/actions/setup-bazel-cache/action.yml create mode 100644 third_party/upb/.github/workflows/mergeable.yml create mode 100644 third_party/upb/bazel/amalgamation.bzl create mode 100644 third_party/upb/cmake/CMakeLists.txt create mode 100644 third_party/upb/cmake/google/protobuf/descriptor.upb.c create mode 100644 third_party/upb/cmake/google/protobuf/descriptor.upb.h create mode 100755 third_party/upb/cmake/push_auto_update.sh rename third_party/upb/{upb/bindings => }/lua/BUILD.bazel (91%) create mode 100644 third_party/upb/lua/README.md rename third_party/upb/{upb/bindings => }/lua/def.c (99%) rename third_party/upb/{upb/bindings => }/lua/lua_proto_library.bzl (84%) rename third_party/upb/{upb/bindings => }/lua/main.c (95%) rename third_party/upb/{upb/bindings => }/lua/msg.c (98%) rename third_party/upb/{upb/bindings => }/lua/test.proto (100%) rename third_party/upb/{upb/bindings => }/lua/test_upb.lua (99%) rename third_party/upb/{upb/bindings => }/lua/upb.c (99%) rename third_party/upb/{upb/bindings => }/lua/upb.h (98%) rename third_party/upb/{upb/bindings => }/lua/upb.lua (100%) rename third_party/upb/{upb/bindings => }/lua/upbc.cc (100%) create mode 100644 third_party/upb/protos/BUILD create mode 100644 third_party/upb/protos/bazel/BUILD create mode 100644 third_party/upb/protos/bazel/upb_cc_proto_library.bzl create mode 100644 third_party/upb/protos/protos.cc create mode 100644 third_party/upb/protos/protos.h create mode 100644 third_party/upb/protos/protos_internal.h create mode 100644 third_party/upb/protos/protos_internal_test.cc create mode 100644 third_party/upb/protos_generator/BUILD create mode 100644 third_party/upb/protos_generator/gen_accessors.cc create mode 100644 third_party/upb/protos_generator/gen_accessors.h create mode 100644 third_party/upb/protos_generator/gen_enums.cc create mode 100644 third_party/upb/protos_generator/gen_enums.h create mode 100644 third_party/upb/protos_generator/gen_extensions.cc create mode 100644 third_party/upb/protos_generator/gen_extensions.h create mode 100644 third_party/upb/protos_generator/gen_messages.cc create mode 100644 third_party/upb/protos_generator/gen_messages.h create mode 100644 third_party/upb/protos_generator/gen_utils.cc create mode 100644 third_party/upb/protos_generator/gen_utils.h create mode 100644 third_party/upb/protos_generator/output.cc create mode 100644 third_party/upb/protos_generator/output.h create mode 100644 third_party/upb/protos_generator/protoc-gen-upb-protos.cc create mode 100644 third_party/upb/protos_generator/tests/BUILD create mode 100644 third_party/upb/protos_generator/tests/child_model.proto create mode 100644 third_party/upb/protos_generator/tests/legacy-name.proto create mode 100644 third_party/upb/protos_generator/tests/no_package.proto create mode 100644 third_party/upb/protos_generator/tests/no_package_enum_user.proto create mode 100644 third_party/upb/protos_generator/tests/test_enum.proto create mode 100644 third_party/upb/protos_generator/tests/test_extension.proto create mode 100644 third_party/upb/protos_generator/tests/test_generated.cc create mode 100644 third_party/upb/protos_generator/tests/test_model.proto create mode 100644 third_party/upb/python/requirements.txt create mode 100644 third_party/upb/python/requirements_311.txt delete mode 100644 third_party/upb/third_party/utf8_range/BUILD delete mode 100644 third_party/upb/third_party/utf8_range/LICENSE delete mode 100644 third_party/upb/third_party/utf8_range/naive.c delete mode 100644 third_party/upb/third_party/utf8_range/range2-neon.c delete mode 100644 third_party/upb/third_party/utf8_range/range2-sse.c delete mode 100644 third_party/upb/third_party/utf8_range/utf8_range.h rename third_party/upb/upb/{upb_internal.h => alloc.h} (88%) create mode 100644 third_party/upb/upb/base/descriptor_constants.h create mode 100644 third_party/upb/upb/base/log2.h rename third_party/upb/upb/{ => base}/status.c (95%) create mode 100644 third_party/upb/upb/base/status.h create mode 100644 third_party/upb/upb/base/string_view.h delete mode 100644 third_party/upb/upb/bindings/lua/README.md rename third_party/upb/upb/{ => collections}/array.c (56%) create mode 100644 third_party/upb/upb/collections/array.h create mode 100644 third_party/upb/upb/collections/array_internal.h rename third_party/upb/upb/{ => collections}/map.c (64%) create mode 100644 third_party/upb/upb/collections/map.h create mode 100644 third_party/upb/upb/collections/map_gencode_util.h create mode 100644 third_party/upb/upb/collections/map_internal.h create mode 100644 third_party/upb/upb/collections/map_sorter.c create mode 100644 third_party/upb/upb/collections/map_sorter_internal.h rename third_party/upb/upb/{ => collections}/message_value.h (86%) create mode 100644 third_party/upb/upb/collections/test.cc create mode 100644 third_party/upb/upb/conformance/BUILD rename third_party/upb/upb/{ => conformance}/conformance_upb.c (97%) create mode 100644 third_party/upb/upb/conformance/conformance_upb_failures.txt delete mode 100644 third_party/upb/upb/conformance_upb_failures.txt delete mode 100644 third_party/upb/upb/decode.c delete mode 100644 third_party/upb/upb/def.c rename third_party/upb/upb/{table.c => hash/common.c} (87%) create mode 100644 third_party/upb/upb/hash/common.h create mode 100644 third_party/upb/upb/hash/int_table.h create mode 100644 third_party/upb/upb/hash/str_table.h create mode 100644 third_party/upb/upb/hash/test.cc delete mode 100644 third_party/upb/upb/internal/table.h create mode 100644 third_party/upb/upb/io/BUILD create mode 100644 third_party/upb/upb/io/README.md create mode 100644 third_party/upb/upb/io/chunked_input_stream.c rename third_party/upb/upb/{internal/mini_table_accessors.h => io/chunked_input_stream.h} (71%) create mode 100644 third_party/upb/upb/io/chunked_output_stream.c rename third_party/upb/upb/{mini_descriptor.h => io/chunked_output_stream.h} (71%) create mode 100644 third_party/upb/upb/io/string.h create mode 100644 third_party/upb/upb/io/string_test.cc create mode 100644 third_party/upb/upb/io/tokenizer.c create mode 100644 third_party/upb/upb/io/tokenizer.h create mode 100644 third_party/upb/upb/io/tokenizer_test.cc create mode 100644 third_party/upb/upb/io/zero_copy_input_stream.h create mode 100644 third_party/upb/upb/io/zero_copy_output_stream.h create mode 100644 third_party/upb/upb/io/zero_copy_stream_test.cc rename third_party/upb/upb/{json_decode.c => json/decode.c} (93%) create mode 100644 third_party/upb/upb/json/decode.h create mode 100644 third_party/upb/upb/json/decode_test.cc rename third_party/upb/upb/{json_encode.c => json/encode.c} (88%) create mode 100644 third_party/upb/upb/json/encode.h rename third_party/upb/upb/{json_test.cc => json/encode_test.cc} (96%) rename third_party/upb/upb/{json_test.proto => json/test.proto} (86%) create mode 100644 third_party/upb/upb/lex/atoi.c create mode 100644 third_party/upb/upb/lex/atoi.h create mode 100644 third_party/upb/upb/lex/atoi_test.cc rename third_party/upb/upb/{upb.c => lex/round_trip.c} (92%) create mode 100644 third_party/upb/upb/lex/round_trip.h create mode 100644 third_party/upb/upb/lex/strtod.c rename third_party/upb/upb/{mini_table_accessors_internal.h => lex/strtod.h} (83%) create mode 100644 third_party/upb/upb/lex/unicode.c create mode 100644 third_party/upb/upb/lex/unicode.h create mode 100644 third_party/upb/upb/mem/alloc.c create mode 100644 third_party/upb/upb/mem/alloc.h rename third_party/upb/upb/{ => mem}/arena.c (85%) create mode 100644 third_party/upb/upb/mem/arena.h rename third_party/upb/upb/{internal/upb.h => mem/arena_internal.h} (76%) create mode 100644 third_party/upb/upb/message/accessors.c create mode 100644 third_party/upb/upb/message/accessors.h create mode 100644 third_party/upb/upb/message/accessors_test.cc create mode 100644 third_party/upb/upb/message/extension_internal.h create mode 100644 third_party/upb/upb/message/internal.h create mode 100644 third_party/upb/upb/message/message.c create mode 100644 third_party/upb/upb/message/message.h rename third_party/upb/upb/{msg_test.cc => message/test.cc} (69%) rename third_party/upb/upb/{msg_test.proto => message/test.proto} (98%) delete mode 100644 third_party/upb/upb/mini_descriptor.c create mode 100644 third_party/upb/upb/mini_table/common.c create mode 100644 third_party/upb/upb/mini_table/common.h create mode 100644 third_party/upb/upb/mini_table/common_internal.h rename third_party/upb/upb/{mini_table.c => mini_table/decode.c} (52%) create mode 100644 third_party/upb/upb/mini_table/decode.h create mode 100644 third_party/upb/upb/mini_table/encode.c create mode 100644 third_party/upb/upb/mini_table/encode_internal.h rename third_party/upb/upb/{mini_table.hpp => mini_table/encode_internal.hpp} (74%) rename third_party/upb/upb/{mini_table_test.cc => mini_table/encode_test.cc} (70%) create mode 100644 third_party/upb/upb/mini_table/enum_internal.h create mode 100644 third_party/upb/upb/mini_table/extension_internal.h rename third_party/upb/upb/{ => mini_table}/extension_registry.c (75%) create mode 100644 third_party/upb/upb/mini_table/extension_registry.h create mode 100644 third_party/upb/upb/mini_table/field_internal.h create mode 100644 third_party/upb/upb/mini_table/file_internal.h create mode 100644 third_party/upb/upb/mini_table/message_internal.h rename third_party/upb/upb/{table_internal.h => mini_table/sub_internal.h} (86%) create mode 100644 third_party/upb/upb/mini_table/types.h delete mode 100644 third_party/upb/upb/mini_table_accessors.c delete mode 100644 third_party/upb/upb/mini_table_accessors.h delete mode 100644 third_party/upb/upb/mini_table_accessors_test.cc delete mode 100644 third_party/upb/upb/msg.c rename third_party/upb/upb/{port_def.inc => port/def.inc} (74%) rename third_party/upb/upb/{port_undef.inc => port/undef.inc} (89%) rename third_party/upb/upb/{internal => port}/vsnprintf_compat.h (91%) delete mode 100644 third_party/upb/upb/reflection.c create mode 100644 third_party/upb/upb/reflection/common.h create mode 100644 third_party/upb/upb/reflection/def.h create mode 100644 third_party/upb/upb/reflection/def.hpp create mode 100644 third_party/upb/upb/reflection/def_builder.c create mode 100644 third_party/upb/upb/reflection/def_builder_internal.h create mode 100644 third_party/upb/upb/reflection/def_builder_test.cc create mode 100644 third_party/upb/upb/reflection/def_pool.c create mode 100644 third_party/upb/upb/reflection/def_pool.h create mode 100644 third_party/upb/upb/reflection/def_pool_internal.h create mode 100644 third_party/upb/upb/reflection/def_type.c create mode 100644 third_party/upb/upb/reflection/def_type.h create mode 100644 third_party/upb/upb/reflection/desc_state.c create mode 100644 third_party/upb/upb/reflection/desc_state_internal.h create mode 100644 third_party/upb/upb/reflection/enum_def.c create mode 100644 third_party/upb/upb/reflection/enum_def.h create mode 100644 third_party/upb/upb/reflection/enum_def_internal.h create mode 100644 third_party/upb/upb/reflection/enum_reserved_range.c create mode 100644 third_party/upb/upb/reflection/enum_reserved_range.h create mode 100644 third_party/upb/upb/reflection/enum_reserved_range_internal.h create mode 100644 third_party/upb/upb/reflection/enum_value_def.c create mode 100644 third_party/upb/upb/reflection/enum_value_def.h create mode 100644 third_party/upb/upb/reflection/enum_value_def_internal.h create mode 100644 third_party/upb/upb/reflection/extension_range.c create mode 100644 third_party/upb/upb/reflection/extension_range.h create mode 100644 third_party/upb/upb/reflection/extension_range_internal.h create mode 100644 third_party/upb/upb/reflection/field_def.c create mode 100644 third_party/upb/upb/reflection/field_def.h create mode 100644 third_party/upb/upb/reflection/field_def_internal.h create mode 100644 third_party/upb/upb/reflection/file_def.c create mode 100644 third_party/upb/upb/reflection/file_def.h create mode 100644 third_party/upb/upb/reflection/file_def_internal.h create mode 100644 third_party/upb/upb/reflection/message.c create mode 100644 third_party/upb/upb/reflection/message.h create mode 100644 third_party/upb/upb/reflection/message.hpp create mode 100644 third_party/upb/upb/reflection/message_def.c create mode 100644 third_party/upb/upb/reflection/message_def.h create mode 100644 third_party/upb/upb/reflection/message_def_internal.h create mode 100644 third_party/upb/upb/reflection/message_reserved_range.c create mode 100644 third_party/upb/upb/reflection/message_reserved_range.h create mode 100644 third_party/upb/upb/reflection/message_reserved_range_internal.h create mode 100644 third_party/upb/upb/reflection/method_def.c create mode 100644 third_party/upb/upb/reflection/method_def.h create mode 100644 third_party/upb/upb/reflection/method_def_internal.h create mode 100644 third_party/upb/upb/reflection/oneof_def.c create mode 100644 third_party/upb/upb/reflection/oneof_def.h create mode 100644 third_party/upb/upb/reflection/oneof_def_internal.h create mode 100644 third_party/upb/upb/reflection/service_def.c create mode 100644 third_party/upb/upb/reflection/service_def.h create mode 100644 third_party/upb/upb/reflection/service_def_internal.h create mode 100644 third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c create mode 100644 third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h rename third_party/upb/upb/{decode_internal.h => string_view.h} (86%) create mode 100644 third_party/upb/upb/test/BUILD rename third_party/upb/upb/{ => test}/empty.proto (51%) create mode 100644 third_party/upb/upb/test/fuzz_util.cc create mode 100644 third_party/upb/upb/test/fuzz_util.h create mode 100644 third_party/upb/upb/test/parse_text_proto.h create mode 100644 third_party/upb/upb/test/proto3_test.cc create mode 100644 third_party/upb/upb/test/proto3_test.proto rename third_party/upb/upb/{ => test}/test.proto (81%) rename third_party/upb/upb/{ => test}/test_cpp.cc (93%) rename third_party/upb/upb/{ => test}/test_cpp.proto (100%) rename third_party/upb/upb/{ => test}/test_generated_code.cc (91%) create mode 100644 third_party/upb/upb/test/test_mini_table_oneof.cc delete mode 100644 third_party/upb/upb/test_table.cc rename third_party/upb/upb/{text_encode.c => text/encode.c} (76%) create mode 100644 third_party/upb/upb/text/encode.h create mode 100644 third_party/upb/upb/util/def_to_proto_fuzz_test.cc create mode 100644 third_party/upb/upb/util/def_to_proto_test.h create mode 100644 third_party/upb/upb/wire/common_internal.h create mode 100644 third_party/upb/upb/wire/decode.c create mode 100644 third_party/upb/upb/wire/decode.h rename third_party/upb/upb/{ => wire}/decode_fast.c (87%) create mode 100644 third_party/upb/upb/wire/decode_fast.h rename third_party/upb/upb/{internal/decode.h => wire/decode_internal.h} (51%) rename third_party/upb/upb/{ => wire}/encode.c (80%) create mode 100644 third_party/upb/upb/wire/encode.h create mode 100644 third_party/upb/upb/wire/eps_copy_input_stream.c create mode 100644 third_party/upb/upb/wire/eps_copy_input_stream.h create mode 100644 third_party/upb/upb/wire/eps_copy_input_stream_test.cc create mode 100644 third_party/upb/upb/wire/reader.c create mode 100644 third_party/upb/upb/wire/reader.h create mode 100644 third_party/upb/upb/wire/swap_internal.h create mode 100644 third_party/upb/upb/wire/types.h create mode 100644 third_party/upb/upbc/bootstrap_compiler.bzl create mode 100644 third_party/upb/upbc/file_layout.cc create mode 100644 third_party/upb/upbc/file_layout.h create mode 100644 third_party/upb/upbc/keywords.cc create mode 100644 third_party/upb/upbc/keywords.h create mode 100644 third_party/upb/upbc/names.cc create mode 100644 third_party/upb/upbc/names.h create mode 100644 third_party/upb/upbc/plugin.h create mode 100644 third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c create mode 100644 third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h create mode 100644 third_party/upb/upbc/upbc_so.c create mode 100644 third_party/upb/upbc/upbdev.c create mode 100644 third_party/upb/upbc/upbdev.h diff --git a/BUILD b/BUILD index 03b985ef03a..3405d659afc 100644 --- a/BUILD +++ b/BUILD @@ -802,6 +802,7 @@ grpc_cc_library( external_deps = [ "absl/synchronization", "protobuf_headers", + "protobuf", ], tags = [ "avoid_dep", @@ -949,6 +950,7 @@ grpc_cc_library( "absl/strings", "absl/types:optional", "absl/types:span", + "upb_collections_lib", "upb_lib", ], language = "c++", @@ -1147,7 +1149,10 @@ grpc_cc_library( "include/grpcpp/security/alts_context.h", "include/grpcpp/security/alts_util.h", ], - external_deps = ["upb_lib"], + external_deps = [ + "upb_collections_lib", + "upb_lib", + ], language = "c++", standalone = True, visibility = ["@grpc:tsi"], @@ -1960,6 +1965,7 @@ grpc_cc_library( name = "grpc++_codegen_proto", external_deps = [ "protobuf_headers", + "protobuf", ], language = "c++", public_hdrs = [ @@ -1982,6 +1988,7 @@ grpc_cc_library( name = "grpc++_config_proto", external_deps = [ "protobuf_headers", + "protobuf", ], language = "c++", public_hdrs = [ @@ -2860,6 +2867,7 @@ grpc_cc_library( "absl/synchronization", "absl/types:optional", "absl/types:variant", + "upb_collections_lib", "upb_lib", ], language = "c++", diff --git a/CMakeLists.txt b/CMakeLists.txt index 6707312c407..4a09675012d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4759,26 +4759,50 @@ endif() endif() add_library(upb - third_party/upb/third_party/utf8_range/naive.c - third_party/upb/third_party/utf8_range/range2-neon.c - third_party/upb/third_party/utf8_range/range2-sse.c - third_party/upb/upb/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 + third_party/utf8_range/naive.c + third_party/utf8_range/range2-neon.c + third_party/utf8_range/range2-sse.c + third_party/upb/upb/base/status.c + third_party/upb/upb/collections/array.c + third_party/upb/upb/collections/map.c + third_party/upb/upb/collections/map_sorter.c + third_party/upb/upb/hash/common.c + third_party/upb/upb/json/decode.c + third_party/upb/upb/json/encode.c + third_party/upb/upb/lex/atoi.c + third_party/upb/upb/lex/round_trip.c + third_party/upb/upb/lex/strtod.c + third_party/upb/upb/lex/unicode.c + third_party/upb/upb/mem/alloc.c + third_party/upb/upb/mem/arena.c + third_party/upb/upb/message/accessors.c + third_party/upb/upb/message/message.c + third_party/upb/upb/mini_table/common.c + third_party/upb/upb/mini_table/decode.c + third_party/upb/upb/mini_table/encode.c + third_party/upb/upb/mini_table/extension_registry.c + third_party/upb/upb/reflection/def_builder.c + third_party/upb/upb/reflection/def_pool.c + third_party/upb/upb/reflection/def_type.c + third_party/upb/upb/reflection/desc_state.c + third_party/upb/upb/reflection/enum_def.c + third_party/upb/upb/reflection/enum_reserved_range.c + third_party/upb/upb/reflection/enum_value_def.c + third_party/upb/upb/reflection/extension_range.c + third_party/upb/upb/reflection/field_def.c + third_party/upb/upb/reflection/file_def.c + third_party/upb/upb/reflection/message.c + third_party/upb/upb/reflection/message_def.c + third_party/upb/upb/reflection/message_reserved_range.c + third_party/upb/upb/reflection/method_def.c + third_party/upb/upb/reflection/oneof_def.c + third_party/upb/upb/reflection/service_def.c + third_party/upb/upb/text/encode.c + third_party/upb/upb/wire/decode.c + third_party/upb/upb/wire/decode_fast.c + third_party/upb/upb/wire/encode.c + third_party/upb/upb/wire/eps_copy_input_stream.c + third_party/upb/upb/wire/reader.c src/core/ext/upb-generated/google/protobuf/descriptor.upb.c src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c ) diff --git a/Makefile b/Makefile index 8196861a80e..6730a0970a3 100644 --- a/Makefile +++ b/Makefile @@ -328,7 +328,7 @@ CXXFLAGS += -stdlib=libc++ LDFLAGS += -framework CoreFoundation endif CFLAGS += -g -CPPFLAGS += -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2 -Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated -Ithird_party/xxhash +CPPFLAGS += -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2 -Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated -Ithird_party/utf8_range -Ithird_party/xxhash COREFLAGS += -fno-exceptions LDFLAGS += -g @@ -2646,26 +2646,50 @@ endif # start of build recipe for library "upb" (generated by makelib(lib) template function) 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 \ + third_party/utf8_range/naive.c \ + third_party/utf8_range/range2-neon.c \ + third_party/utf8_range/range2-sse.c \ + third_party/upb/upb/base/status.c \ + third_party/upb/upb/collections/array.c \ + third_party/upb/upb/collections/map.c \ + third_party/upb/upb/collections/map_sorter.c \ + third_party/upb/upb/hash/common.c \ + third_party/upb/upb/json/decode.c \ + third_party/upb/upb/json/encode.c \ + third_party/upb/upb/lex/atoi.c \ + third_party/upb/upb/lex/round_trip.c \ + third_party/upb/upb/lex/strtod.c \ + third_party/upb/upb/lex/unicode.c \ + third_party/upb/upb/mem/alloc.c \ + third_party/upb/upb/mem/arena.c \ + third_party/upb/upb/message/accessors.c \ + third_party/upb/upb/message/message.c \ + third_party/upb/upb/mini_table/common.c \ + third_party/upb/upb/mini_table/decode.c \ + third_party/upb/upb/mini_table/encode.c \ + third_party/upb/upb/mini_table/extension_registry.c \ + third_party/upb/upb/reflection/def_builder.c \ + third_party/upb/upb/reflection/def_pool.c \ + third_party/upb/upb/reflection/def_type.c \ + third_party/upb/upb/reflection/desc_state.c \ + third_party/upb/upb/reflection/enum_def.c \ + third_party/upb/upb/reflection/enum_reserved_range.c \ + third_party/upb/upb/reflection/enum_value_def.c \ + third_party/upb/upb/reflection/extension_range.c \ + third_party/upb/upb/reflection/field_def.c \ + third_party/upb/upb/reflection/file_def.c \ + third_party/upb/upb/reflection/message.c \ + third_party/upb/upb/reflection/message_def.c \ + third_party/upb/upb/reflection/message_reserved_range.c \ + third_party/upb/upb/reflection/method_def.c \ + third_party/upb/upb/reflection/oneof_def.c \ + third_party/upb/upb/reflection/service_def.c \ + third_party/upb/upb/text/encode.c \ + third_party/upb/upb/wire/decode.c \ + third_party/upb/upb/wire/decode_fast.c \ + third_party/upb/upb/wire/encode.c \ + third_party/upb/upb/wire/eps_copy_input_stream.c \ + third_party/upb/upb/wire/reader.c \ src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c \ diff --git a/PYTHON-MANIFEST.in b/PYTHON-MANIFEST.in index 355f5bf1533..dd76dbcf756 100644 --- a/PYTHON-MANIFEST.in +++ b/PYTHON-MANIFEST.in @@ -10,6 +10,7 @@ graft third_party/boringssl-with-bazel graft third_party/cares graft third_party/re2 graft third_party/upb +graft third_party/utf8_range graft third_party/xxhash graft third_party/zlib include src/python/grpcio/_parallel_compile_patch.py diff --git a/WORKSPACE b/WORKSPACE index 0b722da9f6f..73ba6b4b64c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -66,6 +66,23 @@ pip_install( requirements = "@com_github_grpc_grpc//:requirements.bazel.txt", ) +load("@upb//bazel:system_python.bzl", "system_python") + +system_python( + name = "system_python", + minimum_python_version = "3.7", +) + +load("@system_python//:pip.bzl", "pip_parse") + +pip_parse( + name = "pip_deps", + requirements = "@upb//python:requirements.txt", + requirements_overrides = { + "3.11": "@upb//python:requirements_311.txt", + }, +) + http_archive( name = "build_bazel_rules_swift", sha256 = "12057b7aa904467284eee640de5e33853e51d8e31aae50b3fb25d2823d51c6b8", diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 0d1cffe16a4..815431a2014 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -25,6 +25,11 @@ def grpc_deps(): actual = "@upb//:upb", ) + native.bind( + name = "upb_collections_lib", + actual = "@upb//:collections", + ) + native.bind( name = "upb_reflection", actual = "@upb//:reflection", @@ -248,13 +253,17 @@ def grpc_deps(): if "com_google_protobuf" not in native.existing_rules(): http_archive( name = "com_google_protobuf", - sha256 = "d594b561fb41bf243233d8f411c7f2b7d913e5c9c1be4ca439baf7e48384c893", - strip_prefix = "protobuf-f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c", + sha256 = "81cf6e89aa03bfc5fcdf7fa99d0c2e3073ea342b9e7500cc75feecac8fc4c33d", + strip_prefix = "protobuf-5ddb1fc609d2416e8575c9e7435c608222c2edb2", urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c.tar.gz", - "https://github.com/protocolbuffers/protobuf/archive/f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c.tar.gz", + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/5ddb1fc609d2416e8575c9e7435c608222c2edb2.tar.gz", + "https://github.com/protocolbuffers/protobuf/archive/5ddb1fc609d2416e8575c9e7435c608222c2edb2.tar.gz", + ], + patches = [ + "@com_github_grpc_grpc//third_party:protobuf.patch", + # workaround for https://github.com/protocolbuffers/upb/issues/1239 + "@com_github_grpc_grpc//third_party:protobuf2.patch", ], - patches = ["@com_github_grpc_grpc//third_party:protobuf.patch"], patch_args = ["-p1"], ) @@ -384,11 +393,11 @@ def grpc_deps(): if "upb" not in native.existing_rules(): http_archive( name = "upb", - sha256 = "017a7e8e4e842d01dba5dc8aa316323eee080cd1b75986a7d1f94d87220e6502", - strip_prefix = "upb-e4635f223e7d36dfbea3b722a4ca4807a7e882e2", + sha256 = "50625babfbfbbb85b2c2c1c5b7021c5a9d599113403143c6dc3cb6a8743f7768", + strip_prefix = "upb-aafc17fd6bde032b896bcecc66ad3c2ba9af434d", urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/e4635f223e7d36dfbea3b722a4ca4807a7e882e2.tar.gz", - "https://github.com/protocolbuffers/upb/archive/e4635f223e7d36dfbea3b722a4ca4807a7e882e2.tar.gz", + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/aafc17fd6bde032b896bcecc66ad3c2ba9af434d.tar.gz", + "https://github.com/protocolbuffers/upb/archive/aafc17fd6bde032b896bcecc66ad3c2ba9af434d.tar.gz", ], ) diff --git a/build_handwritten.yaml b/build_handwritten.yaml index 24ca4a40d1c..787914adc15 100644 --- a/build_handwritten.yaml +++ b/build_handwritten.yaml @@ -15,7 +15,7 @@ settings: core_version: 31.0.0 csharp_major_version: 2 g_stands_for: gracious - protobuf_version: 3.21.12 + protobuf_version: 3.22.2 version: 1.55.0-dev configs: asan: @@ -150,7 +150,7 @@ defaults: COREFLAGS: -fno-exceptions CPPFLAGS: -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2 -Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated - -Ithird_party/xxhash + -Ithird_party/utf8_range -Ithird_party/xxhash LDFLAGS: -g zlib: CFLAGS: -fvisibility=hidden diff --git a/cmake/upb.cmake b/cmake/upb.cmake index f2a0e508c34..72630fee212 100644 --- a/cmake/upb.cmake +++ b/cmake/upb.cmake @@ -14,7 +14,7 @@ set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) -set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") +set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range") set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") set(_gRPC_UPB_LIBRARIES upb) diff --git a/config.m4 b/config.m4 index f6f6798832b..906bdd181bb 100644 --- a/config.m4 +++ b/config.m4 @@ -14,6 +14,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl-with-bazel/src/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/re2) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/upb) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/utf8_range) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/xxhash) LIBS="-lpthread $LIBS" @@ -1252,26 +1253,50 @@ if test "$PHP_GRPC" != "no"; then third_party/re2/util/pcre.cc \ third_party/re2/util/rune.cc \ third_party/re2/util/strutil.cc \ - third_party/upb/third_party/utf8_range/naive.c \ - third_party/upb/third_party/utf8_range/range2-neon.c \ - third_party/upb/third_party/utf8_range/range2-sse.c \ - third_party/upb/upb/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 \ + third_party/upb/upb/base/status.c \ + third_party/upb/upb/collections/array.c \ + third_party/upb/upb/collections/map.c \ + third_party/upb/upb/collections/map_sorter.c \ + third_party/upb/upb/hash/common.c \ + third_party/upb/upb/json/decode.c \ + third_party/upb/upb/json/encode.c \ + third_party/upb/upb/lex/atoi.c \ + third_party/upb/upb/lex/round_trip.c \ + third_party/upb/upb/lex/strtod.c \ + third_party/upb/upb/lex/unicode.c \ + third_party/upb/upb/mem/alloc.c \ + third_party/upb/upb/mem/arena.c \ + third_party/upb/upb/message/accessors.c \ + third_party/upb/upb/message/message.c \ + third_party/upb/upb/mini_table/common.c \ + third_party/upb/upb/mini_table/decode.c \ + third_party/upb/upb/mini_table/encode.c \ + third_party/upb/upb/mini_table/extension_registry.c \ + third_party/upb/upb/reflection/def_builder.c \ + third_party/upb/upb/reflection/def_pool.c \ + third_party/upb/upb/reflection/def_type.c \ + third_party/upb/upb/reflection/desc_state.c \ + third_party/upb/upb/reflection/enum_def.c \ + third_party/upb/upb/reflection/enum_reserved_range.c \ + third_party/upb/upb/reflection/enum_value_def.c \ + third_party/upb/upb/reflection/extension_range.c \ + third_party/upb/upb/reflection/field_def.c \ + third_party/upb/upb/reflection/file_def.c \ + third_party/upb/upb/reflection/message.c \ + third_party/upb/upb/reflection/message_def.c \ + third_party/upb/upb/reflection/message_reserved_range.c \ + third_party/upb/upb/reflection/method_def.c \ + third_party/upb/upb/reflection/oneof_def.c \ + third_party/upb/upb/reflection/service_def.c \ + third_party/upb/upb/text/encode.c \ + third_party/upb/upb/wire/decode.c \ + third_party/upb/upb/wire/decode_fast.c \ + third_party/upb/upb/wire/encode.c \ + third_party/upb/upb/wire/eps_copy_input_stream.c \ + third_party/upb/upb/wire/reader.c \ + third_party/utf8_range/naive.c \ + third_party/utf8_range/range2-neon.c \ + third_party/utf8_range/range2-sse.c \ , $ext_shared, , -fvisibility=hidden \ -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \ -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \ @@ -1559,6 +1584,16 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/ssl) PHP_ADD_BUILD_DIR($ext_builddir/third_party/re2/re2) PHP_ADD_BUILD_DIR($ext_builddir/third_party/re2/util) - PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/third_party/utf8_range) - PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/base) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/collections) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/hash) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/json) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/lex) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/mem) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/message) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/mini_table) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/reflection) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/text) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb/wire) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/utf8_range) fi diff --git a/config.w32 b/config.w32 index c9008c9af32..20f48cc2aa3 100644 --- a/config.w32 +++ b/config.w32 @@ -1218,26 +1218,50 @@ if (PHP_GRPC != "no") { "third_party\\re2\\util\\pcre.cc " + "third_party\\re2\\util\\rune.cc " + "third_party\\re2\\util\\strutil.cc " + - "third_party\\upb\\third_party\\utf8_range\\naive.c " + - "third_party\\upb\\third_party\\utf8_range\\range2-neon.c " + - "third_party\\upb\\third_party\\utf8_range\\range2-sse.c " + - "third_party\\upb\\upb\\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 " + + "third_party\\upb\\upb\\base\\status.c " + + "third_party\\upb\\upb\\collections\\array.c " + + "third_party\\upb\\upb\\collections\\map.c " + + "third_party\\upb\\upb\\collections\\map_sorter.c " + + "third_party\\upb\\upb\\hash\\common.c " + + "third_party\\upb\\upb\\json\\decode.c " + + "third_party\\upb\\upb\\json\\encode.c " + + "third_party\\upb\\upb\\lex\\atoi.c " + + "third_party\\upb\\upb\\lex\\round_trip.c " + + "third_party\\upb\\upb\\lex\\strtod.c " + + "third_party\\upb\\upb\\lex\\unicode.c " + + "third_party\\upb\\upb\\mem\\alloc.c " + + "third_party\\upb\\upb\\mem\\arena.c " + + "third_party\\upb\\upb\\message\\accessors.c " + + "third_party\\upb\\upb\\message\\message.c " + + "third_party\\upb\\upb\\mini_table\\common.c " + + "third_party\\upb\\upb\\mini_table\\decode.c " + + "third_party\\upb\\upb\\mini_table\\encode.c " + + "third_party\\upb\\upb\\mini_table\\extension_registry.c " + + "third_party\\upb\\upb\\reflection\\def_builder.c " + + "third_party\\upb\\upb\\reflection\\def_pool.c " + + "third_party\\upb\\upb\\reflection\\def_type.c " + + "third_party\\upb\\upb\\reflection\\desc_state.c " + + "third_party\\upb\\upb\\reflection\\enum_def.c " + + "third_party\\upb\\upb\\reflection\\enum_reserved_range.c " + + "third_party\\upb\\upb\\reflection\\enum_value_def.c " + + "third_party\\upb\\upb\\reflection\\extension_range.c " + + "third_party\\upb\\upb\\reflection\\field_def.c " + + "third_party\\upb\\upb\\reflection\\file_def.c " + + "third_party\\upb\\upb\\reflection\\message.c " + + "third_party\\upb\\upb\\reflection\\message_def.c " + + "third_party\\upb\\upb\\reflection\\message_reserved_range.c " + + "third_party\\upb\\upb\\reflection\\method_def.c " + + "third_party\\upb\\upb\\reflection\\oneof_def.c " + + "third_party\\upb\\upb\\reflection\\service_def.c " + + "third_party\\upb\\upb\\text\\encode.c " + + "third_party\\upb\\upb\\wire\\decode.c " + + "third_party\\upb\\upb\\wire\\decode_fast.c " + + "third_party\\upb\\upb\\wire\\encode.c " + + "third_party\\upb\\upb\\wire\\eps_copy_input_stream.c " + + "third_party\\upb\\upb\\wire\\reader.c " + + "third_party\\utf8_range\\naive.c " + + "third_party\\utf8_range\\range2-neon.c " + + "third_party\\utf8_range\\range2-sse.c " + "third_party\\zlib\\adler32.c " + "third_party\\zlib\\compress.c " + "third_party\\zlib\\crc32.c " + @@ -1267,6 +1291,7 @@ if (PHP_GRPC != "no") { "/I"+configure_module_dirname+"\\third_party\\boringssl-with-bazel\\src\\include "+ "/I"+configure_module_dirname+"\\third_party\\re2 "+ "/I"+configure_module_dirname+"\\third_party\\upb "+ + "/I"+configure_module_dirname+"\\third_party\\utf8_range "+ "/I"+configure_module_dirname+"\\third_party\\xxhash "+ "/I"+configure_module_dirname+"\\third_party\\zlib "); @@ -1708,9 +1733,19 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2\\re2"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2\\util"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\third_party"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\third_party\\utf8_range"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\base"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\collections"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\hash"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\json"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\lex"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\mem"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\message"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\mini_table"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\reflection"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\text"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb\\wire"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\utf8_range"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib"); _build_dirs = new Array(); for (i = 0; i < build_dirs.length; i++) { diff --git a/examples/android/helloworld/app/build.gradle b/examples/android/helloworld/app/build.gradle index 3d19575c13a..0127b24d700 100644 --- a/examples/android/helloworld/app/build.gradle +++ b/examples/android/helloworld/app/build.gradle @@ -29,6 +29,8 @@ android { arguments '-DgRPC_BUILD_CODEGEN=off' arguments '-Dhelloworld_PROTOBUF_PROTOC_EXECUTABLE=' + protoc arguments '-Dhelloworld_GRPC_CPP_PLUGIN_EXECUTABLE=' + grpc_cpp_plugin + arguments '-Dprotobuf_INSTALL=OFF' + arguments '-Dutf8_range_ENABLE_INSTALL=OFF' } } ndk.abiFilters 'x86' diff --git a/examples/cpp/compression/Makefile b/examples/cpp/compression/Makefile index 5286413289c..7e9994ccdb6 100644 --- a/examples/cpp/compression/Makefile +++ b/examples/cpp/compression/Makefile @@ -60,7 +60,7 @@ clean: # They are by no means necessary to actually compile a grpc-enabled software. PROTOC_CMD = which $(PROTOC) -PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q libprotoc.3 +PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q 'libprotoc.3\|libprotoc [0-9][0-9]\.' PLUGIN_CHECK_CMD = which $(GRPC_CPP_PLUGIN) HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) @@ -79,11 +79,11 @@ system-check: ifneq ($(HAS_VALID_PROTOC),true) @echo " DEPENDENCY ERROR" @echo - @echo "You don't have protoc 3.0.0 installed in your path." - @echo "Please install Google protocol buffers 3.0.0 and its compiler." + @echo "You don't have protoc 3.0.0 or newer installed in your path." + @echo "Please install an up-to-date version of Google protocol buffers." @echo "You can find it here:" @echo - @echo " https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0" + @echo " https://github.com/protocolbuffers/protobuf/releases" @echo @echo "Here is what I get when trying to evaluate your version of protoc:" @echo diff --git a/examples/cpp/helloworld/Makefile b/examples/cpp/helloworld/Makefile index f5524eacc10..50829c0026b 100644 --- a/examples/cpp/helloworld/Makefile +++ b/examples/cpp/helloworld/Makefile @@ -14,18 +14,28 @@ # limitations under the License. # +# TODO(jtattermusch): Remove the hack to workaround protobuf bug. See https://github.com/protocolbuffers/protobuf/issues/12439 +# Hack: protobuf currently doesn't declare it's absl dependencies when protobuf.pc pkgconfig file is used. +PROTOBUF_ABSL_DEPS = absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant +# TODO(jtattermusch): Remove the hack to workaround protobuf/utf8_range bug. See https://github.com/protocolbuffers/utf8_range/issues/20 +# Hack: utf8_range (which is protobuf's dependency) currently doesn't have a pkgconfig file, so we need to explicitly +# tweak the list of libraries to link against to fix the build. +PROTOBUF_UTF8_RANGE_LINK_LIBS = -lutf8_validity + HOST_SYSTEM = $(shell uname | cut -f 1 -d_) SYSTEM ?= $(HOST_SYSTEM) CXX = g++ CPPFLAGS += `pkg-config --cflags protobuf grpc absl_flags absl_flags_parse` CXXFLAGS += -std=c++14 ifeq ($(SYSTEM),Darwin) -LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++ absl_flags absl_flags_parse`\ +LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++ absl_flags absl_flags_parse $(PROTOBUF_ABSL_DEPS)`\ + $(PROTOBUF_UTF8_RANGE_LINK_LIBS) \ -pthread\ -lgrpc++_reflection\ -ldl else -LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++ absl_flags absl_flags_parse`\ +LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++ absl_flags absl_flags_parse $(PROTOBUF_ABSL_DEPS)`\ + $(PROTOBUF_UTF8_RANGE_LINK_LIBS) \ -pthread\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -ldl @@ -77,7 +87,7 @@ clean: # They are by no means necessary to actually compile a grpc-enabled software. PROTOC_CMD = which $(PROTOC) -PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q libprotoc.3 +PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q 'libprotoc.3\|libprotoc [0-9][0-9]\.' PLUGIN_CHECK_CMD = which $(GRPC_CPP_PLUGIN) HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) @@ -96,11 +106,11 @@ system-check: ifneq ($(HAS_VALID_PROTOC),true) @echo " DEPENDENCY ERROR" @echo - @echo "You don't have protoc 3.0.0 installed in your path." - @echo "Please install Google protocol buffers 3.0.0 and its compiler." + @echo "You don't have protoc 3.0.0 or newer installed in your path." + @echo "Please install an up-to-date version of Google protocol buffers." @echo "You can find it here:" @echo - @echo " https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0" + @echo " https://github.com/protocolbuffers/protobuf/releases" @echo @echo "Here is what I get when trying to evaluate your version of protoc:" @echo diff --git a/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt b/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt index f8ecbcae411..ebf528847e9 100644 --- a/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt +++ b/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt @@ -40,6 +40,18 @@ ExternalProject_Add(absl -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/absl ) +# Builds absl project from the git submodule. +ExternalProject_Add(utf8_range + PREFIX utf8_range + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../third_party/utf8_range" + CMAKE_CACHE_ARGS + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE + -Dutf8_range_ENABLE_TESTS:BOOL=OFF + -Dabsl_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/absl/lib/cmake/absl + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/utf8_range + DEPENDS absl +) + # Builds c-ares project from the git submodule. ExternalProject_Add(c-ares PREFIX c-ares @@ -58,8 +70,12 @@ ExternalProject_Add(protobuf CMAKE_CACHE_ARGS -Dprotobuf_BUILD_TESTS:BOOL=OFF -Dprotobuf_WITH_ZLIB:BOOL=OFF + -Dprotobuf_ABSL_PROVIDER:STRING=package + -Dabsl_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/absl/lib/cmake/absl + -Dutf8_range_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/utf8_range/lib/cmake/utf8_range -Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/protobuf + DEPENDS absl utf8_range ) # Builds re2 project from the git submodule. @@ -101,6 +117,7 @@ ExternalProject_Add(grpc -DgRPC_INSTALL:BOOL=ON -DgRPC_BUILD_TESTS:BOOL=OFF -DgRPC_BUILD_MSVC_MP_COUNT:STRING=-1 + -Dutf8_range_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/utf8_range/lib/cmake/utf8_range -DgRPC_PROTOBUF_PROVIDER:STRING=package -DgRPC_PROTOBUF_PACKAGE_TYPE:STRING=CONFIG -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR} @@ -134,6 +151,7 @@ ExternalProject_Add(helloworld -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR} -Dc-ares_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares/lib/cmake/c-ares -Dre2_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/re2/lib/cmake/re2 + -Dutf8_range_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/utf8_range/lib/cmake/utf8_range -DZLIB_ROOT:STRING=${CMAKE_CURRENT_BINARY_DIR}/zlib -Dabsl_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR}/absl/lib/cmake/absl ${_CMAKE_ARGS_OPENSSL_ROOT_DIR} diff --git a/examples/cpp/load_balancing/Makefile b/examples/cpp/load_balancing/Makefile index 8254286ceba..2da6814b659 100644 --- a/examples/cpp/load_balancing/Makefile +++ b/examples/cpp/load_balancing/Makefile @@ -60,7 +60,7 @@ clean: # They are by no means necessary to actually compile a grpc-enabled software. PROTOC_CMD = which $(PROTOC) -PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q libprotoc.3 +PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q 'libprotoc.3\|libprotoc [0-9][0-9]\.' PLUGIN_CHECK_CMD = which $(GRPC_CPP_PLUGIN) HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) @@ -79,11 +79,11 @@ system-check: ifneq ($(HAS_VALID_PROTOC),true) @echo " DEPENDENCY ERROR" @echo - @echo "You don't have protoc 3.0.0 installed in your path." - @echo "Please install Google protocol buffers 3.0.0 and its compiler." + @echo "You don't have protoc 3.0.0 or newer installed in your path." + @echo "Please install an up-to-date version of Google protocol buffers." @echo "You can find it here:" @echo - @echo " https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0" + @echo " https://github.com/protocolbuffers/protobuf/releases" @echo @echo "Here is what I get when trying to evaluate your version of protoc:" @echo diff --git a/examples/cpp/metadata/Makefile b/examples/cpp/metadata/Makefile index a4a452178f4..0f596aaa0d6 100644 --- a/examples/cpp/metadata/Makefile +++ b/examples/cpp/metadata/Makefile @@ -48,7 +48,7 @@ GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)` # The following is to test your system and ensure a smoother experience. # They are by no means necessary to actually compile a grpc-enabled software. PROTOC_CMD = which $(PROTOC) -PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q libprotoc.3 +PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q 'libprotoc.3\|libprotoc [0-9][0-9]\.' PLUGIN_CHECK_CMD = which $(GRPC_CPP_PLUGIN) HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) @@ -65,11 +65,11 @@ endif ifneq ($(HAS_VALID_PROTOC),true) @echo " DEPENDENCY ERROR" @echo - @echo "You don't have protoc 3.0.0 installed in your path." - @echo "Please install Google protocol buffers 3.0.0 and its compiler." + @echo "You don't have protoc 3.0.0 or newer installed in your path." + @echo "Please install an up-to-date version of Google protocol buffers." @echo "You can find it here:" @echo - @echo " https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0" + @echo " https://github.com/protocolbuffers/protobuf/releases" @echo @echo "Here is what I get when trying to evaluate your version of protoc:" @echo diff --git a/examples/cpp/route_guide/Makefile b/examples/cpp/route_guide/Makefile index 89102374708..25fcde95676 100644 --- a/examples/cpp/route_guide/Makefile +++ b/examples/cpp/route_guide/Makefile @@ -14,18 +14,28 @@ # limitations under the License. # +# TODO(jtattermusch): Remove the hack to workaround protobuf bug. See https://github.com/protocolbuffers/protobuf/issues/12439 +# Hack: protobuf currently doesn't declare it's absl dependencies when protobuf.pc pkgconfig file is used. +PROTOBUF_ABSL_DEPS = absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant +# TODO(jtattermusch): Remove the hack to workaround protobuf/utf8_range bug. See https://github.com/protocolbuffers/utf8_range/issues/20 +# Hack: utf8_range (which is protobuf's dependency) currently doesn't have a pkgconfig file, so we need to explicitly +# tweak the list of libraries to link against to fix the build. +PROTOBUF_UTF8_RANGE_LINK_LIBS = -lutf8_validity + HOST_SYSTEM = $(shell uname | cut -f 1 -d_) SYSTEM ?= $(HOST_SYSTEM) CXX = g++ CPPFLAGS += `pkg-config --cflags protobuf grpc` CXXFLAGS += -std=c++14 ifeq ($(SYSTEM),Darwin) -LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++`\ - -pthread\ +LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++ $(PROTOBUF_ABSL_DEPS)`\ + $(PROTOBUF_UTF8_RANGE_LINK_LIBS) \ + -pthread\ -lgrpc++_reflection\ -ldl else -LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++`\ +LDFLAGS += -L/usr/local/lib `pkg-config --libs --static protobuf grpc++ $(PROTOBUF_ABSL_DEPS)`\ + $(PROTOBUF_UTF8_RANGE_LINK_LIBS) \ -pthread\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -ldl @@ -60,7 +70,7 @@ clean: # They are by no means necessary to actually compile a grpc-enabled software. PROTOC_CMD = which $(PROTOC) -PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q libprotoc.3 +PROTOC_CHECK_CMD = $(PROTOC) --version | grep -q 'libprotoc.3\|libprotoc [0-9][0-9]\.' PLUGIN_CHECK_CMD = which $(GRPC_CPP_PLUGIN) HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) @@ -79,11 +89,11 @@ system-check: ifneq ($(HAS_VALID_PROTOC),true) @echo " DEPENDENCY ERROR" @echo - @echo "You don't have protoc 3.0.0 installed in your path." - @echo "Please install Google protocol buffers 3.0.0 and its compiler." + @echo "You don't have protoc 3.0.0 or newer installed in your path." + @echo "Please install an up-to-date version of Google protocol buffers." @echo "You can find it here:" @echo - @echo " https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0" + @echo " https://github.com/protocolbuffers/protobuf/releases" @echo @echo "Here is what I get when trying to evaluate your version of protoc:" @echo diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index deece3ee6f6..b93e89d619c 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -1167,37 +1167,113 @@ Pod::Spec.new do |s| 'third_party/re2/util/test.h', 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', - 'third_party/upb/third_party/utf8_range/utf8_range.h', + 'third_party/upb/upb/alloc.h', 'third_party/upb/upb/arena.h', 'third_party/upb/upb/array.h', - 'third_party/upb/upb/collections.h', + 'third_party/upb/upb/base/descriptor_constants.h', + 'third_party/upb/upb/base/log2.h', + 'third_party/upb/upb/base/status.h', + 'third_party/upb/upb/base/string_view.h', + 'third_party/upb/upb/collections/array.h', + 'third_party/upb/upb/collections/array_internal.h', + 'third_party/upb/upb/collections/map.h', + 'third_party/upb/upb/collections/map_gencode_util.h', + 'third_party/upb/upb/collections/map_internal.h', + 'third_party/upb/upb/collections/map_sorter_internal.h', + 'third_party/upb/upb/collections/message_value.h', 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/decode_fast.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/hash/common.h', + 'third_party/upb/upb/hash/int_table.h', + 'third_party/upb/upb/hash/str_table.h', + 'third_party/upb/upb/json/decode.h', + 'third_party/upb/upb/json/encode.h', 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/lex/atoi.h', + 'third_party/upb/upb/lex/round_trip.h', + 'third_party/upb/upb/lex/strtod.h', + 'third_party/upb/upb/lex/unicode.h', 'third_party/upb/upb/map.h', - 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mem/alloc.h', + 'third_party/upb/upb/mem/arena.h', + 'third_party/upb/upb/mem/arena_internal.h', + 'third_party/upb/upb/message/accessors.h', + 'third_party/upb/upb/message/extension_internal.h', + 'third_party/upb/upb/message/internal.h', + 'third_party/upb/upb/message/message.h', 'third_party/upb/upb/mini_table.h', - 'third_party/upb/upb/mini_table.hpp', + 'third_party/upb/upb/mini_table/common.h', + 'third_party/upb/upb/mini_table/common_internal.h', + 'third_party/upb/upb/mini_table/decode.h', + 'third_party/upb/upb/mini_table/encode_internal.h', + 'third_party/upb/upb/mini_table/encode_internal.hpp', + 'third_party/upb/upb/mini_table/enum_internal.h', + 'third_party/upb/upb/mini_table/extension_internal.h', + 'third_party/upb/upb/mini_table/extension_registry.h', + 'third_party/upb/upb/mini_table/field_internal.h', + 'third_party/upb/upb/mini_table/file_internal.h', + 'third_party/upb/upb/mini_table/message_internal.h', + 'third_party/upb/upb/mini_table/sub_internal.h', + 'third_party/upb/upb/mini_table/types.h', 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/msg_internal.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/port/def.inc', + 'third_party/upb/upb/port/undef.inc', + 'third_party/upb/upb/port/vsnprintf_compat.h', 'third_party/upb/upb/reflection.h', 'third_party/upb/upb/reflection.hpp', + 'third_party/upb/upb/reflection/common.h', + 'third_party/upb/upb/reflection/def.h', + 'third_party/upb/upb/reflection/def.hpp', + 'third_party/upb/upb/reflection/def_builder_internal.h', + 'third_party/upb/upb/reflection/def_pool.h', + 'third_party/upb/upb/reflection/def_pool_internal.h', + 'third_party/upb/upb/reflection/def_type.h', + 'third_party/upb/upb/reflection/desc_state_internal.h', + 'third_party/upb/upb/reflection/enum_def.h', + 'third_party/upb/upb/reflection/enum_def_internal.h', + 'third_party/upb/upb/reflection/enum_reserved_range.h', + 'third_party/upb/upb/reflection/enum_reserved_range_internal.h', + 'third_party/upb/upb/reflection/enum_value_def.h', + 'third_party/upb/upb/reflection/enum_value_def_internal.h', + 'third_party/upb/upb/reflection/extension_range.h', + 'third_party/upb/upb/reflection/extension_range_internal.h', + 'third_party/upb/upb/reflection/field_def.h', + 'third_party/upb/upb/reflection/field_def_internal.h', + 'third_party/upb/upb/reflection/file_def.h', + 'third_party/upb/upb/reflection/file_def_internal.h', + 'third_party/upb/upb/reflection/message.h', + 'third_party/upb/upb/reflection/message.hpp', + 'third_party/upb/upb/reflection/message_def.h', + 'third_party/upb/upb/reflection/message_def_internal.h', + 'third_party/upb/upb/reflection/message_reserved_range.h', + 'third_party/upb/upb/reflection/message_reserved_range_internal.h', + 'third_party/upb/upb/reflection/method_def.h', + 'third_party/upb/upb/reflection/method_def_internal.h', + 'third_party/upb/upb/reflection/oneof_def.h', + 'third_party/upb/upb/reflection/oneof_def_internal.h', + 'third_party/upb/upb/reflection/service_def.h', + 'third_party/upb/upb/reflection/service_def_internal.h', + 'third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h', 'third_party/upb/upb/status.h', - 'third_party/upb/upb/table_internal.h', + 'third_party/upb/upb/string_view.h', + 'third_party/upb/upb/text/encode.h', 'third_party/upb/upb/text_encode.h', 'third_party/upb/upb/upb.h', 'third_party/upb/upb/upb.hpp', + 'third_party/upb/upb/wire/common_internal.h', + 'third_party/upb/upb/wire/decode.h', + 'third_party/upb/upb/wire/decode_fast.h', + 'third_party/upb/upb/wire/decode_internal.h', + 'third_party/upb/upb/wire/encode.h', + 'third_party/upb/upb/wire/eps_copy_input_stream.h', + 'third_party/upb/upb/wire/reader.h', + 'third_party/upb/upb/wire/swap_internal.h', + 'third_party/upb/upb/wire/types.h', + 'third_party/utf8_range/utf8_range.h', 'third_party/xxhash/xxhash.h' ss.private_header_files = 'src/core/ext/filters/backend_metrics/backend_metric_filter.h', @@ -2061,37 +2137,113 @@ Pod::Spec.new do |s| 'third_party/re2/util/test.h', 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', - 'third_party/upb/third_party/utf8_range/utf8_range.h', + 'third_party/upb/upb/alloc.h', 'third_party/upb/upb/arena.h', 'third_party/upb/upb/array.h', - 'third_party/upb/upb/collections.h', + 'third_party/upb/upb/base/descriptor_constants.h', + 'third_party/upb/upb/base/log2.h', + 'third_party/upb/upb/base/status.h', + 'third_party/upb/upb/base/string_view.h', + 'third_party/upb/upb/collections/array.h', + 'third_party/upb/upb/collections/array_internal.h', + 'third_party/upb/upb/collections/map.h', + 'third_party/upb/upb/collections/map_gencode_util.h', + 'third_party/upb/upb/collections/map_internal.h', + 'third_party/upb/upb/collections/map_sorter_internal.h', + 'third_party/upb/upb/collections/message_value.h', 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/decode_fast.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/hash/common.h', + 'third_party/upb/upb/hash/int_table.h', + 'third_party/upb/upb/hash/str_table.h', + 'third_party/upb/upb/json/decode.h', + 'third_party/upb/upb/json/encode.h', 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/lex/atoi.h', + 'third_party/upb/upb/lex/round_trip.h', + 'third_party/upb/upb/lex/strtod.h', + 'third_party/upb/upb/lex/unicode.h', 'third_party/upb/upb/map.h', - 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mem/alloc.h', + 'third_party/upb/upb/mem/arena.h', + 'third_party/upb/upb/mem/arena_internal.h', + 'third_party/upb/upb/message/accessors.h', + 'third_party/upb/upb/message/extension_internal.h', + 'third_party/upb/upb/message/internal.h', + 'third_party/upb/upb/message/message.h', 'third_party/upb/upb/mini_table.h', - 'third_party/upb/upb/mini_table.hpp', + 'third_party/upb/upb/mini_table/common.h', + 'third_party/upb/upb/mini_table/common_internal.h', + 'third_party/upb/upb/mini_table/decode.h', + 'third_party/upb/upb/mini_table/encode_internal.h', + 'third_party/upb/upb/mini_table/encode_internal.hpp', + 'third_party/upb/upb/mini_table/enum_internal.h', + 'third_party/upb/upb/mini_table/extension_internal.h', + 'third_party/upb/upb/mini_table/extension_registry.h', + 'third_party/upb/upb/mini_table/field_internal.h', + 'third_party/upb/upb/mini_table/file_internal.h', + 'third_party/upb/upb/mini_table/message_internal.h', + 'third_party/upb/upb/mini_table/sub_internal.h', + 'third_party/upb/upb/mini_table/types.h', 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/msg_internal.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/port/def.inc', + 'third_party/upb/upb/port/undef.inc', + 'third_party/upb/upb/port/vsnprintf_compat.h', 'third_party/upb/upb/reflection.h', 'third_party/upb/upb/reflection.hpp', + 'third_party/upb/upb/reflection/common.h', + 'third_party/upb/upb/reflection/def.h', + 'third_party/upb/upb/reflection/def.hpp', + 'third_party/upb/upb/reflection/def_builder_internal.h', + 'third_party/upb/upb/reflection/def_pool.h', + 'third_party/upb/upb/reflection/def_pool_internal.h', + 'third_party/upb/upb/reflection/def_type.h', + 'third_party/upb/upb/reflection/desc_state_internal.h', + 'third_party/upb/upb/reflection/enum_def.h', + 'third_party/upb/upb/reflection/enum_def_internal.h', + 'third_party/upb/upb/reflection/enum_reserved_range.h', + 'third_party/upb/upb/reflection/enum_reserved_range_internal.h', + 'third_party/upb/upb/reflection/enum_value_def.h', + 'third_party/upb/upb/reflection/enum_value_def_internal.h', + 'third_party/upb/upb/reflection/extension_range.h', + 'third_party/upb/upb/reflection/extension_range_internal.h', + 'third_party/upb/upb/reflection/field_def.h', + 'third_party/upb/upb/reflection/field_def_internal.h', + 'third_party/upb/upb/reflection/file_def.h', + 'third_party/upb/upb/reflection/file_def_internal.h', + 'third_party/upb/upb/reflection/message.h', + 'third_party/upb/upb/reflection/message.hpp', + 'third_party/upb/upb/reflection/message_def.h', + 'third_party/upb/upb/reflection/message_def_internal.h', + 'third_party/upb/upb/reflection/message_reserved_range.h', + 'third_party/upb/upb/reflection/message_reserved_range_internal.h', + 'third_party/upb/upb/reflection/method_def.h', + 'third_party/upb/upb/reflection/method_def_internal.h', + 'third_party/upb/upb/reflection/oneof_def.h', + 'third_party/upb/upb/reflection/oneof_def_internal.h', + 'third_party/upb/upb/reflection/service_def.h', + 'third_party/upb/upb/reflection/service_def_internal.h', + 'third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h', 'third_party/upb/upb/status.h', - 'third_party/upb/upb/table_internal.h', + 'third_party/upb/upb/string_view.h', + 'third_party/upb/upb/text/encode.h', 'third_party/upb/upb/text_encode.h', 'third_party/upb/upb/upb.h', 'third_party/upb/upb/upb.hpp', + 'third_party/upb/upb/wire/common_internal.h', + 'third_party/upb/upb/wire/decode.h', + 'third_party/upb/upb/wire/decode_fast.h', + 'third_party/upb/upb/wire/decode_internal.h', + 'third_party/upb/upb/wire/encode.h', + 'third_party/upb/upb/wire/eps_copy_input_stream.h', + 'third_party/upb/upb/wire/reader.h', + 'third_party/upb/upb/wire/swap_internal.h', + 'third_party/upb/upb/wire/types.h', + 'third_party/utf8_range/utf8_range.h', 'third_party/xxhash/xxhash.h' end diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index c071ff7c43b..3874783485e 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -78,6 +78,7 @@ Pod::Spec.new do |s| ' "$(PODS_TARGET_SRCROOT)/src/core/ext/upbdefs-generated"'\ ' "$(PODS_TARGET_SRCROOT)/third_party/re2"'\ ' "$(PODS_TARGET_SRCROOT)/third_party/upb"'\ + ' "$(PODS_TARGET_SRCROOT)/third_party/utf8_range"'\ ' "$(PODS_TARGET_SRCROOT)/third_party/xxhash"', # If we don't set these two settings, `include/grpc/support/time.h` and # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the @@ -1858,57 +1859,157 @@ Pod::Spec.new do |s| 'third_party/re2/util/test.h', 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', - 'third_party/upb/third_party/utf8_range/naive.c', - 'third_party/upb/third_party/utf8_range/range2-neon.c', - 'third_party/upb/third_party/utf8_range/range2-sse.c', - 'third_party/upb/third_party/utf8_range/utf8_range.h', - 'third_party/upb/upb/arena.c', + 'third_party/upb/upb/alloc.h', '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/base/descriptor_constants.h', + 'third_party/upb/upb/base/log2.h', + 'third_party/upb/upb/base/status.c', + 'third_party/upb/upb/base/status.h', + 'third_party/upb/upb/base/string_view.h', + 'third_party/upb/upb/collections/array.c', + 'third_party/upb/upb/collections/array.h', + 'third_party/upb/upb/collections/array_internal.h', + 'third_party/upb/upb/collections/map.c', + 'third_party/upb/upb/collections/map.h', + 'third_party/upb/upb/collections/map_gencode_util.h', + 'third_party/upb/upb/collections/map_internal.h', + 'third_party/upb/upb/collections/map_sorter.c', + 'third_party/upb/upb/collections/map_sorter_internal.h', + 'third_party/upb/upb/collections/message_value.h', 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/decode_fast.c', - 'third_party/upb/upb/decode_fast.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/hash/common.c', + 'third_party/upb/upb/hash/common.h', + 'third_party/upb/upb/hash/int_table.h', + 'third_party/upb/upb/hash/str_table.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/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/lex/atoi.c', + 'third_party/upb/upb/lex/atoi.h', + 'third_party/upb/upb/lex/round_trip.c', + 'third_party/upb/upb/lex/round_trip.h', + 'third_party/upb/upb/lex/strtod.c', + 'third_party/upb/upb/lex/strtod.h', + 'third_party/upb/upb/lex/unicode.c', + 'third_party/upb/upb/lex/unicode.h', 'third_party/upb/upb/map.h', - 'third_party/upb/upb/message_value.h', - 'third_party/upb/upb/mini_table.c', + 'third_party/upb/upb/mem/alloc.c', + 'third_party/upb/upb/mem/alloc.h', + 'third_party/upb/upb/mem/arena.c', + 'third_party/upb/upb/mem/arena.h', + 'third_party/upb/upb/mem/arena_internal.h', + 'third_party/upb/upb/message/accessors.c', + 'third_party/upb/upb/message/accessors.h', + 'third_party/upb/upb/message/extension_internal.h', + 'third_party/upb/upb/message/internal.h', + 'third_party/upb/upb/message/message.c', + 'third_party/upb/upb/message/message.h', 'third_party/upb/upb/mini_table.h', - 'third_party/upb/upb/mini_table.hpp', - 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/mini_table/common.c', + 'third_party/upb/upb/mini_table/common.h', + 'third_party/upb/upb/mini_table/common_internal.h', + 'third_party/upb/upb/mini_table/decode.c', + 'third_party/upb/upb/mini_table/decode.h', + 'third_party/upb/upb/mini_table/encode.c', + 'third_party/upb/upb/mini_table/encode_internal.h', + 'third_party/upb/upb/mini_table/encode_internal.hpp', + 'third_party/upb/upb/mini_table/enum_internal.h', + 'third_party/upb/upb/mini_table/extension_internal.h', + 'third_party/upb/upb/mini_table/extension_registry.c', + 'third_party/upb/upb/mini_table/extension_registry.h', + 'third_party/upb/upb/mini_table/field_internal.h', + 'third_party/upb/upb/mini_table/file_internal.h', + 'third_party/upb/upb/mini_table/message_internal.h', + 'third_party/upb/upb/mini_table/sub_internal.h', + 'third_party/upb/upb/mini_table/types.h', 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/msg_internal.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', - 'third_party/upb/upb/reflection.c', + 'third_party/upb/upb/port/def.inc', + 'third_party/upb/upb/port/undef.inc', + 'third_party/upb/upb/port/vsnprintf_compat.h', 'third_party/upb/upb/reflection.h', 'third_party/upb/upb/reflection.hpp', - 'third_party/upb/upb/status.c', + 'third_party/upb/upb/reflection/common.h', + 'third_party/upb/upb/reflection/def.h', + 'third_party/upb/upb/reflection/def.hpp', + 'third_party/upb/upb/reflection/def_builder.c', + 'third_party/upb/upb/reflection/def_builder_internal.h', + 'third_party/upb/upb/reflection/def_pool.c', + 'third_party/upb/upb/reflection/def_pool.h', + 'third_party/upb/upb/reflection/def_pool_internal.h', + 'third_party/upb/upb/reflection/def_type.c', + 'third_party/upb/upb/reflection/def_type.h', + 'third_party/upb/upb/reflection/desc_state.c', + 'third_party/upb/upb/reflection/desc_state_internal.h', + 'third_party/upb/upb/reflection/enum_def.c', + 'third_party/upb/upb/reflection/enum_def.h', + 'third_party/upb/upb/reflection/enum_def_internal.h', + 'third_party/upb/upb/reflection/enum_reserved_range.c', + 'third_party/upb/upb/reflection/enum_reserved_range.h', + 'third_party/upb/upb/reflection/enum_reserved_range_internal.h', + 'third_party/upb/upb/reflection/enum_value_def.c', + 'third_party/upb/upb/reflection/enum_value_def.h', + 'third_party/upb/upb/reflection/enum_value_def_internal.h', + 'third_party/upb/upb/reflection/extension_range.c', + 'third_party/upb/upb/reflection/extension_range.h', + 'third_party/upb/upb/reflection/extension_range_internal.h', + 'third_party/upb/upb/reflection/field_def.c', + 'third_party/upb/upb/reflection/field_def.h', + 'third_party/upb/upb/reflection/field_def_internal.h', + 'third_party/upb/upb/reflection/file_def.c', + 'third_party/upb/upb/reflection/file_def.h', + 'third_party/upb/upb/reflection/file_def_internal.h', + 'third_party/upb/upb/reflection/message.c', + 'third_party/upb/upb/reflection/message.h', + 'third_party/upb/upb/reflection/message.hpp', + 'third_party/upb/upb/reflection/message_def.c', + 'third_party/upb/upb/reflection/message_def.h', + 'third_party/upb/upb/reflection/message_def_internal.h', + 'third_party/upb/upb/reflection/message_reserved_range.c', + 'third_party/upb/upb/reflection/message_reserved_range.h', + 'third_party/upb/upb/reflection/message_reserved_range_internal.h', + 'third_party/upb/upb/reflection/method_def.c', + 'third_party/upb/upb/reflection/method_def.h', + 'third_party/upb/upb/reflection/method_def_internal.h', + 'third_party/upb/upb/reflection/oneof_def.c', + 'third_party/upb/upb/reflection/oneof_def.h', + 'third_party/upb/upb/reflection/oneof_def_internal.h', + 'third_party/upb/upb/reflection/service_def.c', + 'third_party/upb/upb/reflection/service_def.h', + 'third_party/upb/upb/reflection/service_def_internal.h', + 'third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h', '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', + 'third_party/upb/upb/string_view.h', + 'third_party/upb/upb/text/encode.c', + 'third_party/upb/upb/text/encode.h', 'third_party/upb/upb/text_encode.h', - 'third_party/upb/upb/upb.c', 'third_party/upb/upb/upb.h', 'third_party/upb/upb/upb.hpp', + 'third_party/upb/upb/wire/common_internal.h', + 'third_party/upb/upb/wire/decode.c', + 'third_party/upb/upb/wire/decode.h', + 'third_party/upb/upb/wire/decode_fast.c', + 'third_party/upb/upb/wire/decode_fast.h', + 'third_party/upb/upb/wire/decode_internal.h', + 'third_party/upb/upb/wire/encode.c', + 'third_party/upb/upb/wire/encode.h', + 'third_party/upb/upb/wire/eps_copy_input_stream.c', + 'third_party/upb/upb/wire/eps_copy_input_stream.h', + 'third_party/upb/upb/wire/reader.c', + 'third_party/upb/upb/wire/reader.h', + 'third_party/upb/upb/wire/swap_internal.h', + 'third_party/upb/upb/wire/types.h', + 'third_party/utf8_range/naive.c', + 'third_party/utf8_range/range2-neon.c', + 'third_party/utf8_range/range2-sse.c', + 'third_party/utf8_range/utf8_range.h', 'third_party/xxhash/xxhash.h' ss.private_header_files = 'src/core/ext/filters/backend_metrics/backend_metric_filter.h', 'src/core/ext/filters/backend_metrics/backend_metric_provider.h', @@ -2739,37 +2840,113 @@ Pod::Spec.new do |s| 'third_party/re2/util/test.h', 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', - 'third_party/upb/third_party/utf8_range/utf8_range.h', + 'third_party/upb/upb/alloc.h', 'third_party/upb/upb/arena.h', 'third_party/upb/upb/array.h', - 'third_party/upb/upb/collections.h', + 'third_party/upb/upb/base/descriptor_constants.h', + 'third_party/upb/upb/base/log2.h', + 'third_party/upb/upb/base/status.h', + 'third_party/upb/upb/base/string_view.h', + 'third_party/upb/upb/collections/array.h', + 'third_party/upb/upb/collections/array_internal.h', + 'third_party/upb/upb/collections/map.h', + 'third_party/upb/upb/collections/map_gencode_util.h', + 'third_party/upb/upb/collections/map_internal.h', + 'third_party/upb/upb/collections/map_sorter_internal.h', + 'third_party/upb/upb/collections/message_value.h', 'third_party/upb/upb/decode.h', - 'third_party/upb/upb/decode_fast.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/hash/common.h', + 'third_party/upb/upb/hash/int_table.h', + 'third_party/upb/upb/hash/str_table.h', + 'third_party/upb/upb/json/decode.h', + 'third_party/upb/upb/json/encode.h', 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/lex/atoi.h', + 'third_party/upb/upb/lex/round_trip.h', + 'third_party/upb/upb/lex/strtod.h', + 'third_party/upb/upb/lex/unicode.h', 'third_party/upb/upb/map.h', - 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mem/alloc.h', + 'third_party/upb/upb/mem/arena.h', + 'third_party/upb/upb/mem/arena_internal.h', + 'third_party/upb/upb/message/accessors.h', + 'third_party/upb/upb/message/extension_internal.h', + 'third_party/upb/upb/message/internal.h', + 'third_party/upb/upb/message/message.h', 'third_party/upb/upb/mini_table.h', - 'third_party/upb/upb/mini_table.hpp', + 'third_party/upb/upb/mini_table/common.h', + 'third_party/upb/upb/mini_table/common_internal.h', + 'third_party/upb/upb/mini_table/decode.h', + 'third_party/upb/upb/mini_table/encode_internal.h', + 'third_party/upb/upb/mini_table/encode_internal.hpp', + 'third_party/upb/upb/mini_table/enum_internal.h', + 'third_party/upb/upb/mini_table/extension_internal.h', + 'third_party/upb/upb/mini_table/extension_registry.h', + 'third_party/upb/upb/mini_table/field_internal.h', + 'third_party/upb/upb/mini_table/file_internal.h', + 'third_party/upb/upb/mini_table/message_internal.h', + 'third_party/upb/upb/mini_table/sub_internal.h', + 'third_party/upb/upb/mini_table/types.h', 'third_party/upb/upb/msg.h', - 'third_party/upb/upb/msg_internal.h', - 'third_party/upb/upb/port_def.inc', - 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/port/def.inc', + 'third_party/upb/upb/port/undef.inc', + 'third_party/upb/upb/port/vsnprintf_compat.h', 'third_party/upb/upb/reflection.h', 'third_party/upb/upb/reflection.hpp', + 'third_party/upb/upb/reflection/common.h', + 'third_party/upb/upb/reflection/def.h', + 'third_party/upb/upb/reflection/def.hpp', + 'third_party/upb/upb/reflection/def_builder_internal.h', + 'third_party/upb/upb/reflection/def_pool.h', + 'third_party/upb/upb/reflection/def_pool_internal.h', + 'third_party/upb/upb/reflection/def_type.h', + 'third_party/upb/upb/reflection/desc_state_internal.h', + 'third_party/upb/upb/reflection/enum_def.h', + 'third_party/upb/upb/reflection/enum_def_internal.h', + 'third_party/upb/upb/reflection/enum_reserved_range.h', + 'third_party/upb/upb/reflection/enum_reserved_range_internal.h', + 'third_party/upb/upb/reflection/enum_value_def.h', + 'third_party/upb/upb/reflection/enum_value_def_internal.h', + 'third_party/upb/upb/reflection/extension_range.h', + 'third_party/upb/upb/reflection/extension_range_internal.h', + 'third_party/upb/upb/reflection/field_def.h', + 'third_party/upb/upb/reflection/field_def_internal.h', + 'third_party/upb/upb/reflection/file_def.h', + 'third_party/upb/upb/reflection/file_def_internal.h', + 'third_party/upb/upb/reflection/message.h', + 'third_party/upb/upb/reflection/message.hpp', + 'third_party/upb/upb/reflection/message_def.h', + 'third_party/upb/upb/reflection/message_def_internal.h', + 'third_party/upb/upb/reflection/message_reserved_range.h', + 'third_party/upb/upb/reflection/message_reserved_range_internal.h', + 'third_party/upb/upb/reflection/method_def.h', + 'third_party/upb/upb/reflection/method_def_internal.h', + 'third_party/upb/upb/reflection/oneof_def.h', + 'third_party/upb/upb/reflection/oneof_def_internal.h', + 'third_party/upb/upb/reflection/service_def.h', + 'third_party/upb/upb/reflection/service_def_internal.h', + 'third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h', 'third_party/upb/upb/status.h', - 'third_party/upb/upb/table_internal.h', + 'third_party/upb/upb/string_view.h', + 'third_party/upb/upb/text/encode.h', 'third_party/upb/upb/text_encode.h', 'third_party/upb/upb/upb.h', 'third_party/upb/upb/upb.hpp', + 'third_party/upb/upb/wire/common_internal.h', + 'third_party/upb/upb/wire/decode.h', + 'third_party/upb/upb/wire/decode_fast.h', + 'third_party/upb/upb/wire/decode_internal.h', + 'third_party/upb/upb/wire/encode.h', + 'third_party/upb/upb/wire/eps_copy_input_stream.h', + 'third_party/upb/upb/wire/reader.h', + 'third_party/upb/upb/wire/swap_internal.h', + 'third_party/upb/upb/wire/types.h', + 'third_party/utf8_range/utf8_range.h', 'third_party/xxhash/xxhash.h' end diff --git a/grpc.gemspec b/grpc.gemspec index 0bca4f77b14..4b697fcf561 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |s| s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb ) s.platform = Gem::Platform::RUBY - s.add_dependency 'google-protobuf', '~> 3.21' + s.add_dependency 'google-protobuf', '~> 3.22' s.add_dependency 'googleapis-common-protos-types', '~> 1.0' s.add_development_dependency 'bundler', '>= 1.9' @@ -2710,57 +2710,157 @@ Gem::Specification.new do |s| s.files += %w( third_party/re2/util/test.h ) s.files += %w( third_party/re2/util/utf.h ) s.files += %w( third_party/re2/util/util.h ) - s.files += %w( third_party/upb/third_party/utf8_range/naive.c ) - s.files += %w( third_party/upb/third_party/utf8_range/range2-neon.c ) - s.files += %w( third_party/upb/third_party/utf8_range/range2-sse.c ) - s.files += %w( third_party/upb/third_party/utf8_range/utf8_range.h ) - s.files += %w( third_party/upb/upb/arena.c ) + s.files += %w( third_party/upb/upb/alloc.h ) 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/base/descriptor_constants.h ) + s.files += %w( third_party/upb/upb/base/log2.h ) + s.files += %w( third_party/upb/upb/base/status.c ) + s.files += %w( third_party/upb/upb/base/status.h ) + s.files += %w( third_party/upb/upb/base/string_view.h ) + s.files += %w( third_party/upb/upb/collections/array.c ) + s.files += %w( third_party/upb/upb/collections/array.h ) + s.files += %w( third_party/upb/upb/collections/array_internal.h ) + s.files += %w( third_party/upb/upb/collections/map.c ) + s.files += %w( third_party/upb/upb/collections/map.h ) + s.files += %w( third_party/upb/upb/collections/map_gencode_util.h ) + s.files += %w( third_party/upb/upb/collections/map_internal.h ) + s.files += %w( third_party/upb/upb/collections/map_sorter.c ) + s.files += %w( third_party/upb/upb/collections/map_sorter_internal.h ) + s.files += %w( third_party/upb/upb/collections/message_value.h ) 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/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/hash/common.c ) + s.files += %w( third_party/upb/upb/hash/common.h ) + s.files += %w( third_party/upb/upb/hash/int_table.h ) + s.files += %w( third_party/upb/upb/hash/str_table.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/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/lex/atoi.c ) + s.files += %w( third_party/upb/upb/lex/atoi.h ) + s.files += %w( third_party/upb/upb/lex/round_trip.c ) + s.files += %w( third_party/upb/upb/lex/round_trip.h ) + s.files += %w( third_party/upb/upb/lex/strtod.c ) + s.files += %w( third_party/upb/upb/lex/strtod.h ) + s.files += %w( third_party/upb/upb/lex/unicode.c ) + s.files += %w( third_party/upb/upb/lex/unicode.h ) 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/mem/alloc.c ) + s.files += %w( third_party/upb/upb/mem/alloc.h ) + s.files += %w( third_party/upb/upb/mem/arena.c ) + s.files += %w( third_party/upb/upb/mem/arena.h ) + s.files += %w( third_party/upb/upb/mem/arena_internal.h ) + s.files += %w( third_party/upb/upb/message/accessors.c ) + s.files += %w( third_party/upb/upb/message/accessors.h ) + s.files += %w( third_party/upb/upb/message/extension_internal.h ) + s.files += %w( third_party/upb/upb/message/internal.h ) + s.files += %w( third_party/upb/upb/message/message.c ) + s.files += %w( third_party/upb/upb/message/message.h ) 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/mini_table/common.c ) + s.files += %w( third_party/upb/upb/mini_table/common.h ) + s.files += %w( third_party/upb/upb/mini_table/common_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/decode.c ) + s.files += %w( third_party/upb/upb/mini_table/decode.h ) + s.files += %w( third_party/upb/upb/mini_table/encode.c ) + s.files += %w( third_party/upb/upb/mini_table/encode_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/encode_internal.hpp ) + s.files += %w( third_party/upb/upb/mini_table/enum_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/extension_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/extension_registry.c ) + s.files += %w( third_party/upb/upb/mini_table/extension_registry.h ) + s.files += %w( third_party/upb/upb/mini_table/field_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/file_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/message_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/sub_internal.h ) + s.files += %w( third_party/upb/upb/mini_table/types.h ) s.files += %w( third_party/upb/upb/msg.h ) - s.files += %w( third_party/upb/upb/msg_internal.h ) - s.files += %w( third_party/upb/upb/port_def.inc ) - s.files += %w( third_party/upb/upb/port_undef.inc ) - s.files += %w( third_party/upb/upb/reflection.c ) + s.files += %w( third_party/upb/upb/port/def.inc ) + s.files += %w( third_party/upb/upb/port/undef.inc ) + s.files += %w( third_party/upb/upb/port/vsnprintf_compat.h ) 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/reflection/common.h ) + s.files += %w( third_party/upb/upb/reflection/def.h ) + s.files += %w( third_party/upb/upb/reflection/def.hpp ) + s.files += %w( third_party/upb/upb/reflection/def_builder.c ) + s.files += %w( third_party/upb/upb/reflection/def_builder_internal.h ) + s.files += %w( third_party/upb/upb/reflection/def_pool.c ) + s.files += %w( third_party/upb/upb/reflection/def_pool.h ) + s.files += %w( third_party/upb/upb/reflection/def_pool_internal.h ) + s.files += %w( third_party/upb/upb/reflection/def_type.c ) + s.files += %w( third_party/upb/upb/reflection/def_type.h ) + s.files += %w( third_party/upb/upb/reflection/desc_state.c ) + s.files += %w( third_party/upb/upb/reflection/desc_state_internal.h ) + s.files += %w( third_party/upb/upb/reflection/enum_def.c ) + s.files += %w( third_party/upb/upb/reflection/enum_def.h ) + s.files += %w( third_party/upb/upb/reflection/enum_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/enum_reserved_range.c ) + s.files += %w( third_party/upb/upb/reflection/enum_reserved_range.h ) + s.files += %w( third_party/upb/upb/reflection/enum_reserved_range_internal.h ) + s.files += %w( third_party/upb/upb/reflection/enum_value_def.c ) + s.files += %w( third_party/upb/upb/reflection/enum_value_def.h ) + s.files += %w( third_party/upb/upb/reflection/enum_value_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/extension_range.c ) + s.files += %w( third_party/upb/upb/reflection/extension_range.h ) + s.files += %w( third_party/upb/upb/reflection/extension_range_internal.h ) + s.files += %w( third_party/upb/upb/reflection/field_def.c ) + s.files += %w( third_party/upb/upb/reflection/field_def.h ) + s.files += %w( third_party/upb/upb/reflection/field_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/file_def.c ) + s.files += %w( third_party/upb/upb/reflection/file_def.h ) + s.files += %w( third_party/upb/upb/reflection/file_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/message.c ) + s.files += %w( third_party/upb/upb/reflection/message.h ) + s.files += %w( third_party/upb/upb/reflection/message.hpp ) + s.files += %w( third_party/upb/upb/reflection/message_def.c ) + s.files += %w( third_party/upb/upb/reflection/message_def.h ) + s.files += %w( third_party/upb/upb/reflection/message_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/message_reserved_range.c ) + s.files += %w( third_party/upb/upb/reflection/message_reserved_range.h ) + s.files += %w( third_party/upb/upb/reflection/message_reserved_range_internal.h ) + s.files += %w( third_party/upb/upb/reflection/method_def.c ) + s.files += %w( third_party/upb/upb/reflection/method_def.h ) + s.files += %w( third_party/upb/upb/reflection/method_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/oneof_def.c ) + s.files += %w( third_party/upb/upb/reflection/oneof_def.h ) + s.files += %w( third_party/upb/upb/reflection/oneof_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/service_def.c ) + s.files += %w( third_party/upb/upb/reflection/service_def.h ) + s.files += %w( third_party/upb/upb/reflection/service_def_internal.h ) + s.files += %w( third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h ) 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 ) + s.files += %w( third_party/upb/upb/string_view.h ) + s.files += %w( third_party/upb/upb/text/encode.c ) + s.files += %w( third_party/upb/upb/text/encode.h ) s.files += %w( third_party/upb/upb/text_encode.h ) - s.files += %w( third_party/upb/upb/upb.c ) s.files += %w( third_party/upb/upb/upb.h ) s.files += %w( third_party/upb/upb/upb.hpp ) + s.files += %w( third_party/upb/upb/wire/common_internal.h ) + s.files += %w( third_party/upb/upb/wire/decode.c ) + s.files += %w( third_party/upb/upb/wire/decode.h ) + s.files += %w( third_party/upb/upb/wire/decode_fast.c ) + s.files += %w( third_party/upb/upb/wire/decode_fast.h ) + s.files += %w( third_party/upb/upb/wire/decode_internal.h ) + s.files += %w( third_party/upb/upb/wire/encode.c ) + s.files += %w( third_party/upb/upb/wire/encode.h ) + s.files += %w( third_party/upb/upb/wire/eps_copy_input_stream.c ) + s.files += %w( third_party/upb/upb/wire/eps_copy_input_stream.h ) + s.files += %w( third_party/upb/upb/wire/reader.c ) + s.files += %w( third_party/upb/upb/wire/reader.h ) + s.files += %w( third_party/upb/upb/wire/swap_internal.h ) + s.files += %w( third_party/upb/upb/wire/types.h ) + s.files += %w( third_party/utf8_range/naive.c ) + s.files += %w( third_party/utf8_range/range2-neon.c ) + s.files += %w( third_party/utf8_range/range2-sse.c ) + s.files += %w( third_party/utf8_range/utf8_range.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 d912b9ffd24..e5720ab8205 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -60,6 +60,7 @@ '-Ithird_party/upb', '-Isrc/core/ext/upb-generated', '-Isrc/core/ext/upbdefs-generated', + '-Ithird_party/utf8_range', '-Ithird_party/xxhash', ], 'ldflags': [ @@ -140,6 +141,7 @@ '-Ithird_party/upb', '-Isrc/core/ext/upb-generated', '-Isrc/core/ext/upbdefs-generated', + '-Ithird_party/utf8_range', '-Ithird_party/xxhash', ], 'OTHER_CPLUSPLUSFLAGS': [ @@ -152,6 +154,7 @@ '-Ithird_party/upb', '-Isrc/core/ext/upb-generated', '-Isrc/core/ext/upbdefs-generated', + '-Ithird_party/utf8_range', '-Ithird_party/xxhash', '-stdlib=libc++', '-std=c++14', @@ -2315,26 +2318,50 @@ 'dependencies': [ ], 'sources': [ - 'third_party/upb/third_party/utf8_range/naive.c', - 'third_party/upb/third_party/utf8_range/range2-neon.c', - 'third_party/upb/third_party/utf8_range/range2-sse.c', - 'third_party/upb/upb/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', + 'third_party/utf8_range/naive.c', + 'third_party/utf8_range/range2-neon.c', + 'third_party/utf8_range/range2-sse.c', + 'third_party/upb/upb/base/status.c', + 'third_party/upb/upb/collections/array.c', + 'third_party/upb/upb/collections/map.c', + 'third_party/upb/upb/collections/map_sorter.c', + 'third_party/upb/upb/hash/common.c', + 'third_party/upb/upb/json/decode.c', + 'third_party/upb/upb/json/encode.c', + 'third_party/upb/upb/lex/atoi.c', + 'third_party/upb/upb/lex/round_trip.c', + 'third_party/upb/upb/lex/strtod.c', + 'third_party/upb/upb/lex/unicode.c', + 'third_party/upb/upb/mem/alloc.c', + 'third_party/upb/upb/mem/arena.c', + 'third_party/upb/upb/message/accessors.c', + 'third_party/upb/upb/message/message.c', + 'third_party/upb/upb/mini_table/common.c', + 'third_party/upb/upb/mini_table/decode.c', + 'third_party/upb/upb/mini_table/encode.c', + 'third_party/upb/upb/mini_table/extension_registry.c', + 'third_party/upb/upb/reflection/def_builder.c', + 'third_party/upb/upb/reflection/def_pool.c', + 'third_party/upb/upb/reflection/def_type.c', + 'third_party/upb/upb/reflection/desc_state.c', + 'third_party/upb/upb/reflection/enum_def.c', + 'third_party/upb/upb/reflection/enum_reserved_range.c', + 'third_party/upb/upb/reflection/enum_value_def.c', + 'third_party/upb/upb/reflection/extension_range.c', + 'third_party/upb/upb/reflection/field_def.c', + 'third_party/upb/upb/reflection/file_def.c', + 'third_party/upb/upb/reflection/message.c', + 'third_party/upb/upb/reflection/message_def.c', + 'third_party/upb/upb/reflection/message_reserved_range.c', + 'third_party/upb/upb/reflection/method_def.c', + 'third_party/upb/upb/reflection/oneof_def.c', + 'third_party/upb/upb/reflection/service_def.c', + 'third_party/upb/upb/text/encode.c', + 'third_party/upb/upb/wire/decode.c', + 'third_party/upb/upb/wire/decode_fast.c', + 'third_party/upb/upb/wire/encode.c', + 'third_party/upb/upb/wire/eps_copy_input_stream.c', + 'third_party/upb/upb/wire/reader.c', 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', 'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c', ], diff --git a/include/grpcpp/impl/codegen/config_protobuf.h b/include/grpcpp/impl/codegen/config_protobuf.h index e1f3d40ac92..0affc784389 100644 --- a/include/grpcpp/impl/codegen/config_protobuf.h +++ b/include/grpcpp/impl/codegen/config_protobuf.h @@ -68,8 +68,10 @@ #ifndef GRPC_CUSTOM_JSONUTIL #include #include + +#include "absl/status/status.h" #define GRPC_CUSTOM_JSONUTIL ::google::protobuf::util -#define GRPC_CUSTOM_UTIL_STATUS ::google::protobuf::util::Status +#define GRPC_CUSTOM_UTIL_STATUS ::absl::Status #endif namespace grpc { diff --git a/package.xml b/package.xml index 18f013dffc6..98884c94092 100644 --- a/package.xml +++ b/package.xml @@ -2628,57 +2628,157 @@ - - - - - + - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + - - + + + + + + + + - - + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + + + + + + + + + + + + + + + + + + diff --git a/setup.py b/setup.py index 6501b43d612..c654d7d1c20 100644 --- a/setup.py +++ b/setup.py @@ -76,6 +76,7 @@ UPB_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext', 'upb-generated'),) UPBDEFS_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext', 'upbdefs-generated'),) +UTF8_RANGE_INCLUDE = (os.path.join('third_party', 'utf8_range'),) XXHASH_INCLUDE = (os.path.join('third_party', 'xxhash'),) ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),) README = os.path.join(PYTHON_STEM, 'README.rst') @@ -313,7 +314,8 @@ EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE + RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE + UPB_GRPC_GENERATED_INCLUDE + UPBDEFS_GRPC_GENERATED_INCLUDE + - XXHASH_INCLUDE + ZLIB_INCLUDE) + UTF8_RANGE_INCLUDE + XXHASH_INCLUDE + + ZLIB_INCLUDE) EXTENSION_LIBRARIES = () if "linux" in sys.platform: diff --git a/src/android/test/interop/app/build.gradle b/src/android/test/interop/app/build.gradle index 3ba47a697c8..85e1323ed3f 100644 --- a/src/android/test/interop/app/build.gradle +++ b/src/android/test/interop/app/build.gradle @@ -29,6 +29,8 @@ android { arguments '-DgRPC_BUILD_CODEGEN=off' arguments '-DPROTOBUF_PROTOC_EXECUTABLE=' + protoc arguments '-DgRPC_CPP_PLUGIN_EXECUTABLE=' + grpc_cpp_plugin + arguments '-Dprotobuf_INSTALL=OFF' + arguments '-Dutf8_range_ENABLE_INSTALL=OFF' } } ndk { diff --git a/src/compiler/BUILD b/src/compiler/BUILD index f4f977b2333..e787a96b60b 100644 --- a/src/compiler/BUILD +++ b/src/compiler/BUILD @@ -77,6 +77,7 @@ grpc_cc_library( ], external_deps = [ "protobuf_clib", + "protobuf", ], language = "c++", deps = [ diff --git a/src/compiler/config_protobuf.h b/src/compiler/config_protobuf.h index 4b27c8e2b62..6564a65a389 100644 --- a/src/compiler/config_protobuf.h +++ b/src/compiler/config_protobuf.h @@ -50,7 +50,7 @@ #endif #ifndef GRPC_CUSTOM_CSHARP_GETCLASSNAME -#include +#include #define GRPC_CUSTOM_CSHARP_GETCLASSNAME \ ::google::protobuf::compiler::csharp::GetClassName #define GRPC_CUSTOM_CSHARP_GETFILENAMESPACE \ diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index fa8db719d59..2a2a9ebc0d2 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include "src/compiler/config.h" #include "src/compiler/objective_c_generator_helpers.h" diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index 326e420c53e..8ee9e90c91e 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -21,7 +21,7 @@ #include -#include +#include #include "src/compiler/config.h" #include "src/compiler/generator_helpers.h" diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 65807dc98d8..e13693227fa 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -20,7 +20,7 @@ #include -#include +#include #include "src/compiler/config.h" #include "src/compiler/objective_c_generator.h" diff --git a/src/core/BUILD b/src/core/BUILD index 2897eef882c..67d5977b105 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -3917,6 +3917,7 @@ grpc_cc_library( "upb_json_lib", "re2", "upb_reflection", + "upb_collections_lib", ], language = "c++", tags = ["nofixdeps"], diff --git a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc index 2eb13bcd888..d94a1b1e127 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc @@ -26,7 +26,7 @@ #include #include "absl/strings/string_view.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" #include "upb/upb.hpp" #include "xds/data/orca/v3/orca_load_report.upb.h" diff --git a/src/core/ext/filters/client_channel/backend_metric.cc b/src/core/ext/filters/client_channel/backend_metric.cc index a0504d7be1d..6f5523a2d4f 100644 --- a/src/core/ext/filters/client_channel/backend_metric.cc +++ b/src/core/ext/filters/client_channel/backend_metric.cc @@ -23,7 +23,8 @@ #include #include "absl/strings/string_view.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/collections/map.h" #include "upb/upb.hpp" #include "xds/data/orca/v3/orca_load_report.upb.h" diff --git a/src/core/ext/filters/client_channel/health/health_check_client.cc b/src/core/ext/filters/client_channel/health/health_check_client.cc index cdd15447199..4ce6d664ce9 100644 --- a/src/core/ext/filters/client_channel/health/health_check_client.cc +++ b/src/core/ext/filters/client_channel/health/health_check_client.cc @@ -28,7 +28,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" #include "upb/upb.hpp" #include 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 297c0f165a2..b1b792a98bd 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,7 +26,7 @@ #include "google/protobuf/duration.upb.h" #include "google/protobuf/timestamp.upb.h" -#include "upb/upb.h" +#include "upb/base/string_view.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 48a59554d84..b74868ce334 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 @@ -24,7 +24,7 @@ #include -#include "upb/arena.h" +#include "upb/mem/arena.h" #include diff --git a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc index 7448a494305..661787fc604 100644 --- a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +++ b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc @@ -50,7 +50,7 @@ #include "absl/strings/string_view.h" #include "absl/strings/strip.h" #include "absl/types/optional.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" #include "upb/upb.hpp" #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 86c3c1d844a..f18fcae4872 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 @@ -7,104 +7,139 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/certs.upb.h" #include "google/protobuf/timestamp.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_Certificates_submsgs[1] = { - {.submsg = &envoy_admin_v3_Certificate_msginit}, +static const upb_MiniTableSub envoy_admin_v3_Certificates_submsgs[1] = { + {.submsg = &envoy_admin_v3_Certificate_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_Certificates__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_Certificates__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_Certificates_msginit = { +const upb_MiniTable envoy_admin_v3_Certificates_msg_init = { &envoy_admin_v3_Certificates_submsgs[0], &envoy_admin_v3_Certificates__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_Certificate_submsgs[2] = { - {.submsg = &envoy_admin_v3_CertificateDetails_msginit}, - {.submsg = &envoy_admin_v3_CertificateDetails_msginit}, +static const upb_MiniTableSub envoy_admin_v3_Certificate_submsgs[2] = { + {.submsg = &envoy_admin_v3_CertificateDetails_msg_init}, + {.submsg = &envoy_admin_v3_CertificateDetails_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_Certificate__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_Certificate__fields[2] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_Certificate_msginit = { +const upb_MiniTable envoy_admin_v3_Certificate_msg_init = { &envoy_admin_v3_Certificate_submsgs[0], &envoy_admin_v3_Certificate__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + {0x000800003f010012, &upb_prm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_CertificateDetails_submsgs[4] = { - {.submsg = &envoy_admin_v3_SubjectAlternateName_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_CertificateDetails_OcspDetails_msginit}, +static const upb_MiniTableSub envoy_admin_v3_CertificateDetails_submsgs[4] = { + {.submsg = &envoy_admin_v3_SubjectAlternateName_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_CertificateDetails_OcspDetails_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_CertificateDetails__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 64), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_CertificateDetails__fields[7] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 56), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 64), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 72), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_CertificateDetails_msginit = { +const upb_MiniTable envoy_admin_v3_CertificateDetails_msg_init = { &envoy_admin_v3_CertificateDetails_submsgs[0], &envoy_admin_v3_CertificateDetails__fields[0], - UPB_SIZE(48, 80), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(48, 80), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_prm_1bt_max64b}, + {0x003000003f000020, &upb_psv8_1bt}, + {0x003800000101002a, &upb_psm_1bt_maxmaxb}, + {0x0040000002020032, &upb_psm_1bt_maxmaxb}, + {0x004800000303003a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_CertificateDetails_OcspDetails_submsgs[2] = { - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_CertificateDetails_OcspDetails_submsgs[2] = { + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_CertificateDetails_OcspDetails__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_CertificateDetails_OcspDetails__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_CertificateDetails_OcspDetails_msginit = { +const upb_MiniTable envoy_admin_v3_CertificateDetails_OcspDetails_msg_init = { &envoy_admin_v3_CertificateDetails_OcspDetails_submsgs[0], &envoy_admin_v3_CertificateDetails_OcspDetails__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_admin_v3_SubjectAlternateName__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_SubjectAlternateName__fields[3] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_SubjectAlternateName_msginit = { +const upb_MiniTable envoy_admin_v3_SubjectAlternateName_msg_init = { NULL, &envoy_admin_v3_SubjectAlternateName__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pos_1bt}, + {0x000800000300001a, &upb_pos_1bt}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_admin_v3_Certificates_msginit, - &envoy_admin_v3_Certificate_msginit, - &envoy_admin_v3_CertificateDetails_msginit, - &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, - &envoy_admin_v3_SubjectAlternateName_msginit, + &envoy_admin_v3_Certificates_msg_init, + &envoy_admin_v3_Certificate_msg_init, + &envoy_admin_v3_CertificateDetails_msg_init, + &envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, + &envoy_admin_v3_SubjectAlternateName_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_certs_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_certs_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -113,5 +148,5 @@ const upb_MiniTable_File envoy_admin_v3_certs_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 3d93f72bb84..e75ce6fcc70 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 @@ -9,46 +9,46 @@ #ifndef ENVOY_ADMIN_V3_CERTS_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_CERTS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_Certificates; -struct envoy_admin_v3_Certificate; -struct envoy_admin_v3_CertificateDetails; -struct envoy_admin_v3_CertificateDetails_OcspDetails; -struct envoy_admin_v3_SubjectAlternateName; typedef struct envoy_admin_v3_Certificates envoy_admin_v3_Certificates; typedef struct envoy_admin_v3_Certificate envoy_admin_v3_Certificate; typedef struct envoy_admin_v3_CertificateDetails envoy_admin_v3_CertificateDetails; typedef struct envoy_admin_v3_CertificateDetails_OcspDetails envoy_admin_v3_CertificateDetails_OcspDetails; typedef struct envoy_admin_v3_SubjectAlternateName envoy_admin_v3_SubjectAlternateName; -extern const upb_MiniTable envoy_admin_v3_Certificates_msginit; -extern const upb_MiniTable envoy_admin_v3_Certificate_msginit; -extern const upb_MiniTable envoy_admin_v3_CertificateDetails_msginit; -extern const upb_MiniTable envoy_admin_v3_CertificateDetails_OcspDetails_msginit; -extern const upb_MiniTable envoy_admin_v3_SubjectAlternateName_msginit; +extern const upb_MiniTable envoy_admin_v3_Certificates_msg_init; +extern const upb_MiniTable envoy_admin_v3_Certificate_msg_init; +extern const upb_MiniTable envoy_admin_v3_CertificateDetails_msg_init; +extern const upb_MiniTable envoy_admin_v3_CertificateDetails_OcspDetails_msg_init; +extern const upb_MiniTable envoy_admin_v3_SubjectAlternateName_msg_init; struct google_protobuf_Timestamp; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; /* envoy.admin.v3.Certificates */ UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_new(upb_Arena* arena) { - return (envoy_admin_v3_Certificates*)_upb_Message_New(&envoy_admin_v3_Certificates_msginit, arena); + return (envoy_admin_v3_Certificates*)_upb_Message_New(&envoy_admin_v3_Certificates_msg_init, arena); } UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_Certificates* ret = envoy_admin_v3_Certificates_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificates_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificates_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -58,7 +58,7 @@ UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_parse_ex(con int options, upb_Arena* arena) { envoy_admin_v3_Certificates* ret = envoy_admin_v3_Certificates_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificates_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificates_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -66,47 +66,72 @@ UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_parse_ex(con } UPB_INLINE char* envoy_admin_v3_Certificates_serialize(const envoy_admin_v3_Certificates* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Certificates_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Certificates_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Certificates_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Certificates_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_Certificates_clear_certificates(envoy_admin_v3_Certificates* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_Certificate* const* envoy_admin_v3_Certificates_certificates(const envoy_admin_v3_Certificates* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_Certificate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_admin_v3_Certificates_has_certificates(const envoy_admin_v3_Certificates* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_admin_v3_Certificates_clear_certificates(const envoy_admin_v3_Certificates* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_admin_v3_Certificate* const* envoy_admin_v3_Certificates_certificates(const envoy_admin_v3_Certificates* msg, size_t* len) { - return (const envoy_admin_v3_Certificate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_admin_v3_Certificates_certificates(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_Certificate** envoy_admin_v3_Certificates_mutable_certificates(envoy_admin_v3_Certificates* msg, size_t* len) { - return (envoy_admin_v3_Certificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_Certificate** envoy_admin_v3_Certificates_mutable_certificates(envoy_admin_v3_Certificates* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_Certificate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_Certificate** envoy_admin_v3_Certificates_resize_certificates(envoy_admin_v3_Certificates* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_Certificate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_Certificate** envoy_admin_v3_Certificates_resize_certificates(envoy_admin_v3_Certificates* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_Certificate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_Certificate* envoy_admin_v3_Certificates_add_certificates(envoy_admin_v3_Certificates* msg, upb_Arena* arena) { - struct envoy_admin_v3_Certificate* sub = (struct envoy_admin_v3_Certificate*)_upb_Message_New(&envoy_admin_v3_Certificate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_Certificate* sub = (struct envoy_admin_v3_Certificate*)_upb_Message_New(&envoy_admin_v3_Certificate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.Certificate */ UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_new(upb_Arena* arena) { - return (envoy_admin_v3_Certificate*)_upb_Message_New(&envoy_admin_v3_Certificate_msginit, arena); + return (envoy_admin_v3_Certificate*)_upb_Message_New(&envoy_admin_v3_Certificate_msg_init, arena); } UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_Certificate* ret = envoy_admin_v3_Certificate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -116,7 +141,7 @@ UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_parse_ex(const int options, upb_Arena* arena) { envoy_admin_v3_Certificate* ret = envoy_admin_v3_Certificate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -124,68 +149,118 @@ UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_parse_ex(const } UPB_INLINE char* envoy_admin_v3_Certificate_serialize(const envoy_admin_v3_Certificate* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Certificate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Certificate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Certificate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Certificate_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_Certificate_clear_ca_cert(envoy_admin_v3_Certificate* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_CertificateDetails* const* envoy_admin_v3_Certificate_ca_cert(const envoy_admin_v3_Certificate* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_CertificateDetails* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_admin_v3_Certificate_ca_cert(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_Certificate_clear_ca_cert(const envoy_admin_v3_Certificate* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_admin_v3_Certificate_clear_cert_chain(envoy_admin_v3_Certificate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_CertificateDetails* const* envoy_admin_v3_Certificate_ca_cert(const envoy_admin_v3_Certificate* msg, size_t* len) { - return (const envoy_admin_v3_CertificateDetails* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const envoy_admin_v3_CertificateDetails* const* envoy_admin_v3_Certificate_cert_chain(const envoy_admin_v3_Certificate* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_CertificateDetails* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_Certificate_has_cert_chain(const envoy_admin_v3_Certificate* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_admin_v3_Certificate_clear_cert_chain(const envoy_admin_v3_Certificate* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_admin_v3_CertificateDetails* const* envoy_admin_v3_Certificate_cert_chain(const envoy_admin_v3_Certificate* msg, size_t* len) { - return (const envoy_admin_v3_CertificateDetails* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_admin_v3_Certificate_cert_chain(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_mutable_ca_cert(envoy_admin_v3_Certificate* msg, size_t* len) { - return (envoy_admin_v3_CertificateDetails**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_mutable_ca_cert(envoy_admin_v3_Certificate* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_CertificateDetails**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_resize_ca_cert(envoy_admin_v3_Certificate* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_CertificateDetails**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_resize_ca_cert(envoy_admin_v3_Certificate* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_CertificateDetails**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_CertificateDetails* envoy_admin_v3_Certificate_add_ca_cert(envoy_admin_v3_Certificate* msg, upb_Arena* arena) { - struct envoy_admin_v3_CertificateDetails* sub = (struct envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_CertificateDetails* sub = (struct envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_mutable_cert_chain(envoy_admin_v3_Certificate* msg, size_t* len) { - return (envoy_admin_v3_CertificateDetails**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_mutable_cert_chain(envoy_admin_v3_Certificate* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_CertificateDetails**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_resize_cert_chain(envoy_admin_v3_Certificate* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_CertificateDetails**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_resize_cert_chain(envoy_admin_v3_Certificate* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_CertificateDetails**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_CertificateDetails* envoy_admin_v3_Certificate_add_cert_chain(envoy_admin_v3_Certificate* msg, upb_Arena* arena) { - struct envoy_admin_v3_CertificateDetails* sub = (struct envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_CertificateDetails* sub = (struct envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.CertificateDetails */ UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_new(upb_Arena* arena) { - return (envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msginit, arena); + return (envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msg_init, arena); } UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_CertificateDetails* ret = envoy_admin_v3_CertificateDetails_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -195,7 +270,7 @@ UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_ int options, upb_Arena* arena) { envoy_admin_v3_CertificateDetails* ret = envoy_admin_v3_CertificateDetails_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -203,127 +278,185 @@ UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_ } UPB_INLINE char* envoy_admin_v3_CertificateDetails_serialize(const envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msg_init, 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); +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_path(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CertificateDetails_path(const envoy_admin_v3_CertificateDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_serial_number(const envoy_admin_v3_CertificateDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_serial_number(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CertificateDetails_serial_number(const envoy_admin_v3_CertificateDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_subject_alt_names(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_SubjectAlternateName* const* envoy_admin_v3_CertificateDetails_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_SubjectAlternateName* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_admin_v3_CertificateDetails_subject_alt_names(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE const envoy_admin_v3_SubjectAlternateName* const* envoy_admin_v3_CertificateDetails_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg, size_t* len) { - return (const envoy_admin_v3_SubjectAlternateName* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); -} -UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_days_until_expiration(const envoy_admin_v3_CertificateDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_days_until_expiration(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_CertificateDetails_days_until_expiration(const envoy_admin_v3_CertificateDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_valid_from(const envoy_admin_v3_CertificateDetails* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_valid_from(const envoy_admin_v3_CertificateDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_valid_from(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 56), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_valid_from(const envoy_admin_v3_CertificateDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 56), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_expiration_time(const envoy_admin_v3_CertificateDetails* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_valid_from(const envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 56), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_expiration_time(const envoy_admin_v3_CertificateDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_expiration_time(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_expiration_time(const envoy_admin_v3_CertificateDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_expiration_time(const envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_ocsp_details(envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_admin_v3_CertificateDetails_OcspDetails*); + const envoy_admin_v3_CertificateDetails_OcspDetails* default_val = NULL; + const envoy_admin_v3_CertificateDetails_OcspDetails* ret; + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_CertificateDetails_set_path(envoy_admin_v3_CertificateDetails *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CertificateDetails_set_serial_number(envoy_admin_v3_CertificateDetails *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_admin_v3_SubjectAlternateName** envoy_admin_v3_CertificateDetails_mutable_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, size_t* len) { - return (envoy_admin_v3_SubjectAlternateName**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE envoy_admin_v3_SubjectAlternateName** envoy_admin_v3_CertificateDetails_mutable_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_SubjectAlternateName**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_SubjectAlternateName** envoy_admin_v3_CertificateDetails_resize_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_SubjectAlternateName**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_SubjectAlternateName** envoy_admin_v3_CertificateDetails_resize_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_SubjectAlternateName**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_CertificateDetails_add_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) { - struct envoy_admin_v3_SubjectAlternateName* sub = (struct envoy_admin_v3_SubjectAlternateName*)_upb_Message_New(&envoy_admin_v3_SubjectAlternateName_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_SubjectAlternateName* sub = (struct envoy_admin_v3_SubjectAlternateName*)_upb_Message_New(&envoy_admin_v3_SubjectAlternateName_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_admin_v3_CertificateDetails_set_days_until_expiration(envoy_admin_v3_CertificateDetails *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), uint64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CertificateDetails_set_valid_from(envoy_admin_v3_CertificateDetails *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 56), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_mutable_valid_from(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_valid_from(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CertificateDetails_set_valid_from(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_CertificateDetails_set_valid_from(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_CertificateDetails_set_expiration_time(envoy_admin_v3_CertificateDetails *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_mutable_expiration_time(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_expiration_time(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CertificateDetails_set_expiration_time(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_CertificateDetails_set_expiration_time(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_CertificateDetails_set_ocsp_details(envoy_admin_v3_CertificateDetails *msg, envoy_admin_v3_CertificateDetails_OcspDetails* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_admin_v3_CertificateDetails_OcspDetails*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_mutable_ocsp_details(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) { struct envoy_admin_v3_CertificateDetails_OcspDetails* sub = (struct envoy_admin_v3_CertificateDetails_OcspDetails*)envoy_admin_v3_CertificateDetails_ocsp_details(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_CertificateDetails_OcspDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_OcspDetails_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CertificateDetails_set_ocsp_details(msg, sub); + sub = (struct envoy_admin_v3_CertificateDetails_OcspDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, arena); + if (sub) envoy_admin_v3_CertificateDetails_set_ocsp_details(msg, sub); } return sub; } @@ -331,12 +464,12 @@ UPB_INLINE struct envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_ /* envoy.admin.v3.CertificateDetails.OcspDetails */ UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_OcspDetails_new(upb_Arena* arena) { - return (envoy_admin_v3_CertificateDetails_OcspDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_OcspDetails_msginit, arena); + return (envoy_admin_v3_CertificateDetails_OcspDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, arena); } UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_OcspDetails_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_CertificateDetails_OcspDetails* ret = envoy_admin_v3_CertificateDetails_OcspDetails_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -346,7 +479,7 @@ UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_Certifi int options, upb_Arena* arena) { envoy_admin_v3_CertificateDetails_OcspDetails* ret = envoy_admin_v3_CertificateDetails_OcspDetails_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -354,57 +487,67 @@ UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_Certifi } UPB_INLINE char* envoy_admin_v3_CertificateDetails_OcspDetails_serialize(const envoy_admin_v3_CertificateDetails_OcspDetails* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_clear_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_clear_valid_from(envoy_admin_v3_CertificateDetails_OcspDetails* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CertificateDetails_OcspDetails_has_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_CertificateDetails_OcspDetails_has_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_clear_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_clear_expiration(envoy_admin_v3_CertificateDetails_OcspDetails* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_CertificateDetails_OcspDetails_has_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_set_valid_from(envoy_admin_v3_CertificateDetails_OcspDetails *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_mutable_valid_from(envoy_admin_v3_CertificateDetails_OcspDetails* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_OcspDetails_valid_from(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CertificateDetails_OcspDetails_set_valid_from(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_CertificateDetails_OcspDetails_set_valid_from(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_set_expiration(envoy_admin_v3_CertificateDetails_OcspDetails *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_mutable_expiration(envoy_admin_v3_CertificateDetails_OcspDetails* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_OcspDetails_expiration(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CertificateDetails_OcspDetails_set_expiration(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_CertificateDetails_OcspDetails_set_expiration(msg, sub); } return sub; } @@ -412,12 +555,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_O /* envoy.admin.v3.SubjectAlternateName */ UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateName_new(upb_Arena* arena) { - return (envoy_admin_v3_SubjectAlternateName*)_upb_Message_New(&envoy_admin_v3_SubjectAlternateName_msginit, arena); + return (envoy_admin_v3_SubjectAlternateName*)_upb_Message_New(&envoy_admin_v3_SubjectAlternateName_msg_init, arena); } UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateName_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_SubjectAlternateName* ret = envoy_admin_v3_SubjectAlternateName_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SubjectAlternateName_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SubjectAlternateName_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -427,7 +570,7 @@ UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateN int options, upb_Arena* arena) { envoy_admin_v3_SubjectAlternateName* ret = envoy_admin_v3_SubjectAlternateName_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SubjectAlternateName_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SubjectAlternateName_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -435,13 +578,13 @@ UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateN } UPB_INLINE char* envoy_admin_v3_SubjectAlternateName_serialize(const envoy_admin_v3_SubjectAlternateName* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -451,52 +594,74 @@ typedef enum { envoy_admin_v3_SubjectAlternateName_name_NOT_SET = 0 } envoy_admin_v3_SubjectAlternateName_name_oneofcases; UPB_INLINE envoy_admin_v3_SubjectAlternateName_name_oneofcases envoy_admin_v3_SubjectAlternateName_name_case(const envoy_admin_v3_SubjectAlternateName* msg) { - return (envoy_admin_v3_SubjectAlternateName_name_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_SubjectAlternateName_name_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_dns(const envoy_admin_v3_SubjectAlternateName* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_dns(const envoy_admin_v3_SubjectAlternateName* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_admin_v3_SubjectAlternateName_name_NOT_SET); +UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_dns(envoy_admin_v3_SubjectAlternateName* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SubjectAlternateName_dns(const envoy_admin_v3_SubjectAlternateName* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_uri(const envoy_admin_v3_SubjectAlternateName* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_dns(const envoy_admin_v3_SubjectAlternateName* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_uri(const envoy_admin_v3_SubjectAlternateName* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_admin_v3_SubjectAlternateName_name_NOT_SET); +UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_uri(envoy_admin_v3_SubjectAlternateName* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SubjectAlternateName_uri(const envoy_admin_v3_SubjectAlternateName* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_uri(const envoy_admin_v3_SubjectAlternateName* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_admin_v3_SubjectAlternateName_name_NOT_SET); +UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_ip_address(envoy_admin_v3_SubjectAlternateName* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SubjectAlternateName_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_SubjectAlternateName_set_dns(envoy_admin_v3_SubjectAlternateName *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SubjectAlternateName_set_uri(envoy_admin_v3_SubjectAlternateName *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SubjectAlternateName_set_ip_address(envoy_admin_v3_SubjectAlternateName *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_admin_v3_certs_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_certs_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CERTS_PROTO_UPB_H_ */ 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 d4cfa038dd6..6ba8932f619 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/clusters.upb.h" #include "envoy/admin/v3/metrics.upb.h" #include "envoy/config/cluster/v3/circuit_breaker.upb.h" @@ -18,98 +20,157 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_Clusters_submsgs[1] = { - {.submsg = &envoy_admin_v3_ClusterStatus_msginit}, +static const upb_MiniTableSub envoy_admin_v3_Clusters_submsgs[1] = { + {.submsg = &envoy_admin_v3_ClusterStatus_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_Clusters__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_Clusters__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_Clusters_msginit = { +const upb_MiniTable envoy_admin_v3_Clusters_msg_init = { &envoy_admin_v3_Clusters_submsgs[0], &envoy_admin_v3_Clusters__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ClusterStatus_submsgs[4] = { - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_admin_v3_HostStatus_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ClusterStatus_submsgs[4] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_admin_v3_HostStatus_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ClusterStatus__fields[8] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ClusterStatus__fields[8] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(36, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ClusterStatus_msginit = { +const upb_MiniTable envoy_admin_v3_ClusterStatus_msg_init = { &envoy_admin_v3_ClusterStatus_submsgs[0], &envoy_admin_v3_ClusterStatus__fields[0], - UPB_SIZE(48, 88), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(48, 88), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x001800000100001a, &upb_psm_1bt_maxmaxb}, + {0x002000003f010022, &upb_prm_1bt_max128b}, + {0x002800000202002a, &upb_psm_1bt_maxmaxb}, + {0x0030000003030032, &upb_psm_1bt_maxmaxb}, + {0x003800003f00003a, &upb_pss_1bt}, + {0x004800003f000042, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_HostStatus_submsgs[6] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_admin_v3_SimpleMetric_msginit}, - {.submsg = &envoy_admin_v3_HostHealthStatus_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_config_core_v3_Locality_msginit}, +static const upb_MiniTableSub envoy_admin_v3_HostStatus_submsgs[6] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_admin_v3_SimpleMetric_msg_init}, + {.submsg = &envoy_admin_v3_HostHealthStatus_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_config_core_v3_Locality_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_HostStatus__fields[9] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(40, 72), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_HostStatus__fields[9] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_HostStatus_msginit = { +const upb_MiniTable envoy_admin_v3_HostStatus_msg_init = { &envoy_admin_v3_HostStatus_submsgs[0], &envoy_admin_v3_HostStatus__fields[0], - UPB_SIZE(48, 80), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(48, 80), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x001800003f010012, &upb_prm_1bt_maxmaxb}, + {0x002000000202001a, &upb_psm_1bt_max64b}, + {0x0028000003030022, &upb_psm_1bt_maxmaxb}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x003000003f000032, &upb_pss_1bt}, + {0x000800003f000038, &upb_psv4_1bt}, + {0x0040000004040042, &upb_psm_1bt_maxmaxb}, + {0x004800000505004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_admin_v3_HostHealthStatus__fields[8] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(10, 10), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(11, 11), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_HostHealthStatus__fields[8] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, 9, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 10, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, 11, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, 12, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_HostHealthStatus_msginit = { +const upb_MiniTable envoy_admin_v3_HostHealthStatus_msg_init = { NULL, &envoy_admin_v3_HostHealthStatus__fields[0], - UPB_SIZE(16, 16), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + 16, 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x000400003f000018, &upb_psv4_1bt}, + {0x000800003f000020, &upb_psb1_1bt}, + {0x000900003f000028, &upb_psb1_1bt}, + {0x000a00003f000030, &upb_psb1_1bt}, + {0x000b00003f000038, &upb_psb1_1bt}, + {0x000c00003f000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[4] = { - &envoy_admin_v3_Clusters_msginit, - &envoy_admin_v3_ClusterStatus_msginit, - &envoy_admin_v3_HostStatus_msginit, - &envoy_admin_v3_HostHealthStatus_msginit, + &envoy_admin_v3_Clusters_msg_init, + &envoy_admin_v3_ClusterStatus_msg_init, + &envoy_admin_v3_HostStatus_msg_init, + &envoy_admin_v3_HostHealthStatus_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_clusters_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_clusters_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -118,5 +179,5 @@ const upb_MiniTable_File envoy_admin_v3_clusters_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 278b5e0c949..dd964b8888b 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 @@ -9,51 +9,52 @@ #ifndef ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_Clusters; -struct envoy_admin_v3_ClusterStatus; -struct envoy_admin_v3_HostStatus; -struct envoy_admin_v3_HostHealthStatus; typedef struct envoy_admin_v3_Clusters envoy_admin_v3_Clusters; typedef struct envoy_admin_v3_ClusterStatus envoy_admin_v3_ClusterStatus; typedef struct envoy_admin_v3_HostStatus envoy_admin_v3_HostStatus; typedef struct envoy_admin_v3_HostHealthStatus envoy_admin_v3_HostHealthStatus; -extern const upb_MiniTable envoy_admin_v3_Clusters_msginit; -extern const upb_MiniTable envoy_admin_v3_ClusterStatus_msginit; -extern const upb_MiniTable envoy_admin_v3_HostStatus_msginit; -extern const upb_MiniTable envoy_admin_v3_HostHealthStatus_msginit; +extern const upb_MiniTable envoy_admin_v3_Clusters_msg_init; +extern const upb_MiniTable envoy_admin_v3_ClusterStatus_msg_init; +extern const upb_MiniTable envoy_admin_v3_HostStatus_msg_init; +extern const upb_MiniTable envoy_admin_v3_HostHealthStatus_msg_init; struct envoy_admin_v3_SimpleMetric; struct envoy_config_cluster_v3_CircuitBreakers; struct envoy_config_core_v3_Address; struct envoy_config_core_v3_Locality; struct envoy_type_v3_Percent; -extern const upb_MiniTable envoy_admin_v3_SimpleMetric_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_Locality_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; +extern const upb_MiniTable envoy_admin_v3_SimpleMetric_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Locality_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; /* envoy.admin.v3.Clusters */ UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_new(upb_Arena* arena) { - return (envoy_admin_v3_Clusters*)_upb_Message_New(&envoy_admin_v3_Clusters_msginit, arena); + return (envoy_admin_v3_Clusters*)_upb_Message_New(&envoy_admin_v3_Clusters_msg_init, arena); } UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_Clusters* ret = envoy_admin_v3_Clusters_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Clusters_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Clusters_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -63,7 +64,7 @@ UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_parse_ex(const char* int options, upb_Arena* arena) { envoy_admin_v3_Clusters* ret = envoy_admin_v3_Clusters_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Clusters_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Clusters_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -71,47 +72,72 @@ UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_parse_ex(const char* } UPB_INLINE char* envoy_admin_v3_Clusters_serialize(const envoy_admin_v3_Clusters* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Clusters_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Clusters_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Clusters_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Clusters_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_Clusters_clear_cluster_statuses(envoy_admin_v3_Clusters* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_ClusterStatus* const* envoy_admin_v3_Clusters_cluster_statuses(const envoy_admin_v3_Clusters* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ClusterStatus* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_admin_v3_Clusters_has_cluster_statuses(const envoy_admin_v3_Clusters* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_admin_v3_Clusters_clear_cluster_statuses(const envoy_admin_v3_Clusters* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_admin_v3_ClusterStatus* const* envoy_admin_v3_Clusters_cluster_statuses(const envoy_admin_v3_Clusters* msg, size_t* len) { - return (const envoy_admin_v3_ClusterStatus* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_admin_v3_Clusters_cluster_statuses(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_ClusterStatus** envoy_admin_v3_Clusters_mutable_cluster_statuses(envoy_admin_v3_Clusters* msg, size_t* len) { - return (envoy_admin_v3_ClusterStatus**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_ClusterStatus** envoy_admin_v3_Clusters_mutable_cluster_statuses(envoy_admin_v3_Clusters* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ClusterStatus**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ClusterStatus** envoy_admin_v3_Clusters_resize_cluster_statuses(envoy_admin_v3_Clusters* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ClusterStatus**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ClusterStatus** envoy_admin_v3_Clusters_resize_cluster_statuses(envoy_admin_v3_Clusters* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ClusterStatus**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ClusterStatus* envoy_admin_v3_Clusters_add_cluster_statuses(envoy_admin_v3_Clusters* msg, upb_Arena* arena) { - struct envoy_admin_v3_ClusterStatus* sub = (struct envoy_admin_v3_ClusterStatus*)_upb_Message_New(&envoy_admin_v3_ClusterStatus_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ClusterStatus* sub = (struct envoy_admin_v3_ClusterStatus*)_upb_Message_New(&envoy_admin_v3_ClusterStatus_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.ClusterStatus */ UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_new(upb_Arena* arena) { - return (envoy_admin_v3_ClusterStatus*)_upb_Message_New(&envoy_admin_v3_ClusterStatus_msginit, arena); + return (envoy_admin_v3_ClusterStatus*)_upb_Message_New(&envoy_admin_v3_ClusterStatus_msg_init, arena); } UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ClusterStatus* ret = envoy_admin_v3_ClusterStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClusterStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClusterStatus_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -121,7 +147,7 @@ UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_parse_ex(c int options, upb_Arena* arena) { envoy_admin_v3_ClusterStatus* ret = envoy_admin_v3_ClusterStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClusterStatus_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClusterStatus_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -129,149 +155,213 @@ UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_parse_ex(c } UPB_INLINE char* envoy_admin_v3_ClusterStatus_serialize(const envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_name(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ClusterStatus_name(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_added_via_api(const envoy_admin_v3_ClusterStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_added_via_api(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_ClusterStatus_added_via_api(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_host_statuses(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_HostStatus* const* envoy_admin_v3_ClusterStatus_host_statuses(const envoy_admin_v3_ClusterStatus* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_HostStatus* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_host_statuses(const envoy_admin_v3_ClusterStatus* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + envoy_admin_v3_ClusterStatus_host_statuses(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_host_statuses(const envoy_admin_v3_ClusterStatus* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_admin_v3_HostStatus* const* envoy_admin_v3_ClusterStatus_host_statuses(const envoy_admin_v3_ClusterStatus* msg, size_t* len) { - return (const envoy_admin_v3_HostStatus* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); -} -UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_local_origin_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_circuit_breakers(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_cluster_v3_CircuitBreakers* envoy_admin_v3_ClusterStatus_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_cluster_v3_CircuitBreakers*); + const struct envoy_config_cluster_v3_CircuitBreakers* default_val = NULL; + const struct envoy_config_cluster_v3_CircuitBreakers* ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_observability_name(const envoy_admin_v3_ClusterStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_observability_name(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ClusterStatus_observability_name(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_eds_service_name(const envoy_admin_v3_ClusterStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_eds_service_name(envoy_admin_v3_ClusterStatus* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(36, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ClusterStatus_eds_service_name(const envoy_admin_v3_ClusterStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(36, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_name(envoy_admin_v3_ClusterStatus *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_added_via_api(envoy_admin_v3_ClusterStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_mutable_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_ClusterStatus_success_rate_ejection_threshold(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClusterStatus_set_success_rate_ejection_threshold(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_admin_v3_ClusterStatus_set_success_rate_ejection_threshold(msg, sub); } return sub; } -UPB_INLINE envoy_admin_v3_HostStatus** envoy_admin_v3_ClusterStatus_mutable_host_statuses(envoy_admin_v3_ClusterStatus* msg, size_t* len) { - return (envoy_admin_v3_HostStatus**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_admin_v3_HostStatus** envoy_admin_v3_ClusterStatus_mutable_host_statuses(envoy_admin_v3_ClusterStatus* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_HostStatus**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_HostStatus** envoy_admin_v3_ClusterStatus_resize_host_statuses(envoy_admin_v3_ClusterStatus* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_HostStatus**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_HostStatus** envoy_admin_v3_ClusterStatus_resize_host_statuses(envoy_admin_v3_ClusterStatus* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_HostStatus**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_HostStatus* envoy_admin_v3_ClusterStatus_add_host_statuses(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) { - struct envoy_admin_v3_HostStatus* sub = (struct envoy_admin_v3_HostStatus*)_upb_Message_New(&envoy_admin_v3_HostStatus_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_HostStatus* sub = (struct envoy_admin_v3_HostStatus*)_upb_Message_New(&envoy_admin_v3_HostStatus_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_local_origin_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_mutable_local_origin_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_ClusterStatus_local_origin_success_rate_ejection_threshold(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClusterStatus_set_local_origin_success_rate_ejection_threshold(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_admin_v3_ClusterStatus_set_local_origin_success_rate_ejection_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_circuit_breakers(envoy_admin_v3_ClusterStatus *msg, struct envoy_config_cluster_v3_CircuitBreakers* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_cluster_v3_CircuitBreakers*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers* envoy_admin_v3_ClusterStatus_mutable_circuit_breakers(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_CircuitBreakers* sub = (struct envoy_config_cluster_v3_CircuitBreakers*)envoy_admin_v3_ClusterStatus_circuit_breakers(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClusterStatus_set_circuit_breakers(msg, sub); + sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msg_init, arena); + if (sub) envoy_admin_v3_ClusterStatus_set_circuit_breakers(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_observability_name(envoy_admin_v3_ClusterStatus *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ClusterStatus_set_eds_service_name(envoy_admin_v3_ClusterStatus *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(36, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.HostStatus */ UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_new(upb_Arena* arena) { - return (envoy_admin_v3_HostStatus*)_upb_Message_New(&envoy_admin_v3_HostStatus_msginit, arena); + return (envoy_admin_v3_HostStatus*)_upb_Message_New(&envoy_admin_v3_HostStatus_msg_init, arena); } UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_HostStatus* ret = envoy_admin_v3_HostStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostStatus_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -281,7 +371,7 @@ UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_parse_ex(const c int options, upb_Arena* arena) { envoy_admin_v3_HostStatus* ret = envoy_admin_v3_HostStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostStatus_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostStatus_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -289,171 +379,239 @@ UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_parse_ex(const c } UPB_INLINE char* envoy_admin_v3_HostStatus_serialize(const envoy_admin_v3_HostStatus* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_HostStatus_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_HostStatus_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_HostStatus_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_HostStatus_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_HostStatus_clear_address(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_HostStatus_clear_address(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_admin_v3_HostStatus_address(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_HostStatus_has_address(const envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_HostStatus_clear_stats(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_admin_v3_SimpleMetric* const* envoy_admin_v3_HostStatus_stats(const envoy_admin_v3_HostStatus* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_admin_v3_SimpleMetric* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_HostStatus_has_stats(const envoy_admin_v3_HostStatus* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); + size_t size; + envoy_admin_v3_HostStatus_stats(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_HostStatus_clear_stats(const envoy_admin_v3_HostStatus* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); -} -UPB_INLINE const struct envoy_admin_v3_SimpleMetric* const* envoy_admin_v3_HostStatus_stats(const envoy_admin_v3_HostStatus* msg, size_t* len) { - return (const struct envoy_admin_v3_SimpleMetric* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); -} -UPB_INLINE bool envoy_admin_v3_HostStatus_has_health_status(const envoy_admin_v3_HostStatus* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_admin_v3_HostStatus_clear_health_status(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_HostStatus_clear_health_status(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostStatus_health_status(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_admin_v3_HostHealthStatus*); + const envoy_admin_v3_HostHealthStatus* default_val = NULL; + const envoy_admin_v3_HostHealthStatus* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_HostStatus_has_success_rate(const envoy_admin_v3_HostStatus* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_HostStatus_has_health_status(const envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_HostStatus_clear_success_rate(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_HostStatus_clear_success_rate(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_success_rate(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostStatus_clear_weight(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE bool envoy_admin_v3_HostStatus_has_success_rate(const envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_HostStatus_clear_weight(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_admin_v3_HostStatus_weight(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostStatus_clear_hostname(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_HostStatus_clear_hostname(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_HostStatus_hostname(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostStatus_clear_priority(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0; +UPB_INLINE void envoy_admin_v3_HostStatus_clear_priority(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_admin_v3_HostStatus_priority(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_HostStatus_has_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_admin_v3_HostStatus_clear_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_HostStatus_clear_local_origin_success_rate(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {8, UPB_SIZE(28, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_HostStatus_has_locality(const envoy_admin_v3_HostStatus* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_admin_v3_HostStatus_has_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_HostStatus_clear_locality(const envoy_admin_v3_HostStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_HostStatus_clear_locality(envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_admin_v3_HostStatus_locality(const envoy_admin_v3_HostStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct envoy_config_core_v3_Locality*); + const struct envoy_config_core_v3_Locality* default_val = NULL; + const struct envoy_config_core_v3_Locality* ret; + const upb_MiniTableField field = {9, UPB_SIZE(32, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_HostStatus_has_locality(const envoy_admin_v3_HostStatus* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_HostStatus_set_address(envoy_admin_v3_HostStatus *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_admin_v3_HostStatus_mutable_address(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_admin_v3_HostStatus_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_HostStatus_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_admin_v3_HostStatus_set_address(msg, sub); } return sub; } -UPB_INLINE struct envoy_admin_v3_SimpleMetric** envoy_admin_v3_HostStatus_mutable_stats(envoy_admin_v3_HostStatus* msg, size_t* len) { - return (struct envoy_admin_v3_SimpleMetric**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE struct envoy_admin_v3_SimpleMetric** envoy_admin_v3_HostStatus_mutable_stats(envoy_admin_v3_HostStatus* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_admin_v3_SimpleMetric**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_admin_v3_SimpleMetric** envoy_admin_v3_HostStatus_resize_stats(envoy_admin_v3_HostStatus* msg, size_t len, upb_Arena* arena) { - return (struct envoy_admin_v3_SimpleMetric**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_admin_v3_SimpleMetric** envoy_admin_v3_HostStatus_resize_stats(envoy_admin_v3_HostStatus* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_admin_v3_SimpleMetric**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_SimpleMetric* envoy_admin_v3_HostStatus_add_stats(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) { - struct envoy_admin_v3_SimpleMetric* sub = (struct envoy_admin_v3_SimpleMetric*)_upb_Message_New(&envoy_admin_v3_SimpleMetric_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_SimpleMetric* sub = (struct envoy_admin_v3_SimpleMetric*)_upb_Message_New(&envoy_admin_v3_SimpleMetric_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_admin_v3_HostStatus_set_health_status(envoy_admin_v3_HostStatus *msg, envoy_admin_v3_HostHealthStatus* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_admin_v3_HostHealthStatus*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostStatus_mutable_health_status(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) { struct envoy_admin_v3_HostHealthStatus* sub = (struct envoy_admin_v3_HostHealthStatus*)envoy_admin_v3_HostStatus_health_status(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_HostHealthStatus*)_upb_Message_New(&envoy_admin_v3_HostHealthStatus_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_HostStatus_set_health_status(msg, sub); + sub = (struct envoy_admin_v3_HostHealthStatus*)_upb_Message_New(&envoy_admin_v3_HostHealthStatus_msg_init, arena); + if (sub) envoy_admin_v3_HostStatus_set_health_status(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_HostStatus_set_success_rate(envoy_admin_v3_HostStatus *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_mutable_success_rate(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_HostStatus_success_rate(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_HostStatus_set_success_rate(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_admin_v3_HostStatus_set_success_rate(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_HostStatus_set_weight(envoy_admin_v3_HostStatus *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostStatus_set_hostname(envoy_admin_v3_HostStatus *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostStatus_set_priority(envoy_admin_v3_HostStatus *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostStatus_set_local_origin_success_rate(envoy_admin_v3_HostStatus *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(28, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_mutable_local_origin_success_rate(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_HostStatus_local_origin_success_rate(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_HostStatus_set_local_origin_success_rate(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_admin_v3_HostStatus_set_local_origin_success_rate(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_HostStatus_set_locality(envoy_admin_v3_HostStatus *msg, struct envoy_config_core_v3_Locality* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct envoy_config_core_v3_Locality*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(32, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Locality* envoy_admin_v3_HostStatus_mutable_locality(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) { struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_admin_v3_HostStatus_locality(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_HostStatus_set_locality(msg, sub); + sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msg_init, arena); + if (sub) envoy_admin_v3_HostStatus_set_locality(msg, sub); } return sub; } @@ -461,12 +619,12 @@ UPB_INLINE struct envoy_config_core_v3_Locality* envoy_admin_v3_HostStatus_mutab /* envoy.admin.v3.HostHealthStatus */ UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_new(upb_Arena* arena) { - return (envoy_admin_v3_HostHealthStatus*)_upb_Message_New(&envoy_admin_v3_HostHealthStatus_msginit, arena); + return (envoy_admin_v3_HostHealthStatus*)_upb_Message_New(&envoy_admin_v3_HostHealthStatus_msg_init, arena); } UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_HostHealthStatus* ret = envoy_admin_v3_HostHealthStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostHealthStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostHealthStatus_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -476,7 +634,7 @@ UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_pars int options, upb_Arena* arena) { envoy_admin_v3_HostHealthStatus* ret = envoy_admin_v3_HostHealthStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostHealthStatus_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostHealthStatus_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -484,95 +642,143 @@ UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_pars } UPB_INLINE char* envoy_admin_v3_HostHealthStatus_serialize(const envoy_admin_v3_HostHealthStatus* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msg_init, 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; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_active_health_check(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_failed_active_health_check(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_outlier_check(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_outlier_check(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_failed_outlier_check(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_eds_health_status(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_eds_health_status(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_HostHealthStatus_eds_health_status(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_active_degraded_check(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_active_degraded_check(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_failed_active_degraded_check(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_pending_dynamic_removal(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_pending_dynamic_removal(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {5, 9, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_pending_dynamic_removal(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, 9, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_pending_active_hc(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_pending_active_hc(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {6, 10, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_pending_active_hc(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 10, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_excluded_via_immediate_hc_fail(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_excluded_via_immediate_hc_fail(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {7, 11, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_excluded_via_immediate_hc_fail(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, 11, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_active_hc_timeout(const envoy_admin_v3_HostHealthStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0; +UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_active_hc_timeout(envoy_admin_v3_HostHealthStatus* msg) { + const upb_MiniTableField field = {8, 12, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_HostHealthStatus_active_hc_timeout(const envoy_admin_v3_HostHealthStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, 12, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_failed_active_health_check(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_failed_outlier_check(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_eds_health_status(envoy_admin_v3_HostHealthStatus *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_failed_active_degraded_check(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_pending_dynamic_removal(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {5, 9, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_pending_active_hc(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value; + const upb_MiniTableField field = {6, 10, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_excluded_via_immediate_hc_fail(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value; + const upb_MiniTableField field = {7, 11, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_active_hc_timeout(envoy_admin_v3_HostHealthStatus *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; + const upb_MiniTableField field = {8, 12, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_admin_v3_clusters_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_clusters_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPB_H_ */ 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 129e9c561c6..8835382faa3 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/config_dump.upb.h" #include "envoy/admin/v3/config_dump_shared.upb.h" #include "envoy/config/bootstrap/v3/bootstrap.upb.h" @@ -16,103 +18,136 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_ConfigDump_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ConfigDump_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ConfigDump__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ConfigDump__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_ConfigDump_msg_init = { &envoy_admin_v3_ConfigDump_submsgs[0], &envoy_admin_v3_ConfigDump__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_BootstrapConfigDump_submsgs[2] = { - {.submsg = &envoy_config_bootstrap_v3_Bootstrap_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_BootstrapConfigDump_submsgs[2] = { + {.submsg = &envoy_config_bootstrap_v3_Bootstrap_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_BootstrapConfigDump__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_BootstrapConfigDump__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msg_init = { &envoy_admin_v3_BootstrapConfigDump_submsgs[0], &envoy_admin_v3_BootstrapConfigDump__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_submsgs[3] = { - {.submsg = &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit}, - {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit}, - {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit}, +static const upb_MiniTableSub envoy_admin_v3_SecretsConfigDump_submsgs[3] = { + {.submsg = &envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init}, + {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init}, + {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_SecretsConfigDump__fields[3] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msg_init = { &envoy_admin_v3_SecretsConfigDump_submsgs[0], &envoy_admin_v3_SecretsConfigDump__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + {0x000800003f010012, &upb_prm_1bt_max128b}, + {0x001000003f02001a, &upb_prm_1bt_max128b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = { - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = { + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[6] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit = { +const upb_MiniTable envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init = { &envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[0], &envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[0], - UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800000100001a, &upb_psm_1bt_maxmaxb}, + {0x0030000002010022, &upb_psm_1bt_maxmaxb}, + {0x003800000302002a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = { - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = { + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit = { +const upb_MiniTable envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init = { &envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[0], &envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_admin_v3_ConfigDump_msginit, - &envoy_admin_v3_BootstrapConfigDump_msginit, - &envoy_admin_v3_SecretsConfigDump_msginit, - &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, - &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, + &envoy_admin_v3_ConfigDump_msg_init, + &envoy_admin_v3_BootstrapConfigDump_msg_init, + &envoy_admin_v3_SecretsConfigDump_msg_init, + &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, + &envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_config_dump_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_config_dump_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -121,5 +156,5 @@ const upb_MiniTable_File envoy_admin_v3_config_dump_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 2ea4790226b..76d5157ae16 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 @@ -9,52 +9,52 @@ #ifndef ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_ConfigDump; -struct envoy_admin_v3_BootstrapConfigDump; -struct envoy_admin_v3_SecretsConfigDump; -struct envoy_admin_v3_SecretsConfigDump_DynamicSecret; -struct envoy_admin_v3_SecretsConfigDump_StaticSecret; typedef struct envoy_admin_v3_ConfigDump envoy_admin_v3_ConfigDump; typedef struct envoy_admin_v3_BootstrapConfigDump envoy_admin_v3_BootstrapConfigDump; typedef struct envoy_admin_v3_SecretsConfigDump envoy_admin_v3_SecretsConfigDump; typedef struct envoy_admin_v3_SecretsConfigDump_DynamicSecret envoy_admin_v3_SecretsConfigDump_DynamicSecret; typedef struct envoy_admin_v3_SecretsConfigDump_StaticSecret envoy_admin_v3_SecretsConfigDump_StaticSecret; -extern const upb_MiniTable envoy_admin_v3_ConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit; -extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit; +extern const upb_MiniTable envoy_admin_v3_ConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init; +extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init; struct envoy_admin_v3_UpdateFailureState; struct envoy_config_bootstrap_v3_Bootstrap; struct google_protobuf_Any; struct google_protobuf_Timestamp; -extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; /* envoy.admin.v3.ConfigDump */ UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_ConfigDump*)_upb_Message_New(&envoy_admin_v3_ConfigDump_msginit, arena); + return (envoy_admin_v3_ConfigDump*)_upb_Message_New(&envoy_admin_v3_ConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ConfigDump* ret = envoy_admin_v3_ConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -64,7 +64,7 @@ UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_parse_ex(const c int options, upb_Arena* arena) { envoy_admin_v3_ConfigDump* ret = envoy_admin_v3_ConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -72,47 +72,72 @@ UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_parse_ex(const c } UPB_INLINE char* envoy_admin_v3_ConfigDump_serialize(const envoy_admin_v3_ConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ConfigDump_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_ConfigDump_clear_configs(envoy_admin_v3_ConfigDump* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ConfigDump_configs(const envoy_admin_v3_ConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_admin_v3_ConfigDump_has_configs(const envoy_admin_v3_ConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_admin_v3_ConfigDump_clear_configs(const envoy_admin_v3_ConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ConfigDump_configs(const envoy_admin_v3_ConfigDump* msg, size_t* len) { - return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_admin_v3_ConfigDump_configs(msg, &size); + return size != 0; } -UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_mutable_configs(envoy_admin_v3_ConfigDump* msg, size_t* len) { - return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_mutable_configs(envoy_admin_v3_ConfigDump* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Any**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_resize_configs(envoy_admin_v3_ConfigDump* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_resize_configs(envoy_admin_v3_ConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ConfigDump_add_configs(envoy_admin_v3_ConfigDump* msg, upb_Arena* arena) { - struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.BootstrapConfigDump */ UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_BootstrapConfigDump*)_upb_Message_New(&envoy_admin_v3_BootstrapConfigDump_msginit, arena); + return (envoy_admin_v3_BootstrapConfigDump*)_upb_Message_New(&envoy_admin_v3_BootstrapConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_BootstrapConfigDump* ret = envoy_admin_v3_BootstrapConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -122,7 +147,7 @@ UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDum int options, upb_Arena* arena) { envoy_admin_v3_BootstrapConfigDump* ret = envoy_admin_v3_BootstrapConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -130,57 +155,67 @@ UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDum } UPB_INLINE char* envoy_admin_v3_BootstrapConfigDump_serialize(const envoy_admin_v3_BootstrapConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_clear_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_clear_bootstrap(envoy_admin_v3_BootstrapConfigDump* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_bootstrap_v3_Bootstrap* envoy_admin_v3_BootstrapConfigDump_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_bootstrap_v3_Bootstrap*); + const struct envoy_config_bootstrap_v3_Bootstrap* default_val = NULL; + const struct envoy_config_bootstrap_v3_Bootstrap* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_clear_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_clear_last_updated(envoy_admin_v3_BootstrapConfigDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_set_bootstrap(envoy_admin_v3_BootstrapConfigDump *msg, struct envoy_config_bootstrap_v3_Bootstrap* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_bootstrap_v3_Bootstrap*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap* envoy_admin_v3_BootstrapConfigDump_mutable_bootstrap(envoy_admin_v3_BootstrapConfigDump* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Bootstrap* sub = (struct envoy_config_bootstrap_v3_Bootstrap*)envoy_admin_v3_BootstrapConfigDump_bootstrap(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Bootstrap*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_BootstrapConfigDump_set_bootstrap(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Bootstrap*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_msg_init, arena); + if (sub) envoy_admin_v3_BootstrapConfigDump_set_bootstrap(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_set_last_updated(envoy_admin_v3_BootstrapConfigDump *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_mutable_last_updated(envoy_admin_v3_BootstrapConfigDump* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_BootstrapConfigDump_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_BootstrapConfigDump_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_BootstrapConfigDump_set_last_updated(msg, sub); } return sub; } @@ -188,12 +223,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_ /* envoy.admin.v3.SecretsConfigDump */ UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_SecretsConfigDump*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_msginit, arena); + return (envoy_admin_v3_SecretsConfigDump*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_SecretsConfigDump* ret = envoy_admin_v3_SecretsConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -203,7 +238,7 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_pa int options, upb_Arena* arena) { envoy_admin_v3_SecretsConfigDump* ret = envoy_admin_v3_SecretsConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -211,89 +246,164 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_pa } UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_serialize(const envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_static_secrets(envoy_admin_v3_SecretsConfigDump* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_SecretsConfigDump_StaticSecret* const* envoy_admin_v3_SecretsConfigDump_static_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_SecretsConfigDump_StaticSecret* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_admin_v3_SecretsConfigDump_static_secrets(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_static_secrets(const envoy_admin_v3_SecretsConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_SecretsConfigDump_StaticSecret* const* envoy_admin_v3_SecretsConfigDump_static_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_SecretsConfigDump_StaticSecret* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + envoy_admin_v3_SecretsConfigDump_dynamic_active_secrets(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_admin_v3_SecretsConfigDump_dynamic_warming_secrets(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_mutable_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* len) { - return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_mutable_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_resize_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_resize_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_add_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_SecretsConfigDump_StaticSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_SecretsConfigDump_StaticSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* len) { - return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_add_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* len) { - return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_add_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.SecretsConfigDump.DynamicSecret */ UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(upb_Arena* arena) { - return (envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena); + return (envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, arena); } UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_SecretsConfigDump_DynamicSecret* ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -303,7 +413,7 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_Secret int options, upb_Arena* arena) { envoy_admin_v3_SecretsConfigDump_DynamicSecret* ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -311,119 +421,152 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_Secret } UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_DynamicSecret_serialize(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msg_init, 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); +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_name(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SecretsConfigDump_DynamicSecret_name(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_version_info(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_version_info(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SecretsConfigDump_DynamicSecret_version_info(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_last_updated(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_DynamicSecret_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_secret(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_DynamicSecret_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_error_state(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_SecretsConfigDump_DynamicSecret_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_admin_v3_UpdateFailureState*); + const struct envoy_admin_v3_UpdateFailureState* default_val = NULL; + const struct envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_client_status(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_client_status(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_SecretsConfigDump_DynamicSecret_client_status(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_name(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_version_info(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_last_updated(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_last_updated(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_SecretsConfigDump_DynamicSecret_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_secret(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_secret(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_SecretsConfigDump_DynamicSecret_secret(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_secret(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_secret(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_error_state(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, struct envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_error_state(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_SecretsConfigDump_DynamicSecret_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_client_status(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.SecretsConfigDump.StaticSecret */ UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_StaticSecret_new(upb_Arena* arena) { - return (envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena); + return (envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, arena); } UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_StaticSecret_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_SecretsConfigDump_StaticSecret* ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -433,7 +576,7 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_Secrets int options, upb_Arena* arena) { envoy_admin_v3_SecretsConfigDump_StaticSecret* ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -441,76 +584,92 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_Secrets } UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_StaticSecret_serialize(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msg_init, 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); +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_name(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SecretsConfigDump_StaticSecret_name(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_last_updated(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_StaticSecret_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_secret(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSecret_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_name(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_last_updated(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_StaticSecret_mutable_last_updated(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_SecretsConfigDump_StaticSecret_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_SecretsConfigDump_StaticSecret_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_SecretsConfigDump_StaticSecret_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_secret(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSecret_mutable_secret(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_SecretsConfigDump_StaticSecret_secret(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_SecretsConfigDump_StaticSecret_set_secret(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_SecretsConfigDump_StaticSecret_set_secret(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_admin_v3_config_dump_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_config_dump_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c index cdd0b077d4b..600a2097b7c 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c @@ -7,375 +7,522 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/config_dump_shared.upb.h" #include "google/protobuf/any.upb.h" #include "google/protobuf/timestamp.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_UpdateFailureState_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_UpdateFailureState_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_UpdateFailureState__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_UpdateFailureState__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit = { +const upb_MiniTable envoy_admin_v3_UpdateFailureState_msg_init = { &envoy_admin_v3_UpdateFailureState_submsgs[0], &envoy_admin_v3_UpdateFailureState__fields[0], - UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x002800003f000022, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_submsgs[2] = { - {.submsg = &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit}, - {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ListenersConfigDump_submsgs[2] = { + {.submsg = &envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init}, + {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ListenersConfigDump__fields[3] = { + {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msg_init = { &envoy_admin_v3_ListenersConfigDump_submsgs[0], &envoy_admin_v3_ListenersConfigDump__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prm_1bt_max64b}, + {0x001800003f01001a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_StaticListener__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ListenersConfigDump_StaticListener__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ListenersConfigDump_StaticListener_msginit = { +const upb_MiniTable envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init = { &envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[0], &envoy_admin_v3_ListenersConfigDump_StaticListener__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit = { +const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init = { &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[0], &envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[4] = { - {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit}, - {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit}, - {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[4] = { + {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init}, + {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init}, + {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 48), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[6] = { + {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit = { +const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init = { &envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[0], &envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[0], - UPB_SIZE(32, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 56), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x003000000403002a, &upb_psm_1bt_max64b}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_submsgs[3] = { - {.submsg = &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit}, - {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit}, - {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ClustersConfigDump_submsgs[3] = { + {.submsg = &envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init}, + {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init}, + {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump__fields[4] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ClustersConfigDump__fields[4] = { + {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msg_init = { &envoy_admin_v3_ClustersConfigDump_submsgs[0], &envoy_admin_v3_ClustersConfigDump__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prm_1bt_max64b}, + {0x001800003f01001a, &upb_prm_1bt_max64b}, + {0x002000003f020022, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit = { +const upb_MiniTable envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init = { &envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[0], &envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[5] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[5] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit = { +const upb_MiniTable envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init = { &envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[0], &envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[0], - UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_submsgs[2] = { - {.submsg = &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit}, - {.submsg = &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit}, +static const upb_MiniTableSub envoy_admin_v3_RoutesConfigDump_submsgs[2] = { + {.submsg = &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init}, + {.submsg = &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump__fields[2] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_RoutesConfigDump__fields[2] = { + {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msg_init = { &envoy_admin_v3_RoutesConfigDump_submsgs[0], &envoy_admin_v3_RoutesConfigDump__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_prm_1bt_max64b}, + {0x000800003f01001a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit = { +const upb_MiniTable envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init = { &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[0], &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[5] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[5] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit = { +const upb_MiniTable envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init = { &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[0], &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[0], - UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = { - {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit}, - {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = { + {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init}, + {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ScopedRoutesConfigDump__fields[2] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msg_init = { &envoy_admin_v3_ScopedRoutesConfigDump_submsgs[0], &envoy_admin_v3_ScopedRoutesConfigDump__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + {0x000800003f010012, &upb_prm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit = { +const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init = { &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[0], &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_maxmaxb}, + {0x002000000101001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 48), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 56), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[6] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit = { +const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init = { &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[0], &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[0], - UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_prm_1bt_maxmaxb}, + {0x0030000001010022, &upb_psm_1bt_maxmaxb}, + {0x003800000202002a, &upb_psm_1bt_max64b}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_submsgs[2] = { - {.submsg = &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit}, - {.submsg = &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit}, +static const upb_MiniTableSub envoy_admin_v3_EndpointsConfigDump_submsgs[2] = { + {.submsg = &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init}, + {.submsg = &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump__fields[2] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_EndpointsConfigDump__fields[2] = { + {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msg_init = { &envoy_admin_v3_EndpointsConfigDump_submsgs[0], &envoy_admin_v3_EndpointsConfigDump__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_prm_1bt_max64b}, + {0x000800003f01001a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit = { +const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init = { &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[0], &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[5] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[5] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit = { +const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init = { &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[0], &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[0], - UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_EcdsConfigDump_submsgs[1] = { - {.submsg = &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit}, +static const upb_MiniTableSub envoy_admin_v3_EcdsConfigDump_submsgs[1] = { + {.submsg = &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_EcdsConfigDump__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_EcdsConfigDump__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_EcdsConfigDump_msginit = { +const upb_MiniTable envoy_admin_v3_EcdsConfigDump_msg_init = { &envoy_admin_v3_EcdsConfigDump_submsgs[0], &envoy_admin_v3_EcdsConfigDump__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig__fields[5] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig__fields[5] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit = { +const upb_MiniTable envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init = { &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_submsgs[0], &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig__fields[0], - UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[19] = { - &envoy_admin_v3_UpdateFailureState_msginit, - &envoy_admin_v3_ListenersConfigDump_msginit, - &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, - &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, - &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, - &envoy_admin_v3_ClustersConfigDump_msginit, - &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, - &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, - &envoy_admin_v3_RoutesConfigDump_msginit, - &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, - &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, - &envoy_admin_v3_ScopedRoutesConfigDump_msginit, - &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, - &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, - &envoy_admin_v3_EndpointsConfigDump_msginit, - &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, - &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, - &envoy_admin_v3_EcdsConfigDump_msginit, - &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, + &envoy_admin_v3_UpdateFailureState_msg_init, + &envoy_admin_v3_ListenersConfigDump_msg_init, + &envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, + &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, + &envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, + &envoy_admin_v3_ClustersConfigDump_msg_init, + &envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, + &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, + &envoy_admin_v3_RoutesConfigDump_msg_init, + &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, + &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, + &envoy_admin_v3_ScopedRoutesConfigDump_msg_init, + &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, + &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, + &envoy_admin_v3_EndpointsConfigDump_msg_init, + &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, + &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, + &envoy_admin_v3_EcdsConfigDump_msg_init, + &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_config_dump_shared_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_config_dump_shared_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -384,5 +531,5 @@ const upb_MiniTable_File envoy_admin_v3_config_dump_shared_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h index 9fdd511ce5c..b0cd0436154 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h @@ -9,36 +9,22 @@ #ifndef ENVOY_ADMIN_V3_CONFIG_DUMP_SHARED_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_CONFIG_DUMP_SHARED_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_UpdateFailureState; -struct envoy_admin_v3_ListenersConfigDump; -struct envoy_admin_v3_ListenersConfigDump_StaticListener; -struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState; -struct envoy_admin_v3_ListenersConfigDump_DynamicListener; -struct envoy_admin_v3_ClustersConfigDump; -struct envoy_admin_v3_ClustersConfigDump_StaticCluster; -struct envoy_admin_v3_ClustersConfigDump_DynamicCluster; -struct envoy_admin_v3_RoutesConfigDump; -struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig; -struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig; -struct envoy_admin_v3_ScopedRoutesConfigDump; -struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs; -struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs; -struct envoy_admin_v3_EndpointsConfigDump; -struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig; -struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig; -struct envoy_admin_v3_EcdsConfigDump; -struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig; typedef struct envoy_admin_v3_UpdateFailureState envoy_admin_v3_UpdateFailureState; typedef struct envoy_admin_v3_ListenersConfigDump envoy_admin_v3_ListenersConfigDump; typedef struct envoy_admin_v3_ListenersConfigDump_StaticListener envoy_admin_v3_ListenersConfigDump_StaticListener; @@ -58,29 +44,29 @@ typedef struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig envoy_adm typedef struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig; typedef struct envoy_admin_v3_EcdsConfigDump envoy_admin_v3_EcdsConfigDump; typedef struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig; -extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit; -extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_StaticListener_msginit; -extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit; -extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit; -extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit; -extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit; -extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit; -extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit; -extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit; -extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit; -extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit; -extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit; -extern const upb_MiniTable envoy_admin_v3_EcdsConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit; +extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msg_init; +extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init; +extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init; +extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init; +extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init; +extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init; +extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init; +extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init; +extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init; +extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init; +extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init; +extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init; +extern const upb_MiniTable envoy_admin_v3_EcdsConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init; struct google_protobuf_Any; struct google_protobuf_Timestamp; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; typedef enum { envoy_admin_v3_UNKNOWN = 0, @@ -95,12 +81,12 @@ typedef enum { /* envoy.admin.v3.UpdateFailureState */ UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_new(upb_Arena* arena) { - return (envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); + return (envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); } UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_UpdateFailureState* ret = envoy_admin_v3_UpdateFailureState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -110,7 +96,7 @@ UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_ int options, upb_Arena* arena) { envoy_admin_v3_UpdateFailureState* ret = envoy_admin_v3_UpdateFailureState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -118,88 +104,110 @@ UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_ } UPB_INLINE char* envoy_admin_v3_UpdateFailureState_serialize(const envoy_admin_v3_UpdateFailureState* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_failed_configuration(envoy_admin_v3_UpdateFailureState* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_last_update_attempt(envoy_admin_v3_UpdateFailureState* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_UpdateFailureState_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_details(const envoy_admin_v3_UpdateFailureState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_details(envoy_admin_v3_UpdateFailureState* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_UpdateFailureState_details(const envoy_admin_v3_UpdateFailureState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_version_info(const envoy_admin_v3_UpdateFailureState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_version_info(envoy_admin_v3_UpdateFailureState* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_UpdateFailureState_version_info(const envoy_admin_v3_UpdateFailureState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_failed_configuration(envoy_admin_v3_UpdateFailureState *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_mutable_failed_configuration(envoy_admin_v3_UpdateFailureState* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_UpdateFailureState_failed_configuration(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_UpdateFailureState_set_failed_configuration(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_UpdateFailureState_set_failed_configuration(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_last_update_attempt(envoy_admin_v3_UpdateFailureState *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_UpdateFailureState_mutable_last_update_attempt(envoy_admin_v3_UpdateFailureState* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_UpdateFailureState_last_update_attempt(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_UpdateFailureState_set_last_update_attempt(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_UpdateFailureState_set_last_update_attempt(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_details(envoy_admin_v3_UpdateFailureState *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_version_info(envoy_admin_v3_UpdateFailureState *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.ListenersConfigDump */ UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_ListenersConfigDump*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_msginit, arena); + return (envoy_admin_v3_ListenersConfigDump*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump* ret = envoy_admin_v3_ListenersConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -209,7 +217,7 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDum int options, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump* ret = envoy_admin_v3_ListenersConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -217,77 +225,133 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDum } UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_serialize(const envoy_admin_v3_ListenersConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_version_info(envoy_admin_v3_ListenersConfigDump* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ListenersConfigDump_version_info(const envoy_admin_v3_ListenersConfigDump* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_static_listeners(envoy_admin_v3_ListenersConfigDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_ListenersConfigDump_StaticListener* const* envoy_admin_v3_ListenersConfigDump_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ListenersConfigDump_StaticListener* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_has_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_admin_v3_ListenersConfigDump_static_listeners(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_ListenersConfigDump_StaticListener* const* envoy_admin_v3_ListenersConfigDump_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ListenersConfigDump_StaticListener* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListener* const* envoy_admin_v3_ListenersConfigDump_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ListenersConfigDump_DynamicListener* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_has_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListener* const* envoy_admin_v3_ListenersConfigDump_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ListenersConfigDump_DynamicListener* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); + size_t size; + envoy_admin_v3_ListenersConfigDump_dynamic_listeners(msg, &size); + return size != 0; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_set_version_info(envoy_admin_v3_ListenersConfigDump *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_mutable_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ListenersConfigDump_StaticListener**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_mutable_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ListenersConfigDump_StaticListener**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_resize_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ListenersConfigDump_StaticListener**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_resize_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ListenersConfigDump_StaticListener**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_add_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ListenersConfigDump_StaticListener* sub = (struct envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ListenersConfigDump_StaticListener* sub = (struct envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_mutable_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_mutable_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_resize_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_resize_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_add_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ListenersConfigDump_DynamicListener* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ListenersConfigDump_DynamicListener* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.ListenersConfigDump.StaticListener */ UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_StaticListener_new(upb_Arena* arena) { - return (envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena); + return (envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, arena); } UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_StaticListener_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump_StaticListener* ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -297,7 +361,7 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_Lis int options, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump_StaticListener* ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -305,57 +369,67 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_Lis } UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_StaticListener_serialize(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_clear_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_clear_listener(envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_StaticListener_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_clear_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_clear_last_updated(envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_StaticListener_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_set_listener(envoy_admin_v3_ListenersConfigDump_StaticListener *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_StaticListener_mutable_listener(envoy_admin_v3_ListenersConfigDump_StaticListener* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ListenersConfigDump_StaticListener_listener(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_StaticListener_set_listener(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_StaticListener_set_listener(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_set_last_updated(envoy_admin_v3_ListenersConfigDump_StaticListener *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_StaticListener_mutable_last_updated(envoy_admin_v3_ListenersConfigDump_StaticListener* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ListenersConfigDump_StaticListener_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_StaticListener_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_StaticListener_set_last_updated(msg, sub); } return sub; } @@ -363,12 +437,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_ /* envoy.admin.v3.ListenersConfigDump.DynamicListenerState */ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(upb_Arena* arena) { - return (envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena); + return (envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, arena); } UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -378,7 +452,7 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_ int options, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -386,66 +460,82 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_ } UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_version_info(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ListenersConfigDump_DynamicListenerState_version_info(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_listener(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_last_updated(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_version_info(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_listener(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_listener(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ListenersConfigDump_DynamicListenerState_listener(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_listener(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_listener(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last_updated(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_last_updated(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ListenersConfigDump_DynamicListenerState_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last_updated(msg, sub); } return sub; } @@ -453,12 +543,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_ /* envoy.admin.v3.ListenersConfigDump.DynamicListener */ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_DynamicListener_new(upb_Arena* arena) { - return (envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena); + return (envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, arena); } UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_DynamicListener_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump_DynamicListener* ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -468,7 +558,7 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_Li int options, upb_Arena* arena) { envoy_admin_v3_ListenersConfigDump_DynamicListener* ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -476,132 +566,164 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_Li } UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_DynamicListener_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_name(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ListenersConfigDump_DynamicListener_name(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_active_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*); + const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* default_val = NULL; + const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_warming_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*); + const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* default_val = NULL; + const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_draining_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*); + const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* default_val = NULL; + const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_error_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ListenersConfigDump_DynamicListener_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_admin_v3_UpdateFailureState*); + const envoy_admin_v3_UpdateFailureState* default_val = NULL; + const envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_client_status(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_client_status(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_ListenersConfigDump_DynamicListener_client_status(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_name(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_active_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, envoy_admin_v3_ListenersConfigDump_DynamicListenerState* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_admin_v3_ListenersConfigDump_DynamicListenerState*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_active_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) { struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_active_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_DynamicListener_set_active_state(msg, sub); + sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_DynamicListener_set_active_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_warming_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, envoy_admin_v3_ListenersConfigDump_DynamicListenerState* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_admin_v3_ListenersConfigDump_DynamicListenerState*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_warming_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) { struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_warming_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_DynamicListener_set_warming_state(msg, sub); + sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_DynamicListener_set_warming_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_draining_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, envoy_admin_v3_ListenersConfigDump_DynamicListenerState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_ListenersConfigDump_DynamicListenerState*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_draining_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) { struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_draining_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_DynamicListener_set_draining_state(msg, sub); + sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_DynamicListener_set_draining_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_error_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_client_status(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.ClustersConfigDump */ UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_ClustersConfigDump*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_msginit, arena); + return (envoy_admin_v3_ClustersConfigDump*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ClustersConfigDump* ret = envoy_admin_v3_ClustersConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -611,7 +733,7 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_ int options, upb_Arena* arena) { envoy_admin_v3_ClustersConfigDump* ret = envoy_admin_v3_ClustersConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -619,98 +741,179 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_ } UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_serialize(const envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_version_info(envoy_admin_v3_ClustersConfigDump* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ClustersConfigDump_version_info(const envoy_admin_v3_ClustersConfigDump* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_static_clusters(envoy_admin_v3_ClustersConfigDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_ClustersConfigDump_StaticCluster* const* envoy_admin_v3_ClustersConfigDump_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ClustersConfigDump_StaticCluster* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_admin_v3_ClustersConfigDump_static_clusters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_ClustersConfigDump_StaticCluster* const* envoy_admin_v3_ClustersConfigDump_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ClustersConfigDump_StaticCluster* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_admin_v3_ClustersConfigDump_dynamic_active_clusters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + envoy_admin_v3_ClustersConfigDump_dynamic_warming_clusters(msg, &size); + return size != 0; } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_set_version_info(envoy_admin_v3_ClustersConfigDump *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_mutable_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_mutable_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_resize_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_resize_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_add_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ClustersConfigDump_StaticCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ClustersConfigDump_StaticCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_add_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_add_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.ClustersConfigDump.StaticCluster */ UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_StaticCluster_new(upb_Arena* arena) { - return (envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena); + return (envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, arena); } UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_StaticCluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ClustersConfigDump_StaticCluster* ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -720,7 +923,7 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_Clust int options, upb_Arena* arena) { envoy_admin_v3_ClustersConfigDump_StaticCluster* ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -728,57 +931,67 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_Clust } UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_StaticCluster_serialize(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_clear_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_clear_cluster(envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_StaticCluster_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_clear_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_clear_last_updated(envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_StaticCluster_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_set_cluster(envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_StaticCluster_mutable_cluster(envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ClustersConfigDump_StaticCluster_cluster(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClustersConfigDump_StaticCluster_set_cluster(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_ClustersConfigDump_StaticCluster_set_cluster(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_set_last_updated(envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_StaticCluster_mutable_last_updated(envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ClustersConfigDump_StaticCluster_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClustersConfigDump_StaticCluster_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_ClustersConfigDump_StaticCluster_set_last_updated(msg, sub); } return sub; } @@ -786,12 +999,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_S /* envoy.admin.v3.ClustersConfigDump.DynamicCluster */ UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(upb_Arena* arena) { - return (envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena); + return (envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, arena); } UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ClustersConfigDump_DynamicCluster* ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -801,7 +1014,7 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_Clus int options, upb_Arena* arena) { envoy_admin_v3_ClustersConfigDump_DynamicCluster* ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -809,110 +1022,137 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_Clus } UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_DynamicCluster_serialize(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_version_info(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ClustersConfigDump_DynamicCluster_version_info(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_cluster(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_DynamicCluster_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_last_updated(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_DynamicCluster_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_error_state(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ClustersConfigDump_DynamicCluster_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); + const envoy_admin_v3_UpdateFailureState* default_val = NULL; + const envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_client_status(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_client_status(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_ClustersConfigDump_DynamicCluster_client_status(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_version_info(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_cluster(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_cluster(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ClustersConfigDump_DynamicCluster_cluster(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_cluster(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_cluster(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_updated(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_last_updated(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ClustersConfigDump_DynamicCluster_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_error_state(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_ClustersConfigDump_DynamicCluster_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_client_status(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.RoutesConfigDump */ UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_RoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_msginit, arena); + return (envoy_admin_v3_RoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_RoutesConfigDump* ret = envoy_admin_v3_RoutesConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -922,7 +1162,7 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_pars int options, upb_Arena* arena) { envoy_admin_v3_RoutesConfigDump* ret = envoy_admin_v3_RoutesConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -930,68 +1170,118 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_pars } UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_serialize(const envoy_admin_v3_RoutesConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_clear_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg) { + const upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const* envoy_admin_v3_RoutesConfigDump_static_route_configs(const envoy_admin_v3_RoutesConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_admin_v3_RoutesConfigDump_static_route_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_clear_static_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_clear_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const* envoy_admin_v3_RoutesConfigDump_static_route_configs(const envoy_admin_v3_RoutesConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const* envoy_admin_v3_RoutesConfigDump_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_has_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_clear_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const* envoy_admin_v3_RoutesConfigDump_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_admin_v3_RoutesConfigDump_dynamic_route_configs(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t* len) { - return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t* size) { + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_add_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t* len) { - return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_add_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.RoutesConfigDump.StaticRouteConfig */ UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(upb_Arena* arena) { - return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena); + return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, arena); } UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1001,7 +1291,7 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_Rou int options, upb_Arena* arena) { envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1009,57 +1299,67 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_Rou } UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_clear_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_clear_route_config(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_clear_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_clear_last_updated(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_route_config(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_mutable_route_config(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_route_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_route_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_route_config(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_last_updated(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_mutable_last_updated(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_last_updated(msg, sub); } return sub; } @@ -1067,12 +1367,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_Sta /* envoy.admin.v3.RoutesConfigDump.DynamicRouteConfig */ UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(upb_Arena* arena) { - return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena); + return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, arena); } UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1082,7 +1382,7 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_Ro int options, upb_Arena* arena) { envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1090,110 +1390,137 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_Ro } UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msg_init, 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); +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_version_info(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_version_info(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_route_config(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_last_updated(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_error_state(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); + const envoy_admin_v3_UpdateFailureState* default_val = NULL; + const envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_client_status(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_client_status(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_client_status(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_version_info(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_route_config(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_route_config(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_route_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_route_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_route_config(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_updated(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_last_updated(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_state(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_error_state(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_client_status(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.ScopedRoutesConfigDump */ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_ScopedRoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena); + return (envoy_admin_v3_ScopedRoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ScopedRoutesConfigDump* ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1203,7 +1530,7 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesCon int options, upb_Arena* arena) { envoy_admin_v3_ScopedRoutesConfigDump* ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1211,68 +1538,118 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesCon } UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_serialize(const envoy_admin_v3_ScopedRoutesConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_clear_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_admin_v3_ScopedRoutesConfigDump_inline_scoped_route_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_clear_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_clear_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_has_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_clear_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_admin_v3_ScopedRoutesConfigDump_dynamic_scoped_route_configs(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_add_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) { - return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_add_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.ScopedRoutesConfigDump.InlineScopedRouteConfigs */ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(upb_Arena* arena) { - return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena); + return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, arena); } UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1282,7 +1659,7 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy int options, upb_Arena* arena) { envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1290,65 +1667,101 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy } UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_name(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_name(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_scoped_route_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t* len) { - return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_name(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t* len) { - return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Any**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_add_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, upb_Arena* arena) { - struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_last_updated(msg, sub); } return sub; } @@ -1356,12 +1769,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDu /* envoy.admin.v3.ScopedRoutesConfigDump.DynamicScopedRouteConfigs */ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(upb_Arena* arena) { - return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena); + return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, arena); } UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1371,7 +1784,7 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envo int options, upb_Arena* arena) { envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1379,118 +1792,171 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envo } UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_name(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_name(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_version_info(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_version_info(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_version_info(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); + size_t size; + envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_scoped_route_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); -} -UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t* len) { - return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); -} -UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_error_state(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_admin_v3_UpdateFailureState*); + const envoy_admin_v3_UpdateFailureState* default_val = NULL; + const envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_client_status(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_client_status(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_client_status(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_name(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_version_info(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t* len) { - return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Any**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_add_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena) { - struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_error_state(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_error_state(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_client_status(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.EndpointsConfigDump */ UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_EndpointsConfigDump*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_msginit, arena); + return (envoy_admin_v3_EndpointsConfigDump*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_EndpointsConfigDump* ret = envoy_admin_v3_EndpointsConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1500,7 +1966,7 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDum int options, upb_Arena* arena) { envoy_admin_v3_EndpointsConfigDump* ret = envoy_admin_v3_EndpointsConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1508,68 +1974,118 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDum } UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_serialize(const envoy_admin_v3_EndpointsConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_clear_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg) { + const upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_admin_v3_EndpointsConfigDump_static_endpoint_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_clear_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_clear_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_has_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_clear_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_admin_v3_EndpointsConfigDump_dynamic_endpoint_configs(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) { - return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t* size) { + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_add_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) { - return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_add_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.EndpointsConfigDump.StaticEndpointConfig */ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(upb_Arena* arena) { - return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena); + return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, arena); } UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1579,7 +2095,7 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_ int options, upb_Arena* arena) { envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1587,57 +2103,67 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_ } UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msg_init, 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); -} -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_clear_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_clear_endpoint_config(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_clear_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_clear_last_updated(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_endpoint_config(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_mutable_endpoint_config(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_endpoint_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_endpoint_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_endpoint_config(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_last_updated(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_mutable_last_updated(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_last_updated(msg, sub); } return sub; } @@ -1645,12 +2171,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_ /* envoy.admin.v3.EndpointsConfigDump.DynamicEndpointConfig */ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(upb_Arena* arena) { - return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena); + return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, arena); } UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1660,7 +2186,7 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin int options, upb_Arena* arena) { envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1668,110 +2194,137 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin } UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msg_init, 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); +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_version_info(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_version_info(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_endpoint_config(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_last_updated(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_error_state(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); + const envoy_admin_v3_UpdateFailureState* default_val = NULL; + const envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_client_status(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_client_status(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_client_status(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_version_info(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_endpoint_config(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_endpoint_config(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_endpoint_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_endpoint_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_endpoint_config(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_last_updated(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_last_updated(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_error_state(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_error_state(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_client_status(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.admin.v3.EcdsConfigDump */ UPB_INLINE envoy_admin_v3_EcdsConfigDump* envoy_admin_v3_EcdsConfigDump_new(upb_Arena* arena) { - return (envoy_admin_v3_EcdsConfigDump*)_upb_Message_New(&envoy_admin_v3_EcdsConfigDump_msginit, arena); + return (envoy_admin_v3_EcdsConfigDump*)_upb_Message_New(&envoy_admin_v3_EcdsConfigDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_EcdsConfigDump* envoy_admin_v3_EcdsConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_EcdsConfigDump* ret = envoy_admin_v3_EcdsConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1781,7 +2334,7 @@ UPB_INLINE envoy_admin_v3_EcdsConfigDump* envoy_admin_v3_EcdsConfigDump_parse_ex int options, upb_Arena* arena) { envoy_admin_v3_EcdsConfigDump* ret = envoy_admin_v3_EcdsConfigDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1789,47 +2342,72 @@ UPB_INLINE envoy_admin_v3_EcdsConfigDump* envoy_admin_v3_EcdsConfigDump_parse_ex } UPB_INLINE char* envoy_admin_v3_EcdsConfigDump_serialize(const envoy_admin_v3_EcdsConfigDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_admin_v3_EcdsConfigDump_serialize_ex(const envoy_admin_v3_EcdsConfigDump* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_EcdsConfigDump_clear_ecds_filters(envoy_admin_v3_EcdsConfigDump* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* const* envoy_admin_v3_EcdsConfigDump_ecds_filters(const envoy_admin_v3_EcdsConfigDump* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_has_ecds_filters(const envoy_admin_v3_EcdsConfigDump* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_admin_v3_EcdsConfigDump_clear_ecds_filters(const envoy_admin_v3_EcdsConfigDump* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* const* envoy_admin_v3_EcdsConfigDump_ecds_filters(const envoy_admin_v3_EcdsConfigDump* msg, size_t* len) { - return (const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_admin_v3_EcdsConfigDump_ecds_filters(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig** envoy_admin_v3_EcdsConfigDump_mutable_ecds_filters(envoy_admin_v3_EcdsConfigDump* msg, size_t* len) { - return (envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig** envoy_admin_v3_EcdsConfigDump_mutable_ecds_filters(envoy_admin_v3_EcdsConfigDump* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig** envoy_admin_v3_EcdsConfigDump_resize_ecds_filters(envoy_admin_v3_EcdsConfigDump* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig** envoy_admin_v3_EcdsConfigDump_resize_ecds_filters(envoy_admin_v3_EcdsConfigDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* envoy_admin_v3_EcdsConfigDump_add_ecds_filters(envoy_admin_v3_EcdsConfigDump* msg, upb_Arena* arena) { - struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* sub = (struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig*)_upb_Message_New(&envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* sub = (struct envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig*)_upb_Message_New(&envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.EcdsConfigDump.EcdsFilterConfig */ UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_new(upb_Arena* arena) { - return (envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig*)_upb_Message_New(&envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, arena); + return (envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig*)_upb_Message_New(&envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, arena); } UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* ret = envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1839,7 +2417,7 @@ UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* envoy_admin_v3_EcdsCo int options, upb_Arena* arena) { envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* ret = envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1847,107 +2425,134 @@ UPB_INLINE envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* envoy_admin_v3_EcdsCo } UPB_INLINE char* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_serialize(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_serialize_ex(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_version_info(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_version_info(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_version_info(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_has_ecds_filter(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_ecds_filter(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_ecds_filter(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_ecds_filter(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_has_last_updated(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_has_ecds_filter(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_last_updated(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_last_updated(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_last_updated(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_has_error_state(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_has_last_updated(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_error_state(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_error_state(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_error_state(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); + const envoy_admin_v3_UpdateFailureState* default_val = NULL; + const envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_client_status(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_has_error_state(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_clear_client_status(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_client_status(const envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_version_info(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_ecds_filter(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_mutable_ecds_filter(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_ecds_filter(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_ecds_filter(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_ecds_filter(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_last_updated(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_mutable_last_updated(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_error_state(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig *msg, envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_mutable_error_state(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_set_client_status(envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_admin_v3_config_dump_shared_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_config_dump_shared_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CONFIG_DUMP_SHARED_PROTO_UPB_H_ */ 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 e00bf945ddb..f554289a24b 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 @@ -7,43 +7,56 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/init_dump.upb.h" #include "udpa/annotations/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_UnreadyTargetsDumps_submsgs[1] = { - {.submsg = &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit}, +static const upb_MiniTableSub envoy_admin_v3_UnreadyTargetsDumps_submsgs[1] = { + {.submsg = &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_UnreadyTargetsDumps__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_msginit = { +const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_msg_init = { &envoy_admin_v3_UnreadyTargetsDumps_submsgs[0], &envoy_admin_v3_UnreadyTargetsDumps__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump__fields[2] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit = { +const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init = { NULL, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_admin_v3_UnreadyTargetsDumps_msginit, - &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, + &envoy_admin_v3_UnreadyTargetsDumps_msg_init, + &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_init_dump_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_init_dump_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -52,5 +65,5 @@ const upb_MiniTable_File envoy_admin_v3_init_dump_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 ff8d68df45a..972eebf762f 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 @@ -9,35 +9,38 @@ #ifndef ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_UnreadyTargetsDumps; -struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump; typedef struct envoy_admin_v3_UnreadyTargetsDumps envoy_admin_v3_UnreadyTargetsDumps; typedef struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump; -extern const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_msginit; -extern const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit; +extern const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_msg_init; +extern const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init; /* envoy.admin.v3.UnreadyTargetsDumps */ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDumps_new(upb_Arena* arena) { - return (envoy_admin_v3_UnreadyTargetsDumps*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_msginit, arena); + return (envoy_admin_v3_UnreadyTargetsDumps*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_msg_init, arena); } UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDumps_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_UnreadyTargetsDumps* ret = envoy_admin_v3_UnreadyTargetsDumps_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +50,7 @@ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDump int options, upb_Arena* arena) { envoy_admin_v3_UnreadyTargetsDumps* ret = envoy_admin_v3_UnreadyTargetsDumps_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,47 +58,72 @@ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDump } UPB_INLINE char* envoy_admin_v3_UnreadyTargetsDumps_serialize(const envoy_admin_v3_UnreadyTargetsDumps* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_clear_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* const* envoy_admin_v3_UnreadyTargetsDumps_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_admin_v3_UnreadyTargetsDumps_has_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_clear_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* const* envoy_admin_v3_UnreadyTargetsDumps_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg, size_t* len) { - return (const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_admin_v3_UnreadyTargetsDumps_unready_targets_dumps(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump** envoy_admin_v3_UnreadyTargetsDumps_mutable_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, size_t* len) { - return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump** envoy_admin_v3_UnreadyTargetsDumps_mutable_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump** envoy_admin_v3_UnreadyTargetsDumps_resize_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump** envoy_admin_v3_UnreadyTargetsDumps_resize_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_add_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, upb_Arena* arena) { - struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* sub = (struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* sub = (struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.UnreadyTargetsDumps.UnreadyTargetsDump */ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_new(upb_Arena* arena) { - return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, arena); + return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, arena); } UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* ret = envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -105,7 +133,7 @@ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3 int options, upb_Arena* arena) { envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* ret = envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -113,47 +141,82 @@ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3 } UPB_INLINE char* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_serialize(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msg_init, 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); +UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_clear_name(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_name(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_clear_target_names(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_clear_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_target_names(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView const* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_target_names(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_has_target_names(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) { + size_t size; + envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_target_names(msg, &size); + return size != 0; } UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_set_name(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_mutable_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_mutable_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_resize_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_resize_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_add_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File envoy_admin_v3_init_dump_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_init_dump_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPB_H_ */ 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 938c795d35c..d0dedd9583b 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 @@ -7,51 +7,64 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/listeners.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_Listeners_submsgs[1] = { - {.submsg = &envoy_admin_v3_ListenerStatus_msginit}, +static const upb_MiniTableSub envoy_admin_v3_Listeners_submsgs[1] = { + {.submsg = &envoy_admin_v3_ListenerStatus_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_Listeners__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_Listeners__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_Listeners_msginit = { +const upb_MiniTable envoy_admin_v3_Listeners_msg_init = { &envoy_admin_v3_Listeners_submsgs[0], &envoy_admin_v3_Listeners__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_ListenerStatus_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_core_v3_Address_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ListenerStatus_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_core_v3_Address_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ListenerStatus__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ListenerStatus__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ListenerStatus_msginit = { +const upb_MiniTable envoy_admin_v3_ListenerStatus_msg_init = { &envoy_admin_v3_ListenerStatus_submsgs[0], &envoy_admin_v3_ListenerStatus__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f01001a, &upb_prm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_admin_v3_Listeners_msginit, - &envoy_admin_v3_ListenerStatus_msginit, + &envoy_admin_v3_Listeners_msg_init, + &envoy_admin_v3_ListenerStatus_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_listeners_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_listeners_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -60,5 +73,5 @@ const upb_MiniTable_File envoy_admin_v3_listeners_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d6c1793b451..4234d483b0c 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_ADMIN_V3_LISTENERS_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_LISTENERS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_Listeners; -struct envoy_admin_v3_ListenerStatus; typedef struct envoy_admin_v3_Listeners envoy_admin_v3_Listeners; typedef struct envoy_admin_v3_ListenerStatus envoy_admin_v3_ListenerStatus; -extern const upb_MiniTable envoy_admin_v3_Listeners_msginit; -extern const upb_MiniTable envoy_admin_v3_ListenerStatus_msginit; +extern const upb_MiniTable envoy_admin_v3_Listeners_msg_init; +extern const upb_MiniTable envoy_admin_v3_ListenerStatus_msg_init; struct envoy_config_core_v3_Address; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; /* envoy.admin.v3.Listeners */ UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_new(upb_Arena* arena) { - return (envoy_admin_v3_Listeners*)_upb_Message_New(&envoy_admin_v3_Listeners_msginit, arena); + return (envoy_admin_v3_Listeners*)_upb_Message_New(&envoy_admin_v3_Listeners_msg_init, arena); } UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_Listeners* ret = envoy_admin_v3_Listeners_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Listeners_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Listeners_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_parse_ex(const cha int options, upb_Arena* arena) { envoy_admin_v3_Listeners* ret = envoy_admin_v3_Listeners_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Listeners_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Listeners_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,47 +60,72 @@ UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_parse_ex(const cha } UPB_INLINE char* envoy_admin_v3_Listeners_serialize(const envoy_admin_v3_Listeners* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Listeners_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Listeners_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Listeners_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Listeners_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_admin_v3_Listeners_clear_listener_statuses(envoy_admin_v3_Listeners* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_admin_v3_ListenerStatus* const* envoy_admin_v3_Listeners_listener_statuses(const envoy_admin_v3_Listeners* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_admin_v3_ListenerStatus* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_admin_v3_Listeners_has_listener_statuses(const envoy_admin_v3_Listeners* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_admin_v3_Listeners_clear_listener_statuses(const envoy_admin_v3_Listeners* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_admin_v3_ListenerStatus* const* envoy_admin_v3_Listeners_listener_statuses(const envoy_admin_v3_Listeners* msg, size_t* len) { - return (const envoy_admin_v3_ListenerStatus* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_admin_v3_Listeners_listener_statuses(msg, &size); + return size != 0; } -UPB_INLINE envoy_admin_v3_ListenerStatus** envoy_admin_v3_Listeners_mutable_listener_statuses(envoy_admin_v3_Listeners* msg, size_t* len) { - return (envoy_admin_v3_ListenerStatus**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_admin_v3_ListenerStatus** envoy_admin_v3_Listeners_mutable_listener_statuses(envoy_admin_v3_Listeners* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_admin_v3_ListenerStatus**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_admin_v3_ListenerStatus** envoy_admin_v3_Listeners_resize_listener_statuses(envoy_admin_v3_Listeners* msg, size_t len, upb_Arena* arena) { - return (envoy_admin_v3_ListenerStatus**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_admin_v3_ListenerStatus** envoy_admin_v3_Listeners_resize_listener_statuses(envoy_admin_v3_Listeners* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_admin_v3_ListenerStatus**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_admin_v3_ListenerStatus* envoy_admin_v3_Listeners_add_listener_statuses(envoy_admin_v3_Listeners* msg, upb_Arena* arena) { - struct envoy_admin_v3_ListenerStatus* sub = (struct envoy_admin_v3_ListenerStatus*)_upb_Message_New(&envoy_admin_v3_ListenerStatus_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_admin_v3_ListenerStatus* sub = (struct envoy_admin_v3_ListenerStatus*)_upb_Message_New(&envoy_admin_v3_ListenerStatus_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.admin.v3.ListenerStatus */ UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_new(upb_Arena* arena) { - return (envoy_admin_v3_ListenerStatus*)_upb_Message_New(&envoy_admin_v3_ListenerStatus_msginit, arena); + return (envoy_admin_v3_ListenerStatus*)_upb_Message_New(&envoy_admin_v3_ListenerStatus_msg_init, arena); } UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ListenerStatus* ret = envoy_admin_v3_ListenerStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenerStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenerStatus_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -107,7 +135,7 @@ UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_parse_ex int options, upb_Arena* arena) { envoy_admin_v3_ListenerStatus* ret = envoy_admin_v3_ListenerStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenerStatus_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenerStatus_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -115,75 +143,111 @@ UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_parse_ex } UPB_INLINE char* envoy_admin_v3_ListenerStatus_serialize(const envoy_admin_v3_ListenerStatus* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_name(envoy_admin_v3_ListenerStatus* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ListenerStatus_name(const envoy_admin_v3_ListenerStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ListenerStatus_has_local_address(const envoy_admin_v3_ListenerStatus* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_local_address(const envoy_admin_v3_ListenerStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_local_address(envoy_admin_v3_ListenerStatus* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_admin_v3_ListenerStatus_local_address(const envoy_admin_v3_ListenerStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ListenerStatus_has_local_address(const envoy_admin_v3_ListenerStatus* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_additional_local_addresses(envoy_admin_v3_ListenerStatus* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_admin_v3_ListenerStatus_additional_local_addresses(const envoy_admin_v3_ListenerStatus* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_Address* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_admin_v3_ListenerStatus_has_additional_local_addresses(const envoy_admin_v3_ListenerStatus* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_additional_local_addresses(const envoy_admin_v3_ListenerStatus* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_admin_v3_ListenerStatus_additional_local_addresses(const envoy_admin_v3_ListenerStatus* msg, size_t* len) { - return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + envoy_admin_v3_ListenerStatus_additional_local_addresses(msg, &size); + return size != 0; } UPB_INLINE void envoy_admin_v3_ListenerStatus_set_name(envoy_admin_v3_ListenerStatus *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ListenerStatus_set_local_address(envoy_admin_v3_ListenerStatus *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_admin_v3_ListenerStatus_mutable_local_address(envoy_admin_v3_ListenerStatus* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_admin_v3_ListenerStatus_local_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ListenerStatus_set_local_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_admin_v3_ListenerStatus_set_local_address(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_admin_v3_ListenerStatus_mutable_additional_local_addresses(envoy_admin_v3_ListenerStatus* msg, size_t* len) { - return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_admin_v3_ListenerStatus_mutable_additional_local_addresses(envoy_admin_v3_ListenerStatus* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_Address**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_admin_v3_ListenerStatus_resize_additional_local_addresses(envoy_admin_v3_ListenerStatus* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_Address**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_admin_v3_ListenerStatus_resize_additional_local_addresses(envoy_admin_v3_ListenerStatus* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_Address**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_admin_v3_ListenerStatus_add_additional_local_addresses(envoy_admin_v3_ListenerStatus* msg, upb_Arena* arena) { - struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_admin_v3_listeners_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_listeners_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_LISTENERS_PROTO_UPB_H_ */ 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 a221f2e435c..1d721fcc23f 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 @@ -7,33 +7,46 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/memory.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_admin_v3_Memory__fields[6] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_Memory__fields[6] = { + {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, 40, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_Memory_msginit = { +const upb_MiniTable envoy_admin_v3_Memory_msg_init = { NULL, &envoy_admin_v3_Memory__fields[0], - UPB_SIZE(48, 48), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + 48, 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + {0x000800003f000010, &upb_psv8_1bt}, + {0x001000003f000018, &upb_psv8_1bt}, + {0x001800003f000020, &upb_psv8_1bt}, + {0x002000003f000028, &upb_psv8_1bt}, + {0x002800003f000030, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_admin_v3_Memory_msginit, + &envoy_admin_v3_Memory_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_memory_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_memory_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +55,5 @@ const upb_MiniTable_File envoy_admin_v3_memory_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 e76f5106ba1..8618fab530e 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 @@ -9,32 +9,36 @@ #ifndef ENVOY_ADMIN_V3_MEMORY_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_MEMORY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_Memory; typedef struct envoy_admin_v3_Memory envoy_admin_v3_Memory; -extern const upb_MiniTable envoy_admin_v3_Memory_msginit; +extern const upb_MiniTable envoy_admin_v3_Memory_msg_init; /* envoy.admin.v3.Memory */ UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_new(upb_Arena* arena) { - return (envoy_admin_v3_Memory*)_upb_Message_New(&envoy_admin_v3_Memory_msginit, arena); + return (envoy_admin_v3_Memory*)_upb_Message_New(&envoy_admin_v3_Memory_msg_init, arena); } UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_Memory* ret = envoy_admin_v3_Memory_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Memory_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Memory_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_parse_ex(const char* buf int options, upb_Arena* arena) { envoy_admin_v3_Memory* ret = envoy_admin_v3_Memory_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_Memory_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_Memory_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,77 +56,113 @@ UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_parse_ex(const char* buf } UPB_INLINE char* envoy_admin_v3_Memory_serialize(const envoy_admin_v3_Memory* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Memory_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Memory_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_Memory_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_Memory_msg_init, 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; +UPB_INLINE void envoy_admin_v3_Memory_clear_allocated(envoy_admin_v3_Memory* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_Memory_allocated(const envoy_admin_v3_Memory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_Memory_clear_heap_size(const envoy_admin_v3_Memory* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_Memory_clear_heap_size(envoy_admin_v3_Memory* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_Memory_heap_size(const envoy_admin_v3_Memory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_Memory_clear_pageheap_unmapped(const envoy_admin_v3_Memory* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_Memory_clear_pageheap_unmapped(envoy_admin_v3_Memory* msg) { + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_Memory_pageheap_unmapped(const envoy_admin_v3_Memory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_Memory_clear_pageheap_free(const envoy_admin_v3_Memory* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_Memory_clear_pageheap_free(envoy_admin_v3_Memory* msg) { + const upb_MiniTableField field = {4, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_Memory_pageheap_free(const envoy_admin_v3_Memory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_Memory_clear_total_thread_cache(const envoy_admin_v3_Memory* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_Memory_clear_total_thread_cache(envoy_admin_v3_Memory* msg) { + const upb_MiniTableField field = {5, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_Memory_total_thread_cache(const envoy_admin_v3_Memory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {5, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_Memory_clear_total_physical_bytes(const envoy_admin_v3_Memory* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_Memory_clear_total_physical_bytes(envoy_admin_v3_Memory* msg) { + const upb_MiniTableField field = {6, 40, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_Memory_total_physical_bytes(const envoy_admin_v3_Memory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {6, 40, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_Memory_set_allocated(envoy_admin_v3_Memory *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_Memory_set_heap_size(envoy_admin_v3_Memory *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_Memory_set_pageheap_unmapped(envoy_admin_v3_Memory *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value; + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_Memory_set_pageheap_free(envoy_admin_v3_Memory *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value; + const upb_MiniTableField field = {4, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_Memory_set_total_thread_cache(envoy_admin_v3_Memory *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value; + const upb_MiniTableField field = {5, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_Memory_set_total_physical_bytes(envoy_admin_v3_Memory *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value; + const upb_MiniTableField field = {6, 40, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_admin_v3_memory_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_memory_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_MEMORY_PROTO_UPB_H_ */ 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 24330ddb714..33e03f68ed2 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 @@ -7,30 +7,39 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/metrics.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_admin_v3_SimpleMetric__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_SimpleMetric__fields[3] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_SimpleMetric_msginit = { +const upb_MiniTable envoy_admin_v3_SimpleMetric_msg_init = { NULL, &envoy_admin_v3_SimpleMetric__fields[0], - UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000010, &upb_psv8_1bt}, + {0x001000003f00001a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_admin_v3_SimpleMetric_msginit, + &envoy_admin_v3_SimpleMetric_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_metrics_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_metrics_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -39,5 +48,5 @@ const upb_MiniTable_File envoy_admin_v3_metrics_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 230dd2a47eb..5c9119da99f 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 @@ -9,20 +9,24 @@ #ifndef ENVOY_ADMIN_V3_METRICS_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_METRICS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_SimpleMetric; typedef struct envoy_admin_v3_SimpleMetric envoy_admin_v3_SimpleMetric; -extern const upb_MiniTable envoy_admin_v3_SimpleMetric_msginit; +extern const upb_MiniTable envoy_admin_v3_SimpleMetric_msg_init; typedef enum { envoy_admin_v3_SimpleMetric_COUNTER = 0, @@ -34,12 +38,12 @@ typedef enum { /* envoy.admin.v3.SimpleMetric */ UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_new(upb_Arena* arena) { - return (envoy_admin_v3_SimpleMetric*)_upb_Message_New(&envoy_admin_v3_SimpleMetric_msginit, arena); + return (envoy_admin_v3_SimpleMetric*)_upb_Message_New(&envoy_admin_v3_SimpleMetric_msg_init, arena); } UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_SimpleMetric* ret = envoy_admin_v3_SimpleMetric_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SimpleMetric_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SimpleMetric_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +53,7 @@ UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_parse_ex(con int options, upb_Arena* arena) { envoy_admin_v3_SimpleMetric* ret = envoy_admin_v3_SimpleMetric_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_SimpleMetric_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_SimpleMetric_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,50 +61,68 @@ UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_parse_ex(con } UPB_INLINE char* envoy_admin_v3_SimpleMetric_serialize(const envoy_admin_v3_SimpleMetric* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msg_init, 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; +UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_type(envoy_admin_v3_SimpleMetric* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_SimpleMetric_type(const envoy_admin_v3_SimpleMetric* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_value(const envoy_admin_v3_SimpleMetric* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_value(envoy_admin_v3_SimpleMetric* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_SimpleMetric_value(const envoy_admin_v3_SimpleMetric* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_name(const envoy_admin_v3_SimpleMetric* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_name(envoy_admin_v3_SimpleMetric* msg) { + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_SimpleMetric_name(const envoy_admin_v3_SimpleMetric* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_SimpleMetric_set_type(envoy_admin_v3_SimpleMetric *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SimpleMetric_set_value(envoy_admin_v3_SimpleMetric *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_SimpleMetric_set_name(envoy_admin_v3_SimpleMetric *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_admin_v3_metrics_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_metrics_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_METRICS_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c index 39033342975..3908a6905b7 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c @@ -7,30 +7,39 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/mutex_stats.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_admin_v3_MutexStats__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_MutexStats__fields[3] = { + {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_MutexStats_msginit = { +const upb_MiniTable envoy_admin_v3_MutexStats_msg_init = { NULL, &envoy_admin_v3_MutexStats__fields[0], - UPB_SIZE(24, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + 24, 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + {0x000800003f000010, &upb_psv8_1bt}, + {0x001000003f000018, &upb_psv8_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_admin_v3_MutexStats_msginit, + &envoy_admin_v3_MutexStats_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_mutex_stats_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_mutex_stats_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -39,5 +48,5 @@ const upb_MiniTable_File envoy_admin_v3_mutex_stats_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1a7d4eba4cb..45521178775 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 @@ -9,32 +9,36 @@ #ifndef ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_MutexStats; typedef struct envoy_admin_v3_MutexStats envoy_admin_v3_MutexStats; -extern const upb_MiniTable envoy_admin_v3_MutexStats_msginit; +extern const upb_MiniTable envoy_admin_v3_MutexStats_msg_init; /* envoy.admin.v3.MutexStats */ UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_new(upb_Arena* arena) { - return (envoy_admin_v3_MutexStats*)_upb_Message_New(&envoy_admin_v3_MutexStats_msginit, arena); + return (envoy_admin_v3_MutexStats*)_upb_Message_New(&envoy_admin_v3_MutexStats_msg_init, arena); } UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_MutexStats* ret = envoy_admin_v3_MutexStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_MutexStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_MutexStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_parse_ex(const c int options, upb_Arena* arena) { envoy_admin_v3_MutexStats* ret = envoy_admin_v3_MutexStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_MutexStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_MutexStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,50 +56,68 @@ UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_parse_ex(const c } UPB_INLINE char* envoy_admin_v3_MutexStats_serialize(const envoy_admin_v3_MutexStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_MutexStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_MutexStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_MutexStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_MutexStats_msg_init, 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; +UPB_INLINE void envoy_admin_v3_MutexStats_clear_num_contentions(envoy_admin_v3_MutexStats* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_MutexStats_num_contentions(const envoy_admin_v3_MutexStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_MutexStats_clear_current_wait_cycles(const envoy_admin_v3_MutexStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_MutexStats_clear_current_wait_cycles(envoy_admin_v3_MutexStats* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_MutexStats_current_wait_cycles(const envoy_admin_v3_MutexStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_MutexStats_clear_lifetime_wait_cycles(const envoy_admin_v3_MutexStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = 0; +UPB_INLINE void envoy_admin_v3_MutexStats_clear_lifetime_wait_cycles(envoy_admin_v3_MutexStats* msg) { + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_MutexStats_lifetime_wait_cycles(const envoy_admin_v3_MutexStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_admin_v3_MutexStats_set_num_contentions(envoy_admin_v3_MutexStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_MutexStats_set_current_wait_cycles(envoy_admin_v3_MutexStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_MutexStats_set_lifetime_wait_cycles(envoy_admin_v3_MutexStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value; + const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_admin_v3_mutex_stats_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_mutex_stats_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c index dc761de6fc2..2d32fff8523 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c @@ -7,93 +7,140 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/server_info.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "google/protobuf/duration.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_ServerInfo_submsgs[4] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_admin_v3_CommandLineOptions_msginit}, - {.submsg = &envoy_config_core_v3_Node_msginit}, +static const upb_MiniTableSub envoy_admin_v3_ServerInfo_submsgs[4] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_admin_v3_CommandLineOptions_msg_init}, + {.submsg = &envoy_config_core_v3_Node_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_ServerInfo__fields[7] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_ServerInfo__fields[7] = { + {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_ServerInfo_msginit = { +const upb_MiniTable envoy_admin_v3_ServerInfo_msg_init = { &envoy_admin_v3_ServerInfo_submsgs[0], &envoy_admin_v3_ServerInfo__fields[0], - UPB_SIZE(40, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 72), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x001800000100001a, &upb_psm_1bt_maxmaxb}, + {0x0020000002010022, &upb_psm_1bt_maxmaxb}, + {0x002800003f00002a, &upb_pss_1bt}, + {0x0038000003020032, &upb_psm_1bt_maxmaxb}, + {0x004000000403003a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_admin_v3_CommandLineOptions_submsgs[3] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_admin_v3_CommandLineOptions_submsgs[3] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_CommandLineOptions__fields[34] = { - {1, UPB_SIZE(168, 288), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(52, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(60, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(68, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(76, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(84, 120), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(92, 136), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(100, 152), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(108, 168), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(116, 184), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(124, 200), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(132, 216), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(136, 224), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(140, 232), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(21, 21), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(28, 28), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(29, 29), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {27, UPB_SIZE(30, 30), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {28, UPB_SIZE(144, 240), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {30, UPB_SIZE(31, 31), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(32, 32), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {32, UPB_SIZE(148, 248), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {33, UPB_SIZE(36, 36), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {34, UPB_SIZE(40, 40), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {35, UPB_SIZE(156, 264), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(44, 44), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(48, 48), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {38, UPB_SIZE(164, 280), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_CommandLineOptions__fields[34] = { + {1, UPB_SIZE(72, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(80, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(88, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 96, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, 12, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(104, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(112, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(120, 144), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(128, 160), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(136, 176), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(144, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(152, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(16, 224), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(20, 232), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(24, 240), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(28, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(32, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(33, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(36, 24), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(40, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(41, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {27, UPB_SIZE(42, 30), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {28, UPB_SIZE(44, 248), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {30, UPB_SIZE(48, 31), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {31, UPB_SIZE(49, 32), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {32, UPB_SIZE(160, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {33, UPB_SIZE(52, 36), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(56, 40), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {35, UPB_SIZE(168, 272), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(60, 44), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(64, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {38, UPB_SIZE(68, 288), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_CommandLineOptions_msginit = { +const upb_MiniTable envoy_admin_v3_CommandLineOptions_msg_init = { &envoy_admin_v3_CommandLineOptions_submsgs[0], &envoy_admin_v3_CommandLineOptions__fields[0], - UPB_SIZE(176, 296), 34, kUpb_ExtMode_NonExtendable, 11, 255, 0, + UPB_SIZE(176, 296), 34, kUpb_ExtMode_NonExtendable, 11, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f000008, &upb_psv8_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x004000003f00001a, &upb_pss_1bt}, + {0x005000003f000022, &upb_pss_1bt}, + {0x000800003f000028, &upb_psb1_1bt}, + {0x006000003f000032, &upb_pss_1bt}, + {0x000c00003f000038, &upb_psv4_1bt}, + {0x007000003f000042, &upb_pss_1bt}, + {0x008000003f00004a, &upb_pss_1bt}, + {0x009000003f000052, &upb_pss_1bt}, + {0x00a000003f00005a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x00b000003f00006a, &upb_pss_1bt}, + {0x00c000003f000072, &upb_pss_1bt}, + {0x00d000003f00007a, &upb_pss_1bt}, + {0x00e0000001000182, &upb_psm_2bt_maxmaxb}, + {0x00e800000201018a, &upb_psm_2bt_maxmaxb}, + {0x00f0000003020192, &upb_psm_2bt_maxmaxb}, + {0x001000003f000198, &upb_psv4_2bt}, + {0x002c00003f0002a0, &upb_psv4_2bt}, + {0x003000003f0002a8, &upb_psb1_2bt}, + {0x001400003f0001b0, &upb_psb1_2bt}, + {0x001500003f0001b8, &upb_psb1_2bt}, + {0x001800003f0001c0, &upb_psv4_2bt}, + {0x001c00003f0001c8, &upb_psb1_2bt}, + {0x001d00003f0001d0, &upb_psb1_2bt}, + {0x001e00003f0001d8, &upb_psb1_2bt}, + {0x00f800003f0001e2, &upb_prs_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001f00003f0001f0, &upb_psb1_2bt}, + {0x002000003f0001f8, &upb_psb1_2bt}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_admin_v3_ServerInfo_msginit, - &envoy_admin_v3_CommandLineOptions_msginit, + &envoy_admin_v3_ServerInfo_msg_init, + &envoy_admin_v3_CommandLineOptions_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_server_info_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_server_info_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -102,5 +149,5 @@ const upb_MiniTable_File envoy_admin_v3_server_info_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 2b81c2099e1..2702e03f29f 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 @@ -9,27 +9,30 @@ #ifndef ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_ServerInfo; -struct envoy_admin_v3_CommandLineOptions; typedef struct envoy_admin_v3_ServerInfo envoy_admin_v3_ServerInfo; typedef struct envoy_admin_v3_CommandLineOptions envoy_admin_v3_CommandLineOptions; -extern const upb_MiniTable envoy_admin_v3_ServerInfo_msginit; -extern const upb_MiniTable envoy_admin_v3_CommandLineOptions_msginit; +extern const upb_MiniTable envoy_admin_v3_ServerInfo_msg_init; +extern const upb_MiniTable envoy_admin_v3_CommandLineOptions_msg_init; struct envoy_config_core_v3_Node; struct google_protobuf_Duration; -extern const upb_MiniTable envoy_config_core_v3_Node_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable envoy_config_core_v3_Node_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; typedef enum { envoy_admin_v3_CommandLineOptions_Gradual = 0, @@ -59,12 +62,12 @@ typedef enum { /* envoy.admin.v3.ServerInfo */ UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_new(upb_Arena* arena) { - return (envoy_admin_v3_ServerInfo*)_upb_Message_New(&envoy_admin_v3_ServerInfo_msginit, arena); + return (envoy_admin_v3_ServerInfo*)_upb_Message_New(&envoy_admin_v3_ServerInfo_msg_init, arena); } UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_ServerInfo* ret = envoy_admin_v3_ServerInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ServerInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ServerInfo_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -74,7 +77,7 @@ UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_parse_ex(const c int options, upb_Arena* arena) { envoy_admin_v3_ServerInfo* ret = envoy_admin_v3_ServerInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_ServerInfo_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_ServerInfo_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -82,128 +85,166 @@ UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_parse_ex(const c } UPB_INLINE char* envoy_admin_v3_ServerInfo_serialize(const envoy_admin_v3_ServerInfo* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ServerInfo_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ServerInfo_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_ServerInfo_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_ServerInfo_msg_init, 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); +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_version(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ServerInfo_version(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ServerInfo_clear_state(const envoy_admin_v3_ServerInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_state(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_ServerInfo_state(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ServerInfo_has_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_ServerInfo_clear_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_uptime_current_epoch(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ServerInfo_has_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_ServerInfo_has_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ServerInfo_clear_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_uptime_all_epochs(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_ServerInfo_clear_hot_restart_version(const envoy_admin_v3_ServerInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_admin_v3_ServerInfo_has_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_hot_restart_version(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_ServerInfo_hot_restart_version(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ServerInfo_has_command_line_options(const envoy_admin_v3_ServerInfo* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_admin_v3_ServerInfo_clear_command_line_options(const envoy_admin_v3_ServerInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_command_line_options(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_admin_v3_CommandLineOptions* envoy_admin_v3_ServerInfo_command_line_options(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_admin_v3_CommandLineOptions*); + const envoy_admin_v3_CommandLineOptions* default_val = NULL; + const envoy_admin_v3_CommandLineOptions* ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_ServerInfo_has_node(const envoy_admin_v3_ServerInfo* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_admin_v3_ServerInfo_has_command_line_options(const envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_ServerInfo_clear_node(const envoy_admin_v3_ServerInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_ServerInfo_clear_node(envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_admin_v3_ServerInfo_node(const envoy_admin_v3_ServerInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_ServerInfo_has_node(const envoy_admin_v3_ServerInfo* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_ServerInfo_set_version(envoy_admin_v3_ServerInfo *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ServerInfo_set_state(envoy_admin_v3_ServerInfo *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ServerInfo_set_uptime_current_epoch(envoy_admin_v3_ServerInfo *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_mutable_uptime_current_epoch(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_ServerInfo_uptime_current_epoch(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ServerInfo_set_uptime_current_epoch(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_admin_v3_ServerInfo_set_uptime_current_epoch(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ServerInfo_set_uptime_all_epochs(envoy_admin_v3_ServerInfo *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_mutable_uptime_all_epochs(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_ServerInfo_uptime_all_epochs(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ServerInfo_set_uptime_all_epochs(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_admin_v3_ServerInfo_set_uptime_all_epochs(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ServerInfo_set_hot_restart_version(envoy_admin_v3_ServerInfo *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_ServerInfo_set_command_line_options(envoy_admin_v3_ServerInfo *msg, envoy_admin_v3_CommandLineOptions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_admin_v3_CommandLineOptions*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_CommandLineOptions* envoy_admin_v3_ServerInfo_mutable_command_line_options(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) { struct envoy_admin_v3_CommandLineOptions* sub = (struct envoy_admin_v3_CommandLineOptions*)envoy_admin_v3_ServerInfo_command_line_options(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_CommandLineOptions*)_upb_Message_New(&envoy_admin_v3_CommandLineOptions_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ServerInfo_set_command_line_options(msg, sub); + sub = (struct envoy_admin_v3_CommandLineOptions*)_upb_Message_New(&envoy_admin_v3_CommandLineOptions_msg_init, arena); + if (sub) envoy_admin_v3_ServerInfo_set_command_line_options(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_ServerInfo_set_node(envoy_admin_v3_ServerInfo *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_admin_v3_ServerInfo_mutable_node(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_admin_v3_ServerInfo_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_ServerInfo_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_admin_v3_ServerInfo_set_node(msg, sub); } return sub; } @@ -211,12 +252,12 @@ UPB_INLINE struct envoy_config_core_v3_Node* envoy_admin_v3_ServerInfo_mutable_n /* envoy.admin.v3.CommandLineOptions */ UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_new(upb_Arena* arena) { - return (envoy_admin_v3_CommandLineOptions*)_upb_Message_New(&envoy_admin_v3_CommandLineOptions_msginit, arena); + return (envoy_admin_v3_CommandLineOptions*)_upb_Message_New(&envoy_admin_v3_CommandLineOptions_msg_init, arena); } UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_CommandLineOptions* ret = envoy_admin_v3_CommandLineOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_CommandLineOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_CommandLineOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -226,7 +267,7 @@ UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_ int options, upb_Arena* arena) { envoy_admin_v3_CommandLineOptions* ret = envoy_admin_v3_CommandLineOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_CommandLineOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_CommandLineOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -234,380 +275,627 @@ UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_ } UPB_INLINE char* envoy_admin_v3_CommandLineOptions_serialize(const envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msg_init, 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; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_base_id(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(72, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_admin_v3_CommandLineOptions_base_id(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(168, 288), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(72, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_concurrency(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_concurrency(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_admin_v3_CommandLineOptions_concurrency(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_config_path(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_config_path(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(80, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_config_path(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(80, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_config_yaml(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_config_yaml(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(88, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_config_yaml(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(88, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_allow_unknown_static_fields(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_allow_unknown_static_fields(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {5, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_allow_unknown_static_fields(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_admin_address_path(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_admin_address_path(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {6, 96, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_admin_address_path(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 88), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, 96, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_local_address_ip_version(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_local_address_ip_version(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {7, 12, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_CommandLineOptions_local_address_ip_version(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {7, 12, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_level(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_level(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(104, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_log_level(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 104), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(104, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_component_log_level(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_component_log_level(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(112, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_component_log_level(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 120), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(112, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_format(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(92, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_format(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(120, 144), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_log_format(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(92, 136), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(120, 144), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_path(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(100, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_path(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(128, 160), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_log_path(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(100, 152), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {11, UPB_SIZE(128, 160), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_cluster(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_cluster(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(136, 176), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_service_cluster(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {13, UPB_SIZE(136, 176), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_node(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_node(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(144, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_service_node(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {14, UPB_SIZE(144, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_zone(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(124, 200), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_zone(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(152, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_service_zone(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(124, 200), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {15, UPB_SIZE(152, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_file_flush_interval(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(16, 224), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {16, UPB_SIZE(16, 224), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_drain_time(const envoy_admin_v3_CommandLineOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(16, 224), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_drain_time(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_drain_time(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(20, 232), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_drain_time(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {17, UPB_SIZE(20, 232), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_drain_time(const envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(20, 232), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_parent_shutdown_time(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(24, 240), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {18, UPB_SIZE(24, 240), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_mode(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0; +UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(24, 240), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_mode(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(28, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_CommandLineOptions_mode(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {19, UPB_SIZE(28, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_disable_hot_restart(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_disable_hot_restart(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(32, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_disable_hot_restart(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {22, UPB_SIZE(32, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_mutex_tracing(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_mutex_tracing(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(33, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_enable_mutex_tracing(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {23, UPB_SIZE(33, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_restart_epoch(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_restart_epoch(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(36, 24), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_admin_v3_CommandLineOptions_restart_epoch(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {24, UPB_SIZE(36, 24), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_cpuset_threads(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_cpuset_threads(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(40, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_cpuset_threads(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {25, UPB_SIZE(40, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_reject_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_reject_unknown_dynamic_fields(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(41, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_reject_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {26, UPB_SIZE(41, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_format_escaped(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_format_escaped(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(42, 30), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_log_format_escaped(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {27, UPB_SIZE(42, 30), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_disabled_extensions(const envoy_admin_v3_CommandLineOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(144, 240)); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(44, 248), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_admin_v3_CommandLineOptions_disabled_extensions(const envoy_admin_v3_CommandLineOptions* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(144, 240), len); +UPB_INLINE upb_StringView const* envoy_admin_v3_CommandLineOptions_disabled_extensions(const envoy_admin_v3_CommandLineOptions* msg, size_t* size) { + const upb_MiniTableField field = {28, UPB_SIZE(44, 248), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_ignore_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = 0; +UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_disabled_extensions(const envoy_admin_v3_CommandLineOptions* msg) { + size_t size; + envoy_admin_v3_CommandLineOptions_disabled_extensions(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_ignore_unknown_dynamic_fields(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(48, 31), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_ignore_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {30, UPB_SIZE(48, 31), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_use_dynamic_base_id(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_use_dynamic_base_id(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(49, 32), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_use_dynamic_base_id(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {31, UPB_SIZE(49, 32), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_base_id_path(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(148, 248), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_base_id_path(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(160, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_base_id_path(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(148, 248), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {32, UPB_SIZE(160, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_drain_strategy(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 36), int32_t) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_drain_strategy(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(52, 36), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_admin_v3_CommandLineOptions_drain_strategy(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 36), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {33, UPB_SIZE(52, 36), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_fine_grain_logging(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 40), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_fine_grain_logging(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(56, 40), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_enable_fine_grain_logging(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {34, UPB_SIZE(56, 40), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_socket_path(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(156, 264), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_socket_path(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(168, 272), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_socket_path(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(156, 264), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {35, UPB_SIZE(168, 272), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_socket_mode(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 44), uint32_t) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_socket_mode(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(60, 44), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_admin_v3_CommandLineOptions_socket_mode(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 44), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {36, UPB_SIZE(60, 44), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_core_dump(const envoy_admin_v3_CommandLineOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = 0; +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_core_dump(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(64, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_enable_core_dump(const envoy_admin_v3_CommandLineOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {37, UPB_SIZE(64, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_stats_tag(const envoy_admin_v3_CommandLineOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(164, 280)); +UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_stats_tag(envoy_admin_v3_CommandLineOptions* msg) { + const upb_MiniTableField field = {38, UPB_SIZE(68, 288), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_admin_v3_CommandLineOptions_stats_tag(const envoy_admin_v3_CommandLineOptions* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(164, 280), len); +UPB_INLINE upb_StringView const* envoy_admin_v3_CommandLineOptions_stats_tag(const envoy_admin_v3_CommandLineOptions* msg, size_t* size) { + const upb_MiniTableField field = {38, UPB_SIZE(68, 288), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_stats_tag(const envoy_admin_v3_CommandLineOptions* msg) { + size_t size; + envoy_admin_v3_CommandLineOptions_stats_tag(msg, &size); + return size != 0; } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_base_id(envoy_admin_v3_CommandLineOptions *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(168, 288), uint64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(72, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_concurrency(envoy_admin_v3_CommandLineOptions *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_config_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(80, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_config_yaml(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 72), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(88, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_allow_unknown_static_fields(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {5, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_admin_address_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 88), upb_StringView) = value; + const upb_MiniTableField field = {6, 96, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_local_address_ip_version(envoy_admin_v3_CommandLineOptions *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {7, 12, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_level(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 104), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(104, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_component_log_level(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 120), upb_StringView) = value; + const upb_MiniTableField field = {9, UPB_SIZE(112, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_format(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(92, 136), upb_StringView) = value; + const upb_MiniTableField field = {10, UPB_SIZE(120, 144), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(100, 152), upb_StringView) = value; + const upb_MiniTableField field = {11, UPB_SIZE(128, 160), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_service_cluster(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = value; + const upb_MiniTableField field = {13, UPB_SIZE(136, 176), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_service_node(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = value; + const upb_MiniTableField field = {14, UPB_SIZE(144, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_service_zone(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(124, 200), upb_StringView) = value; + const upb_MiniTableField field = {15, UPB_SIZE(152, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_file_flush_interval(envoy_admin_v3_CommandLineOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(132, 216), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(16, 224), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_mutable_file_flush_interval(envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_CommandLineOptions_file_flush_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CommandLineOptions_set_file_flush_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_admin_v3_CommandLineOptions_set_file_flush_interval(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_drain_time(envoy_admin_v3_CommandLineOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(136, 224), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(20, 232), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_mutable_drain_time(envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_CommandLineOptions_drain_time(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CommandLineOptions_set_drain_time(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_admin_v3_CommandLineOptions_set_drain_time(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_parent_shutdown_time(envoy_admin_v3_CommandLineOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(140, 232), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {18, UPB_SIZE(24, 240), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_mutable_parent_shutdown_time(envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_CommandLineOptions_parent_shutdown_time(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_CommandLineOptions_set_parent_shutdown_time(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_admin_v3_CommandLineOptions_set_parent_shutdown_time(msg, sub); } return sub; } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_mode(envoy_admin_v3_CommandLineOptions *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + const upb_MiniTableField field = {19, UPB_SIZE(28, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_disable_hot_restart(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; + const upb_MiniTableField field = {22, UPB_SIZE(32, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_enable_mutex_tracing(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value; + const upb_MiniTableField field = {23, UPB_SIZE(33, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_restart_epoch(envoy_admin_v3_CommandLineOptions *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t) = value; + const upb_MiniTableField field = {24, UPB_SIZE(36, 24), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_cpuset_threads(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value; + const upb_MiniTableField field = {25, UPB_SIZE(40, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_reject_unknown_dynamic_fields(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value; + const upb_MiniTableField field = {26, UPB_SIZE(41, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_format_escaped(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = value; + const upb_MiniTableField field = {27, UPB_SIZE(42, 30), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_mutable_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(144, 240), len); +UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_mutable_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, size_t* size) { + upb_MiniTableField field = {28, UPB_SIZE(44, 248), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_resize_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(144, 240), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_resize_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {28, UPB_SIZE(44, 248), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_add_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(144, 240), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {28, UPB_SIZE(44, 248), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_ignore_unknown_dynamic_fields(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = value; + const upb_MiniTableField field = {30, UPB_SIZE(48, 31), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_use_dynamic_base_id(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value; + const upb_MiniTableField field = {31, UPB_SIZE(49, 32), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_base_id_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(148, 248), upb_StringView) = value; + const upb_MiniTableField field = {32, UPB_SIZE(160, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_drain_strategy(envoy_admin_v3_CommandLineOptions *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 36), int32_t) = value; + const upb_MiniTableField field = {33, UPB_SIZE(52, 36), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_enable_fine_grain_logging(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 40), bool) = value; + const upb_MiniTableField field = {34, UPB_SIZE(56, 40), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_socket_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(156, 264), upb_StringView) = value; + const upb_MiniTableField field = {35, UPB_SIZE(168, 272), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_socket_mode(envoy_admin_v3_CommandLineOptions *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 44), uint32_t) = value; + const upb_MiniTableField field = {36, UPB_SIZE(60, 44), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_enable_core_dump(envoy_admin_v3_CommandLineOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value; + const upb_MiniTableField field = {37, UPB_SIZE(64, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_mutable_stats_tag(envoy_admin_v3_CommandLineOptions* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(164, 280), len); +UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_mutable_stats_tag(envoy_admin_v3_CommandLineOptions* msg, size_t* size) { + upb_MiniTableField field = {38, UPB_SIZE(68, 288), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_resize_stats_tag(envoy_admin_v3_CommandLineOptions* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(164, 280), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_resize_stats_tag(envoy_admin_v3_CommandLineOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {38, UPB_SIZE(68, 288), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_admin_v3_CommandLineOptions_add_stats_tag(envoy_admin_v3_CommandLineOptions* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(164, 280), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {38, UPB_SIZE(68, 288), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File envoy_admin_v3_server_info_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_server_info_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPB_H_ */ 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 fdaef640f45..5e5ce77ace7 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 @@ -7,35 +7,44 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/admin/v3/tap.upb.h" #include "envoy/config/tap/v3/common.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_admin_v3_TapRequest_submsgs[1] = { - {.submsg = &envoy_config_tap_v3_TapConfig_msginit}, +static const upb_MiniTableSub envoy_admin_v3_TapRequest_submsgs[1] = { + {.submsg = &envoy_config_tap_v3_TapConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_admin_v3_TapRequest__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_admin_v3_TapRequest__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_admin_v3_TapRequest_msginit = { +const upb_MiniTable envoy_admin_v3_TapRequest_msg_init = { &envoy_admin_v3_TapRequest_submsgs[0], &envoy_admin_v3_TapRequest__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_admin_v3_TapRequest_msginit, + &envoy_admin_v3_TapRequest_msg_init, }; -const upb_MiniTable_File envoy_admin_v3_tap_proto_upb_file_layout = { +const upb_MiniTableFile envoy_admin_v3_tap_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -44,5 +53,5 @@ const upb_MiniTable_File envoy_admin_v3_tap_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 93fc1b10d1c..282b1191353 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_ADMIN_V3_TAP_PROTO_UPB_H_ #define ENVOY_ADMIN_V3_TAP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_admin_v3_TapRequest; typedef struct envoy_admin_v3_TapRequest envoy_admin_v3_TapRequest; -extern const upb_MiniTable envoy_admin_v3_TapRequest_msginit; +extern const upb_MiniTable envoy_admin_v3_TapRequest_msg_init; struct envoy_config_tap_v3_TapConfig; -extern const upb_MiniTable envoy_config_tap_v3_TapConfig_msginit; +extern const upb_MiniTable envoy_config_tap_v3_TapConfig_msg_init; /* envoy.admin.v3.TapRequest */ UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_new(upb_Arena* arena) { - return (envoy_admin_v3_TapRequest*)_upb_Message_New(&envoy_admin_v3_TapRequest_msginit, arena); + return (envoy_admin_v3_TapRequest*)_upb_Message_New(&envoy_admin_v3_TapRequest_msg_init, arena); } UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_admin_v3_TapRequest* ret = envoy_admin_v3_TapRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_TapRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_admin_v3_TapRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_parse_ex(const c int options, upb_Arena* arena) { envoy_admin_v3_TapRequest* ret = envoy_admin_v3_TapRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_admin_v3_TapRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_admin_v3_TapRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_parse_ex(const c } UPB_INLINE char* envoy_admin_v3_TapRequest_serialize(const envoy_admin_v3_TapRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_TapRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_TapRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_admin_v3_TapRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_admin_v3_TapRequest_msg_init, 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); +UPB_INLINE void envoy_admin_v3_TapRequest_clear_config_id(envoy_admin_v3_TapRequest* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_admin_v3_TapRequest_config_id(const envoy_admin_v3_TapRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_admin_v3_TapRequest_has_tap_config(const envoy_admin_v3_TapRequest* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_admin_v3_TapRequest_clear_tap_config(const envoy_admin_v3_TapRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_admin_v3_TapRequest_clear_tap_config(envoy_admin_v3_TapRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_tap_v3_TapConfig* envoy_admin_v3_TapRequest_tap_config(const envoy_admin_v3_TapRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_tap_v3_TapConfig*); + const struct envoy_config_tap_v3_TapConfig* default_val = NULL; + const struct envoy_config_tap_v3_TapConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_admin_v3_TapRequest_has_tap_config(const envoy_admin_v3_TapRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_admin_v3_TapRequest_set_config_id(envoy_admin_v3_TapRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_admin_v3_TapRequest_set_tap_config(envoy_admin_v3_TapRequest *msg, struct envoy_config_tap_v3_TapConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_tap_v3_TapConfig*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_TapConfig* envoy_admin_v3_TapRequest_mutable_tap_config(envoy_admin_v3_TapRequest* msg, upb_Arena* arena) { struct envoy_config_tap_v3_TapConfig* sub = (struct envoy_config_tap_v3_TapConfig*)envoy_admin_v3_TapRequest_tap_config(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_TapConfig*)_upb_Message_New(&envoy_config_tap_v3_TapConfig_msginit, arena); - if (!sub) return NULL; - envoy_admin_v3_TapRequest_set_tap_config(msg, sub); + sub = (struct envoy_config_tap_v3_TapConfig*)_upb_Message_New(&envoy_config_tap_v3_TapConfig_msg_init, arena); + if (sub) envoy_admin_v3_TapRequest_set_tap_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_admin_v3_tap_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_admin_v3_tap_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_TAP_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c b/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c index d91566cbd30..d6ddba6d8ae 100644 --- a/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +++ b/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c @@ -7,47 +7,50 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/annotations/deprecation.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_ext = { - {189503207, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +const upb_MiniTableExtension envoy_annotations_disallowed_by_default_ext = { + {189503207, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, {.submsg = NULL}, }; -const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_ext = { - {157299826, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, +const upb_MiniTableExtension envoy_annotations_deprecated_at_minor_version_ext = { + {157299826, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, {.submsg = NULL}, }; -const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_enum_ext = { - {70100853, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_EnumValueOptions_msginit, +const upb_MiniTableExtension envoy_annotations_disallowed_by_default_enum_ext = { + {70100853, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_EnumValueOptions_msg_init, {.submsg = NULL}, }; -const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_enum_ext = { - {181198657, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - &google_protobuf_EnumValueOptions_msginit, +const upb_MiniTableExtension envoy_annotations_deprecated_at_minor_version_enum_ext = { + {181198657, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + &google_protobuf_EnumValueOptions_msg_init, {.submsg = NULL}, }; -static const upb_MiniTable_Extension *extensions_layout[4] = { +static const upb_MiniTableExtension *extensions_layout[4] = { &envoy_annotations_disallowed_by_default_ext, &envoy_annotations_deprecated_at_minor_version_ext, &envoy_annotations_disallowed_by_default_enum_ext, &envoy_annotations_deprecated_at_minor_version_enum_ext, }; -const upb_MiniTable_File envoy_annotations_deprecation_proto_upb_file_layout = { +const upb_MiniTableFile envoy_annotations_deprecation_proto_upb_file_layout = { NULL, NULL, extensions_layout, @@ -56,5 +59,5 @@ const upb_MiniTable_File envoy_annotations_deprecation_proto_upb_file_layout = { 4, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h b/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h index bec105c1fe2..3c4c3fc4601 100644 --- a/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +++ b/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h @@ -9,73 +9,126 @@ #ifndef ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_ #define ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -extern const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_ext; -extern const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_ext; -extern const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_enum_ext; -extern const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_enum_ext; +extern const upb_MiniTableExtension envoy_annotations_disallowed_by_default_ext; +extern const upb_MiniTableExtension envoy_annotations_deprecated_at_minor_version_ext; +extern const upb_MiniTableExtension envoy_annotations_disallowed_by_default_enum_ext; +extern const upb_MiniTableExtension envoy_annotations_deprecated_at_minor_version_enum_ext; struct google_protobuf_EnumValueOptions; struct google_protobuf_FieldOptions; -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; UPB_INLINE bool envoy_annotations_has_disallowed_by_default(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &envoy_annotations_disallowed_by_default_ext); } UPB_INLINE void envoy_annotations_clear_disallowed_by_default(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &envoy_annotations_disallowed_by_default_ext); + _upb_Message_ClearExtensionField(msg, &envoy_annotations_disallowed_by_default_ext); } UPB_INLINE bool envoy_annotations_disallowed_by_default(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &envoy_annotations_disallowed_by_default_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_annotations_set_disallowed_by_default(struct google_protobuf_FieldOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &envoy_annotations_disallowed_by_default_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool envoy_annotations_has_deprecated_at_minor_version(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &envoy_annotations_deprecated_at_minor_version_ext); } UPB_INLINE void envoy_annotations_clear_deprecated_at_minor_version(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &envoy_annotations_deprecated_at_minor_version_ext); + _upb_Message_ClearExtensionField(msg, &envoy_annotations_deprecated_at_minor_version_ext); } UPB_INLINE upb_StringView envoy_annotations_deprecated_at_minor_version(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, upb_StringView) : upb_StringView_FromString(""); + const upb_MiniTableExtension* ext = &envoy_annotations_deprecated_at_minor_version_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_annotations_set_deprecated_at_minor_version(struct google_protobuf_FieldOptions* msg, upb_StringView val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &envoy_annotations_deprecated_at_minor_version_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_StringView); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool envoy_annotations_has_disallowed_by_default_enum(const struct google_protobuf_EnumValueOptions* msg) { - return _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_enum_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &envoy_annotations_disallowed_by_default_enum_ext); } UPB_INLINE void envoy_annotations_clear_disallowed_by_default_enum(struct google_protobuf_EnumValueOptions* msg) { - _upb_Message_Clearext(msg, &envoy_annotations_disallowed_by_default_enum_ext); + _upb_Message_ClearExtensionField(msg, &envoy_annotations_disallowed_by_default_enum_ext); } UPB_INLINE bool envoy_annotations_disallowed_by_default_enum(const struct google_protobuf_EnumValueOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_enum_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &envoy_annotations_disallowed_by_default_enum_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_annotations_set_disallowed_by_default_enum(struct google_protobuf_EnumValueOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &envoy_annotations_disallowed_by_default_enum_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool envoy_annotations_has_deprecated_at_minor_version_enum(const struct google_protobuf_EnumValueOptions* msg) { - return _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext); } UPB_INLINE void envoy_annotations_clear_deprecated_at_minor_version_enum(struct google_protobuf_EnumValueOptions* msg) { - _upb_Message_Clearext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext); + _upb_Message_ClearExtensionField(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext); } UPB_INLINE upb_StringView envoy_annotations_deprecated_at_minor_version_enum(const struct google_protobuf_EnumValueOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, upb_StringView) : upb_StringView_FromString(""); + const upb_MiniTableExtension* ext = &envoy_annotations_deprecated_at_minor_version_enum_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -extern const upb_MiniTable_File envoy_annotations_deprecation_proto_upb_file_layout; +UPB_INLINE void envoy_annotations_set_deprecated_at_minor_version_enum(struct google_protobuf_EnumValueOptions* msg, upb_StringView val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &envoy_annotations_deprecated_at_minor_version_enum_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_StringView); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); +} +extern const upb_MiniTableFile envoy_annotations_deprecation_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_ */ 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 d82588748b0..23b90dec8aa 100644 --- a/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +++ b/src/core/ext/upb-generated/envoy/annotations/resource.upb.c @@ -7,40 +7,47 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/annotations/resource.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_annotations_ResourceAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_annotations_ResourceAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit = { +const upb_MiniTable envoy_annotations_ResourceAnnotation_msg_init = { NULL, &envoy_annotations_ResourceAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_annotations_ResourceAnnotation_msginit, + &envoy_annotations_ResourceAnnotation_msg_init, }; -extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit; -extern const upb_MiniTable google_protobuf_ServiceOptions_msginit; -const upb_MiniTable_Extension envoy_annotations_resource_ext = { - {265073217, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_ServiceOptions_msginit, - {.submsg = &envoy_annotations_ResourceAnnotation_msginit}, +extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msg_init; +extern const upb_MiniTable google_protobuf_ServiceOptions_msg_init; +const upb_MiniTableExtension envoy_annotations_resource_ext = { + {265073217, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_ServiceOptions_msg_init, + {.submsg = &envoy_annotations_ResourceAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &envoy_annotations_resource_ext, }; -const upb_MiniTable_File envoy_annotations_resource_proto_upb_file_layout = { +const upb_MiniTableFile envoy_annotations_resource_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -49,5 +56,5 @@ const upb_MiniTable_File envoy_annotations_resource_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 217139c1dbf..b72f4dd4e1f 100644 --- a/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +++ b/src/core/ext/upb-generated/envoy/annotations/resource.upb.h @@ -9,35 +9,39 @@ #ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ #define ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_annotations_ResourceAnnotation; typedef struct envoy_annotations_ResourceAnnotation envoy_annotations_ResourceAnnotation; -extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit; -extern const upb_MiniTable_Extension envoy_annotations_resource_ext; +extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msg_init; +extern const upb_MiniTableExtension envoy_annotations_resource_ext; struct google_protobuf_ServiceOptions; -extern const upb_MiniTable google_protobuf_ServiceOptions_msginit; +extern const upb_MiniTable google_protobuf_ServiceOptions_msg_init; /* envoy.annotations.ResourceAnnotation */ UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnotation_new(upb_Arena* arena) { - return (envoy_annotations_ResourceAnnotation*)_upb_Message_New(&envoy_annotations_ResourceAnnotation_msginit, arena); + return (envoy_annotations_ResourceAnnotation*)_upb_Message_New(&envoy_annotations_ResourceAnnotation_msg_init, arena); } UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_annotations_ResourceAnnotation* ret = envoy_annotations_ResourceAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +51,7 @@ UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnot int options, upb_Arena* arena) { envoy_annotations_ResourceAnnotation* ret = envoy_annotations_ResourceAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,49 +59,60 @@ UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnot } UPB_INLINE char* envoy_annotations_ResourceAnnotation_serialize(const envoy_annotations_ResourceAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msg_init, 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); +UPB_INLINE void envoy_annotations_ResourceAnnotation_clear_type(envoy_annotations_ResourceAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_annotations_ResourceAnnotation_type(const envoy_annotations_ResourceAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_annotations_ResourceAnnotation_set_type(envoy_annotations_ResourceAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool envoy_annotations_has_resource(const struct google_protobuf_ServiceOptions* msg) { - return _upb_Message_Getext(msg, &envoy_annotations_resource_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &envoy_annotations_resource_ext); } UPB_INLINE void envoy_annotations_clear_resource(struct google_protobuf_ServiceOptions* msg) { - _upb_Message_Clearext(msg, &envoy_annotations_resource_ext); + _upb_Message_ClearExtensionField(msg, &envoy_annotations_resource_ext); } UPB_INLINE const envoy_annotations_ResourceAnnotation* envoy_annotations_resource(const struct google_protobuf_ServiceOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_resource_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const envoy_annotations_ResourceAnnotation*); + const upb_MiniTableExtension* ext = &envoy_annotations_resource_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const envoy_annotations_ResourceAnnotation* default_val = NULL; + const envoy_annotations_ResourceAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &envoy_annotations_resource_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const envoy_annotations_ResourceAnnotation*) = ext; +UPB_INLINE void envoy_annotations_set_resource(struct google_protobuf_ServiceOptions* msg, const envoy_annotations_ResourceAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &envoy_annotations_resource_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File envoy_annotations_resource_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_annotations_resource_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ */ 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 606b52d9f1b..a04dad4559b 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/accesslog/v3/accesslog.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/route/v3/route_components.upb.h" @@ -19,245 +21,330 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_accesslog_v3_AccessLog_submsgs[2] = { - {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit}, - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_AccessLog_submsgs[2] = { + {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_AccessLog__fields[3] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_AccessLog__fields[3] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msg_init = { &envoy_config_accesslog_v3_AccessLog_submsgs[0], &envoy_config_accesslog_v3_AccessLog__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0020000404010022, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = { - {.submsg = &envoy_config_accesslog_v3_StatusCodeFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_DurationFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_TraceableFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_RuntimeFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_AndFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_OrFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_HeaderFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_ResponseFlagFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_GrpcStatusFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_ExtensionFilter_msginit}, - {.submsg = &envoy_config_accesslog_v3_MetadataFilter_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = { + {.submsg = &envoy_config_accesslog_v3_StatusCodeFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_DurationFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_TraceableFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_RuntimeFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_AndFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_OrFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_HeaderFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_ResponseFlagFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_GrpcStatusFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_ExtensionFilter_msg_init}, + {.submsg = &envoy_config_accesslog_v3_MetadataFilter_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_AccessLogFilter__fields[12] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_AccessLogFilter__fields[12] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(4, 8), -1, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msg_init = { &envoy_config_accesslog_v3_AccessLogFilter_submsgs[0], &envoy_config_accesslog_v3_AccessLogFilter__fields[0], - UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004030022, &upb_pom_1bt_max64b}, + {0x000800000504002a, &upb_pom_1bt_max64b}, + {0x0008000006050032, &upb_pom_1bt_max64b}, + {0x000800000706003a, &upb_pom_1bt_max64b}, + {0x0008000008070042, &upb_pom_1bt_max64b}, + {0x000800000908004a, &upb_pom_1bt_max64b}, + {0x000800000a090052, &upb_pom_1bt_max64b}, + {0x000800000b0a005a, &upb_pom_1bt_max64b}, + {0x000800000c0b0062, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = { - {.submsg = &envoy_config_core_v3_RuntimeUInt32_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = { + {.submsg = &envoy_config_core_v3_RuntimeUInt32_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_ComparisonFilter__fields[2] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_ComparisonFilter__fields[2] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_ComparisonFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_ComparisonFilter_msg_init = { &envoy_config_accesslog_v3_ComparisonFilter_submsgs[0], &envoy_config_accesslog_v3_ComparisonFilter__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = { - {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = { + {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_StatusCodeFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_StatusCodeFilter_msg_init = { &envoy_config_accesslog_v3_StatusCodeFilter_submsgs[0], &envoy_config_accesslog_v3_StatusCodeFilter__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_DurationFilter_submsgs[1] = { - {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_DurationFilter_submsgs[1] = { + {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_DurationFilter__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_DurationFilter__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_DurationFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_DurationFilter_msg_init = { &envoy_config_accesslog_v3_DurationFilter_submsgs[0], &envoy_config_accesslog_v3_DurationFilter__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + }) }; -const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = { - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = { + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_RuntimeFilter__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_RuntimeFilter__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_RuntimeFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_RuntimeFilter_msg_init = { &envoy_config_accesslog_v3_RuntimeFilter_submsgs[0], &envoy_config_accesslog_v3_RuntimeFilter__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_AndFilter_submsgs[1] = { - {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_AndFilter_submsgs[1] = { + {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_AndFilter__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_AndFilter__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_AndFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_AndFilter_msg_init = { &envoy_config_accesslog_v3_AndFilter_submsgs[0], &envoy_config_accesslog_v3_AndFilter__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_OrFilter_submsgs[1] = { - {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_OrFilter_submsgs[1] = { + {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_OrFilter__fields[1] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_OrFilter__fields[1] = { + {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_OrFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_OrFilter_msg_init = { &envoy_config_accesslog_v3_OrFilter_submsgs[0], &envoy_config_accesslog_v3_OrFilter__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = { - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = { + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_HeaderFilter__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_HeaderFilter__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_HeaderFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_HeaderFilter_msg_init = { &envoy_config_accesslog_v3_HeaderFilter_submsgs[0], &envoy_config_accesslog_v3_HeaderFilter__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msg_init = { NULL, &envoy_config_accesslog_v3_ResponseFlagFilter__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prs_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = { + {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msg_init = { NULL, &envoy_config_accesslog_v3_GrpcStatusFilter__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_ppv4_1bt}, + {0x000000003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = { - {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = { + {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_MetadataFilter__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_MetadataFilter__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_MetadataFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_MetadataFilter_msg_init = { &envoy_config_accesslog_v3_MetadataFilter_submsgs[0], &envoy_config_accesslog_v3_MetadataFilter__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_accesslog_v3_ExtensionFilter__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_accesslog_v3_ExtensionFilter__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_accesslog_v3_ExtensionFilter_msginit = { +const upb_MiniTable envoy_config_accesslog_v3_ExtensionFilter_msg_init = { &envoy_config_accesslog_v3_ExtensionFilter_submsgs[0], &envoy_config_accesslog_v3_ExtensionFilter__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[15] = { - &envoy_config_accesslog_v3_AccessLog_msginit, - &envoy_config_accesslog_v3_AccessLogFilter_msginit, - &envoy_config_accesslog_v3_ComparisonFilter_msginit, - &envoy_config_accesslog_v3_StatusCodeFilter_msginit, - &envoy_config_accesslog_v3_DurationFilter_msginit, - &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, - &envoy_config_accesslog_v3_TraceableFilter_msginit, - &envoy_config_accesslog_v3_RuntimeFilter_msginit, - &envoy_config_accesslog_v3_AndFilter_msginit, - &envoy_config_accesslog_v3_OrFilter_msginit, - &envoy_config_accesslog_v3_HeaderFilter_msginit, - &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, - &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, - &envoy_config_accesslog_v3_MetadataFilter_msginit, - &envoy_config_accesslog_v3_ExtensionFilter_msginit, + &envoy_config_accesslog_v3_AccessLog_msg_init, + &envoy_config_accesslog_v3_AccessLogFilter_msg_init, + &envoy_config_accesslog_v3_ComparisonFilter_msg_init, + &envoy_config_accesslog_v3_StatusCodeFilter_msg_init, + &envoy_config_accesslog_v3_DurationFilter_msg_init, + &envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, + &envoy_config_accesslog_v3_TraceableFilter_msg_init, + &envoy_config_accesslog_v3_RuntimeFilter_msg_init, + &envoy_config_accesslog_v3_AndFilter_msg_init, + &envoy_config_accesslog_v3_OrFilter_msg_init, + &envoy_config_accesslog_v3_HeaderFilter_msg_init, + &envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, + &envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, + &envoy_config_accesslog_v3_MetadataFilter_msg_init, + &envoy_config_accesslog_v3_ExtensionFilter_msg_init, }; -const upb_MiniTable_File envoy_config_accesslog_v3_accesslog_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_accesslog_v3_accesslog_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -266,5 +353,5 @@ const upb_MiniTable_File envoy_config_accesslog_v3_accesslog_proto_upb_file_layo 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 64fc927959a..2237bbf9975 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 @@ -9,32 +9,22 @@ #ifndef ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_ #define ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_accesslog_v3_AccessLog; -struct envoy_config_accesslog_v3_AccessLogFilter; -struct envoy_config_accesslog_v3_ComparisonFilter; -struct envoy_config_accesslog_v3_StatusCodeFilter; -struct envoy_config_accesslog_v3_DurationFilter; -struct envoy_config_accesslog_v3_NotHealthCheckFilter; -struct envoy_config_accesslog_v3_TraceableFilter; -struct envoy_config_accesslog_v3_RuntimeFilter; -struct envoy_config_accesslog_v3_AndFilter; -struct envoy_config_accesslog_v3_OrFilter; -struct envoy_config_accesslog_v3_HeaderFilter; -struct envoy_config_accesslog_v3_ResponseFlagFilter; -struct envoy_config_accesslog_v3_GrpcStatusFilter; -struct envoy_config_accesslog_v3_MetadataFilter; -struct envoy_config_accesslog_v3_ExtensionFilter; typedef struct envoy_config_accesslog_v3_AccessLog envoy_config_accesslog_v3_AccessLog; typedef struct envoy_config_accesslog_v3_AccessLogFilter envoy_config_accesslog_v3_AccessLogFilter; typedef struct envoy_config_accesslog_v3_ComparisonFilter envoy_config_accesslog_v3_ComparisonFilter; @@ -50,33 +40,33 @@ typedef struct envoy_config_accesslog_v3_ResponseFlagFilter envoy_config_accessl typedef struct envoy_config_accesslog_v3_GrpcStatusFilter envoy_config_accesslog_v3_GrpcStatusFilter; typedef struct envoy_config_accesslog_v3_MetadataFilter envoy_config_accesslog_v3_MetadataFilter; typedef struct envoy_config_accesslog_v3_ExtensionFilter envoy_config_accesslog_v3_ExtensionFilter; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_ComparisonFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_StatusCodeFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_DurationFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_RuntimeFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_AndFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_OrFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_HeaderFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_MetadataFilter_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_ExtensionFilter_msginit; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_ComparisonFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_StatusCodeFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_DurationFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_RuntimeFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_AndFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_OrFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_HeaderFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_MetadataFilter_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_ExtensionFilter_msg_init; struct envoy_config_core_v3_RuntimeUInt32; struct envoy_config_route_v3_HeaderMatcher; struct envoy_type_matcher_v3_MetadataMatcher; struct envoy_type_v3_FractionalPercent; struct google_protobuf_Any; struct google_protobuf_BoolValue; -extern const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit; -extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; +extern const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msg_init; +extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msg_init; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; typedef enum { envoy_config_accesslog_v3_ComparisonFilter_EQ = 0, @@ -109,12 +99,12 @@ typedef enum { /* envoy.config.accesslog.v3.AccessLog */ UPB_INLINE envoy_config_accesslog_v3_AccessLog* envoy_config_accesslog_v3_AccessLog_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena); + return (envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_AccessLog* envoy_config_accesslog_v3_AccessLog_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_AccessLog* ret = envoy_config_accesslog_v3_AccessLog_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -124,7 +114,7 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLog* envoy_config_accesslog_v3_Access int options, upb_Arena* arena) { envoy_config_accesslog_v3_AccessLog* ret = envoy_config_accesslog_v3_AccessLog_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -132,13 +122,13 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLog* envoy_config_accesslog_v3_Access } UPB_INLINE char* envoy_config_accesslog_v3_AccessLog_serialize(const envoy_config_accesslog_v3_AccessLog* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -146,58 +136,76 @@ typedef enum { envoy_config_accesslog_v3_AccessLog_config_type_NOT_SET = 0 } envoy_config_accesslog_v3_AccessLog_config_type_oneofcases; UPB_INLINE envoy_config_accesslog_v3_AccessLog_config_type_oneofcases envoy_config_accesslog_v3_AccessLog_config_type_case(const envoy_config_accesslog_v3_AccessLog* msg) { - return (envoy_config_accesslog_v3_AccessLog_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_accesslog_v3_AccessLog_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_name(const envoy_config_accesslog_v3_AccessLog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_name(envoy_config_accesslog_v3_AccessLog* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_accesslog_v3_AccessLog_name(const envoy_config_accesslog_v3_AccessLog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_filter(const envoy_config_accesslog_v3_AccessLog* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_filter(const envoy_config_accesslog_v3_AccessLog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_filter(envoy_config_accesslog_v3_AccessLog* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLog_filter(const envoy_config_accesslog_v3_AccessLog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_config_accesslog_v3_AccessLogFilter*); + const envoy_config_accesslog_v3_AccessLogFilter* default_val = NULL; + const envoy_config_accesslog_v3_AccessLogFilter* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_typed_config(const envoy_config_accesslog_v3_AccessLog* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_filter(const envoy_config_accesslog_v3_AccessLog* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_typed_config(const envoy_config_accesslog_v3_AccessLog* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_accesslog_v3_AccessLog_config_type_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_typed_config(envoy_config_accesslog_v3_AccessLog* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_typed_config(const envoy_config_accesslog_v3_AccessLog* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 4, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_typed_config(const envoy_config_accesslog_v3_AccessLog* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_name(envoy_config_accesslog_v3_AccessLog *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_filter(envoy_config_accesslog_v3_AccessLog *msg, envoy_config_accesslog_v3_AccessLogFilter* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_config_accesslog_v3_AccessLogFilter*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLog_mutable_filter(envoy_config_accesslog_v3_AccessLog* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)envoy_config_accesslog_v3_AccessLog_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLog_set_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLog_set_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_typed_config(envoy_config_accesslog_v3_AccessLog *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_mutable_typed_config(envoy_config_accesslog_v3_AccessLog* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_accesslog_v3_AccessLog_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLog_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLog_set_typed_config(msg, sub); } return sub; } @@ -205,12 +213,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_mutab /* envoy.config.accesslog.v3.AccessLogFilter */ UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLogFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena); + return (envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLogFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_AccessLogFilter* ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -220,7 +228,7 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_ int options, upb_Arena* arena) { envoy_config_accesslog_v3_AccessLogFilter* ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -228,13 +236,13 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_ } UPB_INLINE char* envoy_config_accesslog_v3_AccessLogFilter_serialize(const envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -253,258 +261,331 @@ typedef enum { envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET = 0 } envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases; UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_case(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return (envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_AccessLogFilter_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_accesslog_v3_StatusCodeFilter* default_val = NULL; + const envoy_config_accesslog_v3_StatusCodeFilter* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_duration_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_AccessLogFilter_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_accesslog_v3_DurationFilter* default_val = NULL; + const envoy_config_accesslog_v3_DurationFilter* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_AccessLogFilter_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_accesslog_v3_NotHealthCheckFilter* default_val = NULL; + const envoy_config_accesslog_v3_NotHealthCheckFilter* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_AccessLogFilter_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_config_accesslog_v3_TraceableFilter* default_val = NULL; + const envoy_config_accesslog_v3_TraceableFilter* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_AccessLogFilter_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const envoy_config_accesslog_v3_RuntimeFilter* default_val = NULL; + const envoy_config_accesslog_v3_RuntimeFilter* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_and_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_and_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_and_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AccessLogFilter_and_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const envoy_config_accesslog_v3_AndFilter* default_val = NULL; + const envoy_config_accesslog_v3_AndFilter* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_or_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_and_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_or_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_or_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_AccessLogFilter_or_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const envoy_config_accesslog_v3_OrFilter* default_val = NULL; + const envoy_config_accesslog_v3_OrFilter* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_header_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_or_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_header_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_header_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_AccessLogFilter_header_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const envoy_config_accesslog_v3_HeaderFilter* default_val = NULL; + const envoy_config_accesslog_v3_HeaderFilter* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_header_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_AccessLogFilter_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const envoy_config_accesslog_v3_ResponseFlagFilter* default_val = NULL; + const envoy_config_accesslog_v3_ResponseFlagFilter* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_AccessLogFilter_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL); + const envoy_config_accesslog_v3_GrpcStatusFilter* default_val = NULL; + const envoy_config_accesslog_v3_GrpcStatusFilter* ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_extension_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_AccessLogFilter_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 11, NULL); + const envoy_config_accesslog_v3_ExtensionFilter* default_val = NULL; + const envoy_config_accesslog_v3_ExtensionFilter* ret; + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 12; +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_AccessLogFilter_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 12, NULL); + const envoy_config_accesslog_v3_MetadataFilter* default_val = NULL; + const envoy_config_accesslog_v3_MetadataFilter* ret; + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_StatusCodeFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_StatusCodeFilter* sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)envoy_config_accesslog_v3_AccessLogFilter_status_code_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_StatusCodeFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_DurationFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_duration_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_DurationFilter* sub = (struct envoy_config_accesslog_v3_DurationFilter*)envoy_config_accesslog_v3_AccessLogFilter_duration_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_DurationFilter*)_upb_Message_New(&envoy_config_accesslog_v3_DurationFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_DurationFilter*)_upb_Message_New(&envoy_config_accesslog_v3_DurationFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_NotHealthCheckFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_NotHealthCheckFilter* sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)envoy_config_accesslog_v3_AccessLogFilter_not_health_check_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_Message_New(&envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_Message_New(&envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_TraceableFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_TraceableFilter* sub = (struct envoy_config_accesslog_v3_TraceableFilter*)envoy_config_accesslog_v3_AccessLogFilter_traceable_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_TraceableFilter*)_upb_Message_New(&envoy_config_accesslog_v3_TraceableFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_TraceableFilter*)_upb_Message_New(&envoy_config_accesslog_v3_TraceableFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_RuntimeFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_RuntimeFilter* sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)envoy_config_accesslog_v3_AccessLogFilter_runtime_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_RuntimeFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_RuntimeFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_AndFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_and_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_AndFilter* sub = (struct envoy_config_accesslog_v3_AndFilter*)envoy_config_accesslog_v3_AccessLogFilter_and_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_AndFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AndFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_AndFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AndFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_OrFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_or_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_OrFilter* sub = (struct envoy_config_accesslog_v3_OrFilter*)envoy_config_accesslog_v3_AccessLogFilter_or_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_OrFilter*)_upb_Message_New(&envoy_config_accesslog_v3_OrFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_OrFilter*)_upb_Message_New(&envoy_config_accesslog_v3_OrFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_HeaderFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_header_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_HeaderFilter* sub = (struct envoy_config_accesslog_v3_HeaderFilter*)envoy_config_accesslog_v3_AccessLogFilter_header_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_HeaderFilter*)_upb_Message_New(&envoy_config_accesslog_v3_HeaderFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_HeaderFilter*)_upb_Message_New(&envoy_config_accesslog_v3_HeaderFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_ResponseFlagFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_ResponseFlagFilter* sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)envoy_config_accesslog_v3_AccessLogFilter_response_flag_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_GrpcStatusFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_GrpcStatusFilter* sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)envoy_config_accesslog_v3_AccessLogFilter_grpc_status_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_Message_New(&envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_Message_New(&envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_ExtensionFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 11); + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_extension_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_ExtensionFilter* sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)envoy_config_accesslog_v3_AccessLogFilter_extension_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ExtensionFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ExtensionFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_MetadataFilter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 12); + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_MetadataFilter* sub = (struct envoy_config_accesslog_v3_MetadataFilter*)envoy_config_accesslog_v3_AccessLogFilter_metadata_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_MetadataFilter*)_upb_Message_New(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_MetadataFilter*)_upb_Message_New(&envoy_config_accesslog_v3_MetadataFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(msg, sub); } return sub; } @@ -512,12 +593,12 @@ UPB_INLINE struct envoy_config_accesslog_v3_MetadataFilter* envoy_config_accessl /* envoy.config.accesslog.v3.ComparisonFilter */ UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_ComparisonFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena); + return (envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_ComparisonFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_ComparisonFilter* ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -527,7 +608,7 @@ UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3 int options, upb_Arena* arena) { envoy_config_accesslog_v3_ComparisonFilter* ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -535,44 +616,55 @@ UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3 } UPB_INLINE char* envoy_config_accesslog_v3_ComparisonFilter_serialize(const envoy_config_accesslog_v3_ComparisonFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msg_init, 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; +UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_clear_op(envoy_config_accesslog_v3_ComparisonFilter* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_accesslog_v3_ComparisonFilter_op(const envoy_config_accesslog_v3_ComparisonFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_ComparisonFilter_has_value(const envoy_config_accesslog_v3_ComparisonFilter* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_clear_value(const envoy_config_accesslog_v3_ComparisonFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_clear_value(envoy_config_accesslog_v3_ComparisonFilter* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ComparisonFilter_value(const envoy_config_accesslog_v3_ComparisonFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_RuntimeUInt32*); + const struct envoy_config_core_v3_RuntimeUInt32* default_val = NULL; + const struct envoy_config_core_v3_RuntimeUInt32* ret; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_ComparisonFilter_has_value(const envoy_config_accesslog_v3_ComparisonFilter* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_op(envoy_config_accesslog_v3_ComparisonFilter *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_value(envoy_config_accesslog_v3_ComparisonFilter *msg, struct envoy_config_core_v3_RuntimeUInt32* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_RuntimeUInt32*) = value; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ComparisonFilter_mutable_value(envoy_config_accesslog_v3_ComparisonFilter* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeUInt32* sub = (struct envoy_config_core_v3_RuntimeUInt32*)envoy_config_accesslog_v3_ComparisonFilter_value(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeUInt32*)_upb_Message_New(&envoy_config_core_v3_RuntimeUInt32_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_ComparisonFilter_set_value(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeUInt32*)_upb_Message_New(&envoy_config_core_v3_RuntimeUInt32_msg_init, arena); + if (sub) envoy_config_accesslog_v3_ComparisonFilter_set_value(msg, sub); } return sub; } @@ -580,12 +672,12 @@ UPB_INLINE struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ /* envoy.config.accesslog.v3.StatusCodeFilter */ UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_StatusCodeFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_StatusCodeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena); + return (envoy_config_accesslog_v3_StatusCodeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_StatusCodeFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_StatusCodeFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_StatusCodeFilter* ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -595,7 +687,7 @@ UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3 int options, upb_Arena* arena) { envoy_config_accesslog_v3_StatusCodeFilter* ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -603,35 +695,40 @@ UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3 } UPB_INLINE char* envoy_config_accesslog_v3_StatusCodeFilter_serialize(const envoy_config_accesslog_v3_StatusCodeFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msg_init, 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); -} -UPB_INLINE void envoy_config_accesslog_v3_StatusCodeFilter_clear_comparison(const envoy_config_accesslog_v3_StatusCodeFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_StatusCodeFilter_clear_comparison(envoy_config_accesslog_v3_StatusCodeFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_StatusCodeFilter_comparison(const envoy_config_accesslog_v3_StatusCodeFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_accesslog_v3_ComparisonFilter*); + const envoy_config_accesslog_v3_ComparisonFilter* default_val = NULL; + const envoy_config_accesslog_v3_ComparisonFilter* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_StatusCodeFilter_has_comparison(const envoy_config_accesslog_v3_StatusCodeFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(envoy_config_accesslog_v3_StatusCodeFilter *msg, envoy_config_accesslog_v3_ComparisonFilter* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_accesslog_v3_ComparisonFilter*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_StatusCodeFilter_mutable_comparison(envoy_config_accesslog_v3_StatusCodeFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_ComparisonFilter* sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)envoy_config_accesslog_v3_StatusCodeFilter_comparison(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(msg, sub); + sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(msg, sub); } return sub; } @@ -639,12 +736,12 @@ UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_acces /* envoy.config.accesslog.v3.DurationFilter */ UPB_INLINE envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_DurationFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_DurationFilter*)_upb_Message_New(&envoy_config_accesslog_v3_DurationFilter_msginit, arena); + return (envoy_config_accesslog_v3_DurationFilter*)_upb_Message_New(&envoy_config_accesslog_v3_DurationFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_DurationFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_DurationFilter* ret = envoy_config_accesslog_v3_DurationFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -654,7 +751,7 @@ UPB_INLINE envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_D int options, upb_Arena* arena) { envoy_config_accesslog_v3_DurationFilter* ret = envoy_config_accesslog_v3_DurationFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -662,35 +759,40 @@ UPB_INLINE envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_D } UPB_INLINE char* envoy_config_accesslog_v3_DurationFilter_serialize(const envoy_config_accesslog_v3_DurationFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msg_init, 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); -} -UPB_INLINE void envoy_config_accesslog_v3_DurationFilter_clear_comparison(const envoy_config_accesslog_v3_DurationFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_DurationFilter_clear_comparison(envoy_config_accesslog_v3_DurationFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_DurationFilter_comparison(const envoy_config_accesslog_v3_DurationFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_accesslog_v3_ComparisonFilter*); + const envoy_config_accesslog_v3_ComparisonFilter* default_val = NULL; + const envoy_config_accesslog_v3_ComparisonFilter* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_DurationFilter_has_comparison(const envoy_config_accesslog_v3_DurationFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_DurationFilter_set_comparison(envoy_config_accesslog_v3_DurationFilter *msg, envoy_config_accesslog_v3_ComparisonFilter* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_accesslog_v3_ComparisonFilter*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_DurationFilter_mutable_comparison(envoy_config_accesslog_v3_DurationFilter* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_ComparisonFilter* sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)envoy_config_accesslog_v3_DurationFilter_comparison(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_DurationFilter_set_comparison(msg, sub); + sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msg_init, arena); + if (sub) envoy_config_accesslog_v3_DurationFilter_set_comparison(msg, sub); } return sub; } @@ -698,12 +800,12 @@ UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_acces /* envoy.config.accesslog.v3.NotHealthCheckFilter */ UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_NotHealthCheckFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_Message_New(&envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena); + return (envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_Message_New(&envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_NotHealthCheckFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_NotHealthCheckFilter* ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -713,7 +815,7 @@ UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslo int options, upb_Arena* arena) { envoy_config_accesslog_v3_NotHealthCheckFilter* ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -721,13 +823,13 @@ UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslo } UPB_INLINE char* envoy_config_accesslog_v3_NotHealthCheckFilter_serialize(const envoy_config_accesslog_v3_NotHealthCheckFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msg_init, options, arena, &ptr, len); return ptr; } @@ -735,12 +837,12 @@ UPB_INLINE char* envoy_config_accesslog_v3_NotHealthCheckFilter_serialize_ex(con /* envoy.config.accesslog.v3.TraceableFilter */ UPB_INLINE envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_TraceableFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_TraceableFilter*)_upb_Message_New(&envoy_config_accesslog_v3_TraceableFilter_msginit, arena); + return (envoy_config_accesslog_v3_TraceableFilter*)_upb_Message_New(&envoy_config_accesslog_v3_TraceableFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_TraceableFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_TraceableFilter* ret = envoy_config_accesslog_v3_TraceableFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -750,7 +852,7 @@ UPB_INLINE envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_ int options, upb_Arena* arena) { envoy_config_accesslog_v3_TraceableFilter* ret = envoy_config_accesslog_v3_TraceableFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -758,13 +860,13 @@ UPB_INLINE envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_ } UPB_INLINE char* envoy_config_accesslog_v3_TraceableFilter_serialize(const envoy_config_accesslog_v3_TraceableFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msg_init, options, arena, &ptr, len); return ptr; } @@ -772,12 +874,12 @@ UPB_INLINE char* envoy_config_accesslog_v3_TraceableFilter_serialize_ex(const en /* envoy.config.accesslog.v3.RuntimeFilter */ UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_RuntimeFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_RuntimeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_RuntimeFilter_msginit, arena); + return (envoy_config_accesslog_v3_RuntimeFilter*)_upb_Message_New(&envoy_config_accesslog_v3_RuntimeFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_RuntimeFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_RuntimeFilter* ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -787,7 +889,7 @@ UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_Ru int options, upb_Arena* arena) { envoy_config_accesslog_v3_RuntimeFilter* ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -795,66 +897,83 @@ UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_Ru } UPB_INLINE char* envoy_config_accesslog_v3_RuntimeFilter_serialize(const envoy_config_accesslog_v3_RuntimeFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msg_init, 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); +UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_runtime_key(envoy_config_accesslog_v3_RuntimeFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_accesslog_v3_RuntimeFilter_runtime_key(const envoy_config_accesslog_v3_RuntimeFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_has_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_accesslog_v3_RuntimeFilter_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_use_independent_randomness(const envoy_config_accesslog_v3_RuntimeFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_has_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_use_independent_randomness(envoy_config_accesslog_v3_RuntimeFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_use_independent_randomness(const envoy_config_accesslog_v3_RuntimeFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_runtime_key(envoy_config_accesslog_v3_RuntimeFilter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_accesslog_v3_RuntimeFilter_mutable_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_accesslog_v3_RuntimeFilter_percent_sampled(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_use_independent_randomness(envoy_config_accesslog_v3_RuntimeFilter *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.accesslog.v3.AndFilter */ UPB_INLINE envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AndFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_AndFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AndFilter_msginit, arena); + return (envoy_config_accesslog_v3_AndFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AndFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AndFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_AndFilter* ret = envoy_config_accesslog_v3_AndFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -864,7 +983,7 @@ UPB_INLINE envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AndFil int options, upb_Arena* arena) { envoy_config_accesslog_v3_AndFilter* ret = envoy_config_accesslog_v3_AndFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -872,47 +991,72 @@ UPB_INLINE envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AndFil } UPB_INLINE char* envoy_config_accesslog_v3_AndFilter_serialize(const envoy_config_accesslog_v3_AndFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_accesslog_v3_AndFilter_clear_filters(envoy_config_accesslog_v3_AndFilter* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_AndFilter_filters(const envoy_config_accesslog_v3_AndFilter* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_accesslog_v3_AndFilter_has_filters(const envoy_config_accesslog_v3_AndFilter* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_accesslog_v3_AndFilter_clear_filters(const envoy_config_accesslog_v3_AndFilter* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_AndFilter_filters(const envoy_config_accesslog_v3_AndFilter* msg, size_t* len) { - return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_accesslog_v3_AndFilter_filters(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_mutable_filters(envoy_config_accesslog_v3_AndFilter* msg, size_t* len) { - return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_mutable_filters(envoy_config_accesslog_v3_AndFilter* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_resize_filters(envoy_config_accesslog_v3_AndFilter* msg, size_t len, upb_Arena* arena) { - return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_resize_filters(envoy_config_accesslog_v3_AndFilter* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_accesslog_v3_AccessLogFilter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AndFilter_add_filters(envoy_config_accesslog_v3_AndFilter* msg, upb_Arena* arena) { - struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.accesslog.v3.OrFilter */ UPB_INLINE envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_OrFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_OrFilter*)_upb_Message_New(&envoy_config_accesslog_v3_OrFilter_msginit, arena); + return (envoy_config_accesslog_v3_OrFilter*)_upb_Message_New(&envoy_config_accesslog_v3_OrFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_OrFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_OrFilter* ret = envoy_config_accesslog_v3_OrFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -922,7 +1066,7 @@ UPB_INLINE envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_OrFilte int options, upb_Arena* arena) { envoy_config_accesslog_v3_OrFilter* ret = envoy_config_accesslog_v3_OrFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -930,47 +1074,72 @@ UPB_INLINE envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_OrFilte } UPB_INLINE char* envoy_config_accesslog_v3_OrFilter_serialize(const envoy_config_accesslog_v3_OrFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_accesslog_v3_OrFilter_clear_filters(envoy_config_accesslog_v3_OrFilter* msg) { + const upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_OrFilter_filters(const envoy_config_accesslog_v3_OrFilter* msg, size_t* size) { + const upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_accesslog_v3_OrFilter_has_filters(const envoy_config_accesslog_v3_OrFilter* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_accesslog_v3_OrFilter_clear_filters(const envoy_config_accesslog_v3_OrFilter* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_OrFilter_filters(const envoy_config_accesslog_v3_OrFilter* msg, size_t* len) { - return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_accesslog_v3_OrFilter_filters(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_mutable_filters(envoy_config_accesslog_v3_OrFilter* msg, size_t* len) { - return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_mutable_filters(envoy_config_accesslog_v3_OrFilter* msg, size_t* size) { + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_resize_filters(envoy_config_accesslog_v3_OrFilter* msg, size_t len, upb_Arena* arena) { - return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_resize_filters(envoy_config_accesslog_v3_OrFilter* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_accesslog_v3_AccessLogFilter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_OrFilter_add_filters(envoy_config_accesslog_v3_OrFilter* msg, upb_Arena* arena) { - struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.accesslog.v3.HeaderFilter */ UPB_INLINE envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_HeaderFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_HeaderFilter*)_upb_Message_New(&envoy_config_accesslog_v3_HeaderFilter_msginit, arena); + return (envoy_config_accesslog_v3_HeaderFilter*)_upb_Message_New(&envoy_config_accesslog_v3_HeaderFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_HeaderFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_HeaderFilter* ret = envoy_config_accesslog_v3_HeaderFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -980,7 +1149,7 @@ UPB_INLINE envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_Hea int options, upb_Arena* arena) { envoy_config_accesslog_v3_HeaderFilter* ret = envoy_config_accesslog_v3_HeaderFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -988,35 +1157,40 @@ UPB_INLINE envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_Hea } UPB_INLINE char* envoy_config_accesslog_v3_HeaderFilter_serialize(const envoy_config_accesslog_v3_HeaderFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msg_init, 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); -} -UPB_INLINE void envoy_config_accesslog_v3_HeaderFilter_clear_header(const envoy_config_accesslog_v3_HeaderFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_HeaderFilter_clear_header(envoy_config_accesslog_v3_HeaderFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3_HeaderFilter_header(const envoy_config_accesslog_v3_HeaderFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_route_v3_HeaderMatcher*); + const struct envoy_config_route_v3_HeaderMatcher* default_val = NULL; + const struct envoy_config_route_v3_HeaderMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_HeaderFilter_has_header(const envoy_config_accesslog_v3_HeaderFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_HeaderFilter_set_header(envoy_config_accesslog_v3_HeaderFilter *msg, struct envoy_config_route_v3_HeaderMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_route_v3_HeaderMatcher*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3_HeaderFilter_mutable_header(envoy_config_accesslog_v3_HeaderFilter* msg, upb_Arena* arena) { struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_accesslog_v3_HeaderFilter_header(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_HeaderFilter_set_header(msg, sub); + sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (sub) envoy_config_accesslog_v3_HeaderFilter_set_header(msg, sub); } return sub; } @@ -1024,12 +1198,12 @@ UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3 /* envoy.config.accesslog.v3.ResponseFlagFilter */ UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_ResponseFlagFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena); + return (envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_ResponseFlagFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_ResponseFlagFilter* ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1039,7 +1213,7 @@ UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_ int options, upb_Arena* arena) { envoy_config_accesslog_v3_ResponseFlagFilter* ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1047,41 +1221,70 @@ UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_ } UPB_INLINE char* envoy_config_accesslog_v3_ResponseFlagFilter_serialize(const envoy_config_accesslog_v3_ResponseFlagFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msg_init, 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)); +UPB_INLINE void envoy_config_accesslog_v3_ResponseFlagFilter_clear_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_accesslog_v3_ResponseFlagFilter_flags(const envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView const* envoy_config_accesslog_v3_ResponseFlagFilter_flags(const envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_accesslog_v3_ResponseFlagFilter_has_flags(const envoy_config_accesslog_v3_ResponseFlagFilter* msg) { + size_t size; + envoy_config_accesslog_v3_ResponseFlagFilter_flags(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView* envoy_config_accesslog_v3_ResponseFlagFilter_mutable_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView* envoy_config_accesslog_v3_ResponseFlagFilter_mutable_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_accesslog_v3_ResponseFlagFilter_resize_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_accesslog_v3_ResponseFlagFilter_resize_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_accesslog_v3_ResponseFlagFilter_add_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.accesslog.v3.GrpcStatusFilter */ UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_GrpcStatusFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_Message_New(&envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena); + return (envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_Message_New(&envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_GrpcStatusFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_GrpcStatusFilter* ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1091,7 +1294,7 @@ UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3 int options, upb_Arena* arena) { envoy_config_accesslog_v3_GrpcStatusFilter* ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1099,50 +1302,85 @@ UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3 } UPB_INLINE char* envoy_config_accesslog_v3_GrpcStatusFilter_serialize(const envoy_config_accesslog_v3_GrpcStatusFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msg_init, 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)); +UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_clear_statuses(envoy_config_accesslog_v3_GrpcStatusFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* envoy_config_accesslog_v3_GrpcStatusFilter_statuses(const envoy_config_accesslog_v3_GrpcStatusFilter* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int32_t const* envoy_config_accesslog_v3_GrpcStatusFilter_statuses(const envoy_config_accesslog_v3_GrpcStatusFilter* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_clear_exclude(const envoy_config_accesslog_v3_GrpcStatusFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_has_statuses(const envoy_config_accesslog_v3_GrpcStatusFilter* msg) { + size_t size; + envoy_config_accesslog_v3_GrpcStatusFilter_statuses(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_clear_exclude(envoy_config_accesslog_v3_GrpcStatusFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_exclude(const envoy_config_accesslog_v3_GrpcStatusFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_mutable_statuses(envoy_config_accesslog_v3_GrpcStatusFilter* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_mutable_statuses(envoy_config_accesslog_v3_GrpcStatusFilter* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_resize_statuses(envoy_config_accesslog_v3_GrpcStatusFilter* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 2, arena); +UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_resize_statuses(envoy_config_accesslog_v3_GrpcStatusFilter* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_add_statuses(envoy_config_accesslog_v3_GrpcStatusFilter* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 2, &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_set_exclude(envoy_config_accesslog_v3_GrpcStatusFilter *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.accesslog.v3.MetadataFilter */ UPB_INLINE envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_MetadataFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_MetadataFilter*)_upb_Message_New(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena); + return (envoy_config_accesslog_v3_MetadataFilter*)_upb_Message_New(&envoy_config_accesslog_v3_MetadataFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_MetadataFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_MetadataFilter* ret = envoy_config_accesslog_v3_MetadataFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1152,7 +1390,7 @@ UPB_INLINE envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_M int options, upb_Arena* arena) { envoy_config_accesslog_v3_MetadataFilter* ret = envoy_config_accesslog_v3_MetadataFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1160,57 +1398,67 @@ UPB_INLINE envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_M } UPB_INLINE char* envoy_config_accesslog_v3_MetadataFilter_serialize(const envoy_config_accesslog_v3_MetadataFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msg_init, 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); -} -UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_clear_matcher(const envoy_config_accesslog_v3_MetadataFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_clear_matcher(envoy_config_accesslog_v3_MetadataFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_accesslog_v3_MetadataFilter_matcher(const envoy_config_accesslog_v3_MetadataFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_MetadataMatcher*); + const struct envoy_type_matcher_v3_MetadataMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_MetadataMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_matcher(const envoy_config_accesslog_v3_MetadataFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_clear_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_clear_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataFilter_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_matcher(envoy_config_accesslog_v3_MetadataFilter *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_MetadataMatcher*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_accesslog_v3_MetadataFilter_mutable_matcher(envoy_config_accesslog_v3_MetadataFilter* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_accesslog_v3_MetadataFilter_matcher(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_MetadataFilter_set_matcher(msg, sub); + sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msg_init, arena); + if (sub) envoy_config_accesslog_v3_MetadataFilter_set_matcher(msg, sub); } return sub; } UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataFilter_mutable_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_accesslog_v3_MetadataFilter_match_if_key_not_found(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(msg, sub); } return sub; } @@ -1218,12 +1466,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataF /* envoy.config.accesslog.v3.ExtensionFilter */ UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_ExtensionFilter_new(upb_Arena* arena) { - return (envoy_config_accesslog_v3_ExtensionFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ExtensionFilter_msginit, arena); + return (envoy_config_accesslog_v3_ExtensionFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ExtensionFilter_msg_init, arena); } UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_ExtensionFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_accesslog_v3_ExtensionFilter* ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1233,7 +1481,7 @@ UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_ int options, upb_Arena* arena) { envoy_config_accesslog_v3_ExtensionFilter* ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1241,13 +1489,13 @@ UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_ } UPB_INLINE char* envoy_config_accesslog_v3_ExtensionFilter_serialize(const envoy_config_accesslog_v3_ExtensionFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1255,46 +1503,59 @@ typedef enum { envoy_config_accesslog_v3_ExtensionFilter_config_type_NOT_SET = 0 } envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases; UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases envoy_config_accesslog_v3_ExtensionFilter_config_type_case(const envoy_config_accesslog_v3_ExtensionFilter* msg) { - return (envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_clear_name(const envoy_config_accesslog_v3_ExtensionFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_clear_name(envoy_config_accesslog_v3_ExtensionFilter* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_accesslog_v3_ExtensionFilter_name(const envoy_config_accesslog_v3_ExtensionFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_accesslog_v3_ExtensionFilter_has_typed_config(const envoy_config_accesslog_v3_ExtensionFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_clear_typed_config(const envoy_config_accesslog_v3_ExtensionFilter* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_ExtensionFilter_config_type_NOT_SET); +UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_clear_typed_config(envoy_config_accesslog_v3_ExtensionFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_typed_config(const envoy_config_accesslog_v3_ExtensionFilter* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_accesslog_v3_ExtensionFilter_has_typed_config(const envoy_config_accesslog_v3_ExtensionFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_set_name(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(envoy_config_accesslog_v3_ExtensionFilter *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_mutable_typed_config(envoy_config_accesslog_v3_ExtensionFilter* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_accesslog_v3_ExtensionFilter_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_accesslog_v3_accesslog_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_accesslog_v3_accesslog_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_ */ 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 d09a3d2f381..a9099374a71 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/bootstrap/v3/bootstrap.upb.h" #include "envoy/config/accesslog/v3/accesslog.upb.h" #include "envoy/config/cluster/v3/cluster.upb.h" @@ -34,379 +36,530 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_submsgs[27] = { - {.submsg = &envoy_config_core_v3_Node_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit}, - {.submsg = &envoy_config_bootstrap_v3_ClusterManager_msginit}, - {.submsg = &envoy_config_metrics_v3_StatsSink_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit}, - {.submsg = &envoy_config_trace_v3_Tracing_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Admin_msginit}, - {.submsg = &envoy_config_metrics_v3_StatsConfig_msginit}, - {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit}, - {.submsg = &envoy_config_overload_v3_OverloadManager_msginit}, - {.submsg = &envoy_config_bootstrap_v3_LayeredRuntime_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Watchdogs_msginit}, - {.submsg = &envoy_config_bootstrap_v3_FatalAction_msginit}, - {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_bootstrap_v3_CustomInlineHeader_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Bootstrap_submsgs[27] = { + {.submsg = &envoy_config_core_v3_Node_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_ClusterManager_msg_init}, + {.submsg = &envoy_config_metrics_v3_StatsSink_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Watchdog_msg_init}, + {.submsg = &envoy_config_trace_v3_Tracing_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Admin_msg_init}, + {.submsg = &envoy_config_metrics_v3_StatsConfig_msg_init}, + {.submsg = &envoy_config_core_v3_ApiConfigSource_msg_init}, + {.submsg = &envoy_config_overload_v3_OverloadManager_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_LayeredRuntime_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Watchdogs_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_FatalAction_msg_init}, + {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_CustomInlineHeader_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap__fields[35] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 72), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(44, 80), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(48, 88), UPB_SIZE(7, 7), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(52, 96), UPB_SIZE(8, 8), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(56, 104), UPB_SIZE(9, 9), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(60, 112), UPB_SIZE(10, 10), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(64, 120), UPB_SIZE(11, 11), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(68, 128), UPB_SIZE(12, 12), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(72, 136), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(80, 152), UPB_SIZE(13, 13), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(5, 5), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(84, 160), UPB_SIZE(0, 0), 14, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(88, 168), UPB_SIZE(0, 0), 15, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(92, 176), UPB_SIZE(14, 14), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(96, 184), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(104, 200), UPB_SIZE(0, 0), 17, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(108, 208), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {27, UPB_SIZE(112, 216), UPB_SIZE(15, 15), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {28, UPB_SIZE(116, 224), UPB_SIZE(0, 0), 19, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {29, UPB_SIZE(3, 3), UPB_SIZE(-9, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {30, UPB_SIZE(120, 232), UPB_SIZE(16, 16), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(124, 240), UPB_SIZE(17, 17), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {32, UPB_SIZE(128, 248), UPB_SIZE(0, 0), 22, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {33, UPB_SIZE(132, 256), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {34, UPB_SIZE(140, 272), UPB_SIZE(18, 18), 23, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {35, UPB_SIZE(144, 280), UPB_SIZE(19, 19), 24, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(148, 288), UPB_SIZE(20, 20), 25, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(152, 296), UPB_SIZE(21, 21), 26, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Bootstrap__fields[35] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(128, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 64), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 88), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(36, 96), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(40, 104), 9, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(44, 112), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(48, 120), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(52, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(56, 128), 12, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, 136, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(60, 152), 13, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(64, 5), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(68, 160), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(72, 168), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(76, 176), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(144, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(84, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {27, UPB_SIZE(88, 216), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {28, UPB_SIZE(92, 224), 0, 19, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {29, 3, UPB_SIZE(-97, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {30, UPB_SIZE(100, 232), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {31, UPB_SIZE(104, 240), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {32, UPB_SIZE(108, 248), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {33, UPB_SIZE(152, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(112, 272), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {35, UPB_SIZE(116, 280), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(120, 288), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(124, 296), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msg_init = { &envoy_config_bootstrap_v3_Bootstrap_submsgs[0], &envoy_config_bootstrap_v3_Bootstrap__fields[0], - UPB_SIZE(160, 304), 35, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(160, 304), 35, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x0018000002010012, &upb_psm_1bt_max64b}, + {0x002000000302001a, &upb_psm_1bt_max128b}, + {0x0028000004030022, &upb_psm_1bt_max64b}, + {0x003000003f00002a, &upb_pss_1bt}, + {0x004000003f040032, &upb_prm_1bt_maxmaxb}, + {0x004800000505003a, &upb_psm_1bt_maxmaxb}, + {0x0050000006060042, &upb_psm_1bt_max128b}, + {0x005800000707004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0060000008080062, &upb_psm_1bt_max128b}, + {0x006800000909006a, &upb_psm_1bt_maxmaxb}, + {0x007000000a0a0072, &upb_psm_1bt_maxmaxb}, + {0x007800000b0b007a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000180, &upb_psb1_2bt}, + {0x008000000c0c018a, &upb_psm_2bt_max64b}, + {0x008800003f000192, &upb_pss_2bt}, + {0x009800000d0d019a, &upb_psm_2bt_maxmaxb}, + {0x000500003f0001a0, &upb_psb1_2bt}, + {0x00a000003f0e01aa, &upb_prm_2bt_maxmaxb}, + {0x00a800003f0f01b2, &upb_prm_2bt_maxmaxb}, + {0x00b000000e1001ba, &upb_psm_2bt_maxmaxb}, + {0x00b800003f0001c2, &upb_pss_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x00d000003f0001d2, &upb_prs_2bt}, + {0x00d800000f1201da, &upb_psm_2bt_max64b}, + {0x00e000003f1301e2, &upb_prm_2bt_max64b}, + {0x000300081d0001e8, &upb_pob1_2bt}, + {0x00e80000101401f2, &upb_psm_2bt_maxmaxb}, + {0x00f00000111501fa, &upb_psm_2bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = { - {.submsg = &envoy_config_listener_v3_Listener_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_Secret_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = { + {.submsg = &envoy_config_listener_v3_Listener_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_Secret_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[3] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init = { &envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[0], &envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + {0x000800003f010012, &upb_prm_1bt_maxmaxb}, + {0x001000003f02001a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[3] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[3] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &envoy_config_core_v3_ApiConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[5] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init = { &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[0], &envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[0], - UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f00002a, &upb_pss_1bt}, + {0x003000003f000032, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msg_init = { &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[0], &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Admin_submsgs[3] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_core_v3_SocketOption_msginit}, - {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Admin_submsgs[3] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_core_v3_SocketOption_msg_init}, + {.submsg = &envoy_config_accesslog_v3_AccessLog_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Admin__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Admin__fields[6] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Admin_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Admin_msg_init = { &envoy_config_bootstrap_v3_Admin_submsgs[0], &envoy_config_bootstrap_v3_Admin__fields[0], - UPB_SIZE(32, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800000100001a, &upb_psm_1bt_maxmaxb}, + {0x003000003f010022, &upb_prm_1bt_maxmaxb}, + {0x003800003f02002a, &upb_prm_1bt_maxmaxb}, + {0x000100003f000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = { - {.submsg = &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit}, - {.submsg = &envoy_config_core_v3_BindConfig_msginit}, - {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = { + {.submsg = &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init}, + {.submsg = &envoy_config_core_v3_BindConfig_msg_init}, + {.submsg = &envoy_config_core_v3_ApiConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_ClusterManager__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_ClusterManager__fields[4] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_msg_init = { &envoy_config_bootstrap_v3_ClusterManager_submsgs[0], &envoy_config_bootstrap_v3_ClusterManager__fields[0], - UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = { - {.submsg = &envoy_config_core_v3_EventServiceConfig_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = { + {.submsg = &envoy_config_core_v3_EventServiceConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init = { &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[0], &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdogs_submsgs[2] = { - {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Watchdogs_submsgs[2] = { + {.submsg = &envoy_config_bootstrap_v3_Watchdog_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Watchdog_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdogs__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Watchdogs__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Watchdogs_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Watchdogs_msg_init = { &envoy_config_bootstrap_v3_Watchdogs_submsgs[0], &envoy_config_bootstrap_v3_Watchdogs__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + {0x0010000002010012, &upb_psm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdog_submsgs[7] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Watchdog_submsgs[7] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdog__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Watchdog__fields[7] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_msg_init = { &envoy_config_bootstrap_v3_Watchdog_submsgs[0], &envoy_config_bootstrap_v3_Watchdog__fields[0], - UPB_SIZE(32, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(32, 64), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800000504002a, &upb_psm_1bt_maxmaxb}, + {0x0030000006050032, &upb_psm_1bt_maxmaxb}, + {0x003800003f06003a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[2] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init = { &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[0], &envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_FatalAction_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_FatalAction_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_FatalAction__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_FatalAction__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_FatalAction_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_FatalAction_msg_init = { &envoy_config_bootstrap_v3_FatalAction_submsgs[0], &envoy_config_bootstrap_v3_FatalAction__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Runtime_submsgs[1] = { - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_Runtime_submsgs[1] = { + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_Runtime__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_Runtime__fields[4] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_Runtime_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_Runtime_msg_init = { &envoy_config_bootstrap_v3_Runtime_submsgs[0], &envoy_config_bootstrap_v3_Runtime__fields[0], - UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_pss_1bt}, + {0x0038000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = { - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit}, - {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit}, - {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = { + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init}, + {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_RuntimeLayer__fields[5] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_msg_init = { &envoy_config_bootstrap_v3_RuntimeLayer_submsgs[0], &envoy_config_bootstrap_v3_RuntimeLayer__fields[0], - UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_maxmaxb}, + {0x001800000301001a, &upb_pom_1bt_max64b}, + {0x0018000004020022, &upb_pom_1bt_max64b}, + {0x001800000503002a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[3] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init = { NULL, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psb1_1bt}, + {0x001800003f00001a, &upb_pss_1bt}, + }) }; -const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init = { &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[0], &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = { - {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_msginit}, +static const upb_MiniTableSub envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = { + {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_msg_init}, }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_LayeredRuntime__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_LayeredRuntime__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_LayeredRuntime_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_LayeredRuntime_msg_init = { &envoy_config_bootstrap_v3_LayeredRuntime_submsgs[0], &envoy_config_bootstrap_v3_LayeredRuntime__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field envoy_config_bootstrap_v3_CustomInlineHeader__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_bootstrap_v3_CustomInlineHeader__fields[2] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_bootstrap_v3_CustomInlineHeader_msginit = { +const upb_MiniTable envoy_config_bootstrap_v3_CustomInlineHeader_msg_init = { NULL, &envoy_config_bootstrap_v3_CustomInlineHeader__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[18] = { - &envoy_config_bootstrap_v3_Bootstrap_msginit, - &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, - &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, - &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit, - &envoy_config_bootstrap_v3_Admin_msginit, - &envoy_config_bootstrap_v3_ClusterManager_msginit, - &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, - &envoy_config_bootstrap_v3_Watchdogs_msginit, - &envoy_config_bootstrap_v3_Watchdog_msginit, - &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, - &envoy_config_bootstrap_v3_FatalAction_msginit, - &envoy_config_bootstrap_v3_Runtime_msginit, - &envoy_config_bootstrap_v3_RuntimeLayer_msginit, - &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, - &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, - &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, - &envoy_config_bootstrap_v3_LayeredRuntime_msginit, - &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, + &envoy_config_bootstrap_v3_Bootstrap_msg_init, + &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, + &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, + &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msg_init, + &envoy_config_bootstrap_v3_Admin_msg_init, + &envoy_config_bootstrap_v3_ClusterManager_msg_init, + &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, + &envoy_config_bootstrap_v3_Watchdogs_msg_init, + &envoy_config_bootstrap_v3_Watchdog_msg_init, + &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, + &envoy_config_bootstrap_v3_FatalAction_msg_init, + &envoy_config_bootstrap_v3_Runtime_msg_init, + &envoy_config_bootstrap_v3_RuntimeLayer_msg_init, + &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, + &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, + &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, + &envoy_config_bootstrap_v3_LayeredRuntime_msg_init, + &envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, }; -const upb_MiniTable_File envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -415,5 +568,5 @@ const upb_MiniTable_File envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layo 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d37937a68b6..11240ef4e7e 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 @@ -9,35 +9,22 @@ #ifndef ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_ #define ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_bootstrap_v3_Bootstrap; -struct envoy_config_bootstrap_v3_Bootstrap_StaticResources; -struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources; -struct envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry; -struct envoy_config_bootstrap_v3_Admin; -struct envoy_config_bootstrap_v3_ClusterManager; -struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection; -struct envoy_config_bootstrap_v3_Watchdogs; -struct envoy_config_bootstrap_v3_Watchdog; -struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction; -struct envoy_config_bootstrap_v3_FatalAction; -struct envoy_config_bootstrap_v3_Runtime; -struct envoy_config_bootstrap_v3_RuntimeLayer; -struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer; -struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer; -struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer; -struct envoy_config_bootstrap_v3_LayeredRuntime; -struct envoy_config_bootstrap_v3_CustomInlineHeader; typedef struct envoy_config_bootstrap_v3_Bootstrap envoy_config_bootstrap_v3_Bootstrap; typedef struct envoy_config_bootstrap_v3_Bootstrap_StaticResources envoy_config_bootstrap_v3_Bootstrap_StaticResources; typedef struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources envoy_config_bootstrap_v3_Bootstrap_DynamicResources; @@ -56,24 +43,24 @@ typedef struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer envoy_config_bo typedef struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer; typedef struct envoy_config_bootstrap_v3_LayeredRuntime envoy_config_bootstrap_v3_LayeredRuntime; typedef struct envoy_config_bootstrap_v3_CustomInlineHeader envoy_config_bootstrap_v3_CustomInlineHeader; -extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Admin_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdogs_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_FatalAction_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_Runtime_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_LayeredRuntime_msginit; -extern const upb_MiniTable envoy_config_bootstrap_v3_CustomInlineHeader_msginit; +extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Admin_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdogs_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_FatalAction_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_Runtime_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_LayeredRuntime_msg_init; +extern const upb_MiniTable envoy_config_bootstrap_v3_CustomInlineHeader_msg_init; struct envoy_config_accesslog_v3_AccessLog; struct envoy_config_cluster_v3_Cluster; struct envoy_config_core_v3_Address; @@ -95,27 +82,27 @@ struct envoy_type_v3_Percent; struct google_protobuf_Duration; struct google_protobuf_Struct; struct google_protobuf_UInt64Value; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_BindConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_Node_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_listener_v3_Listener_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_StatsSink_msginit; -extern const upb_MiniTable envoy_config_overload_v3_OverloadManager_msginit; -extern const upb_MiniTable envoy_config_trace_v3_Tracing_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_BindConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Node_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_Listener_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_StatsSink_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_OverloadManager_msg_init; +extern const upb_MiniTable envoy_config_trace_v3_Tracing_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; typedef enum { envoy_config_bootstrap_v3_CustomInlineHeader_REQUEST_HEADER = 0, @@ -137,12 +124,12 @@ typedef enum { /* envoy.config.bootstrap.v3.Bootstrap */ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootstrap_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Bootstrap*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_msginit, arena); + return (envoy_config_bootstrap_v3_Bootstrap*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootstrap_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Bootstrap* ret = envoy_config_bootstrap_v3_Bootstrap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -152,7 +139,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootst int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Bootstrap* ret = envoy_config_bootstrap_v3_Bootstrap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -160,13 +147,13 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootst } UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_serialize(const envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -174,679 +161,1005 @@ typedef enum { envoy_config_bootstrap_v3_Bootstrap_stats_flush_NOT_SET = 0 } envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases; UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases envoy_config_bootstrap_v3_Bootstrap_stats_flush_case(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return (envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + const upb_MiniTableField field = {29, 3, UPB_SIZE(-97, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_node(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_node(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_node(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_node(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_node(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_static_resources(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_config_bootstrap_v3_Bootstrap_StaticResources*); + const envoy_config_bootstrap_v3_Bootstrap_StaticResources* default_val = NULL; + const envoy_config_bootstrap_v3_Bootstrap_StaticResources* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_config_bootstrap_v3_Bootstrap_DynamicResources*); + const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* default_val = NULL; + const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_cluster_manager(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_bootstrap_v3_ClusterManager*); + const envoy_config_bootstrap_v3_ClusterManager* default_val = NULL; + const envoy_config_bootstrap_v3_ClusterManager* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_flags_path(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_flags_path(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(128, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_flags_path(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(128, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_metrics_v3_StatsSink* const* envoy_config_bootstrap_v3_Bootstrap_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_metrics_v3_StatsSink* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_stats_sinks(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 64)); -} -UPB_INLINE const struct envoy_config_metrics_v3_StatsSink* const* envoy_config_bootstrap_v3_Bootstrap_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (const struct envoy_config_metrics_v3_StatsSink* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); -} -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_watchdog(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const envoy_config_bootstrap_v3_Watchdog*); + const envoy_config_bootstrap_v3_Watchdog* default_val = NULL; + const envoy_config_bootstrap_v3_Watchdog* ret; + const upb_MiniTableField field = {8, UPB_SIZE(28, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_tracing(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 88), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct envoy_config_trace_v3_Tracing*); + const struct envoy_config_trace_v3_Tracing* default_val = NULL; + const struct envoy_config_trace_v3_Tracing* ret; + const upb_MiniTableField field = {9, UPB_SIZE(32, 88), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 88), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_admin(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(36, 96), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const envoy_config_bootstrap_v3_Admin*); + const envoy_config_bootstrap_v3_Admin* default_val = NULL; + const envoy_config_bootstrap_v3_Admin* ret; + const upb_MiniTableField field = {12, UPB_SIZE(36, 96), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(36, 96), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_config(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(40, 104), 9, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct envoy_config_metrics_v3_StatsConfig*); + const struct envoy_config_metrics_v3_StatsConfig* default_val = NULL; + const struct envoy_config_metrics_v3_StatsConfig* ret; + const upb_MiniTableField field = {13, UPB_SIZE(40, 104), 9, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(40, 104), 9, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_hds_config(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(44, 112), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const struct envoy_config_core_v3_ApiConfigSource*); + const struct envoy_config_core_v3_ApiConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ApiConfigSource* ret; + const upb_MiniTableField field = {14, UPB_SIZE(44, 112), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(44, 112), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_overload_manager(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(48, 120), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const struct envoy_config_overload_v3_OverloadManager*); + const struct envoy_config_overload_v3_OverloadManager* default_val = NULL; + const struct envoy_config_overload_v3_OverloadManager* ret; + const upb_MiniTableField field = {15, UPB_SIZE(48, 120), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(48, 120), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_enable_dispatcher_stats(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(52, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, UPB_SIZE(52, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 12); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_layered_runtime(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(56, 128), 12, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const envoy_config_bootstrap_v3_LayeredRuntime*); + const envoy_config_bootstrap_v3_LayeredRuntime* default_val = NULL; + const envoy_config_bootstrap_v3_LayeredRuntime* ret; + const upb_MiniTableField field = {17, UPB_SIZE(56, 128), 12, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_header_prefix(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(56, 128), 12, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_header_prefix(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {18, 136, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_header_prefix(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 136), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {18, 136, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 13); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 152), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(60, 152), 13, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 152), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {19, UPB_SIZE(60, 152), 13, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(5, 5), bool) = 0; +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(60, 152), 13, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_use_tcp_for_dns_lookups(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(64, 5), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(5, 5), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {20, UPB_SIZE(64, 5), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(68, 160), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + const upb_MiniTableField field = {21, UPB_SIZE(68, 160), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 160)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(84, 160)); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(72, 168), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(84, 160), len); +UPB_INLINE const struct envoy_config_core_v3_ConfigSource* const* envoy_config_bootstrap_v3_Bootstrap_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + const upb_MiniTableField field = {22, UPB_SIZE(72, 168), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_ConfigSource* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 168)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_config_sources(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(88, 168)); -} -UPB_INLINE const struct envoy_config_core_v3_ConfigSource* const* envoy_config_bootstrap_v3_Bootstrap_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (const struct envoy_config_core_v3_ConfigSource* const*)_upb_array_accessor(msg, UPB_SIZE(88, 168), len); -} -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 14); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(92, 176), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_config_source(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(76, 176), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(92, 176), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {23, UPB_SIZE(76, 176), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 184), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(76, 176), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_socket_interface(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(144, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(96, 184), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {24, UPB_SIZE(144, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 200)); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(104, 200)); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_certificate_provider_instances(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_size(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(104, 200)); + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_get(const envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView key, struct envoy_config_core_v3_TypedExtensionConfig** val) { - return _upb_msg_map_get(msg, UPB_SIZE(104, 200), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_next(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* iter) { - return (const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(104, 200), iter); + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_map_next(map, iter); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_node_context_params(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(108, 208)); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap* msg) { + return envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_size(msg) != 0; } -UPB_INLINE upb_StringView const* envoy_config_bootstrap_v3_Bootstrap_node_context_params(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(108, 208), len); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(84, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 15); +UPB_INLINE upb_StringView const* envoy_config_bootstrap_v3_Bootstrap_node_context_params(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + const upb_MiniTableField field = {26, UPB_SIZE(84, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(112, 216), const upb_Message*) = NULL; +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_node_context_params(const envoy_config_bootstrap_v3_Bootstrap* msg) { + size_t size; + envoy_config_bootstrap_v3_Bootstrap_node_context_params(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_watchdogs(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(88, 216), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(112, 216), const envoy_config_bootstrap_v3_Watchdogs*); + const envoy_config_bootstrap_v3_Watchdogs* default_val = NULL; + const envoy_config_bootstrap_v3_Watchdogs* ret; + const upb_MiniTableField field = {27, UPB_SIZE(88, 216), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(88, 216), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(92, 224), 0, 19, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_bootstrap_v3_FatalAction* const* envoy_config_bootstrap_v3_Bootstrap_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + const upb_MiniTableField field = {28, UPB_SIZE(92, 224), 0, 19, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_bootstrap_v3_FatalAction* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 224)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_fatal_actions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(116, 224)); -} -UPB_INLINE const envoy_config_bootstrap_v3_FatalAction* const* envoy_config_bootstrap_v3_Bootstrap_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (const envoy_config_bootstrap_v3_FatalAction* const*)_upb_array_accessor(msg, UPB_SIZE(116, 224), len); -} -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 29; -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(3, 3), 0, UPB_SIZE(8, 8), envoy_config_bootstrap_v3_Bootstrap_stats_flush_NOT_SET); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_flush_on_admin(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {29, 3, UPB_SIZE(-97, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(3, 3), UPB_SIZE(8, 8), 29, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {29, 3, UPB_SIZE(-97, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 16); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {29, 3, UPB_SIZE(-97, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(120, 232), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(100, 232), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_bootstrap_v3_Bootstrap_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(120, 232), const struct envoy_config_core_v3_DnsResolutionConfig*); + const struct envoy_config_core_v3_DnsResolutionConfig* default_val = NULL; + const struct envoy_config_core_v3_DnsResolutionConfig* ret; + const upb_MiniTableField field = {30, UPB_SIZE(100, 232), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 17); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(100, 232), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(124, 240), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(104, 240), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(124, 240), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {31, UPB_SIZE(104, 240), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(104, 240), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(108, 248), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_bootstrap_v3_CustomInlineHeader* const* envoy_config_bootstrap_v3_Bootstrap_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + const upb_MiniTableField field = {32, UPB_SIZE(108, 248), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_bootstrap_v3_CustomInlineHeader* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 248)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_inline_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg) { - _upb_array_detach(msg, UPB_SIZE(128, 248)); -} -UPB_INLINE const envoy_config_bootstrap_v3_CustomInlineHeader* const* envoy_config_bootstrap_v3_Bootstrap_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (const envoy_config_bootstrap_v3_CustomInlineHeader* const*)_upb_array_accessor(msg, UPB_SIZE(128, 248), len); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_perf_tracing_file_path(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(132, 256), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_perf_tracing_file_path(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(152, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_perf_tracing_file_path(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(132, 256), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {33, UPB_SIZE(152, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_regex_engine(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 18); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_regex_engine(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(140, 272), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_regex_engine(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(112, 272), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_default_regex_engine(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(140, 272), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {34, UPB_SIZE(112, 272), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_xds_delegate_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 19); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_regex_engine(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(112, 272), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_xds_delegate_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(144, 280), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_xds_delegate_extension(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(116, 280), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_xds_delegate_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(144, 280), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {35, UPB_SIZE(116, 280), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_xds_config_tracker_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 20); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_xds_delegate_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(116, 280), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_xds_config_tracker_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(148, 288), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_xds_config_tracker_extension(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(120, 288), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_xds_config_tracker_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(148, 288), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {36, UPB_SIZE(120, 288), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_listener_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return _upb_hasbit(msg, 21); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_xds_config_tracker_extension(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(120, 288), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_listener_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(152, 296), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_listener_manager(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(124, 296), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_listener_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(152, 296), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {37, UPB_SIZE(124, 296), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_listener_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(124, 296), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_node(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_mutable_node(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_config_bootstrap_v3_Bootstrap_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_node(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_static_resources(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Bootstrap_StaticResources* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_config_bootstrap_v3_Bootstrap_StaticResources*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_mutable_static_resources(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)envoy_config_bootstrap_v3_Bootstrap_static_resources(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_static_resources(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_static_resources(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Bootstrap_DynamicResources* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_bootstrap_v3_Bootstrap_DynamicResources*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_mutable_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_dynamic_resources(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_dynamic_resources(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_cluster_manager(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_ClusterManager* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_bootstrap_v3_ClusterManager*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_mutable_cluster_manager(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_ClusterManager* sub = (struct envoy_config_bootstrap_v3_ClusterManager*)envoy_config_bootstrap_v3_Bootstrap_cluster_manager(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_ClusterManager*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_cluster_manager(msg, sub); + sub = (struct envoy_config_bootstrap_v3_ClusterManager*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_cluster_manager(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_flags_path(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(128, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_mutable_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len); +UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_mutable_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_resize_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_metrics_v3_StatsSink**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_resize_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_metrics_v3_StatsSink**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_metrics_v3_StatsSink* envoy_config_bootstrap_v3_Bootstrap_add_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { - struct envoy_config_metrics_v3_StatsSink* sub = (struct envoy_config_metrics_v3_StatsSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsSink_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_metrics_v3_StatsSink* sub = (struct envoy_config_metrics_v3_StatsSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsSink_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_watchdog(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Watchdog* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), envoy_config_bootstrap_v3_Watchdog*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(28, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdog(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Bootstrap_watchdog(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_watchdog(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_watchdog(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_tracing(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_trace_v3_Tracing* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct envoy_config_trace_v3_Tracing*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(32, 88), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_mutable_tracing(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_trace_v3_Tracing* sub = (struct envoy_config_trace_v3_Tracing*)envoy_config_bootstrap_v3_Bootstrap_tracing(msg); if (sub == NULL) { - sub = (struct envoy_config_trace_v3_Tracing*)_upb_Message_New(&envoy_config_trace_v3_Tracing_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_tracing(msg, sub); + sub = (struct envoy_config_trace_v3_Tracing*)_upb_Message_New(&envoy_config_trace_v3_Tracing_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_tracing(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_admin(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Admin* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), envoy_config_bootstrap_v3_Admin*) = value; + const upb_MiniTableField field = {12, UPB_SIZE(36, 96), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_mutable_admin(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Admin* sub = (struct envoy_config_bootstrap_v3_Admin*)envoy_config_bootstrap_v3_Bootstrap_admin(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Admin*)_upb_Message_New(&envoy_config_bootstrap_v3_Admin_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_admin(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Admin*)_upb_Message_New(&envoy_config_bootstrap_v3_Admin_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_admin(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_metrics_v3_StatsConfig* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct envoy_config_metrics_v3_StatsConfig*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(40, 104), 9, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_metrics_v3_StatsConfig* sub = (struct envoy_config_metrics_v3_StatsConfig*)envoy_config_bootstrap_v3_Bootstrap_stats_config(msg); if (sub == NULL) { - sub = (struct envoy_config_metrics_v3_StatsConfig*)_upb_Message_New(&envoy_config_metrics_v3_StatsConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_stats_config(msg, sub); + sub = (struct envoy_config_metrics_v3_StatsConfig*)_upb_Message_New(&envoy_config_metrics_v3_StatsConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_stats_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_hds_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_ApiConfigSource* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(60, 112), struct envoy_config_core_v3_ApiConfigSource*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(44, 112), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_hds_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_Bootstrap_hds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_hds_config(msg, sub); + sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_hds_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_overload_manager(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_overload_v3_OverloadManager* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(64, 120), struct envoy_config_overload_v3_OverloadManager*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(48, 120), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_mutable_overload_manager(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_overload_v3_OverloadManager* sub = (struct envoy_config_overload_v3_OverloadManager*)envoy_config_bootstrap_v3_Bootstrap_overload_manager(msg); if (sub == NULL) { - sub = (struct envoy_config_overload_v3_OverloadManager*)_upb_Message_New(&envoy_config_overload_v3_OverloadManager_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_overload_manager(msg, sub); + sub = (struct envoy_config_overload_v3_OverloadManager*)_upb_Message_New(&envoy_config_overload_v3_OverloadManager_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_overload_manager(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_enable_dispatcher_stats(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {16, UPB_SIZE(52, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_layered_runtime(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_LayeredRuntime* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(68, 128), envoy_config_bootstrap_v3_LayeredRuntime*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(56, 128), 12, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_mutable_layered_runtime(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_LayeredRuntime* sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)envoy_config_bootstrap_v3_Bootstrap_layered_runtime(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)_upb_Message_New(&envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_layered_runtime(msg, sub); + sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)_upb_Message_New(&envoy_config_bootstrap_v3_LayeredRuntime_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_layered_runtime(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_header_prefix(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 136), upb_StringView) = value; + const upb_MiniTableField field = {18, 136, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(80, 152), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {19, UPB_SIZE(60, 152), 13, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_stats_server_version_override(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_stats_server_version_override(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_use_tcp_for_dns_lookups(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(5, 5), bool) = value; + const upb_MiniTableField field = {20, UPB_SIZE(64, 5), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_mutable_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(84, 160), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_mutable_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + upb_MiniTableField field = {21, UPB_SIZE(68, 160), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_resize_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(84, 160), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_resize_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {21, UPB_SIZE(68, 160), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_add_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(84, 160), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {21, UPB_SIZE(68, 160), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_mutable_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (struct envoy_config_core_v3_ConfigSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 168), len); +UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_mutable_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + upb_MiniTableField field = {22, UPB_SIZE(72, 168), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_ConfigSource**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_resize_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_ConfigSource**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(88, 168), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_resize_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {22, UPB_SIZE(72, 168), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_ConfigSource**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_add_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { - struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(88, 168), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {22, UPB_SIZE(72, 168), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_config_source(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(92, 176), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {23, UPB_SIZE(76, 176), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_default_config_source(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_default_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_default_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_default_config_source(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_socket_interface(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 184), upb_StringView) = value; + const upb_MiniTableField field = {24, UPB_SIZE(144, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_clear(envoy_config_bootstrap_v3_Bootstrap* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_clear(envoy_config_bootstrap_v3_Bootstrap* msg) { _upb_msg_map_clear(msg, UPB_SIZE(104, 200)); } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_set(envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView key, struct envoy_config_core_v3_TypedExtensionConfig* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(104, 200), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_delete(envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(104, 200), &key, 0); + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_nextmutable(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* iter) { - return (envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(104, 200), iter); + const upb_MiniTableField field = {25, UPB_SIZE(80, 200), 0, 17, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_map_next(map, iter); } -UPB_INLINE upb_StringView* envoy_config_bootstrap_v3_Bootstrap_mutable_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 208), len); +UPB_INLINE upb_StringView* envoy_config_bootstrap_v3_Bootstrap_mutable_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + upb_MiniTableField field = {26, UPB_SIZE(84, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_bootstrap_v3_Bootstrap_resize_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(108, 208), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_bootstrap_v3_Bootstrap_resize_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {26, UPB_SIZE(84, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_add_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(108, 208), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {26, UPB_SIZE(84, 208), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_watchdogs(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Watchdogs* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(112, 216), envoy_config_bootstrap_v3_Watchdogs*) = value; + const upb_MiniTableField field = {27, UPB_SIZE(88, 216), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdogs(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Watchdogs* sub = (struct envoy_config_bootstrap_v3_Watchdogs*)envoy_config_bootstrap_v3_Bootstrap_watchdogs(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Watchdogs*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdogs_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_watchdogs(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Watchdogs*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdogs_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_watchdogs(msg, sub); } return sub; } -UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_mutable_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(116, 224), len); +UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_mutable_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + upb_MiniTableField field = {28, UPB_SIZE(92, 224), 0, 19, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_resize_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) { - return (envoy_config_bootstrap_v3_FatalAction**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(116, 224), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_resize_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {28, UPB_SIZE(92, 224), 0, 19, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_bootstrap_v3_FatalAction**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Bootstrap_add_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { - struct envoy_config_bootstrap_v3_FatalAction* sub = (struct envoy_config_bootstrap_v3_FatalAction*)_upb_Message_New(&envoy_config_bootstrap_v3_FatalAction_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(116, 224), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {28, UPB_SIZE(92, 224), 0, 19, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_bootstrap_v3_FatalAction* sub = (struct envoy_config_bootstrap_v3_FatalAction*)_upb_Message_New(&envoy_config_bootstrap_v3_FatalAction_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_on_admin(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(3, 3), value, UPB_SIZE(8, 8), 29); + const upb_MiniTableField field = {29, 3, UPB_SIZE(-97, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_DnsResolutionConfig* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(120, 232), struct envoy_config_core_v3_DnsResolutionConfig*) = value; + const upb_MiniTableField field = {30, UPB_SIZE(100, 232), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_DnsResolutionConfig* sub = (struct envoy_config_core_v3_DnsResolutionConfig*)envoy_config_bootstrap_v3_Bootstrap_dns_resolution_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(msg, sub); + sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(124, 240), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {31, UPB_SIZE(104, 240), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_typed_dns_resolver_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(msg, sub); } return sub; } -UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_mutable_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) { - return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_array_mutable_accessor(msg, UPB_SIZE(128, 248), len); +UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_mutable_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* size) { + upb_MiniTableField field = {32, UPB_SIZE(108, 248), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_resize_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) { - return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(128, 248), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_resize_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {32, UPB_SIZE(108, 248), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_bootstrap_v3_CustomInlineHeader**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_Bootstrap_add_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { - struct envoy_config_bootstrap_v3_CustomInlineHeader* sub = (struct envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_Message_New(&envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(128, 248), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {32, UPB_SIZE(108, 248), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_bootstrap_v3_CustomInlineHeader* sub = (struct envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_Message_New(&envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_perf_tracing_file_path(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(132, 256), upb_StringView) = value; + const upb_MiniTableField field = {33, UPB_SIZE(152, 256), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_regex_engine(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 18); - *UPB_PTR_AT(msg, UPB_SIZE(140, 272), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {34, UPB_SIZE(112, 272), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_default_regex_engine(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_default_regex_engine(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_default_regex_engine(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_default_regex_engine(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_xds_delegate_extension(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 19); - *UPB_PTR_AT(msg, UPB_SIZE(144, 280), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {35, UPB_SIZE(116, 280), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_xds_delegate_extension(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_xds_delegate_extension(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_xds_delegate_extension(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_xds_delegate_extension(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_xds_config_tracker_extension(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 20); - *UPB_PTR_AT(msg, UPB_SIZE(148, 288), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {36, UPB_SIZE(120, 288), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_xds_config_tracker_extension(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_xds_config_tracker_extension(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_xds_config_tracker_extension(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_xds_config_tracker_extension(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_listener_manager(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 21); - *UPB_PTR_AT(msg, UPB_SIZE(152, 296), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {37, UPB_SIZE(124, 296), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_listener_manager(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_listener_manager(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_set_listener_manager(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_set_listener_manager(msg, sub); } return sub; } @@ -854,12 +1167,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootst /* envoy.config.bootstrap.v3.Bootstrap.StaticResources */ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena); + return (envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Bootstrap_StaticResources* ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -869,7 +1182,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_boo int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Bootstrap_StaticResources* ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -877,89 +1190,164 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_boo } UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_StaticResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_listener_v3_Listener* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_listener_v3_Listener* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_StaticResources_listeners(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_listener_v3_Listener* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) { - return (const struct envoy_config_listener_v3_Listener* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const struct envoy_config_cluster_v3_Cluster* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_cluster_v3_Cluster* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_StaticResources_clusters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_cluster_v3_Cluster* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) { - return (const struct envoy_config_cluster_v3_Cluster* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_Secret* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_extensions_transport_sockets_tls_v3_Secret* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_Secret* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) { - return (const struct envoy_extensions_transport_sockets_tls_v3_Secret* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_config_bootstrap_v3_Bootstrap_StaticResources_secrets(msg, &size); + return size != 0; } -UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) { - return (struct envoy_config_listener_v3_Listener**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_listener_v3_Listener**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_listener_v3_Listener**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_listener_v3_Listener**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_listener_v3_Listener* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena) { - struct envoy_config_listener_v3_Listener* sub = (struct envoy_config_listener_v3_Listener*)_upb_Message_New(&envoy_config_listener_v3_Listener_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_listener_v3_Listener* sub = (struct envoy_config_listener_v3_Listener*)_upb_Message_New(&envoy_config_listener_v3_Listener_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) { - return (struct envoy_config_cluster_v3_Cluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_cluster_v3_Cluster**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_cluster_v3_Cluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_cluster_v3_Cluster**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_Cluster* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_Cluster* sub = (struct envoy_config_cluster_v3_Cluster*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_Cluster* sub = (struct envoy_config_cluster_v3_Cluster*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) { - return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t len, upb_Arena* arena) { - return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena) { - struct envoy_extensions_transport_sockets_tls_v3_Secret* sub = (struct envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_transport_sockets_tls_v3_Secret* sub = (struct envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.bootstrap.v3.Bootstrap.DynamicResources */ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena); + return (envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Bootstrap_DynamicResources* ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -969,7 +1357,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bo int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Bootstrap_DynamicResources* ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -977,99 +1365,126 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bo } UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msg_init, 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); -} -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_lds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_cds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_ads_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ApiConfigSource*); + const struct envoy_config_core_v3_ApiConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ApiConfigSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_lds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_lds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_cds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_cds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_lds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_config(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_cds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_config(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_ads_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, struct envoy_config_core_v3_ApiConfigSource* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ApiConfigSource*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_ads_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena) { struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_Bootstrap_DynamicResources_ads_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_ads_config(msg, sub); + sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_ads_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.bootstrap.v3.Bootstrap.CertificateProviderInstancesEntry */ @@ -1079,14 +1494,15 @@ UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_CertificateProvide _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_has_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* msg) { struct envoy_config_core_v3_TypedExtensionConfig* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_has_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_set_value(envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct envoy_config_core_v3_TypedExtensionConfig*)); @@ -1095,12 +1511,12 @@ UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstances /* envoy.config.bootstrap.v3.Admin */ UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Admin*)_upb_Message_New(&envoy_config_bootstrap_v3_Admin_msginit, arena); + return (envoy_config_bootstrap_v3_Admin*)_upb_Message_New(&envoy_config_bootstrap_v3_Admin_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Admin* ret = envoy_config_bootstrap_v3_Admin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1110,7 +1526,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_pars int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Admin* ret = envoy_config_bootstrap_v3_Admin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1118,117 +1534,190 @@ UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_pars } UPB_INLINE char* envoy_config_bootstrap_v3_Admin_serialize(const envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_access_log_path(envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Admin_access_log_path(const envoy_config_bootstrap_v3_Admin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_profile_path(const envoy_config_bootstrap_v3_Admin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_profile_path(envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Admin_profile_path(const envoy_config_bootstrap_v3_Admin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_address(const envoy_config_bootstrap_v3_Admin* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_address(const envoy_config_bootstrap_v3_Admin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_address(envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_address(const envoy_config_bootstrap_v3_Admin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_address(const envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_socket_options(envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_bootstrap_v3_Admin_socket_options(const envoy_config_bootstrap_v3_Admin* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_socket_options(const envoy_config_bootstrap_v3_Admin* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); + size_t size; + envoy_config_bootstrap_v3_Admin_socket_options(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_socket_options(const envoy_config_bootstrap_v3_Admin* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_access_log(envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_bootstrap_v3_Admin_socket_options(const envoy_config_bootstrap_v3_Admin* msg, size_t* len) { - return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_bootstrap_v3_Admin_access_log(const envoy_config_bootstrap_v3_Admin* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_access_log(const envoy_config_bootstrap_v3_Admin* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); + size_t size; + envoy_config_bootstrap_v3_Admin_access_log(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_access_log(const envoy_config_bootstrap_v3_Admin* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_bootstrap_v3_Admin_access_log(const envoy_config_bootstrap_v3_Admin* msg, size_t* len) { - return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); -} -UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_ignore_global_conn_limit(const envoy_config_bootstrap_v3_Admin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_ignore_global_conn_limit(envoy_config_bootstrap_v3_Admin* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_bootstrap_v3_Admin_ignore_global_conn_limit(const envoy_config_bootstrap_v3_Admin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_access_log_path(envoy_config_bootstrap_v3_Admin *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_profile_path(envoy_config_bootstrap_v3_Admin *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_address(envoy_config_bootstrap_v3_Admin *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_mutable_address(envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_bootstrap_v3_Admin_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Admin_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Admin_set_address(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_mutable_socket_options(envoy_config_bootstrap_v3_Admin* msg, size_t* len) { - return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_mutable_socket_options(envoy_config_bootstrap_v3_Admin* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_SocketOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_resize_socket_options(envoy_config_bootstrap_v3_Admin* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_SocketOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_resize_socket_options(envoy_config_bootstrap_v3_Admin* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_SocketOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_bootstrap_v3_Admin_add_socket_options(envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena) { - struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_mutable_access_log(envoy_config_bootstrap_v3_Admin* msg, size_t* len) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_mutable_access_log(envoy_config_bootstrap_v3_Admin* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_resize_access_log(envoy_config_bootstrap_v3_Admin* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_resize_access_log(envoy_config_bootstrap_v3_Admin* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_accesslog_v3_AccessLog**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_bootstrap_v3_Admin_add_access_log(envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena) { - struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_ignore_global_conn_limit(envoy_config_bootstrap_v3_Admin *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.bootstrap.v3.ClusterManager */ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_ClusterManager_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_ClusterManager*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_msginit, arena); + return (envoy_config_bootstrap_v3_ClusterManager*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_ClusterManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_ClusterManager* ret = envoy_config_bootstrap_v3_ClusterManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1238,7 +1727,7 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_C int options, upb_Arena* arena) { envoy_config_bootstrap_v3_ClusterManager* ret = envoy_config_bootstrap_v3_ClusterManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1246,88 +1735,109 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_C } UPB_INLINE char* envoy_config_bootstrap_v3_ClusterManager_serialize(const envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_local_cluster_name(envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_ClusterManager_local_cluster_name(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_outlier_detection(envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*); + const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* default_val = NULL; + const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_upstream_bind_config(envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_bootstrap_v3_ClusterManager_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_BindConfig*); + const struct envoy_config_core_v3_BindConfig* default_val = NULL; + const struct envoy_config_core_v3_BindConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_load_stats_config(envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_ClusterManager_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_ApiConfigSource*); + const struct envoy_config_core_v3_ApiConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ApiConfigSource* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_local_cluster_name(envoy_config_bootstrap_v3_ClusterManager *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_outlier_detection(envoy_config_bootstrap_v3_ClusterManager *msg, envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_mutable_outlier_detection(envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* sub = (struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)envoy_config_bootstrap_v3_ClusterManager_outlier_detection(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_ClusterManager_set_outlier_detection(msg, sub); + sub = (struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_ClusterManager_set_outlier_detection(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_upstream_bind_config(envoy_config_bootstrap_v3_ClusterManager *msg, struct envoy_config_core_v3_BindConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_BindConfig*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_bootstrap_v3_ClusterManager_mutable_upstream_bind_config(envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_BindConfig* sub = (struct envoy_config_core_v3_BindConfig*)envoy_config_bootstrap_v3_ClusterManager_upstream_bind_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_ClusterManager_set_upstream_bind_config(msg, sub); + sub = (struct envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_ClusterManager_set_upstream_bind_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_load_stats_config(envoy_config_bootstrap_v3_ClusterManager *msg, struct envoy_config_core_v3_ApiConfigSource* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_ApiConfigSource*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_ClusterManager_mutable_load_stats_config(envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_ClusterManager_load_stats_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_ClusterManager_set_load_stats_config(msg, sub); + sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_ClusterManager_set_load_stats_config(msg, sub); } return sub; } @@ -1335,12 +1845,12 @@ UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v /* envoy.config.bootstrap.v3.ClusterManager.OutlierDetection */ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena); + return (envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1350,7 +1860,7 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_conf int options, upb_Arena* arena) { envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1358,44 +1868,55 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_conf } UPB_INLINE char* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_serialize(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_clear_event_log_path(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_log_path(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_has_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_clear_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_clear_event_service(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_EventServiceConfig*); + const struct envoy_config_core_v3_EventServiceConfig* default_val = NULL; + const struct envoy_config_core_v3_EventServiceConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_has_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_log_path(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_service(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, struct envoy_config_core_v3_EventServiceConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_EventServiceConfig*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_mutable_event_service(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg, upb_Arena* arena) { struct envoy_config_core_v3_EventServiceConfig* sub = (struct envoy_config_core_v3_EventServiceConfig*)envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_service(msg, sub); + sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_service(msg, sub); } return sub; } @@ -1403,12 +1924,12 @@ UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstra /* envoy.config.bootstrap.v3.Watchdogs */ UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchdogs_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Watchdogs*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdogs_msginit, arena); + return (envoy_config_bootstrap_v3_Watchdogs*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdogs_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchdogs_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Watchdogs* ret = envoy_config_bootstrap_v3_Watchdogs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1418,7 +1939,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchd int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Watchdogs* ret = envoy_config_bootstrap_v3_Watchdogs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1426,57 +1947,67 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchd } UPB_INLINE char* envoy_config_bootstrap_v3_Watchdogs_serialize(const envoy_config_bootstrap_v3_Watchdogs* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msg_init, 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); -} -UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_clear_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_clear_main_thread_watchdog(envoy_config_bootstrap_v3_Watchdogs* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_bootstrap_v3_Watchdog*); + const envoy_config_bootstrap_v3_Watchdog* default_val = NULL; + const envoy_config_bootstrap_v3_Watchdog* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_clear_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_clear_worker_watchdog(envoy_config_bootstrap_v3_Watchdogs* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_bootstrap_v3_Watchdog*); + const envoy_config_bootstrap_v3_Watchdog* default_val = NULL; + const envoy_config_bootstrap_v3_Watchdog* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_set_main_thread_watchdog(envoy_config_bootstrap_v3_Watchdogs *msg, envoy_config_bootstrap_v3_Watchdog* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_bootstrap_v3_Watchdog*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_mutable_main_thread_watchdog(envoy_config_bootstrap_v3_Watchdogs* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Watchdogs_main_thread_watchdog(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdogs_set_main_thread_watchdog(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdogs_set_main_thread_watchdog(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_set_worker_watchdog(envoy_config_bootstrap_v3_Watchdogs *msg, envoy_config_bootstrap_v3_Watchdog* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_bootstrap_v3_Watchdog*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_mutable_worker_watchdog(envoy_config_bootstrap_v3_Watchdogs* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Watchdogs_worker_watchdog(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdogs_set_worker_watchdog(msg, sub); + sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdogs_set_worker_watchdog(msg, sub); } return sub; } @@ -1484,12 +2015,12 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_ /* envoy.config.bootstrap.v3.Watchdog */ UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdog_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena); + return (envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdog_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Watchdog* ret = envoy_config_bootstrap_v3_Watchdog_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1499,7 +2030,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdo int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Watchdog* ret = envoy_config_bootstrap_v3_Watchdog_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1507,179 +2038,234 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdo } UPB_INLINE char* envoy_config_bootstrap_v3_Watchdog_serialize(const envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msg_init, 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); -} -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_miss_timeout(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_megamiss_timeout(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_kill_timeout(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_multikill_timeout(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_multikill_threshold(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_bootstrap_v3_Watchdog_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_max_kill_timeout_jitter(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_actions(envoy_config_bootstrap_v3_Watchdog* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const* envoy_config_bootstrap_v3_Watchdog_actions(const envoy_config_bootstrap_v3_Watchdog* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_actions(const envoy_config_bootstrap_v3_Watchdog* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_actions(const envoy_config_bootstrap_v3_Watchdog* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const* envoy_config_bootstrap_v3_Watchdog_actions(const envoy_config_bootstrap_v3_Watchdog* msg, size_t* len) { - return (const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); + size_t size; + envoy_config_bootstrap_v3_Watchdog_actions(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_miss_timeout(envoy_config_bootstrap_v3_Watchdog *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_miss_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_miss_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_set_miss_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_set_miss_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_megamiss_timeout(envoy_config_bootstrap_v3_Watchdog *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_megamiss_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_megamiss_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_set_megamiss_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_set_megamiss_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_kill_timeout(envoy_config_bootstrap_v3_Watchdog *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_kill_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_kill_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_set_kill_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_set_kill_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_multikill_timeout(envoy_config_bootstrap_v3_Watchdog *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_multikill_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_multikill_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_set_multikill_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_set_multikill_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_multikill_threshold(envoy_config_bootstrap_v3_Watchdog *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_bootstrap_v3_Watchdog_mutable_multikill_threshold(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_bootstrap_v3_Watchdog_multikill_threshold(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_set_multikill_threshold(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_set_multikill_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_max_kill_timeout_jitter(envoy_config_bootstrap_v3_Watchdog *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_max_kill_timeout_jitter(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_max_kill_timeout_jitter(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_set_max_kill_timeout_jitter(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_set_max_kill_timeout_jitter(msg, sub); } return sub; } -UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_mutable_actions(envoy_config_bootstrap_v3_Watchdog* msg, size_t* len) { - return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_mutable_actions(envoy_config_bootstrap_v3_Watchdog* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_resize_actions(envoy_config_bootstrap_v3_Watchdog* msg, size_t len, upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_resize_actions(envoy_config_bootstrap_v3_Watchdog* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_add_actions(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) { - struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* sub = (struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* sub = (struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.bootstrap.v3.Watchdog.WatchdogAction */ UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena); + return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Watchdog_WatchdogAction* ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1689,7 +2275,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_boots int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Watchdog_WatchdogAction* ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1697,57 +2283,68 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_boots } UPB_INLINE char* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_serialize(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msg_init, 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); -} -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_clear_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_clear_config(envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_clear_event(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_WatchdogAction_has_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_clear_event(envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_bootstrap_v3_Watchdog_WatchdogAction_event(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_config(envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_mutable_config(envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Watchdog_WatchdogAction_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_event(envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.bootstrap.v3.FatalAction */ UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_FatalAction_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_FatalAction*)_upb_Message_New(&envoy_config_bootstrap_v3_FatalAction_msginit, arena); + return (envoy_config_bootstrap_v3_FatalAction*)_upb_Message_New(&envoy_config_bootstrap_v3_FatalAction_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_FatalAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_FatalAction* ret = envoy_config_bootstrap_v3_FatalAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1757,7 +2354,7 @@ UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Fata int options, upb_Arena* arena) { envoy_config_bootstrap_v3_FatalAction* ret = envoy_config_bootstrap_v3_FatalAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1765,35 +2362,40 @@ UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Fata } UPB_INLINE char* envoy_config_bootstrap_v3_FatalAction_serialize(const envoy_config_bootstrap_v3_FatalAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msg_init, 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); -} -UPB_INLINE void envoy_config_bootstrap_v3_FatalAction_clear_config(const envoy_config_bootstrap_v3_FatalAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_FatalAction_clear_config(envoy_config_bootstrap_v3_FatalAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_FatalAction_config(const envoy_config_bootstrap_v3_FatalAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_FatalAction_has_config(const envoy_config_bootstrap_v3_FatalAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_FatalAction_set_config(envoy_config_bootstrap_v3_FatalAction *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_FatalAction_mutable_config(envoy_config_bootstrap_v3_FatalAction* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_FatalAction_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_FatalAction_set_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_FatalAction_set_config(msg, sub); } return sub; } @@ -1801,12 +2403,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootst /* envoy.config.bootstrap.v3.Runtime */ UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_Runtime*)_upb_Message_New(&envoy_config_bootstrap_v3_Runtime_msginit, arena); + return (envoy_config_bootstrap_v3_Runtime*)_upb_Message_New(&envoy_config_bootstrap_v3_Runtime_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_Runtime* ret = envoy_config_bootstrap_v3_Runtime_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1816,7 +2418,7 @@ UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_ int options, upb_Arena* arena) { envoy_config_bootstrap_v3_Runtime* ret = envoy_config_bootstrap_v3_Runtime_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1824,62 +2426,85 @@ UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_ } UPB_INLINE char* envoy_config_bootstrap_v3_Runtime_serialize(const envoy_config_bootstrap_v3_Runtime* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_symlink_root(envoy_config_bootstrap_v3_Runtime* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Runtime_symlink_root(const envoy_config_bootstrap_v3_Runtime* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_subdirectory(envoy_config_bootstrap_v3_Runtime* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Runtime_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_override_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_override_subdirectory(envoy_config_bootstrap_v3_Runtime* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Runtime_override_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_Runtime_has_base(const envoy_config_bootstrap_v3_Runtime* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_base(const envoy_config_bootstrap_v3_Runtime* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_base(envoy_config_bootstrap_v3_Runtime* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_base(const envoy_config_bootstrap_v3_Runtime* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_Runtime_has_base(const envoy_config_bootstrap_v3_Runtime* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_symlink_root(envoy_config_bootstrap_v3_Runtime *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_subdirectory(envoy_config_bootstrap_v3_Runtime *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_override_subdirectory(envoy_config_bootstrap_v3_Runtime *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_base(envoy_config_bootstrap_v3_Runtime *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_mutable_base(envoy_config_bootstrap_v3_Runtime* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_bootstrap_v3_Runtime_base(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_Runtime_set_base(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_Runtime_set_base(msg, sub); } return sub; } @@ -1887,12 +2512,12 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_muta /* envoy.config.bootstrap.v3.RuntimeLayer */ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_RuntimeLayer_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_RuntimeLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena); + return (envoy_config_bootstrap_v3_RuntimeLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_RuntimeLayer_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1902,7 +2527,7 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_Run int options, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1910,13 +2535,13 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_Run } UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1927,99 +2552,130 @@ typedef enum { envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET = 0 } envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases; UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_case(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return (envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_name(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_name(envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_name(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_static_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_bootstrap_v3_RuntimeLayer_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_disk_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* default_val = NULL; + const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_admin_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 4, NULL); + const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* default_val = NULL; + const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_rtds_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, NULL); + const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* default_val = NULL; + const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_name(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_static_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, struct google_protobuf_Struct* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_RuntimeLayer_mutable_static_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_bootstrap_v3_RuntimeLayer_static_layer(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_RuntimeLayer_set_static_layer(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_RuntimeLayer_set_static_layer(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_disk_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* value) { - UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_disk_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)envoy_config_bootstrap_v3_RuntimeLayer_disk_layer(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_RuntimeLayer_set_disk_layer(msg, sub); + sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_RuntimeLayer_set_disk_layer(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_admin_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* value) { - UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_admin_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)envoy_config_bootstrap_v3_RuntimeLayer_admin_layer(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_RuntimeLayer_set_admin_layer(msg, sub); + sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_RuntimeLayer_set_admin_layer(msg, sub); } return sub; } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_rtds_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* value) { - UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_rtds_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) { struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)envoy_config_bootstrap_v3_RuntimeLayer_rtds_layer(msg); if (sub == NULL) { - sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_RuntimeLayer_set_rtds_layer(msg, sub); + sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_RuntimeLayer_set_rtds_layer(msg, sub); } return sub; } @@ -2027,12 +2683,12 @@ UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config /* envoy.config.bootstrap.v3.RuntimeLayer.DiskLayer */ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena); + return (envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2042,7 +2698,7 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootst int options, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2050,53 +2706,71 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootst } UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_symlink_root(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_symlink_root(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_append_service_cluster(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_append_service_cluster(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_append_service_cluster(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_subdirectory(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_subdirectory(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_subdirectory(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_symlink_root(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_append_service_cluster(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_subdirectory(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.bootstrap.v3.RuntimeLayer.AdminLayer */ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena); + return (envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2106,7 +2780,7 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_boots int options, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2114,13 +2788,13 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_boots } UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msg_init, options, arena, &ptr, len); return ptr; } @@ -2128,12 +2802,12 @@ UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_serialize_ex( /* envoy.config.bootstrap.v3.RuntimeLayer.RtdsLayer */ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena); + return (envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2143,7 +2817,7 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootst int options, upb_Arena* arena) { envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2151,44 +2825,55 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootst } UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_clear_name(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_name(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_has_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_clear_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_clear_rtds_config(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_has_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_name(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_rtds_config(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_mutable_rtds_config(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_rtds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_rtds_config(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_rtds_config(msg, sub); } return sub; } @@ -2196,12 +2881,12 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_R /* envoy.config.bootstrap.v3.LayeredRuntime */ UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_LayeredRuntime_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_LayeredRuntime*)_upb_Message_New(&envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena); + return (envoy_config_bootstrap_v3_LayeredRuntime*)_upb_Message_New(&envoy_config_bootstrap_v3_LayeredRuntime_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_LayeredRuntime_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_LayeredRuntime* ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2211,7 +2896,7 @@ UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_L int options, upb_Arena* arena) { envoy_config_bootstrap_v3_LayeredRuntime* ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2219,47 +2904,72 @@ UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_L } UPB_INLINE char* envoy_config_bootstrap_v3_LayeredRuntime_serialize(const envoy_config_bootstrap_v3_LayeredRuntime* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_bootstrap_v3_LayeredRuntime_clear_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer* const* envoy_config_bootstrap_v3_LayeredRuntime_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_bootstrap_v3_RuntimeLayer* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_bootstrap_v3_LayeredRuntime_has_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_bootstrap_v3_LayeredRuntime_clear_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer* const* envoy_config_bootstrap_v3_LayeredRuntime_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t* len) { - return (const envoy_config_bootstrap_v3_RuntimeLayer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_bootstrap_v3_LayeredRuntime_layers(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_mutable_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t* len) { - return (envoy_config_bootstrap_v3_RuntimeLayer**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_mutable_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_bootstrap_v3_RuntimeLayer**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_resize_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t len, upb_Arena* arena) { - return (envoy_config_bootstrap_v3_RuntimeLayer**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_resize_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_bootstrap_v3_RuntimeLayer**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_LayeredRuntime_add_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, upb_Arena* arena) { - struct envoy_config_bootstrap_v3_RuntimeLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_bootstrap_v3_RuntimeLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.bootstrap.v3.CustomInlineHeader */ UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_CustomInlineHeader_new(upb_Arena* arena) { - return (envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_Message_New(&envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena); + return (envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_Message_New(&envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, arena); } UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_CustomInlineHeader_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_bootstrap_v3_CustomInlineHeader* ret = envoy_config_bootstrap_v3_CustomInlineHeader_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2269,7 +2979,7 @@ UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_ int options, upb_Arena* arena) { envoy_config_bootstrap_v3_CustomInlineHeader* ret = envoy_config_bootstrap_v3_CustomInlineHeader_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2277,41 +2987,53 @@ UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_ } UPB_INLINE char* envoy_config_bootstrap_v3_CustomInlineHeader_serialize(const envoy_config_bootstrap_v3_CustomInlineHeader* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msg_init, 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); +UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_clear_inline_header_name(envoy_config_bootstrap_v3_CustomInlineHeader* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_bootstrap_v3_CustomInlineHeader_inline_header_name(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_clear_inline_header_type(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_clear_inline_header_type(envoy_config_bootstrap_v3_CustomInlineHeader* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_bootstrap_v3_CustomInlineHeader_inline_header_type(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_set_inline_header_name(envoy_config_bootstrap_v3_CustomInlineHeader *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_set_inline_header_type(envoy_config_bootstrap_v3_CustomInlineHeader *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_ */ 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 26b807b7ebf..3bf478a26a4 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/cluster/v3/circuit_breaker.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/type/v3/percent.upb.h" @@ -16,73 +18,104 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_submsgs[2] = { - {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit}, - {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_CircuitBreakers_submsgs[2] = { + {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init}, + {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_CircuitBreakers__fields[2] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit = { +const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msg_init = { &envoy_config_cluster_v3_CircuitBreakers_submsgs[0], &envoy_config_cluster_v3_CircuitBreakers__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + {0x000800003f010012, &upb_prm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[6] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[6] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 48), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 56), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit = { +const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init = { &envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[0], &envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[0], - UPB_SIZE(40, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0010000001000012, &upb_psm_1bt_maxmaxb}, + {0x001800000201001a, &upb_psm_1bt_maxmaxb}, + {0x0020000003020022, &upb_psm_1bt_maxmaxb}, + {0x002800000403002a, &upb_psm_1bt_maxmaxb}, + {0x000800003f000030, &upb_psb1_1bt}, + {0x003000000504003a, &upb_psm_1bt_maxmaxb}, + {0x0038000006050042, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = { - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit = { +const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init = { &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[0], &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_config_cluster_v3_CircuitBreakers_msginit, - &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, - &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, + &envoy_config_cluster_v3_CircuitBreakers_msg_init, + &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, + &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, }; -const upb_MiniTable_File envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -91,5 +124,5 @@ const upb_MiniTable_File envoy_config_cluster_v3_circuit_breaker_proto_upb_file_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d8bb222ebf5..d7861d513cc 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 @@ -9,42 +9,44 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_ #define ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_cluster_v3_CircuitBreakers; -struct envoy_config_cluster_v3_CircuitBreakers_Thresholds; -struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget; typedef struct envoy_config_cluster_v3_CircuitBreakers envoy_config_cluster_v3_CircuitBreakers; typedef struct envoy_config_cluster_v3_CircuitBreakers_Thresholds envoy_config_cluster_v3_CircuitBreakers_Thresholds; typedef struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget; -extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit; +extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init; struct envoy_type_v3_Percent; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.cluster.v3.CircuitBreakers */ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_CircuitBreakers_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena); + return (envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_CircuitBreakers_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_CircuitBreakers* ret = envoy_config_cluster_v3_CircuitBreakers_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -54,7 +56,7 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Circ int options, upb_Arena* arena) { envoy_config_cluster_v3_CircuitBreakers* ret = envoy_config_cluster_v3_CircuitBreakers_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -62,68 +64,118 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Circ } UPB_INLINE char* envoy_config_cluster_v3_CircuitBreakers_serialize(const envoy_config_cluster_v3_CircuitBreakers* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_clear_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_cluster_v3_CircuitBreakers_thresholds(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_clear_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_clear_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg, size_t* len) { - return (const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_per_host_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_has_per_host_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_clear_per_host_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_per_host_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg, size_t* len) { - return (const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_config_cluster_v3_CircuitBreakers_per_host_thresholds(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t* len) { - return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t len, upb_Arena* arena) { - return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_add_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t* len) { - return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t len, upb_Arena* arena) { - return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_add_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.cluster.v3.CircuitBreakers.Thresholds */ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena); + return (envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_CircuitBreakers_Thresholds* ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -133,7 +185,7 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_clus int options, upb_Arena* arena) { envoy_config_cluster_v3_CircuitBreakers_Thresholds* ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -141,163 +193,205 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_clus } UPB_INLINE char* envoy_config_cluster_v3_CircuitBreakers_Thresholds_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msg_init, 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; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_priority(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_track_remaining(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_track_remaining(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_track_remaining(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*); + const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* default_val = NULL; + const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_priority(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connections(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_pending_requests(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_retries(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_track_remaining(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connection_pools(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_retry_budget(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(msg, sub); + sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(msg, sub); } return sub; } @@ -305,12 +399,12 @@ UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget /* envoy.config.cluster.v3.CircuitBreakers.Thresholds.RetryBudget */ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena); + return (envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -320,7 +414,7 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy int options, upb_Arena* arena) { envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -328,67 +422,77 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_clear_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_clear_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_clear_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_clear_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_mutable_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_budget_percent(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_mutable_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_min_retry_concurrency(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_ */ 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 3079ff521e5..d7904011b24 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/cluster/v3/cluster.upb.h" #include "envoy/config/cluster/v3/circuit_breaker.upb.h" #include "envoy/config/cluster/v3/filter.upb.h" @@ -33,496 +35,691 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_cluster_v3_ClusterCollection_submsgs[1] = { - {.submsg = &xds_core_v3_CollectionEntry_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_ClusterCollection_submsgs[1] = { + {.submsg = &xds_core_v3_CollectionEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_ClusterCollection__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_ClusterCollection__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_ClusterCollection_msginit = { +const upb_MiniTable envoy_config_cluster_v3_ClusterCollection_msg_init = { &envoy_config_cluster_v3_ClusterCollection_submsgs[0], &envoy_config_cluster_v3_ClusterCollection__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_submsgs[39] = { - {.submsg = &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msginit}, - {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msginit}, - {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_cluster_v3_OutlierDetection_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_BindConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit}, - {.submsg = &envoy_config_core_v3_TransportSocket_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit}, - {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msginit}, - {.submsg = &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit}, - {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit}, - {.submsg = &envoy_config_cluster_v3_Filter_msginit}, - {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_msginit}, - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_RefreshRate_msginit}, - {.submsg = &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_TrackClusterStats_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit}, - {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_submsgs[39] = { + {.submsg = &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msg_init}, + {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msg_init}, + {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_cluster_v3_OutlierDetection_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_BindConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TransportSocket_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init}, + {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msg_init}, + {.submsg = &envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init}, + {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init}, + {.submsg = &envoy_config_cluster_v3_Filter_msg_init}, + {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init}, + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_RefreshRate_msg_init}, + {.submsg = &envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_TrackClusterStats_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init}, + {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster__fields[51] = { - {1, UPB_SIZE(40, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(32, 328), UPB_SIZE(-21, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(48, 48), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(52, 56), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(56, 64), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(60, 72), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(64, 80), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(68, 88), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(72, 96), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(76, 104), UPB_SIZE(7, 7), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(80, 112), UPB_SIZE(8, 8), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(84, 120), UPB_SIZE(0, 0), 9, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(88, 128), UPB_SIZE(9, 9), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(92, 136), UPB_SIZE(10, 10), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(96, 144), UPB_SIZE(11, 11), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(100, 152), UPB_SIZE(12, 12), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(104, 160), UPB_SIZE(13, 13), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(108, 168), UPB_SIZE(14, 14), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {27, UPB_SIZE(112, 176), UPB_SIZE(15, 15), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {28, UPB_SIZE(116, 184), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {29, UPB_SIZE(124, 200), UPB_SIZE(16, 16), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {30, UPB_SIZE(128, 208), UPB_SIZE(17, 17), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {32, UPB_SIZE(17, 17), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {33, UPB_SIZE(132, 216), UPB_SIZE(18, 18), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {34, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(136, 224), UPB_SIZE(0, 0), 22, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 23, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {38, UPB_SIZE(32, 328), UPB_SIZE(-21, -21), 24, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {39, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {40, UPB_SIZE(140, 232), UPB_SIZE(0, 0), 25, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {41, UPB_SIZE(144, 240), UPB_SIZE(19, 19), 26, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {42, UPB_SIZE(148, 248), UPB_SIZE(20, 20), 27, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {43, UPB_SIZE(152, 256), UPB_SIZE(0, 0), 28, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {44, UPB_SIZE(156, 264), UPB_SIZE(21, 21), 29, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {45, UPB_SIZE(25, 25), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {46, UPB_SIZE(160, 272), UPB_SIZE(22, 22), 30, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {47, UPB_SIZE(26, 26), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {48, UPB_SIZE(164, 280), UPB_SIZE(23, 23), 31, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {49, UPB_SIZE(168, 288), UPB_SIZE(24, 24), 32, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {50, UPB_SIZE(172, 296), UPB_SIZE(25, 25), 33, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {51, UPB_SIZE(27, 27), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {52, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 34, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {53, UPB_SIZE(176, 304), UPB_SIZE(26, 26), 35, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {54, UPB_SIZE(180, 312), UPB_SIZE(27, 27), 36, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {55, UPB_SIZE(184, 320), UPB_SIZE(28, 28), 37, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {56, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 38, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster__fields[51] = { + {1, UPB_SIZE(184, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(24, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(28, 88), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(32, 96), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(36, 104), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(40, 112), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(48, 120), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(52, 128), 9, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(56, 136), 10, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(60, 144), 11, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(64, 152), 12, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(68, 160), 13, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(72, 168), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(76, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {27, UPB_SIZE(80, 176), 15, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {28, UPB_SIZE(192, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {29, UPB_SIZE(84, 200), 16, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {30, UPB_SIZE(88, 208), 17, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {31, UPB_SIZE(92, 16), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {32, UPB_SIZE(93, 17), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {33, UPB_SIZE(96, 216), 18, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {38, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(108, 24), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(112, 232), 0, 25, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(116, 240), 19, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {42, UPB_SIZE(120, 248), 20, 27, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {43, UPB_SIZE(124, 256), 0, 28, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {44, UPB_SIZE(128, 264), 21, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {45, UPB_SIZE(132, 25), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {46, UPB_SIZE(136, 272), 22, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {47, UPB_SIZE(140, 26), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {48, UPB_SIZE(144, 280), 23, 31, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {49, UPB_SIZE(148, 288), 24, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {50, UPB_SIZE(152, 296), 25, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {51, UPB_SIZE(156, 27), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {52, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 34, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {53, UPB_SIZE(160, 304), 26, 35, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {54, UPB_SIZE(164, 312), 27, 36, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {55, UPB_SIZE(168, 320), 28, 37, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {56, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 38, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_msg_init = { &envoy_config_cluster_v3_Cluster_submsgs[0], &envoy_config_cluster_v3_Cluster__fields[0], - UPB_SIZE(192, 344), 51, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(200, 344), 51, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f00000a, &upb_pss_1bt}, + {0x0148001402000010, &upb_pov4_1bt}, + {0x003000000100001a, &upb_psm_1bt_max64b}, + {0x0038000002010022, &upb_psm_1bt_maxmaxb}, + {0x004000000302002a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x004800003f030042, &upb_prm_1bt_maxmaxb}, + {0x005000000404004a, &upb_psm_1bt_maxmaxb}, + {0x0058000005050052, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x006000000606006a, &upb_psm_1bt_maxmaxb}, + {0x0068000007070072, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0070000008080182, &upb_psm_2bt_maxmaxb}, + {0x000800003f000188, &upb_psv4_2bt}, + {0x007800003f090192, &upb_prm_2bt_maxmaxb}, + {0x00800000090a019a, &upb_psm_2bt_maxmaxb}, + {0x008800000a0b01a2, &upb_psm_2bt_maxmaxb}, + {0x009000000b0c01aa, &upb_psm_2bt_maxmaxb}, + {0x009800000c0d01b2, &upb_psm_2bt_max64b}, + {0x0150001c170e01ba, &upb_pom_2bt_max64b}, + {0x00a000000d0f01c2, &upb_psm_2bt_maxmaxb}, + {0x00a800000e1001ca, &upb_psm_2bt_maxmaxb}, + {0x000c00003f0001d0, &upb_psv4_2bt}, + {0x00b000000f1101da, &upb_psm_2bt_max64b}, + {0x00b800003f0001e2, &upb_pss_2bt}, + {0x00c80000101201ea, &upb_psm_2bt_maxmaxb}, + {0x00d00000111301f2, &upb_psm_2bt_max64b}, + {0x001000003f0001f8, &upb_psb1_2bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = { - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &envoy_config_core_v3_TransportSocket_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = { + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &envoy_config_core_v3_TransportSocket_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init = { &envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[0], &envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_CustomClusterType_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init = { &envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[0], &envoy_config_cluster_v3_Cluster_CustomClusterType__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init = { &envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = { - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = { + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(10, 10), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(11, 11), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[8] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(18, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(19, 11), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init = { &envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[0], - UPB_SIZE(24, 32), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(24, 32), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0010000001000012, &upb_psm_1bt_maxmaxb}, + {0x001800003f01001a, &upb_prm_1bt_max64b}, + {0x000800003f000020, &upb_psb1_1bt}, + {0x000900003f000028, &upb_psb1_1bt}, + {0x000a00003f000030, &upb_psb1_1bt}, + {0x000b00003f000038, &upb_psb1_1bt}, + {0x000c00003f000040, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = { + {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init = { NULL, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0], - UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prs_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x001000003f00001a, &upb_prs_1bt}, + {0x000400003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[3] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[3] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeDouble_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init = { &envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[1] = { - {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[1] = { + {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[3] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[3] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeDouble_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[2] = { - {.submsg = &google_protobuf_UInt64Value_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[2] = { + {.submsg = &google_protobuf_UInt64Value_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000018, &upb_psv4_1bt}, + {0x0010000002010022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = { - {.submsg = &google_protobuf_UInt64Value_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = { + {.submsg = &google_protobuf_UInt64Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[3] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[3] = { + {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000100003f000008, &upb_psb1_1bt}, + {0x000800003f000012, &upb_pss_1bt}, + {0x001800000100001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[6] = { - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit}, - {.submsg = &envoy_config_core_v3_HealthStatusSet_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[6] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init}, + {.submsg = &envoy_config_core_v3_HealthStatusSet_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[8] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[8] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 32), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[0], - UPB_SIZE(32, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(32, 56), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x0030000402010012, &upb_pom_1bt_max64b}, + {0x003000040302001a, &upb_pom_1bt_max64b}, + {0x0018000002030022, &upb_psm_1bt_maxmaxb}, + {0x000800003f000028, &upb_psb1_1bt}, + {0x000900003f000030, &upb_psb1_1bt}, + {0x002000000304003a, &upb_psm_1bt_max64b}, + {0x0028000004050042, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = { - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + }) }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = { + {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init = { &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[0], &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000100003f000008, &upb_psb1_1bt}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[2] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[2] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_RefreshRate_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_RefreshRate_msg_init = { &envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[0], &envoy_config_cluster_v3_Cluster_RefreshRate__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[2] = { - {.submsg = &google_protobuf_DoubleValue_msginit}, - {.submsg = &google_protobuf_DoubleValue_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[2] = { + {.submsg = &google_protobuf_DoubleValue_msg_init}, + {.submsg = &google_protobuf_DoubleValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init = { &envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[0], &envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msg_init = { &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[0], &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = { - {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = { + {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_LoadBalancingPolicy__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_LoadBalancingPolicy__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msginit = { +const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msg_init = { &envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[0], &envoy_config_cluster_v3_LoadBalancingPolicy__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[1] = { - {4, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[1] = { + {4, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit = { +const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init = { &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[0], &envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TcpKeepalive_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TcpKeepalive_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_UpstreamConnectionOptions__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_UpstreamConnectionOptions__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_UpstreamConnectionOptions_msginit = { +const upb_MiniTable envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init = { &envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[0], &envoy_config_cluster_v3_UpstreamConnectionOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_cluster_v3_TrackClusterStats__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_TrackClusterStats__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_TrackClusterStats_msginit = { +const upb_MiniTable envoy_config_cluster_v3_TrackClusterStats_msg_init = { NULL, &envoy_config_cluster_v3_TrackClusterStats__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[24] = { - &envoy_config_cluster_v3_ClusterCollection_msginit, - &envoy_config_cluster_v3_Cluster_msginit, - &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, - &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, - &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, - &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, - &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, - &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, - &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, - &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, - &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, - &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit, - &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, - &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, - &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, - &envoy_config_cluster_v3_TrackClusterStats_msginit, + &envoy_config_cluster_v3_ClusterCollection_msg_init, + &envoy_config_cluster_v3_Cluster_msg_init, + &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, + &envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, + &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, + &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, + &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, + &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, + &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, + &envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, + &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, + &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msg_init, + &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, + &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, + &envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, + &envoy_config_cluster_v3_TrackClusterStats_msg_init, }; -const upb_MiniTable_File envoy_config_cluster_v3_cluster_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_cluster_v3_cluster_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -531,5 +728,5 @@ const upb_MiniTable_File envoy_config_cluster_v3_cluster_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 90eb7946eac..31cb4243453 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 @@ -9,41 +9,22 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_ #define ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_cluster_v3_ClusterCollection; -struct envoy_config_cluster_v3_Cluster; -struct envoy_config_cluster_v3_Cluster_TransportSocketMatch; -struct envoy_config_cluster_v3_Cluster_CustomClusterType; -struct envoy_config_cluster_v3_Cluster_EdsClusterConfig; -struct envoy_config_cluster_v3_Cluster_LbSubsetConfig; -struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector; -struct envoy_config_cluster_v3_Cluster_SlowStartConfig; -struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig; -struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig; -struct envoy_config_cluster_v3_Cluster_RingHashLbConfig; -struct envoy_config_cluster_v3_Cluster_MaglevLbConfig; -struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig; -struct envoy_config_cluster_v3_Cluster_CommonLbConfig; -struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig; -struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig; -struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig; -struct envoy_config_cluster_v3_Cluster_RefreshRate; -struct envoy_config_cluster_v3_Cluster_PreconnectPolicy; -struct envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry; -struct envoy_config_cluster_v3_LoadBalancingPolicy; -struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy; -struct envoy_config_cluster_v3_UpstreamConnectionOptions; -struct envoy_config_cluster_v3_TrackClusterStats; typedef struct envoy_config_cluster_v3_ClusterCollection envoy_config_cluster_v3_ClusterCollection; typedef struct envoy_config_cluster_v3_Cluster envoy_config_cluster_v3_Cluster; typedef struct envoy_config_cluster_v3_Cluster_TransportSocketMatch envoy_config_cluster_v3_Cluster_TransportSocketMatch; @@ -68,30 +49,30 @@ typedef struct envoy_config_cluster_v3_LoadBalancingPolicy envoy_config_cluster_ typedef struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy envoy_config_cluster_v3_LoadBalancingPolicy_Policy; typedef struct envoy_config_cluster_v3_UpstreamConnectionOptions envoy_config_cluster_v3_UpstreamConnectionOptions; typedef struct envoy_config_cluster_v3_TrackClusterStats envoy_config_cluster_v3_TrackClusterStats; -extern const upb_MiniTable envoy_config_cluster_v3_ClusterCollection_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CustomClusterType_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RefreshRate_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_UpstreamConnectionOptions_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_TrackClusterStats_msginit; +extern const upb_MiniTable envoy_config_cluster_v3_ClusterCollection_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RefreshRate_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_TrackClusterStats_msg_init; struct envoy_config_cluster_v3_CircuitBreakers; struct envoy_config_cluster_v3_Filter; struct envoy_config_cluster_v3_OutlierDetection; @@ -120,34 +101,34 @@ struct google_protobuf_Struct; struct google_protobuf_UInt32Value; struct google_protobuf_UInt64Value; struct xds_core_v3_CollectionEntry; -extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_Filter_msginit; -extern const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msginit; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_BindConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit; -extern const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msginit; -extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_DoubleValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; -extern const upb_MiniTable xds_core_v3_CollectionEntry_msginit; +extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_Filter_msg_init; +extern const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_BindConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_DoubleValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; +extern const upb_MiniTable xds_core_v3_CollectionEntry_msg_init; typedef enum { envoy_config_cluster_v3_Cluster_USE_CONFIGURED_PROTOCOL = 0, @@ -209,12 +190,12 @@ typedef enum { /* envoy.config.cluster.v3.ClusterCollection */ UPB_INLINE envoy_config_cluster_v3_ClusterCollection* envoy_config_cluster_v3_ClusterCollection_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_ClusterCollection*)_upb_Message_New(&envoy_config_cluster_v3_ClusterCollection_msginit, arena); + return (envoy_config_cluster_v3_ClusterCollection*)_upb_Message_New(&envoy_config_cluster_v3_ClusterCollection_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_ClusterCollection* envoy_config_cluster_v3_ClusterCollection_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_ClusterCollection* ret = envoy_config_cluster_v3_ClusterCollection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -224,7 +205,7 @@ UPB_INLINE envoy_config_cluster_v3_ClusterCollection* envoy_config_cluster_v3_Cl int options, upb_Arena* arena) { envoy_config_cluster_v3_ClusterCollection* ret = envoy_config_cluster_v3_ClusterCollection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -232,35 +213,40 @@ UPB_INLINE envoy_config_cluster_v3_ClusterCollection* envoy_config_cluster_v3_Cl } UPB_INLINE char* envoy_config_cluster_v3_ClusterCollection_serialize(const envoy_config_cluster_v3_ClusterCollection* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_clear_entries(const envoy_config_cluster_v3_ClusterCollection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_clear_entries(envoy_config_cluster_v3_ClusterCollection* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_entries(const envoy_config_cluster_v3_ClusterCollection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_core_v3_CollectionEntry*); + const struct xds_core_v3_CollectionEntry* default_val = NULL; + const struct xds_core_v3_CollectionEntry* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_ClusterCollection_has_entries(const envoy_config_cluster_v3_ClusterCollection* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_set_entries(envoy_config_cluster_v3_ClusterCollection *msg, struct xds_core_v3_CollectionEntry* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct xds_core_v3_CollectionEntry*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_mutable_entries(envoy_config_cluster_v3_ClusterCollection* msg, upb_Arena* arena) { struct xds_core_v3_CollectionEntry* sub = (struct xds_core_v3_CollectionEntry*)envoy_config_cluster_v3_ClusterCollection_entries(msg); if (sub == NULL) { - sub = (struct xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_ClusterCollection_set_entries(msg, sub); + sub = (struct xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msg_init, arena); + if (sub) envoy_config_cluster_v3_ClusterCollection_set_entries(msg, sub); } return sub; } @@ -268,12 +254,12 @@ UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCo /* envoy.config.cluster.v3.Cluster */ UPB_INLINE envoy_config_cluster_v3_Cluster* envoy_config_cluster_v3_Cluster_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_msginit, arena); + return (envoy_config_cluster_v3_Cluster*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster* envoy_config_cluster_v3_Cluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster* ret = envoy_config_cluster_v3_Cluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -283,7 +269,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster* envoy_config_cluster_v3_Cluster_pars int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster* ret = envoy_config_cluster_v3_Cluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -291,13 +277,13 @@ UPB_INLINE envoy_config_cluster_v3_Cluster* envoy_config_cluster_v3_Cluster_pars } UPB_INLINE char* envoy_config_cluster_v3_Cluster_serialize(const envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -306,7 +292,8 @@ typedef enum { envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET = 0 } envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases; UPB_INLINE envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases envoy_config_cluster_v3_Cluster_cluster_discovery_type_case(const envoy_config_cluster_v3_Cluster* msg) { - return (envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } typedef enum { envoy_config_cluster_v3_Cluster_lb_config_ring_hash_lb_config = 23, @@ -317,968 +304,1341 @@ typedef enum { envoy_config_cluster_v3_Cluster_lb_config_NOT_SET = 0 } envoy_config_cluster_v3_Cluster_lb_config_oneofcases; UPB_INLINE envoy_config_cluster_v3_Cluster_lb_config_oneofcases envoy_config_cluster_v3_Cluster_lb_config_case(const envoy_config_cluster_v3_Cluster* msg) { - return (envoy_config_cluster_v3_Cluster_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t); + const upb_MiniTableField field = {23, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_Cluster_lb_config_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_name(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_name(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(184, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_name(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(184, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(20, 20)) == 2; -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_type(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(32, 328), 0, UPB_SIZE(20, 20), envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_type(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_type(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(32, 328), UPB_SIZE(20, 20), 2, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_eds_cluster_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_eds_cluster_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_eds_cluster_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), const envoy_config_cluster_v3_Cluster_EdsClusterConfig*); + const envoy_config_cluster_v3_Cluster_EdsClusterConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_EdsClusterConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_connect_timeout(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_connect_timeout(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_connect_timeout(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_connect_timeout(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 56), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_connect_timeout(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 64), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lb_policy(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lb_policy(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_lb_policy(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_health_checks(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HealthCheck* const* envoy_config_cluster_v3_Cluster_health_checks(const envoy_config_cluster_v3_Cluster* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HealthCheck* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_health_checks(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 72)); + size_t size; + envoy_config_cluster_v3_Cluster_health_checks(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_health_checks(const envoy_config_cluster_v3_Cluster* msg) { - _upb_array_detach(msg, UPB_SIZE(60, 72)); -} -UPB_INLINE const struct envoy_config_core_v3_HealthCheck* const* envoy_config_cluster_v3_Cluster_health_checks(const envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (const struct envoy_config_core_v3_HealthCheck* const*)_upb_array_accessor(msg, UPB_SIZE(60, 72), len); -} -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_max_requests_per_connection(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_max_requests_per_connection(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_max_requests_per_connection(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 80), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_circuit_breakers(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_circuit_breakers(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_circuit_breakers(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Cluster_circuit_breakers(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 88), const struct envoy_config_cluster_v3_CircuitBreakers*); + const struct envoy_config_cluster_v3_CircuitBreakers* default_val = NULL; + const struct envoy_config_cluster_v3_CircuitBreakers* ret; + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_circuit_breakers(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_http_protocol_options(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 96), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluster_v3_Cluster_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 96), const struct envoy_config_core_v3_Http1ProtocolOptions*); + const struct envoy_config_core_v3_Http1ProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_Http1ProtocolOptions* ret; + const upb_MiniTableField field = {13, UPB_SIZE(32, 96), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http2_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 96), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_http2_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_http2_protocol_options(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 104), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluster_v3_Cluster_http2_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 104), const struct envoy_config_core_v3_Http2ProtocolOptions*); + const struct envoy_config_core_v3_Http2ProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_Http2ProtocolOptions* ret; + const upb_MiniTableField field = {14, UPB_SIZE(36, 104), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http2_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 104), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 112), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_refresh_rate(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(40, 112), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_dns_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 112), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {16, UPB_SIZE(40, 112), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_lookup_family(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(40, 112), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_lookup_family(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_dns_lookup_family(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {17, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_resolvers(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(48, 120), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_cluster_v3_Cluster_dns_resolvers(const envoy_config_cluster_v3_Cluster* msg, size_t* size) { + const upb_MiniTableField field = {18, UPB_SIZE(48, 120), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_Address* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolvers(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 120)); + size_t size; + envoy_config_cluster_v3_Cluster_dns_resolvers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_resolvers(const envoy_config_cluster_v3_Cluster* msg) { - _upb_array_detach(msg, UPB_SIZE(84, 120)); -} -UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_cluster_v3_Cluster_dns_resolvers(const envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(84, 120), len); -} -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 9); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_outlier_detection(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(88, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_outlier_detection(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(52, 128), 9, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_outlier_detection(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(88, 128), const struct envoy_config_cluster_v3_OutlierDetection*); + const struct envoy_config_cluster_v3_OutlierDetection* default_val = NULL; + const struct envoy_config_cluster_v3_OutlierDetection* ret; + const upb_MiniTableField field = {19, UPB_SIZE(52, 128), 9, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cleanup_interval(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(52, 128), 9, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_cleanup_interval(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(92, 136), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_cleanup_interval(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(56, 136), 10, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_cleanup_interval(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(92, 136), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {20, UPB_SIZE(56, 136), 10, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_bind_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cleanup_interval(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(56, 136), 10, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_bind_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_bind_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(60, 144), 11, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_upstream_bind_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(96, 144), const struct envoy_config_core_v3_BindConfig*); + const struct envoy_config_core_v3_BindConfig* default_val = NULL; + const struct envoy_config_core_v3_BindConfig* ret; + const upb_MiniTableField field = {21, UPB_SIZE(60, 144), 11, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lb_subset_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 12); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_bind_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(60, 144), 11, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lb_subset_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(100, 152), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lb_subset_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(64, 152), 12, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_lb_subset_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(100, 152), const envoy_config_cluster_v3_Cluster_LbSubsetConfig*); + const envoy_config_cluster_v3_Cluster_LbSubsetConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_LbSubsetConfig* ret; + const upb_MiniTableField field = {22, UPB_SIZE(64, 152), 12, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(28, 28)) == 23; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lb_subset_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(64, 152), 12, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_ring_hash_lb_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(36, 336), UPB_SIZE(28, 28), 23, NULL); + const envoy_config_cluster_v3_Cluster_RingHashLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_RingHashLbConfig* ret; + const upb_MiniTableField field = {23, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_transport_socket(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(104, 160), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_transport_socket(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(68, 160), 13, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_transport_socket(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(104, 160), const struct envoy_config_core_v3_TransportSocket*); + const struct envoy_config_core_v3_TransportSocket* default_val = NULL; + const struct envoy_config_core_v3_TransportSocket* ret; + const upb_MiniTableField field = {24, UPB_SIZE(68, 160), 13, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_metadata(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(68, 160), 13, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_metadata(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 168), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_metadata(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(72, 168), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_cluster_v3_Cluster_metadata(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(108, 168), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {25, UPB_SIZE(72, 168), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_protocol_selection(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_metadata(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(72, 168), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_protocol_selection(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(76, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_protocol_selection(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {26, UPB_SIZE(76, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 15); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_common_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(112, 176), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_common_lb_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(80, 176), 15, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_common_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(112, 176), const envoy_config_cluster_v3_Cluster_CommonLbConfig*); + const envoy_config_cluster_v3_Cluster_CommonLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_CommonLbConfig* ret; + const upb_MiniTableField field = {27, UPB_SIZE(80, 176), 15, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_alt_stat_name(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_lb_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(80, 176), 15, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_alt_stat_name(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(192, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_alt_stat_name(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {28, UPB_SIZE(192, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 16); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_common_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(124, 200), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_common_http_protocol_options(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(84, 200), 16, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster_v3_Cluster_common_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(124, 200), const struct envoy_config_core_v3_HttpProtocolOptions*); + const struct envoy_config_core_v3_HttpProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_HttpProtocolOptions* ret; + const upb_MiniTableField field = {29, UPB_SIZE(84, 200), 16, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_connection_options(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 17); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(84, 200), 16, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_connection_options(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(128, 208), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_connection_options(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(88, 208), 17, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_Cluster_upstream_connection_options(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(128, 208), const envoy_config_cluster_v3_UpstreamConnectionOptions*); + const envoy_config_cluster_v3_UpstreamConnectionOptions* default_val = NULL; + const envoy_config_cluster_v3_UpstreamConnectionOptions* ret; + const upb_MiniTableField field = {30, UPB_SIZE(88, 208), 17, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_close_connections_on_host_health_failure(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_connection_options(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(88, 208), 17, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_close_connections_on_host_health_failure(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(92, 16), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_close_connections_on_host_health_failure(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {31, UPB_SIZE(92, 16), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_ignore_health_on_host_removal(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_ignore_health_on_host_removal(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(93, 17), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_ignore_health_on_host_removal(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {32, UPB_SIZE(93, 17), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 18); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_load_assignment(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_load_assignment(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(96, 216), 18, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_load_assignment(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const struct envoy_config_endpoint_v3_ClusterLoadAssignment*); + const struct envoy_config_endpoint_v3_ClusterLoadAssignment* default_val = NULL; + const struct envoy_config_endpoint_v3_ClusterLoadAssignment* ret; + const upb_MiniTableField field = {33, UPB_SIZE(96, 216), 18, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_original_dst_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(28, 28)) == 34; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(96, 216), 18, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_original_dst_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_original_dst_lb_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_original_dst_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(36, 336), UPB_SIZE(28, 28), 34, NULL); + const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* ret; + const upb_MiniTableField field = {34, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(136, 224)); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_original_dst_lb_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - _upb_array_detach(msg, UPB_SIZE(136, 224)); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_typed_extension_protocol_options(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_size(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(136, 224)); + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_get(const envoy_config_cluster_v3_Cluster* msg, upb_StringView key, struct google_protobuf_Any** val) { - return _upb_msg_map_get(msg, UPB_SIZE(136, 224), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_next(const envoy_config_cluster_v3_Cluster* msg, size_t* iter) { - return (const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(136, 224), iter); + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_least_request_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(28, 28)) == 37; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { + return envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_size(msg) != 0; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_least_request_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_least_request_lb_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_least_request_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(36, 336), UPB_SIZE(28, 28), 37, NULL); + const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* ret; + const upb_MiniTableField field = {37, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cluster_type(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(20, 20)) == 38; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_least_request_lb_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_cluster_type(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(32, 328), 0, UPB_SIZE(20, 20), envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_cluster_type(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {38, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_cluster_type(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(32, 328), UPB_SIZE(20, 20), 38, NULL); + const envoy_config_cluster_v3_Cluster_CustomClusterType* default_val = NULL; + const envoy_config_cluster_v3_Cluster_CustomClusterType* ret; + const upb_MiniTableField field = {38, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_respect_dns_ttl(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cluster_type(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {38, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_respect_dns_ttl(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(108, 24), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_respect_dns_ttl(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {39, UPB_SIZE(108, 24), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_filters(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(112, 232), 0, 25, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_cluster_v3_Filter* const* envoy_config_cluster_v3_Cluster_filters(const envoy_config_cluster_v3_Cluster* msg, size_t* size) { + const upb_MiniTableField field = {40, UPB_SIZE(112, 232), 0, 25, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_cluster_v3_Filter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_filters(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(140, 232)); + size_t size; + envoy_config_cluster_v3_Cluster_filters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_filters(const envoy_config_cluster_v3_Cluster* msg) { - _upb_array_detach(msg, UPB_SIZE(140, 232)); -} -UPB_INLINE const struct envoy_config_cluster_v3_Filter* const* envoy_config_cluster_v3_Cluster_filters(const envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (const struct envoy_config_cluster_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(140, 232), len); -} -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 19); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_load_balancing_policy(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(144, 240), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_load_balancing_policy(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(116, 240), 19, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_load_balancing_policy(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(144, 240), const envoy_config_cluster_v3_LoadBalancingPolicy*); + const envoy_config_cluster_v3_LoadBalancingPolicy* default_val = NULL; + const envoy_config_cluster_v3_LoadBalancingPolicy* ret; + const upb_MiniTableField field = {41, UPB_SIZE(116, 240), 19, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lrs_server(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 20); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(116, 240), 19, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lrs_server(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(148, 248), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lrs_server(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {42, UPB_SIZE(120, 248), 20, 27, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_lrs_server(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(148, 248), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {42, UPB_SIZE(120, 248), 20, 27, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lrs_server(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {42, UPB_SIZE(120, 248), 20, 27, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_transport_socket_matches(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {43, UPB_SIZE(124, 256), 0, 28, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const* envoy_config_cluster_v3_Cluster_transport_socket_matches(const envoy_config_cluster_v3_Cluster* msg, size_t* size) { + const upb_MiniTableField field = {43, UPB_SIZE(124, 256), 0, 28, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket_matches(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(152, 256)); + size_t size; + envoy_config_cluster_v3_Cluster_transport_socket_matches(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_transport_socket_matches(const envoy_config_cluster_v3_Cluster* msg) { - _upb_array_detach(msg, UPB_SIZE(152, 256)); -} -UPB_INLINE const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const* envoy_config_cluster_v3_Cluster_transport_socket_matches(const envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const*)_upb_array_accessor(msg, UPB_SIZE(152, 256), len); -} -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 21); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(156, 264), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(128, 264), 21, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(156, 264), const envoy_config_cluster_v3_Cluster_RefreshRate*); + const envoy_config_cluster_v3_Cluster_RefreshRate* default_val = NULL; + const envoy_config_cluster_v3_Cluster_RefreshRate* ret; + const upb_MiniTableField field = {44, UPB_SIZE(128, 264), 21, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_use_tcp_for_dns_lookups(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(128, 264), 21, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_use_tcp_for_dns_lookups(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {45, UPB_SIZE(132, 25), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_use_tcp_for_dns_lookups(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {45, UPB_SIZE(132, 25), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 22); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {46, UPB_SIZE(136, 272), 22, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_cluster_v3_Cluster_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const struct envoy_config_core_v3_UpstreamHttpProtocolOptions*); + const struct envoy_config_core_v3_UpstreamHttpProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_UpstreamHttpProtocolOptions* ret; + const upb_MiniTableField field = {46, UPB_SIZE(136, 272), 22, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_track_timeout_budgets(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {46, UPB_SIZE(136, 272), 22, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_track_timeout_budgets(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {47, UPB_SIZE(140, 26), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_track_timeout_budgets(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {47, UPB_SIZE(140, 26), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 23); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {48, UPB_SIZE(144, 280), 23, 31, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_upstream_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {48, UPB_SIZE(144, 280), 23, 31, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_track_cluster_stats(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 24); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {48, UPB_SIZE(144, 280), 23, 31, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_track_cluster_stats(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_track_cluster_stats(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {49, UPB_SIZE(148, 288), 24, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Cluster_track_cluster_stats(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const envoy_config_cluster_v3_TrackClusterStats*); + const envoy_config_cluster_v3_TrackClusterStats* default_val = NULL; + const envoy_config_cluster_v3_TrackClusterStats* ret; + const upb_MiniTableField field = {49, UPB_SIZE(148, 288), 24, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 25); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_track_cluster_stats(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {49, UPB_SIZE(148, 288), 24, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(172, 296), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_preconnect_policy(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(152, 296), 25, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(172, 296), const envoy_config_cluster_v3_Cluster_PreconnectPolicy*); + const envoy_config_cluster_v3_Cluster_PreconnectPolicy* default_val = NULL; + const envoy_config_cluster_v3_Cluster_PreconnectPolicy* ret; + const upb_MiniTableField field = {50, UPB_SIZE(152, 296), 25, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_connection_pool_per_downstream_connection(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(152, 296), 25, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_connection_pool_per_downstream_connection(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {51, UPB_SIZE(156, 27), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_connection_pool_per_downstream_connection(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {51, UPB_SIZE(156, 27), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_maglev_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(28, 28)) == 52; -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_maglev_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_maglev_lb_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {52, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 34, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_maglev_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(36, 336), UPB_SIZE(28, 28), 52, NULL); + const envoy_config_cluster_v3_Cluster_MaglevLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_MaglevLbConfig* ret; + const upb_MiniTableField field = {52, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 34, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 26); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_maglev_lb_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {52, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 34, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_resolution_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {53, UPB_SIZE(160, 304), 26, 35, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_cluster_v3_Cluster_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const struct envoy_config_core_v3_DnsResolutionConfig*); + const struct envoy_config_core_v3_DnsResolutionConfig* default_val = NULL; + const struct envoy_config_core_v3_DnsResolutionConfig* ret; + const upb_MiniTableField field = {53, UPB_SIZE(160, 304), 26, 35, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 27); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {53, UPB_SIZE(160, 304), 26, 35, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {54, UPB_SIZE(164, 312), 27, 36, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_cluster_v3_Cluster_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {54, UPB_SIZE(164, 312), 27, 36, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_hasbit(msg, 28); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {54, UPB_SIZE(164, 312), 27, 36, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(184, 320), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_typed_dns_resolver_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {55, UPB_SIZE(168, 320), 28, 37, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(184, 320), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {55, UPB_SIZE(168, 320), 28, 37, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(28, 28)) == 56; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {55, UPB_SIZE(168, 320), 28, 37, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_round_robin_lb_config(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {56, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 38, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(36, 336), UPB_SIZE(28, 28), 56, NULL); + const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* ret; + const upb_MiniTableField field = {56, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 38, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {56, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 38, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_name(envoy_config_cluster_v3_Cluster *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 32), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(184, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_type(envoy_config_cluster_v3_Cluster *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(32, 328), value, UPB_SIZE(20, 20), 2); + const upb_MiniTableField field = {2, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_eds_cluster_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_EdsClusterConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(48, 48), envoy_config_cluster_v3_Cluster_EdsClusterConfig*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_mutable_eds_cluster_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)envoy_config_cluster_v3_Cluster_eds_cluster_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_eds_cluster_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_eds_cluster_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connect_timeout(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(52, 56), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_connect_timeout(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_connect_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_connect_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_connect_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(56, 64), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_mutable_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_policy(envoy_config_cluster_v3_Cluster *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_mutable_health_checks(envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (struct envoy_config_core_v3_HealthCheck**)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 72), len); +UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_mutable_health_checks(envoy_config_cluster_v3_Cluster* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HealthCheck**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_resize_health_checks(envoy_config_cluster_v3_Cluster* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HealthCheck**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(60, 72), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_resize_health_checks(envoy_config_cluster_v3_Cluster* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HealthCheck**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HealthCheck* envoy_config_cluster_v3_Cluster_add_health_checks(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HealthCheck* sub = (struct envoy_config_core_v3_HealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 72), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HealthCheck* sub = (struct envoy_config_core_v3_HealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(64, 80), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_mutable_max_requests_per_connection(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_max_requests_per_connection(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_circuit_breakers(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_cluster_v3_CircuitBreakers* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(68, 88), struct envoy_config_cluster_v3_CircuitBreakers*) = value; + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Cluster_mutable_circuit_breakers(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_CircuitBreakers* sub = (struct envoy_config_cluster_v3_CircuitBreakers*)envoy_config_cluster_v3_Cluster_circuit_breakers(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_circuit_breakers(msg, sub); + sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_circuit_breakers(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(72, 96), struct envoy_config_core_v3_Http1ProtocolOptions*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(32, 96), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_http_protocol_options(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_config_cluster_v3_Cluster_http_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_http_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_http_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_http2_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(76, 104), struct envoy_config_core_v3_Http2ProtocolOptions*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(36, 104), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_http2_protocol_options(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_config_cluster_v3_Cluster_http2_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_http2_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_http2_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(80, 112), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(40, 112), 8, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_dns_refresh_rate(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_dns_refresh_rate(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_lookup_family(envoy_config_cluster_v3_Cluster *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {17, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_mutable_dns_resolvers(envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(84, 120), len); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_mutable_dns_resolvers(envoy_config_cluster_v3_Cluster* msg, size_t* size) { + upb_MiniTableField field = {18, UPB_SIZE(48, 120), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_Address**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_resize_dns_resolvers(envoy_config_cluster_v3_Cluster* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_Address**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(84, 120), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_resize_dns_resolvers(envoy_config_cluster_v3_Cluster* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {18, UPB_SIZE(48, 120), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_Address**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_Cluster_add_dns_resolvers(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { - struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(84, 120), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {18, UPB_SIZE(48, 120), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_outlier_detection(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_cluster_v3_OutlierDetection* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(88, 128), struct envoy_config_cluster_v3_OutlierDetection*) = value; + const upb_MiniTableField field = {19, UPB_SIZE(52, 128), 9, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_mutable_outlier_detection(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_OutlierDetection* sub = (struct envoy_config_cluster_v3_OutlierDetection*)envoy_config_cluster_v3_Cluster_outlier_detection(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_OutlierDetection*)_upb_Message_New(&envoy_config_cluster_v3_OutlierDetection_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_outlier_detection(msg, sub); + sub = (struct envoy_config_cluster_v3_OutlierDetection*)_upb_Message_New(&envoy_config_cluster_v3_OutlierDetection_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_outlier_detection(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cleanup_interval(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(92, 136), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {20, UPB_SIZE(56, 136), 10, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_cleanup_interval(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_cleanup_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_cleanup_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_cleanup_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_bind_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_BindConfig* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(96, 144), struct envoy_config_core_v3_BindConfig*) = value; + const upb_MiniTableField field = {21, UPB_SIZE(60, 144), 11, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_mutable_upstream_bind_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_BindConfig* sub = (struct envoy_config_core_v3_BindConfig*)envoy_config_cluster_v3_Cluster_upstream_bind_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_upstream_bind_config(msg, sub); + sub = (struct envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_upstream_bind_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_subset_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LbSubsetConfig* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(100, 152), envoy_config_cluster_v3_Cluster_LbSubsetConfig*) = value; + const upb_MiniTableField field = {22, UPB_SIZE(64, 152), 12, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_mutable_lb_subset_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)envoy_config_cluster_v3_Cluster_lb_subset_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_lb_subset_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_lb_subset_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 23); + const upb_MiniTableField field = {23, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_mutable_ring_hash_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)envoy_config_cluster_v3_Cluster_ring_hash_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_transport_socket(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TransportSocket* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(104, 160), struct envoy_config_core_v3_TransportSocket*) = value; + const upb_MiniTableField field = {24, UPB_SIZE(68, 160), 13, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_mutable_transport_socket(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_cluster_v3_Cluster_transport_socket(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_transport_socket(msg, sub); + sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_transport_socket(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_metadata(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(108, 168), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {25, UPB_SIZE(72, 168), 14, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_cluster_v3_Cluster_mutable_metadata(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_cluster_v3_Cluster_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_metadata(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_protocol_selection(envoy_config_cluster_v3_Cluster *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {26, UPB_SIZE(76, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_common_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(112, 176), envoy_config_cluster_v3_Cluster_CommonLbConfig*) = value; + const upb_MiniTableField field = {27, UPB_SIZE(80, 176), 15, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_mutable_common_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_CommonLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)envoy_config_cluster_v3_Cluster_common_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_common_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_common_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_alt_stat_name(envoy_config_cluster_v3_Cluster *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = value; + const upb_MiniTableField field = {28, UPB_SIZE(192, 184), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(124, 200), struct envoy_config_core_v3_HttpProtocolOptions*) = value; + const upb_MiniTableField field = {29, UPB_SIZE(84, 200), 16, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_common_http_protocol_options(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_config_cluster_v3_Cluster_common_http_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_connection_options(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_UpstreamConnectionOptions* value) { - _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(128, 208), envoy_config_cluster_v3_UpstreamConnectionOptions*) = value; + const upb_MiniTableField field = {30, UPB_SIZE(88, 208), 17, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_Cluster_mutable_upstream_connection_options(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_UpstreamConnectionOptions* sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)envoy_config_cluster_v3_Cluster_upstream_connection_options(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_Message_New(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_upstream_connection_options(msg, sub); + sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_Message_New(&envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_upstream_connection_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_close_connections_on_host_health_failure(envoy_config_cluster_v3_Cluster *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value; + const upb_MiniTableField field = {31, UPB_SIZE(92, 16), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ignore_health_on_host_removal(envoy_config_cluster_v3_Cluster *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value; + const upb_MiniTableField field = {32, UPB_SIZE(93, 17), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_load_assignment(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_endpoint_v3_ClusterLoadAssignment* value) { - _upb_sethas(msg, 18); - *UPB_PTR_AT(msg, UPB_SIZE(132, 216), struct envoy_config_endpoint_v3_ClusterLoadAssignment*) = value; + const upb_MiniTableField field = {33, UPB_SIZE(96, 216), 18, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_mutable_load_assignment(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_endpoint_v3_ClusterLoadAssignment* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)envoy_config_cluster_v3_Cluster_load_assignment(msg); if (sub == NULL) { - sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_load_assignment(msg, sub); + sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_load_assignment(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 34); + const upb_MiniTableField field = {34, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_mutable_original_dst_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)envoy_config_cluster_v3_Cluster_original_dst_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(msg, sub); } return sub; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_clear(envoy_config_cluster_v3_Cluster* msg) { _upb_msg_map_clear(msg, UPB_SIZE(136, 224)); } +UPB_INLINE void envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_clear(envoy_config_cluster_v3_Cluster* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_set(envoy_config_cluster_v3_Cluster* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(136, 224), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_delete(envoy_config_cluster_v3_Cluster* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(136, 224), &key, 0); + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_nextmutable(envoy_config_cluster_v3_Cluster* msg, size_t* iter) { - return (envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(136, 224), iter); + const upb_MiniTableField field = {36, UPB_SIZE(100, 224), 0, 22, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_map_next(map, iter); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 37); + const upb_MiniTableField field = {37, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_mutable_least_request_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)envoy_config_cluster_v3_Cluster_least_request_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_least_request_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_least_request_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cluster_type(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CustomClusterType* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(32, 328), value, UPB_SIZE(20, 20), 38); + const upb_MiniTableField field = {38, UPB_SIZE(176, 328), UPB_SIZE(-105, -21), 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_mutable_cluster_type(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_CustomClusterType* sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)envoy_config_cluster_v3_Cluster_cluster_type(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_cluster_type(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_cluster_type(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_respect_dns_ttl(envoy_config_cluster_v3_Cluster *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {39, UPB_SIZE(108, 24), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_mutable_filters(envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (struct envoy_config_cluster_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(140, 232), len); +UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_mutable_filters(envoy_config_cluster_v3_Cluster* msg, size_t* size) { + upb_MiniTableField field = {40, UPB_SIZE(112, 232), 0, 25, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_cluster_v3_Filter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_resize_filters(envoy_config_cluster_v3_Cluster* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_cluster_v3_Filter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(140, 232), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_resize_filters(envoy_config_cluster_v3_Cluster* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {40, UPB_SIZE(112, 232), 0, 25, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_cluster_v3_Filter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Cluster_add_filters(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_Filter* sub = (struct envoy_config_cluster_v3_Filter*)_upb_Message_New(&envoy_config_cluster_v3_Filter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(140, 232), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {40, UPB_SIZE(112, 232), 0, 25, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_Filter* sub = (struct envoy_config_cluster_v3_Filter*)_upb_Message_New(&envoy_config_cluster_v3_Filter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_load_balancing_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_LoadBalancingPolicy* value) { - _upb_sethas(msg, 19); - *UPB_PTR_AT(msg, UPB_SIZE(144, 240), envoy_config_cluster_v3_LoadBalancingPolicy*) = value; + const upb_MiniTableField field = {41, UPB_SIZE(116, 240), 19, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_mutable_load_balancing_policy(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_LoadBalancingPolicy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)envoy_config_cluster_v3_Cluster_load_balancing_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_load_balancing_policy(msg, sub); + sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_load_balancing_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lrs_server(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 20); - *UPB_PTR_AT(msg, UPB_SIZE(148, 248), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {42, UPB_SIZE(120, 248), 20, 27, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_mutable_lrs_server(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_cluster_v3_Cluster_lrs_server(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_lrs_server(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_lrs_server(msg, sub); } return sub; } -UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_mutable_transport_socket_matches(envoy_config_cluster_v3_Cluster* msg, size_t* len) { - return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(152, 256), len); +UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_mutable_transport_socket_matches(envoy_config_cluster_v3_Cluster* msg, size_t* size) { + upb_MiniTableField field = {43, UPB_SIZE(124, 256), 0, 28, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_resize_transport_socket_matches(envoy_config_cluster_v3_Cluster* msg, size_t len, upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(152, 256), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_resize_transport_socket_matches(envoy_config_cluster_v3_Cluster* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {43, UPB_SIZE(124, 256), 0, 28, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_add_transport_socket_matches(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* sub = (struct envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(152, 256), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {43, UPB_SIZE(124, 256), 0, 28, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* sub = (struct envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RefreshRate* value) { - _upb_sethas(msg, 21); - *UPB_PTR_AT(msg, UPB_SIZE(156, 264), envoy_config_cluster_v3_Cluster_RefreshRate*) = value; + const upb_MiniTableField field = {44, UPB_SIZE(128, 264), 21, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_mutable_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_RefreshRate* sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_use_tcp_for_dns_lookups(envoy_config_cluster_v3_Cluster *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value; + const upb_MiniTableField field = {45, UPB_SIZE(132, 25), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_UpstreamHttpProtocolOptions* value) { - _upb_sethas(msg, 22); - *UPB_PTR_AT(msg, UPB_SIZE(160, 272), struct envoy_config_core_v3_UpstreamHttpProtocolOptions*) = value; + const upb_MiniTableField field = {46, UPB_SIZE(136, 272), 22, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_UpstreamHttpProtocolOptions* sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)envoy_config_cluster_v3_Cluster_upstream_http_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_track_timeout_budgets(envoy_config_cluster_v3_Cluster *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value; + const upb_MiniTableField field = {47, UPB_SIZE(140, 26), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 23); - *UPB_PTR_AT(msg, UPB_SIZE(164, 280), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {48, UPB_SIZE(144, 280), 23, 31, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_mutable_upstream_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_Cluster_upstream_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_upstream_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_upstream_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_track_cluster_stats(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_TrackClusterStats* value) { - _upb_sethas(msg, 24); - *UPB_PTR_AT(msg, UPB_SIZE(168, 288), envoy_config_cluster_v3_TrackClusterStats*) = value; + const upb_MiniTableField field = {49, UPB_SIZE(148, 288), 24, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Cluster_mutable_track_cluster_stats(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_TrackClusterStats* sub = (struct envoy_config_cluster_v3_TrackClusterStats*)envoy_config_cluster_v3_Cluster_track_cluster_stats(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_TrackClusterStats*)_upb_Message_New(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_track_cluster_stats(msg, sub); + sub = (struct envoy_config_cluster_v3_TrackClusterStats*)_upb_Message_New(&envoy_config_cluster_v3_TrackClusterStats_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_track_cluster_stats(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_preconnect_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_PreconnectPolicy* value) { - _upb_sethas(msg, 25); - *UPB_PTR_AT(msg, UPB_SIZE(172, 296), envoy_config_cluster_v3_Cluster_PreconnectPolicy*) = value; + const upb_MiniTableField field = {50, UPB_SIZE(152, 296), 25, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_mutable_preconnect_policy(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_PreconnectPolicy* sub = (struct envoy_config_cluster_v3_Cluster_PreconnectPolicy*)envoy_config_cluster_v3_Cluster_preconnect_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_preconnect_policy(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_preconnect_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connection_pool_per_downstream_connection(envoy_config_cluster_v3_Cluster *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value; + const upb_MiniTableField field = {51, UPB_SIZE(156, 27), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 52); + const upb_MiniTableField field = {52, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 34, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_mutable_maglev_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)envoy_config_cluster_v3_Cluster_maglev_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_maglev_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_maglev_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_resolution_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_DnsResolutionConfig* value) { - _upb_sethas(msg, 26); - *UPB_PTR_AT(msg, UPB_SIZE(176, 304), struct envoy_config_core_v3_DnsResolutionConfig*) = value; + const upb_MiniTableField field = {53, UPB_SIZE(160, 304), 26, 35, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_cluster_v3_Cluster_mutable_dns_resolution_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_DnsResolutionConfig* sub = (struct envoy_config_core_v3_DnsResolutionConfig*)envoy_config_cluster_v3_Cluster_dns_resolution_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_dns_resolution_config(msg, sub); + sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_dns_resolution_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 27); - *UPB_PTR_AT(msg, UPB_SIZE(180, 312), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {54, UPB_SIZE(164, 312), 27, 36, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_cluster_v3_Cluster_mutable_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_cluster_v3_Cluster_wait_for_warm_on_init(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 28); - *UPB_PTR_AT(msg, UPB_SIZE(184, 320), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {55, UPB_SIZE(168, 320), 28, 37, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_mutable_typed_dns_resolver_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_Cluster_typed_dns_resolver_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_set_round_robin_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 56); + const upb_MiniTableField field = {56, UPB_SIZE(180, 336), UPB_SIZE(-173, -29), 38, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_mutable_round_robin_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)envoy_config_cluster_v3_Cluster_round_robin_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_set_round_robin_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_set_round_robin_lb_config(msg, sub); } return sub; } @@ -1286,12 +1646,12 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_conf /* envoy.config.cluster.v3.Cluster.TransportSocketMatch */ UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena); + return (envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_TransportSocketMatch* ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1301,7 +1661,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cl int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_TransportSocketMatch* ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1309,66 +1669,82 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cl } UPB_INLINE char* envoy_config_cluster_v3_Cluster_TransportSocketMatch_serialize(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msg_init, 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); +UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_name(envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_TransportSocketMatch_name(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_TransportSocketMatch_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_TransportSocketMatch_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_TransportSocket*); + const struct envoy_config_core_v3_TransportSocket* default_val = NULL; + const struct envoy_config_core_v3_TransportSocket* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_name(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_TransportSocketMatch_mutable_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_cluster_v3_Cluster_TransportSocketMatch_match(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, struct envoy_config_core_v3_TransportSocket* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_TransportSocket*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_TransportSocketMatch_mutable_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg, upb_Arena* arena) { struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_cluster_v3_Cluster_TransportSocketMatch_transport_socket(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(msg, sub); + sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(msg, sub); } return sub; } @@ -1376,12 +1752,12 @@ UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_ /* envoy.config.cluster.v3.Cluster.CustomClusterType */ UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_CustomClusterType_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena); + return (envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_CustomClusterType_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CustomClusterType* ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1391,7 +1767,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_clust int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CustomClusterType* ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1399,44 +1775,55 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_clust } UPB_INLINE char* envoy_config_cluster_v3_Cluster_CustomClusterType_serialize(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msg_init, 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); +UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_clear_name(envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_CustomClusterType_name(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CustomClusterType_has_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_clear_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_clear_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CustomClusterType_has_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_name(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClusterType_mutable_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(msg, sub); } return sub; } @@ -1444,12 +1831,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClu /* envoy.config.cluster.v3.Cluster.EdsClusterConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_EdsClusterConfig* ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1459,7 +1846,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluste int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_EdsClusterConfig* ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1467,57 +1854,68 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluste } UPB_INLINE char* envoy_config_cluster_v3_Cluster_EdsClusterConfig_serialize(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_clear_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_clear_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_clear_service_name(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_clear_service_name(envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_EdsClusterConfig_mutable_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_service_name(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.cluster.v3.Cluster.LbSubsetConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_LbSubsetConfig* ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1527,7 +1925,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_ int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_LbSubsetConfig* ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1535,123 +1933,189 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_ } UPB_INLINE char* envoy_config_cluster_v3_Cluster_LbSubsetConfig_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msg_init, 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; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_LbSubsetConfig_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); + size_t size; + envoy_config_cluster_v3_Cluster_LbSubsetConfig_subset_selectors(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 24)); -} -UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, size_t* len) { - return (const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_locality_weight_aware(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_locality_weight_aware(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_locality_weight_aware(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_scale_locality_weight(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_scale_locality_weight(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_scale_locality_weight(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_panic_mode_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_panic_mode_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(18, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_panic_mode_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(18, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_list_as_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_list_as_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(19, 11), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_list_as_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(19, 11), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_metadata_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_metadata_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_metadata_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_cluster_v3_Cluster_LbSubsetConfig_default_subset(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(msg, sub); } return sub; } -UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, size_t* len) { - return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len); +UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_resize_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_resize_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envoy_config_cluster_v3_Cluster_LbSubsetConfig_add_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_locality_weight_aware(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_scale_locality_weight(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_panic_mode_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(18, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_list_as_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value; + const upb_MiniTableField field = {7, UPB_SIZE(19, 11), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_metadata_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector */ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena); + return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1661,7 +2125,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envo int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1669,74 +2133,144 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envo } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msg_init, 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)); +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE upb_StringView const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_has_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { + size_t size; + envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_keys(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE upb_StringView const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_single_host_per_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_has_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { + size_t size; + envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_keys_subset(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_single_host_per_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_single_host_per_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_set_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_set_single_host_per_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.cluster.v3.Cluster.SlowStartConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_SlowStartConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_SlowStartConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_SlowStartConfig* ret = envoy_config_cluster_v3_Cluster_SlowStartConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1746,7 +2280,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_SlowStartConfig* ret = envoy_config_cluster_v3_Cluster_SlowStartConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1754,79 +2288,94 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster } UPB_INLINE char* envoy_config_cluster_v3_Cluster_SlowStartConfig_serialize(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_SlowStartConfig_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_SlowStartConfig_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeDouble*); + const struct envoy_config_core_v3_RuntimeDouble* default_val = NULL; + const struct envoy_config_core_v3_RuntimeDouble* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_min_weight_percent(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_SlowStartConfig_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_SlowStartConfig_slow_start_window(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeDouble*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_config_cluster_v3_Cluster_SlowStartConfig_aggression(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_min_weight_percent(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_min_weight_percent(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_SlowStartConfig_min_weight_percent(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_SlowStartConfig_set_min_weight_percent(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_SlowStartConfig_set_min_weight_percent(msg, sub); } return sub; } @@ -1834,12 +2383,12 @@ UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_SlowSta /* envoy.config.cluster.v3.Cluster.RoundRobinLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* ret = envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1849,7 +2398,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_clus int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* ret = envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1857,35 +2406,40 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_clus } UPB_INLINE char* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_clear_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_clear_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_cluster_v3_Cluster_SlowStartConfig*); + const envoy_config_cluster_v3_Cluster_SlowStartConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_SlowStartConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg, envoy_config_cluster_v3_Cluster_SlowStartConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_cluster_v3_Cluster_SlowStartConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_mutable_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_SlowStartConfig* sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_slow_start_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(msg, sub); } return sub; } @@ -1893,12 +2447,12 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_ /* envoy.config.cluster.v3.Cluster.LeastRequestLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1908,7 +2462,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cl int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1916,79 +2470,94 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cl } UPB_INLINE char* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_serialize(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeDouble*); + const struct envoy_config_core_v3_RuntimeDouble* default_val = NULL; + const struct envoy_config_core_v3_RuntimeDouble* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_cluster_v3_Cluster_SlowStartConfig*); + const envoy_config_cluster_v3_Cluster_SlowStartConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_SlowStartConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeDouble*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, envoy_config_cluster_v3_Cluster_SlowStartConfig* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_cluster_v3_Cluster_SlowStartConfig*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_SlowStartConfig* sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_slow_start_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(msg, sub); } return sub; } @@ -1996,12 +2565,12 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_ /* envoy.config.cluster.v3.Cluster.RingHashLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_RingHashLbConfig* ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2011,7 +2580,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluste int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_RingHashLbConfig* ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2019,66 +2588,82 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluste } UPB_INLINE char* envoy_config_cluster_v3_Cluster_RingHashLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_hash_function(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_hash_function(envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_mutable_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_hash_function(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_mutable_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(msg, sub); } return sub; } @@ -2086,12 +2671,12 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_R /* envoy.config.cluster.v3.Cluster.MaglevLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_MaglevLbConfig* ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2101,7 +2686,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_ int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_MaglevLbConfig* ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2109,35 +2694,40 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_ } UPB_INLINE char* envoy_config_cluster_v3_Cluster_MaglevLbConfig_serialize(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_MaglevLbConfig_clear_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_MaglevLbConfig_clear_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_MaglevLbConfig_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_MaglevLbConfig_has_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_MaglevLbConfig_mutable_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_MaglevLbConfig_table_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(msg, sub); } return sub; } @@ -2145,12 +2735,12 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_M /* envoy.config.cluster.v3.Cluster.OriginalDstLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2160,7 +2750,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_clu int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2168,53 +2758,70 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_clu } UPB_INLINE char* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_serialize(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msg_init, 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(1, 1), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_clear_use_http_header(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_use_http_header(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_clear_http_header_name(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_clear_http_header_name(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_http_header_name(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_has_upstream_port_override(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_clear_upstream_port_override(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_clear_upstream_port_override(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_upstream_port_override(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_has_upstream_port_override(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_use_http_header(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_http_header_name(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_upstream_port_override(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_mutable_upstream_port_override(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_upstream_port_override(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_upstream_port_override(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_upstream_port_override(msg, sub); } return sub; } @@ -2222,12 +2829,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_O /* envoy.config.cluster.v3.Cluster.CommonLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2237,7 +2844,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_ int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2245,13 +2852,13 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_ } UPB_INLINE char* envoy_config_cluster_v3_Cluster_CommonLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2260,154 +2867,199 @@ typedef enum { envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET = 0 } envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases; UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_case(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return (envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(28, 48), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET); +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(28, 48), UPB_SIZE(4, 4), 3, NULL); + const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_CommonLbConfig_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_ignore_new_hosts_until_first_hc(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_ignore_new_hosts_until_first_hc(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ignore_new_hosts_until_first_hc(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_close_connections_on_host_set_change(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_close_connections_on_host_set_change(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_close_connections_on_host_set_change(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*); + const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* default_val = NULL; + const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_override_host_status(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_HealthStatusSet* envoy_config_cluster_v3_Cluster_CommonLbConfig_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_config_core_v3_HealthStatusSet*); + const struct envoy_config_core_v3_HealthStatusSet* default_val = NULL; + const struct envoy_config_core_v3_HealthStatusSet* ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_CommonLbConfig_healthy_panic_threshold(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_zone_aware_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(28, 48), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_weighted_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_CommonLbConfig_update_merge_window(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_ignore_new_hosts_until_first_hc(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_close_connections_on_host_set_change(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(17, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_consistent_hashing_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(msg, sub); + sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_override_host_status(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct envoy_config_core_v3_HealthStatusSet* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_config_core_v3_HealthStatusSet*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthStatusSet* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_override_host_status(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthStatusSet* sub = (struct envoy_config_core_v3_HealthStatusSet*)envoy_config_cluster_v3_Cluster_CommonLbConfig_override_host_status(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthStatusSet*)_upb_Message_New(&envoy_config_core_v3_HealthStatusSet_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_set_override_host_status(msg, sub); + sub = (struct envoy_config_core_v3_HealthStatusSet*)_upb_Message_New(&envoy_config_core_v3_HealthStatusSet_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_set_override_host_status(msg, sub); } return sub; } @@ -2415,12 +3067,12 @@ UPB_INLINE struct envoy_config_core_v3_HealthStatusSet* envoy_config_cluster_v3_ /* envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2430,7 +3082,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* env int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2438,79 +3090,95 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* env } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_fail_traffic_on_panic(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_fail_traffic_on_panic(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_fail_traffic_on_panic(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_mutable_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_routing_enabled(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_mutable_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_min_cluster_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_fail_traffic_on_panic(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2520,7 +3188,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConf int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2528,13 +3196,13 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConf } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msg_init, options, arena, &ptr, len); return ptr; } @@ -2542,12 +3210,12 @@ UPB_INLINE char* envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeighted /* envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig */ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena); + return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2557,7 +3225,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbCon int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2565,44 +3233,55 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbCon } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msg_init, 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; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_clear_use_hostname_for_hashing(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_use_hostname_for_hashing(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_has_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_clear_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_clear_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_has_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_use_hostname_for_hashing(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_mutable_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_hash_balance_factor(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub); } return sub; } @@ -2610,12 +3289,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_C /* envoy.config.cluster.v3.Cluster.RefreshRate */ UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_RefreshRate_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena); + return (envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_RefreshRate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_RefreshRate* ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2625,7 +3304,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_ int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_RefreshRate* ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2633,57 +3312,67 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_ } UPB_INLINE char* envoy_config_cluster_v3_Cluster_RefreshRate_serialize(const envoy_config_cluster_v3_Cluster_RefreshRate* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_clear_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_clear_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_clear_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_clear_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_mutable_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_RefreshRate_base_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_mutable_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_RefreshRate_max_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(msg, sub); } return sub; } @@ -2691,12 +3380,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_Refr /* envoy.config.cluster.v3.Cluster.PreconnectPolicy */ UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena); + return (envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_PreconnectPolicy* ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2706,7 +3395,7 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluste int options, upb_Arena* arena) { envoy_config_cluster_v3_Cluster_PreconnectPolicy* ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2714,57 +3403,67 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluste } UPB_INLINE char* envoy_config_cluster_v3_Cluster_PreconnectPolicy_serialize(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_clear_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_clear_per_upstream_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*); + const struct google_protobuf_DoubleValue* default_val = NULL; + const struct google_protobuf_DoubleValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_clear_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_clear_predictive_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_DoubleValue*); + const struct google_protobuf_DoubleValue* default_val = NULL; + const struct google_protobuf_DoubleValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_per_upstream_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, struct google_protobuf_DoubleValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_DoubleValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_mutable_per_upstream_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, upb_Arena* arena) { struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PreconnectPolicy_per_upstream_preconnect_ratio(msg); if (sub == NULL) { - sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_per_upstream_preconnect_ratio(msg, sub); + sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_per_upstream_preconnect_ratio(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_predictive_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, struct google_protobuf_DoubleValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_DoubleValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_mutable_predictive_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, upb_Arena* arena) { struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PreconnectPolicy_predictive_preconnect_ratio(msg); if (sub == NULL) { - sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_predictive_preconnect_ratio(msg, sub); + sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msg_init, arena); + if (sub) envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_predictive_preconnect_ratio(msg, sub); } return sub; } @@ -2776,14 +3475,15 @@ UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_TypedExtensionProtocol _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_has_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* msg) { struct google_protobuf_Any* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_has_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_set_value(envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg, struct google_protobuf_Any* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*)); @@ -2792,12 +3492,12 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEnt /* envoy.config.cluster.v3.LoadBalancingPolicy */ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_LoadBalancingPolicy_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena); + return (envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_LoadBalancingPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_LoadBalancingPolicy* ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2807,7 +3507,7 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_ int options, upb_Arena* arena) { envoy_config_cluster_v3_LoadBalancingPolicy* ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2815,47 +3515,72 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_ } UPB_INLINE char* envoy_config_cluster_v3_LoadBalancingPolicy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_clear_policies(envoy_config_cluster_v3_LoadBalancingPolicy* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const* envoy_config_cluster_v3_LoadBalancingPolicy_policies(const envoy_config_cluster_v3_LoadBalancingPolicy* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_has_policies(const envoy_config_cluster_v3_LoadBalancingPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_clear_policies(const envoy_config_cluster_v3_LoadBalancingPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const* envoy_config_cluster_v3_LoadBalancingPolicy_policies(const envoy_config_cluster_v3_LoadBalancingPolicy* msg, size_t* len) { - return (const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_cluster_v3_LoadBalancingPolicy_policies(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_mutable_policies(envoy_config_cluster_v3_LoadBalancingPolicy* msg, size_t* len) { - return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_mutable_policies(envoy_config_cluster_v3_LoadBalancingPolicy* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_resize_policies(envoy_config_cluster_v3_LoadBalancingPolicy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_resize_policies(envoy_config_cluster_v3_LoadBalancingPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_cluster_v3_LoadBalancingPolicy_add_policies(envoy_config_cluster_v3_LoadBalancingPolicy* msg, upb_Arena* arena) { - struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.cluster.v3.LoadBalancingPolicy.Policy */ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena); + return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_LoadBalancingPolicy_Policy* ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2865,7 +3590,7 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_clus int options, upb_Arena* arena) { envoy_config_cluster_v3_LoadBalancingPolicy_Policy* ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2873,35 +3598,40 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_clus } UPB_INLINE char* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_clear_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_clear_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_mutable_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_extension_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_config(msg, sub); } return sub; } @@ -2909,12 +3639,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluste /* envoy.config.cluster.v3.UpstreamConnectionOptions */ UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_UpstreamConnectionOptions_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_Message_New(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena); + return (envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_Message_New(&envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_UpstreamConnectionOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_UpstreamConnectionOptions* ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2924,7 +3654,7 @@ UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_clust int options, upb_Arena* arena) { envoy_config_cluster_v3_UpstreamConnectionOptions* ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2932,57 +3662,68 @@ UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_clust } UPB_INLINE char* envoy_config_cluster_v3_UpstreamConnectionOptions_serialize(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_clear_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_clear_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TcpKeepalive* envoy_config_cluster_v3_UpstreamConnectionOptions_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TcpKeepalive*); + const struct envoy_config_core_v3_TcpKeepalive* default_val = NULL; + const struct envoy_config_core_v3_TcpKeepalive* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_clear_set_local_interface_name_on_upstream_connections(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_has_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_clear_set_local_interface_name_on_upstream_connections(envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_set_local_interface_name_on_upstream_connections(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, struct envoy_config_core_v3_TcpKeepalive* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TcpKeepalive*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TcpKeepalive* envoy_config_cluster_v3_UpstreamConnectionOptions_mutable_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_TcpKeepalive* sub = (struct envoy_config_core_v3_TcpKeepalive*)envoy_config_cluster_v3_UpstreamConnectionOptions_tcp_keepalive(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TcpKeepalive*)_upb_Message_New(&envoy_config_core_v3_TcpKeepalive_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(msg, sub); + sub = (struct envoy_config_core_v3_TcpKeepalive*)_upb_Message_New(&envoy_config_core_v3_TcpKeepalive_msg_init, arena); + if (sub) envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_set_set_local_interface_name_on_upstream_connections(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.cluster.v3.TrackClusterStats */ UPB_INLINE envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_TrackClusterStats_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_TrackClusterStats*)_upb_Message_New(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena); + return (envoy_config_cluster_v3_TrackClusterStats*)_upb_Message_New(&envoy_config_cluster_v3_TrackClusterStats_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_TrackClusterStats_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_TrackClusterStats* ret = envoy_config_cluster_v3_TrackClusterStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2992,7 +3733,7 @@ UPB_INLINE envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Tr int options, upb_Arena* arena) { envoy_config_cluster_v3_TrackClusterStats* ret = envoy_config_cluster_v3_TrackClusterStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3000,41 +3741,53 @@ UPB_INLINE envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Tr } UPB_INLINE char* envoy_config_cluster_v3_TrackClusterStats_serialize(const envoy_config_cluster_v3_TrackClusterStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msg_init, 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; +UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_clear_timeout_budgets(envoy_config_cluster_v3_TrackClusterStats* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_TrackClusterStats_timeout_budgets(const envoy_config_cluster_v3_TrackClusterStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_clear_request_response_sizes(const envoy_config_cluster_v3_TrackClusterStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_clear_request_response_sizes(envoy_config_cluster_v3_TrackClusterStats* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_TrackClusterStats_request_response_sizes(const envoy_config_cluster_v3_TrackClusterStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_timeout_budgets(envoy_config_cluster_v3_TrackClusterStats *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_request_response_sizes(envoy_config_cluster_v3_TrackClusterStats *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_cluster_v3_cluster_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_cluster_v3_cluster_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_ */ 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 e3571392594..49d6307a843 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 @@ -7,35 +7,44 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/cluster/v3/filter.upb.h" #include "google/protobuf/any.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_cluster_v3_Filter_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_Filter_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_Filter__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_Filter__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_Filter_msginit = { +const upb_MiniTable envoy_config_cluster_v3_Filter_msg_init = { &envoy_config_cluster_v3_Filter_submsgs[0], &envoy_config_cluster_v3_Filter__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_cluster_v3_Filter_msginit, + &envoy_config_cluster_v3_Filter_msg_init, }; -const upb_MiniTable_File envoy_config_cluster_v3_filter_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_cluster_v3_filter_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -44,5 +53,5 @@ const upb_MiniTable_File envoy_config_cluster_v3_filter_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 6a35d89ff87..041a3ee40fe 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_ #define ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_cluster_v3_Filter; typedef struct envoy_config_cluster_v3_Filter envoy_config_cluster_v3_Filter; -extern const upb_MiniTable envoy_config_cluster_v3_Filter_msginit; +extern const upb_MiniTable envoy_config_cluster_v3_Filter_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* envoy.config.cluster.v3.Filter */ UPB_INLINE envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Filter_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_Filter*)_upb_Message_New(&envoy_config_cluster_v3_Filter_msginit, arena); + return (envoy_config_cluster_v3_Filter*)_upb_Message_New(&envoy_config_cluster_v3_Filter_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Filter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_Filter* ret = envoy_config_cluster_v3_Filter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Filter_parse_ int options, upb_Arena* arena) { envoy_config_cluster_v3_Filter* ret = envoy_config_cluster_v3_Filter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Filter_parse_ } UPB_INLINE char* envoy_config_cluster_v3_Filter_serialize(const envoy_config_cluster_v3_Filter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Filter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Filter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_Filter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_Filter_msg_init, 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); +UPB_INLINE void envoy_config_cluster_v3_Filter_clear_name(envoy_config_cluster_v3_Filter* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_cluster_v3_Filter_name(const envoy_config_cluster_v3_Filter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_Filter_has_typed_config(const envoy_config_cluster_v3_Filter* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_cluster_v3_Filter_clear_typed_config(const envoy_config_cluster_v3_Filter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_Filter_clear_typed_config(envoy_config_cluster_v3_Filter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Filter_typed_config(const envoy_config_cluster_v3_Filter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_Filter_has_typed_config(const envoy_config_cluster_v3_Filter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_Filter_set_name(envoy_config_cluster_v3_Filter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_Filter_set_typed_config(envoy_config_cluster_v3_Filter *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Filter_mutable_typed_config(envoy_config_cluster_v3_Filter* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_Filter_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_Filter_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_cluster_v3_Filter_set_typed_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_cluster_v3_filter_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_cluster_v3_filter_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_ */ 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 a0b6d39347d..584055dd07b 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/cluster/v3/outlier_detection.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" @@ -15,68 +17,103 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_cluster_v3_OutlierDetection_submsgs[21] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_cluster_v3_OutlierDetection_submsgs[21] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_cluster_v3_OutlierDetection__fields[22] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 56), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 64), UPB_SIZE(8, 8), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 72), UPB_SIZE(9, 9), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(40, 80), UPB_SIZE(10, 10), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(44, 88), UPB_SIZE(11, 11), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(48, 96), UPB_SIZE(12, 12), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(52, 104), UPB_SIZE(13, 13), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(56, 112), UPB_SIZE(14, 14), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(60, 120), UPB_SIZE(15, 15), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(64, 128), UPB_SIZE(16, 16), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(68, 136), UPB_SIZE(17, 17), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(72, 144), UPB_SIZE(18, 18), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(76, 152), UPB_SIZE(19, 19), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(80, 160), UPB_SIZE(20, 20), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(84, 168), UPB_SIZE(21, 21), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_cluster_v3_OutlierDetection__fields[22] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(40, 80), 10, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(44, 88), 11, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(48, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(52, 96), 12, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(56, 104), 13, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(60, 112), 14, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(64, 120), 15, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(68, 128), 16, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(72, 136), 17, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(76, 144), 18, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(80, 152), 19, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(84, 160), 20, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(88, 168), 21, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msginit = { +const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msg_init = { &envoy_config_cluster_v3_OutlierDetection_submsgs[0], &envoy_config_cluster_v3_OutlierDetection__fields[0], - UPB_SIZE(88, 176), 22, kUpb_ExtMode_NonExtendable, 22, 255, 0, + UPB_SIZE(96, 176), 22, kUpb_ExtMode_NonExtendable, 22, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800000504002a, &upb_psm_1bt_maxmaxb}, + {0x0030000006050032, &upb_psm_1bt_maxmaxb}, + {0x003800000706003a, &upb_psm_1bt_maxmaxb}, + {0x0040000008070042, &upb_psm_1bt_maxmaxb}, + {0x004800000908004a, &upb_psm_1bt_maxmaxb}, + {0x005000000a090052, &upb_psm_1bt_maxmaxb}, + {0x005800000b0a005a, &upb_psm_1bt_maxmaxb}, + {0x000300003f000060, &upb_psb1_1bt}, + {0x006000000c0b006a, &upb_psm_1bt_maxmaxb}, + {0x006800000d0c0072, &upb_psm_1bt_maxmaxb}, + {0x007000000e0d007a, &upb_psm_1bt_maxmaxb}, + {0x007800000f0e0182, &upb_psm_2bt_maxmaxb}, + {0x00800000100f018a, &upb_psm_2bt_maxmaxb}, + {0x0088000011100192, &upb_psm_2bt_maxmaxb}, + {0x009000001211019a, &upb_psm_2bt_maxmaxb}, + {0x00980000131201a2, &upb_psm_2bt_maxmaxb}, + {0x00a00000141301aa, &upb_psm_2bt_maxmaxb}, + {0x00a80000151401b2, &upb_psm_2bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_cluster_v3_OutlierDetection_msginit, + &envoy_config_cluster_v3_OutlierDetection_msg_init, }; -const upb_MiniTable_File envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -85,5 +122,5 @@ const upb_MiniTable_File envoy_config_cluster_v3_outlier_detection_proto_upb_fil 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 daab6004071..8567e2debf5 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 @@ -9,36 +9,40 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_ #define ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_cluster_v3_OutlierDetection; typedef struct envoy_config_cluster_v3_OutlierDetection envoy_config_cluster_v3_OutlierDetection; -extern const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msginit; +extern const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msg_init; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.cluster.v3.OutlierDetection */ UPB_INLINE envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_OutlierDetection_new(upb_Arena* arena) { - return (envoy_config_cluster_v3_OutlierDetection*)_upb_Message_New(&envoy_config_cluster_v3_OutlierDetection_msginit, arena); + return (envoy_config_cluster_v3_OutlierDetection*)_upb_Message_New(&envoy_config_cluster_v3_OutlierDetection_msg_init, arena); } UPB_INLINE envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_OutlierDetection_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_cluster_v3_OutlierDetection* ret = envoy_config_cluster_v3_OutlierDetection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -48,7 +52,7 @@ UPB_INLINE envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Out int options, upb_Arena* arena) { envoy_config_cluster_v3_OutlierDetection* ret = envoy_config_cluster_v3_OutlierDetection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -56,494 +60,605 @@ UPB_INLINE envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Out } UPB_INLINE char* envoy_config_cluster_v3_OutlierDetection_serialize(const envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msg_init, 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); -} -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_interval(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_interval(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_interval(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_interval(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_interval(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_base_ejection_time(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(40, 80), 10, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {10, UPB_SIZE(40, 80), 10, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(40, 80), 10, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(44, 88), 11, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {11, UPB_SIZE(44, 88), 11, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_split_external_local_origin_errors(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(44, 88), 11, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_split_external_local_origin_errors(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(48, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_split_external_local_origin_errors(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {12, UPB_SIZE(48, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 12); -} -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(52, 96), 12, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {13, UPB_SIZE(52, 96), 12, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(52, 96), 12, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(56, 104), 13, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {14, UPB_SIZE(56, 104), 13, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(56, 104), 13, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(60, 112), 14, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {15, UPB_SIZE(60, 112), 14, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 15); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(60, 112), 14, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(64, 120), 15, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {16, UPB_SIZE(64, 120), 15, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 16); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(64, 120), 15, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(68, 128), 16, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {17, UPB_SIZE(68, 128), 16, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 17); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(68, 128), 16, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(72, 136), 17, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {18, UPB_SIZE(72, 136), 17, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 18); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(72, 136), 17, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(76, 144), 18, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {19, UPB_SIZE(76, 144), 18, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 19); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(76, 144), 18, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(80, 152), 19, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {20, UPB_SIZE(80, 152), 19, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 20); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(80, 152), 19, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_time(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(84, 160), 20, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {21, UPB_SIZE(84, 160), 20, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) { - return _upb_hasbit(msg, 21); +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(84, 160), 20, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 168), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_time_jitter(envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(88, 168), 21, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 168), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {22, UPB_SIZE(88, 168), 21, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(88, 168), 21, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_5xx(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_interval(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_interval(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_base_ejection_time(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_base_ejection_time(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_5xx(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {10, UPB_SIZE(40, 80), 10, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_gateway_failure(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(44, 88), 11, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_gateway_failure(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_split_external_local_origin_errors(envoy_config_cluster_v3_OutlierDetection *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {12, UPB_SIZE(48, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(48, 96), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(52, 96), 12, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_local_origin_failure(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(56, 104), 13, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_local_origin_failure(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(60, 112), 14, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_local_origin_success_rate(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(60, 120), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(64, 120), 15, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(64, 128), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(68, 128), 16, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(68, 136), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {18, UPB_SIZE(72, 136), 17, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage_local_origin(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 18); - *UPB_PTR_AT(msg, UPB_SIZE(72, 144), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {19, UPB_SIZE(76, 144), 18, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 19); - *UPB_PTR_AT(msg, UPB_SIZE(76, 152), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {20, UPB_SIZE(80, 152), 19, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 20); - *UPB_PTR_AT(msg, UPB_SIZE(80, 160), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {21, UPB_SIZE(84, 160), 20, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_time(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_max_ejection_time(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time(msg, sub); } return sub; } UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time_jitter(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 21); - *UPB_PTR_AT(msg, UPB_SIZE(84, 168), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {22, UPB_SIZE(88, 168), 21, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_time_jitter(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_max_ejection_time_jitter(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time_jitter(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time_jitter(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_ */ 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 5549e125024..b1057486963 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/common/matcher/v3/matcher.upb.h" #include "envoy/config/core/v3/extension.upb.h" #include "envoy/config/route/v3/route_components.upb.h" @@ -16,277 +18,374 @@ #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_submsgs[3] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_submsgs[3] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher__fields[3] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher__fields[3] = { + {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_msg_init = { &envoy_config_common_matcher_v3_Matcher_submsgs[0], &envoy_config_common_matcher_v3_Matcher__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000040100000a, &upb_pom_1bt_max64b}, + {0x0010000402010012, &upb_pom_1bt_max64b}, + {0x000800000102001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_OnMatch_submsgs[2] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_OnMatch_submsgs[2] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_OnMatch__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_OnMatch__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_OnMatch_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init = { &envoy_config_common_matcher_v3_Matcher_OnMatch_submsgs[0], &envoy_config_common_matcher_v3_Matcher_OnMatch__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_submsgs[1] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherList_submsgs[1] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherList_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate__fields[4] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004030022, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[3] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000402010012, &upb_pom_1bt_maxmaxb}, + {0x001000040302001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[1] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[1] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_submsgs[4] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit}, - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherTree_submsgs[4] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherTree__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherTree__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherTree_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherTree__fields[0], - UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000402010012, &upb_pom_1bt_max64b}, + {0x001000040302001a, &upb_pom_1bt_max64b}, + {0x0010000404030022, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[1] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[1] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = { - {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = { + {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init = { &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[0], &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_MatchPredicate_submsgs[9] = { - {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit}, - {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit}, - {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msginit}, - {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit}, - {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_MatchPredicate_submsgs[9] = { + {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_MatchPredicate__fields[10] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_MatchPredicate__fields[10] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msg_init = { &envoy_config_common_matcher_v3_MatchPredicate_submsgs[0], &envoy_config_common_matcher_v3_MatchPredicate__fields[0], - UPB_SIZE(8, 16), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(8, 16), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004000020, &upb_pob1_1bt}, + {0x000800000503002a, &upb_pom_1bt_max64b}, + {0x0008000006040032, &upb_pom_1bt_max64b}, + {0x000800000705003a, &upb_pom_1bt_max64b}, + {0x0008000008060042, &upb_pom_1bt_max64b}, + {0x000800000907004a, &upb_pom_1bt_max64b}, + {0x000800000a080052, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_MatchPredicate_MatchSet_submsgs[1] = { - {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_MatchPredicate_MatchSet_submsgs[1] = { + {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_MatchPredicate_MatchSet__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_MatchPredicate_MatchSet__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init = { &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_submsgs[0], &envoy_config_common_matcher_v3_MatchPredicate_MatchSet__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_HttpHeadersMatch_submsgs[1] = { - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_HttpHeadersMatch_submsgs[1] = { + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpHeadersMatch__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_HttpHeadersMatch__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_HttpHeadersMatch_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init = { &envoy_config_common_matcher_v3_HttpHeadersMatch_submsgs[0], &envoy_config_common_matcher_v3_HttpHeadersMatch__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_common_matcher_v3_HttpGenericBodyMatch_submsgs[1] = { - {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit}, +static const upb_MiniTableSub envoy_config_common_matcher_v3_HttpGenericBodyMatch_submsgs[1] = { + {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyMatch__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_HttpGenericBodyMatch__fields[2] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init = { &envoy_config_common_matcher_v3_HttpGenericBodyMatch_submsgs[0], &envoy_config_common_matcher_v3_HttpGenericBodyMatch__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit = { +const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init = { NULL, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pob_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[15] = { - &envoy_config_common_matcher_v3_Matcher_msginit, - &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, - &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit, - &envoy_config_common_matcher_v3_MatchPredicate_msginit, - &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, - &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, - &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, - &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, + &envoy_config_common_matcher_v3_Matcher_msg_init, + &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, + &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init, + &envoy_config_common_matcher_v3_MatchPredicate_msg_init, + &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, + &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, + &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, + &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, }; -const upb_MiniTable_File envoy_config_common_matcher_v3_matcher_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_common_matcher_v3_matcher_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -295,5 +394,5 @@ const upb_MiniTable_File envoy_config_common_matcher_v3_matcher_proto_upb_file_l 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 175d7c37b81..9f41d5a8519 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 @@ -9,32 +9,22 @@ #ifndef ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPB_H_ #define ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_common_matcher_v3_Matcher; -struct envoy_config_common_matcher_v3_Matcher_OnMatch; -struct envoy_config_common_matcher_v3_Matcher_MatcherList; -struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate; -struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate; -struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList; -struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher; -struct envoy_config_common_matcher_v3_Matcher_MatcherTree; -struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap; -struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry; -struct envoy_config_common_matcher_v3_MatchPredicate; -struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet; -struct envoy_config_common_matcher_v3_HttpHeadersMatch; -struct envoy_config_common_matcher_v3_HttpGenericBodyMatch; -struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch; typedef struct envoy_config_common_matcher_v3_Matcher envoy_config_common_matcher_v3_Matcher; typedef struct envoy_config_common_matcher_v3_Matcher_OnMatch envoy_config_common_matcher_v3_Matcher_OnMatch; typedef struct envoy_config_common_matcher_v3_Matcher_MatcherList envoy_config_common_matcher_v3_Matcher_MatcherList; @@ -50,39 +40,39 @@ typedef struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet envoy_conf typedef struct envoy_config_common_matcher_v3_HttpHeadersMatch envoy_config_common_matcher_v3_HttpHeadersMatch; typedef struct envoy_config_common_matcher_v3_HttpGenericBodyMatch envoy_config_common_matcher_v3_HttpGenericBodyMatch; typedef struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_OnMatch_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_HttpHeadersMatch_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit; -extern const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init; +extern const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_config_route_v3_HeaderMatcher; struct envoy_type_matcher_v3_StringMatcher; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; /* envoy.config.common.matcher.v3.Matcher */ UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher* ret = envoy_config_common_matcher_v3_Matcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -92,7 +82,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher* ret = envoy_config_common_matcher_v3_Matcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -100,13 +90,13 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v } UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_serialize(const envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -115,70 +105,88 @@ typedef enum { envoy_config_common_matcher_v3_Matcher_matcher_type_NOT_SET = 0 } envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases envoy_config_common_matcher_v3_Matcher_matcher_type_case(const envoy_config_common_matcher_v3_Matcher* msg) { - return (envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_matcher_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_matcher_list(envoy_config_common_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherList* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherList* ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_matcher_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_matcher_tree(envoy_config_common_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherTree* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherTree* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_on_no_match(envoy_config_common_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_config_common_matcher_v3_Matcher_OnMatch*); + const envoy_config_common_matcher_v3_Matcher_OnMatch* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_set_matcher_list(envoy_config_common_matcher_v3_Matcher *msg, envoy_config_common_matcher_v3_Matcher_MatcherList* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_mutable_matcher_list(envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherList* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList*)envoy_config_common_matcher_v3_Matcher_matcher_list(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_set_matcher_list(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_set_matcher_list(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_set_matcher_tree(envoy_config_common_matcher_v3_Matcher *msg, envoy_config_common_matcher_v3_Matcher_MatcherTree* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_mutable_matcher_tree(envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherTree* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree*)envoy_config_common_matcher_v3_Matcher_matcher_tree(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_set_matcher_tree(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_set_matcher_tree(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_set_on_no_match(envoy_config_common_matcher_v3_Matcher *msg, envoy_config_common_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_config_common_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_mutable_on_no_match(envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_OnMatch* sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)envoy_config_common_matcher_v3_Matcher_on_no_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_set_on_no_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_set_on_no_match(msg, sub); } return sub; } @@ -186,12 +194,12 @@ UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_c /* envoy.config.common.matcher.v3.Matcher.OnMatch */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_OnMatch_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_OnMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_OnMatch* ret = envoy_config_common_matcher_v3_Matcher_OnMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -201,7 +209,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_m int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_OnMatch* ret = envoy_config_common_matcher_v3_Matcher_OnMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -209,13 +217,13 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_m } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -224,48 +232,61 @@ typedef enum { envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_NOT_SET = 0 } envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_case(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - return (envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_OnMatch_has_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_clear_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_clear_matcher(envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_OnMatch_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_common_matcher_v3_Matcher* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_OnMatch_has_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_OnMatch_has_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_clear_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_clear_action(envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_OnMatch_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_OnMatch_has_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_set_matcher(envoy_config_common_matcher_v3_Matcher_OnMatch *msg, envoy_config_common_matcher_v3_Matcher* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_OnMatch_mutable_matcher(envoy_config_common_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher* sub = (struct envoy_config_common_matcher_v3_Matcher*)envoy_config_common_matcher_v3_Matcher_OnMatch_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_OnMatch_set_matcher(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_OnMatch_set_matcher(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_set_action(envoy_config_common_matcher_v3_Matcher_OnMatch *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_OnMatch_mutable_action(envoy_config_common_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_OnMatch_action(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_OnMatch_set_action(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_OnMatch_set_action(msg, sub); } return sub; } @@ -273,12 +294,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common /* envoy.config.common.matcher.v3.Matcher.MatcherList */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_MatcherList_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_MatcherList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -288,7 +309,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_comm int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -296,47 +317,72 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_comm } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_clear_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* const* envoy_config_common_matcher_v3_Matcher_MatcherList_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_has_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_clear_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* const* envoy_config_common_matcher_v3_Matcher_MatcherList_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t* len) { - return (const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_common_matcher_v3_Matcher_MatcherList_matchers(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher** envoy_config_common_matcher_v3_Matcher_MatcherList_mutable_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t* len) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher** envoy_config_common_matcher_v3_Matcher_MatcherList_mutable_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher** envoy_config_common_matcher_v3_Matcher_MatcherList_resize_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t len, upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher** envoy_config_common_matcher_v3_Matcher_MatcherList_resize_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_add_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena) { - struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -346,7 +392,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_c int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -354,13 +400,13 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_c } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -371,90 +417,115 @@ typedef enum { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET = 0 } envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_case(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_single_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_or_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_and_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_not_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_single_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_or_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_and_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_not_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(msg, sub); } return sub; } @@ -462,12 +533,12 @@ UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* /* envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -477,7 +548,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePr int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -485,13 +556,13 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePr } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -500,70 +571,88 @@ typedef enum { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET = 0 } envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_case(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_input(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_value_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_input(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_value_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(msg, sub); } return sub; } @@ -571,12 +660,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common /* envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.PredicateList */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -586,7 +675,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_Predicat int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -594,47 +683,72 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_Predicat } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_clear_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* const* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_has_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_clear_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* const* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) { - return (const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate** envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_mutable_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate** envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_mutable_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate** envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_resize_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t len, upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate** envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_resize_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_add_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, upb_Arena* arena) { - struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.common.matcher.v3.Matcher.MatcherList.FieldMatcher */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -644,7 +758,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envo int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -652,57 +766,67 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envo } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, 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); -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*); + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_has_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_has_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_on_match(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_common_matcher_v3_Matcher_OnMatch*); + const envoy_config_common_matcher_v3_Matcher_OnMatch* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_has_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, envoy_config_common_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_common_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_on_match(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_OnMatch* sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(msg, sub); } return sub; } @@ -710,12 +834,12 @@ UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_c /* envoy.config.common.matcher.v3.Matcher.MatcherTree */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_MatcherTree_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_MatcherTree_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherTree* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -725,7 +849,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_comm int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherTree* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -733,13 +857,13 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_comm } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -749,91 +873,115 @@ typedef enum { envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET = 0 } envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_case(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return (envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_input(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_exact_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_prefix_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* default_val = NULL; + const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_input(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_input(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherTree_input(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherTree_set_input(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherTree_set_input(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_exact_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_exact_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)envoy_config_common_matcher_v3_Matcher_MatcherTree_exact_match_map(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherTree_set_exact_match_map(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherTree_set_exact_match_map(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_prefix_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)envoy_config_common_matcher_v3_Matcher_MatcherTree_prefix_match_map(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(msg, sub); + sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherTree_custom_match(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_Matcher_MatcherTree_set_custom_match(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_Matcher_MatcherTree_set_custom_match(msg, sub); } return sub; } @@ -841,12 +989,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common /* envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap */ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena); + return (envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -856,7 +1004,7 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_co int options, upb_Arena* arena) { envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -864,40 +1012,63 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_co } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, 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)); -} -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_clear_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_clear_map(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_get(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, envoy_config_common_matcher_v3_Matcher_OnMatch** val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_next(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) { - return (const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_has_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { + return envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(msg) != 0; } -UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_clear(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } +UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_clear(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_set(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, envoy_config_common_matcher_v3_Matcher_OnMatch* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_delete(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_nextmutable(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) { - return (envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_map_next(map, iter); } /* envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap.MapEntry */ @@ -907,14 +1078,15 @@ UPB_INLINE upb_StringView envoy_config_common_matcher_v3_Matcher_MatcherTree_Mat _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_has_value(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_value(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) { envoy_config_common_matcher_v3_Matcher_OnMatch* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_has_value(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_set_value(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry *msg, envoy_config_common_matcher_v3_Matcher_OnMatch* value) { _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_common_matcher_v3_Matcher_OnMatch*)); @@ -923,12 +1095,12 @@ UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapE /* envoy.config.common.matcher.v3.MatchPredicate */ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena); + return (envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_MatchPredicate* ret = envoy_config_common_matcher_v3_MatchPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -938,7 +1110,7 @@ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_ma int options, upb_Arena* arena) { envoy_config_common_matcher_v3_MatchPredicate* ret = envoy_config_common_matcher_v3_MatchPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -946,13 +1118,13 @@ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_ma } UPB_INLINE char* envoy_config_common_matcher_v3_MatchPredicate_serialize(const envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -969,207 +1141,269 @@ typedef enum { envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET = 0 } envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases envoy_config_common_matcher_v3_MatchPredicate_rule_case(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return (envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_or_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* default_val = NULL; + const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_and_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* default_val = NULL; + const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_not_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_MatchPredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_common_matcher_v3_MatchPredicate* default_val = NULL; + const envoy_config_common_matcher_v3_MatchPredicate* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_any_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_headers_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const envoy_config_common_matcher_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_common_matcher_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_trailers_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const envoy_config_common_matcher_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_common_matcher_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_headers_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const envoy_config_common_matcher_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_common_matcher_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_trailers_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const envoy_config_common_matcher_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_common_matcher_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const envoy_config_common_matcher_v3_HttpGenericBodyMatch* default_val = NULL; + const envoy_config_common_matcher_v3_HttpGenericBodyMatch* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL); + const envoy_config_common_matcher_v3_HttpGenericBodyMatch* default_val = NULL; + const envoy_config_common_matcher_v3_HttpGenericBodyMatch* ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_or_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_mutable_or_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)envoy_config_common_matcher_v3_MatchPredicate_or_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_or_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_or_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_and_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_mutable_and_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)envoy_config_common_matcher_v3_MatchPredicate_and_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_and_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_and_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_not_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_MatchPredicate* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_mutable_not_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)envoy_config_common_matcher_v3_MatchPredicate_not_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_not_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_not_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_any_match(envoy_config_common_matcher_v3_MatchPredicate *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_request_headers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_request_headers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_request_headers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_http_request_headers_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_http_request_headers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_request_trailers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_request_trailers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_request_trailers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_http_request_trailers_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_http_request_trailers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_response_headers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_response_headers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_response_headers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_http_response_headers_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_http_response_headers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_response_trailers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_response_trailers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_response_trailers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_http_response_trailers_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_http_response_trailers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_request_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_request_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_request_generic_body_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_http_request_generic_body_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_http_request_generic_body_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_response_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_response_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_response_generic_body_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_common_matcher_v3_MatchPredicate_set_http_response_generic_body_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, arena); + if (sub) envoy_config_common_matcher_v3_MatchPredicate_set_http_response_generic_body_match(msg, sub); } return sub; } @@ -1177,12 +1411,12 @@ UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_con /* envoy.config.common.matcher.v3.MatchPredicate.MatchSet */ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, arena); + return (envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_MatchPredicate_MatchSet* ret = envoy_config_common_matcher_v3_MatchPredicate_MatchSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1192,7 +1426,7 @@ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_ int options, upb_Arena* arena) { envoy_config_common_matcher_v3_MatchPredicate_MatchSet* ret = envoy_config_common_matcher_v3_MatchPredicate_MatchSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1200,47 +1434,72 @@ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_MatchSet_clear_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate* const* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_common_matcher_v3_MatchPredicate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_MatchSet_has_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_MatchSet_clear_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate* const* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t* len) { - return (const envoy_config_common_matcher_v3_MatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_common_matcher_v3_MatchPredicate_MatchSet_rules(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate** envoy_config_common_matcher_v3_MatchPredicate_MatchSet_mutable_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t* len) { - return (envoy_config_common_matcher_v3_MatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate** envoy_config_common_matcher_v3_MatchPredicate_MatchSet_mutable_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_common_matcher_v3_MatchPredicate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate** envoy_config_common_matcher_v3_MatchPredicate_MatchSet_resize_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t len, upb_Arena* arena) { - return (envoy_config_common_matcher_v3_MatchPredicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate** envoy_config_common_matcher_v3_MatchPredicate_MatchSet_resize_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_MatchPredicate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_add_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena) { - struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.common.matcher.v3.HttpHeadersMatch */ UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_HttpHeadersMatch_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena); + return (envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_HttpHeadersMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_HttpHeadersMatch* ret = envoy_config_common_matcher_v3_HttpHeadersMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1250,7 +1509,7 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_ int options, upb_Arena* arena) { envoy_config_common_matcher_v3_HttpHeadersMatch* ret = envoy_config_common_matcher_v3_HttpHeadersMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1258,47 +1517,72 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_ } UPB_INLINE char* envoy_config_common_matcher_v3_HttpHeadersMatch_serialize(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_common_matcher_v3_HttpHeadersMatch_clear_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_config_common_matcher_v3_HttpHeadersMatch_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_common_matcher_v3_HttpHeadersMatch_has_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_common_matcher_v3_HttpHeadersMatch_clear_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_config_common_matcher_v3_HttpHeadersMatch_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t* len) { - return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_common_matcher_v3_HttpHeadersMatch_headers(msg, &size); + return size != 0; } -UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_common_matcher_v3_HttpHeadersMatch_mutable_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t* len) { - return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_common_matcher_v3_HttpHeadersMatch_mutable_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_common_matcher_v3_HttpHeadersMatch_resize_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_common_matcher_v3_HttpHeadersMatch_resize_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_common_matcher_v3_HttpHeadersMatch_add_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.common.matcher.v3.HttpGenericBodyMatch */ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, arena); + return (envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_HttpGenericBodyMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1308,7 +1592,7 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_com int options, upb_Arena* arena) { envoy_config_common_matcher_v3_HttpGenericBodyMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1316,56 +1600,87 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_com } UPB_INLINE char* envoy_config_common_matcher_v3_HttpGenericBodyMatch_serialize(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msg_init, 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; +UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_clear_bytes_limit(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_common_matcher_v3_HttpGenericBodyMatch_bytes_limit(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_clear_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* const* envoy_config_common_matcher_v3_HttpGenericBodyMatch_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_has_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_clear_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* const* envoy_config_common_matcher_v3_HttpGenericBodyMatch_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t* len) { - return (const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_config_common_matcher_v3_HttpGenericBodyMatch_patterns(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_set_bytes_limit(envoy_config_common_matcher_v3_HttpGenericBodyMatch *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_common_matcher_v3_HttpGenericBodyMatch_mutable_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t* len) { - return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_common_matcher_v3_HttpGenericBodyMatch_mutable_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_common_matcher_v3_HttpGenericBodyMatch_resize_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t len, upb_Arena* arena) { - return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_common_matcher_v3_HttpGenericBodyMatch_resize_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_add_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, upb_Arena* arena) { - struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.common.matcher.v3.HttpGenericBodyMatch.GenericTextMatch */ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_new(upb_Arena* arena) { - return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena); + return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, arena); } UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1375,7 +1690,7 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* int options, upb_Arena* arena) { envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1383,13 +1698,13 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1398,40 +1713,55 @@ typedef enum { envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET = 0 } envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases; UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_case(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_has_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_clear_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_clear_string_match(envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_has_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_has_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_clear_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET); +UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_clear_binary_match(envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_has_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_set_string_match(envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_set_binary_match(envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_common_matcher_v3_matcher_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_common_matcher_v3_matcher_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPB_H_ */ 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 1632223c524..c07975c25d1 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/socket_option.upb.h" #include "google/protobuf/wrappers.upb.h" @@ -16,146 +18,203 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_core_v3_Pipe__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Pipe__fields[2] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Pipe_msginit = { +const upb_MiniTable envoy_config_core_v3_Pipe_msg_init = { NULL, &envoy_config_core_v3_Pipe__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_EnvoyInternalAddress__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_EnvoyInternalAddress__fields[2] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msginit = { +const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msg_init = { NULL, &envoy_config_core_v3_EnvoyInternalAddress__fields[0], - UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_SocketAddress__fields[6] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_SocketAddress__fields[6] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), -5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit = { +const upb_MiniTable envoy_config_core_v3_SocketAddress_msg_init = { NULL, &envoy_config_core_v3_SocketAddress__fields[0], - UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x002000003f000012, &upb_pss_1bt}, + {0x0010000403000018, &upb_pov4_1bt}, + {0x0010000404000022, &upb_pos_1bt}, + {0x003000003f00002a, &upb_pss_1bt}, + {0x000800003f000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_TcpKeepalive_submsgs[3] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_TcpKeepalive_submsgs[3] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_TcpKeepalive__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_TcpKeepalive__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msginit = { +const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msg_init = { &envoy_config_core_v3_TcpKeepalive_submsgs[0], &envoy_config_core_v3_TcpKeepalive__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_ExtraSourceAddress_submsgs[2] = { - {.submsg = &envoy_config_core_v3_SocketAddress_msginit}, - {.submsg = &envoy_config_core_v3_SocketOptionsOverride_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_ExtraSourceAddress_submsgs[2] = { + {.submsg = &envoy_config_core_v3_SocketAddress_msg_init}, + {.submsg = &envoy_config_core_v3_SocketOptionsOverride_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_ExtraSourceAddress__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ExtraSourceAddress__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ExtraSourceAddress_msginit = { +const upb_MiniTable envoy_config_core_v3_ExtraSourceAddress_msg_init = { &envoy_config_core_v3_ExtraSourceAddress_submsgs[0], &envoy_config_core_v3_ExtraSourceAddress__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_BindConfig_submsgs[5] = { - {.submsg = &envoy_config_core_v3_SocketAddress_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_SocketOption_msginit}, - {.submsg = &envoy_config_core_v3_SocketAddress_msginit}, - {.submsg = &envoy_config_core_v3_ExtraSourceAddress_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_BindConfig_submsgs[5] = { + {.submsg = &envoy_config_core_v3_SocketAddress_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_SocketOption_msg_init}, + {.submsg = &envoy_config_core_v3_SocketAddress_msg_init}, + {.submsg = &envoy_config_core_v3_ExtraSourceAddress_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_BindConfig__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_BindConfig__fields[5] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_BindConfig_msginit = { +const upb_MiniTable envoy_config_core_v3_BindConfig_msg_init = { &envoy_config_core_v3_BindConfig_submsgs[0], &envoy_config_core_v3_BindConfig__fields[0], - UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800003f02001a, &upb_prm_1bt_maxmaxb}, + {0x002000003f030022, &upb_prm_1bt_max128b}, + {0x002800003f04002a, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Address_submsgs[3] = { - {.submsg = &envoy_config_core_v3_SocketAddress_msginit}, - {.submsg = &envoy_config_core_v3_Pipe_msginit}, - {.submsg = &envoy_config_core_v3_EnvoyInternalAddress_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Address_submsgs[3] = { + {.submsg = &envoy_config_core_v3_SocketAddress_msg_init}, + {.submsg = &envoy_config_core_v3_Pipe_msg_init}, + {.submsg = &envoy_config_core_v3_EnvoyInternalAddress_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Address__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Address__fields[3] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Address_msginit = { +const upb_MiniTable envoy_config_core_v3_Address_msg_init = { &envoy_config_core_v3_Address_submsgs[0], &envoy_config_core_v3_Address__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max128b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_CidrRange_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_CidrRange_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_CidrRange__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_CidrRange__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_CidrRange_msginit = { +const upb_MiniTable envoy_config_core_v3_CidrRange_msg_init = { &envoy_config_core_v3_CidrRange_submsgs[0], &envoy_config_core_v3_CidrRange__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[8] = { - &envoy_config_core_v3_Pipe_msginit, - &envoy_config_core_v3_EnvoyInternalAddress_msginit, - &envoy_config_core_v3_SocketAddress_msginit, - &envoy_config_core_v3_TcpKeepalive_msginit, - &envoy_config_core_v3_ExtraSourceAddress_msginit, - &envoy_config_core_v3_BindConfig_msginit, - &envoy_config_core_v3_Address_msginit, - &envoy_config_core_v3_CidrRange_msginit, + &envoy_config_core_v3_Pipe_msg_init, + &envoy_config_core_v3_EnvoyInternalAddress_msg_init, + &envoy_config_core_v3_SocketAddress_msg_init, + &envoy_config_core_v3_TcpKeepalive_msg_init, + &envoy_config_core_v3_ExtraSourceAddress_msg_init, + &envoy_config_core_v3_BindConfig_msg_init, + &envoy_config_core_v3_Address_msg_init, + &envoy_config_core_v3_CidrRange_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_address_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_address_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -164,5 +223,5 @@ const upb_MiniTable_File envoy_config_core_v3_address_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 8c5af5a2376..cc9a62be937 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 @@ -9,25 +9,22 @@ #ifndef ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_Pipe; -struct envoy_config_core_v3_EnvoyInternalAddress; -struct envoy_config_core_v3_SocketAddress; -struct envoy_config_core_v3_TcpKeepalive; -struct envoy_config_core_v3_ExtraSourceAddress; -struct envoy_config_core_v3_BindConfig; -struct envoy_config_core_v3_Address; -struct envoy_config_core_v3_CidrRange; typedef struct envoy_config_core_v3_Pipe envoy_config_core_v3_Pipe; typedef struct envoy_config_core_v3_EnvoyInternalAddress envoy_config_core_v3_EnvoyInternalAddress; typedef struct envoy_config_core_v3_SocketAddress envoy_config_core_v3_SocketAddress; @@ -36,22 +33,22 @@ typedef struct envoy_config_core_v3_ExtraSourceAddress envoy_config_core_v3_Extr typedef struct envoy_config_core_v3_BindConfig envoy_config_core_v3_BindConfig; typedef struct envoy_config_core_v3_Address envoy_config_core_v3_Address; typedef struct envoy_config_core_v3_CidrRange envoy_config_core_v3_CidrRange; -extern const upb_MiniTable envoy_config_core_v3_Pipe_msginit; -extern const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit; -extern const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msginit; -extern const upb_MiniTable envoy_config_core_v3_ExtraSourceAddress_msginit; -extern const upb_MiniTable envoy_config_core_v3_BindConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit; +extern const upb_MiniTable envoy_config_core_v3_Pipe_msg_init; +extern const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketAddress_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ExtraSourceAddress_msg_init; +extern const upb_MiniTable envoy_config_core_v3_BindConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_CidrRange_msg_init; struct envoy_config_core_v3_SocketOption; struct envoy_config_core_v3_SocketOptionsOverride; struct google_protobuf_BoolValue; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_SocketOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_config_core_v3_SocketAddress_TCP = 0, @@ -63,12 +60,12 @@ typedef enum { /* envoy.config.core.v3.Pipe */ UPB_INLINE envoy_config_core_v3_Pipe* envoy_config_core_v3_Pipe_new(upb_Arena* arena) { - return (envoy_config_core_v3_Pipe*)_upb_Message_New(&envoy_config_core_v3_Pipe_msginit, arena); + return (envoy_config_core_v3_Pipe*)_upb_Message_New(&envoy_config_core_v3_Pipe_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Pipe* envoy_config_core_v3_Pipe_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Pipe* ret = envoy_config_core_v3_Pipe_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Pipe_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -78,7 +75,7 @@ UPB_INLINE envoy_config_core_v3_Pipe* envoy_config_core_v3_Pipe_parse_ex(const c int options, upb_Arena* arena) { envoy_config_core_v3_Pipe* ret = envoy_config_core_v3_Pipe_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Pipe_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -86,44 +83,56 @@ UPB_INLINE envoy_config_core_v3_Pipe* envoy_config_core_v3_Pipe_parse_ex(const c } UPB_INLINE char* envoy_config_core_v3_Pipe_serialize(const envoy_config_core_v3_Pipe* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Pipe_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Pipe_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Pipe_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Pipe_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_Pipe_clear_path(envoy_config_core_v3_Pipe* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Pipe_path(const envoy_config_core_v3_Pipe* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Pipe_clear_mode(const envoy_config_core_v3_Pipe* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0; +UPB_INLINE void envoy_config_core_v3_Pipe_clear_mode(envoy_config_core_v3_Pipe* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_core_v3_Pipe_mode(const envoy_config_core_v3_Pipe* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_Pipe_set_path(envoy_config_core_v3_Pipe *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Pipe_set_mode(envoy_config_core_v3_Pipe *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.EnvoyInternalAddress */ UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_EnvoyInternalAddress_new(upb_Arena* arena) { - return (envoy_config_core_v3_EnvoyInternalAddress*)_upb_Message_New(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena); + return (envoy_config_core_v3_EnvoyInternalAddress*)_upb_Message_New(&envoy_config_core_v3_EnvoyInternalAddress_msg_init, arena); } UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_EnvoyInternalAddress_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_EnvoyInternalAddress* ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -133,7 +142,7 @@ UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Envoy int options, upb_Arena* arena) { envoy_config_core_v3_EnvoyInternalAddress* ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -141,13 +150,13 @@ UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Envoy } UPB_INLINE char* envoy_config_core_v3_EnvoyInternalAddress_serialize(const envoy_config_core_v3_EnvoyInternalAddress* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -155,40 +164,54 @@ typedef enum { envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_NOT_SET = 0 } envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_case(const envoy_config_core_v3_EnvoyInternalAddress* msg) { - return (envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_EnvoyInternalAddress_has_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_clear_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_clear_server_listener_name(envoy_config_core_v3_EnvoyInternalAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_EnvoyInternalAddress_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_clear_endpoint_id(const envoy_config_core_v3_EnvoyInternalAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_EnvoyInternalAddress_has_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_clear_endpoint_id(envoy_config_core_v3_EnvoyInternalAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_EnvoyInternalAddress_endpoint_id(const envoy_config_core_v3_EnvoyInternalAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_set_server_listener_name(envoy_config_core_v3_EnvoyInternalAddress *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_set_endpoint_id(envoy_config_core_v3_EnvoyInternalAddress *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.SocketAddress */ UPB_INLINE envoy_config_core_v3_SocketAddress* envoy_config_core_v3_SocketAddress_new(upb_Arena* arena) { - return (envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena); + return (envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msg_init, arena); } UPB_INLINE envoy_config_core_v3_SocketAddress* envoy_config_core_v3_SocketAddress_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_SocketAddress* ret = envoy_config_core_v3_SocketAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -198,7 +221,7 @@ UPB_INLINE envoy_config_core_v3_SocketAddress* envoy_config_core_v3_SocketAddres int options, upb_Arena* arena) { envoy_config_core_v3_SocketAddress* ret = envoy_config_core_v3_SocketAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -206,13 +229,13 @@ UPB_INLINE envoy_config_core_v3_SocketAddress* envoy_config_core_v3_SocketAddres } UPB_INLINE char* envoy_config_core_v3_SocketAddress_serialize(const envoy_config_core_v3_SocketAddress* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -221,79 +244,118 @@ typedef enum { envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET = 0 } envoy_config_core_v3_SocketAddress_port_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_SocketAddress_port_specifier_oneofcases envoy_config_core_v3_SocketAddress_port_specifier_case(const envoy_config_core_v3_SocketAddress* msg) { - return (envoy_config_core_v3_SocketAddress_port_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_SocketAddress_port_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_protocol(const envoy_config_core_v3_SocketAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_protocol(envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_SocketAddress_protocol(const envoy_config_core_v3_SocketAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_address(const envoy_config_core_v3_SocketAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_address(envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_address(const envoy_config_core_v3_SocketAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_port_value(const envoy_config_core_v3_SocketAddress* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; -} -UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_port_value(const envoy_config_core_v3_SocketAddress* msg) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_port_value(envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_core_v3_SocketAddress_port_value(const envoy_config_core_v3_SocketAddress* msg) { - return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, _upb_UInt32_FromU(0u)); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_named_port(const envoy_config_core_v3_SocketAddress* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_port_value(const envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_named_port(const envoy_config_core_v3_SocketAddress* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_named_port(envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_named_port(const envoy_config_core_v3_SocketAddress* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_resolver_name(const envoy_config_core_v3_SocketAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_named_port(const envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_resolver_name(envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_resolver_name(const envoy_config_core_v3_SocketAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_ipv4_compat(const envoy_config_core_v3_SocketAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_ipv4_compat(envoy_config_core_v3_SocketAddress* msg) { + const upb_MiniTableField field = {6, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_SocketAddress_ipv4_compat(const envoy_config_core_v3_SocketAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_SocketAddress_set_protocol(envoy_config_core_v3_SocketAddress *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketAddress_set_address(envoy_config_core_v3_SocketAddress *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketAddress_set_port_value(envoy_config_core_v3_SocketAddress *msg, uint32_t value) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketAddress_set_named_port(envoy_config_core_v3_SocketAddress *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketAddress_set_resolver_name(envoy_config_core_v3_SocketAddress *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketAddress_set_ipv4_compat(envoy_config_core_v3_SocketAddress *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {6, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.TcpKeepalive */ UPB_INLINE envoy_config_core_v3_TcpKeepalive* envoy_config_core_v3_TcpKeepalive_new(upb_Arena* arena) { - return (envoy_config_core_v3_TcpKeepalive*)_upb_Message_New(&envoy_config_core_v3_TcpKeepalive_msginit, arena); + return (envoy_config_core_v3_TcpKeepalive*)_upb_Message_New(&envoy_config_core_v3_TcpKeepalive_msg_init, arena); } UPB_INLINE envoy_config_core_v3_TcpKeepalive* envoy_config_core_v3_TcpKeepalive_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_TcpKeepalive* ret = envoy_config_core_v3_TcpKeepalive_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -303,7 +365,7 @@ UPB_INLINE envoy_config_core_v3_TcpKeepalive* envoy_config_core_v3_TcpKeepalive_ int options, upb_Arena* arena) { envoy_config_core_v3_TcpKeepalive* ret = envoy_config_core_v3_TcpKeepalive_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -311,79 +373,94 @@ UPB_INLINE envoy_config_core_v3_TcpKeepalive* envoy_config_core_v3_TcpKeepalive_ } UPB_INLINE char* envoy_config_core_v3_TcpKeepalive_serialize(const envoy_config_core_v3_TcpKeepalive* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_probes(const envoy_config_core_v3_TcpKeepalive* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_probes(envoy_config_core_v3_TcpKeepalive* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_probes(const envoy_config_core_v3_TcpKeepalive* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_time(const envoy_config_core_v3_TcpKeepalive* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_probes(const envoy_config_core_v3_TcpKeepalive* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_time(const envoy_config_core_v3_TcpKeepalive* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_time(envoy_config_core_v3_TcpKeepalive* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_time(const envoy_config_core_v3_TcpKeepalive* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_interval(const envoy_config_core_v3_TcpKeepalive* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_time(const envoy_config_core_v3_TcpKeepalive* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_interval(const envoy_config_core_v3_TcpKeepalive* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_interval(envoy_config_core_v3_TcpKeepalive* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_interval(const envoy_config_core_v3_TcpKeepalive* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_interval(const envoy_config_core_v3_TcpKeepalive* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_probes(envoy_config_core_v3_TcpKeepalive* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_probes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_time(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_time(envoy_config_core_v3_TcpKeepalive* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_time(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_TcpKeepalive_set_keepalive_time(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_TcpKeepalive_set_keepalive_time(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_interval(envoy_config_core_v3_TcpKeepalive* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(msg, sub); } return sub; } @@ -391,12 +468,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive /* envoy.config.core.v3.ExtraSourceAddress */ UPB_INLINE envoy_config_core_v3_ExtraSourceAddress* envoy_config_core_v3_ExtraSourceAddress_new(upb_Arena* arena) { - return (envoy_config_core_v3_ExtraSourceAddress*)_upb_Message_New(&envoy_config_core_v3_ExtraSourceAddress_msginit, arena); + return (envoy_config_core_v3_ExtraSourceAddress*)_upb_Message_New(&envoy_config_core_v3_ExtraSourceAddress_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ExtraSourceAddress* envoy_config_core_v3_ExtraSourceAddress_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ExtraSourceAddress* ret = envoy_config_core_v3_ExtraSourceAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtraSourceAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtraSourceAddress_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -406,7 +483,7 @@ UPB_INLINE envoy_config_core_v3_ExtraSourceAddress* envoy_config_core_v3_ExtraSo int options, upb_Arena* arena) { envoy_config_core_v3_ExtraSourceAddress* ret = envoy_config_core_v3_ExtraSourceAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtraSourceAddress_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtraSourceAddress_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -414,57 +491,67 @@ UPB_INLINE envoy_config_core_v3_ExtraSourceAddress* envoy_config_core_v3_ExtraSo } UPB_INLINE char* envoy_config_core_v3_ExtraSourceAddress_serialize(const envoy_config_core_v3_ExtraSourceAddress* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ExtraSourceAddress_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ExtraSourceAddress_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_core_v3_ExtraSourceAddress_serialize_ex(const envoy_config_core_v3_ExtraSourceAddress* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ExtraSourceAddress_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ExtraSourceAddress_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_config_core_v3_ExtraSourceAddress_has_address(const envoy_config_core_v3_ExtraSourceAddress* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_ExtraSourceAddress_clear_address(const envoy_config_core_v3_ExtraSourceAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ExtraSourceAddress_clear_address(envoy_config_core_v3_ExtraSourceAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_ExtraSourceAddress_address(const envoy_config_core_v3_ExtraSourceAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_SocketAddress*); + const envoy_config_core_v3_SocketAddress* default_val = NULL; + const envoy_config_core_v3_SocketAddress* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ExtraSourceAddress_has_socket_options(const envoy_config_core_v3_ExtraSourceAddress* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_ExtraSourceAddress_has_address(const envoy_config_core_v3_ExtraSourceAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ExtraSourceAddress_clear_socket_options(const envoy_config_core_v3_ExtraSourceAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ExtraSourceAddress_clear_socket_options(envoy_config_core_v3_ExtraSourceAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_v3_ExtraSourceAddress_socket_options(const envoy_config_core_v3_ExtraSourceAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_SocketOptionsOverride*); + const struct envoy_config_core_v3_SocketOptionsOverride* default_val = NULL; + const struct envoy_config_core_v3_SocketOptionsOverride* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_ExtraSourceAddress_has_socket_options(const envoy_config_core_v3_ExtraSourceAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_ExtraSourceAddress_set_address(envoy_config_core_v3_ExtraSourceAddress *msg, envoy_config_core_v3_SocketAddress* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_SocketAddress*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_ExtraSourceAddress_mutable_address(envoy_config_core_v3_ExtraSourceAddress* msg, upb_Arena* arena) { struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_ExtraSourceAddress_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ExtraSourceAddress_set_address(msg, sub); + sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msg_init, arena); + if (sub) envoy_config_core_v3_ExtraSourceAddress_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ExtraSourceAddress_set_socket_options(envoy_config_core_v3_ExtraSourceAddress *msg, struct envoy_config_core_v3_SocketOptionsOverride* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_SocketOptionsOverride*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_v3_ExtraSourceAddress_mutable_socket_options(envoy_config_core_v3_ExtraSourceAddress* msg, upb_Arena* arena) { struct envoy_config_core_v3_SocketOptionsOverride* sub = (struct envoy_config_core_v3_SocketOptionsOverride*)envoy_config_core_v3_ExtraSourceAddress_socket_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SocketOptionsOverride*)_upb_Message_New(&envoy_config_core_v3_SocketOptionsOverride_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ExtraSourceAddress_set_socket_options(msg, sub); + sub = (struct envoy_config_core_v3_SocketOptionsOverride*)_upb_Message_New(&envoy_config_core_v3_SocketOptionsOverride_msg_init, arena); + if (sub) envoy_config_core_v3_ExtraSourceAddress_set_socket_options(msg, sub); } return sub; } @@ -472,12 +559,12 @@ UPB_INLINE struct envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_ /* envoy.config.core.v3.BindConfig */ UPB_INLINE envoy_config_core_v3_BindConfig* envoy_config_core_v3_BindConfig_new(upb_Arena* arena) { - return (envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msginit, arena); + return (envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msg_init, arena); } UPB_INLINE envoy_config_core_v3_BindConfig* envoy_config_core_v3_BindConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_BindConfig* ret = envoy_config_core_v3_BindConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -487,7 +574,7 @@ UPB_INLINE envoy_config_core_v3_BindConfig* envoy_config_core_v3_BindConfig_pars int options, upb_Arena* arena) { envoy_config_core_v3_BindConfig* ret = envoy_config_core_v3_BindConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -495,133 +582,218 @@ UPB_INLINE envoy_config_core_v3_BindConfig* envoy_config_core_v3_BindConfig_pars } UPB_INLINE char* envoy_config_core_v3_BindConfig_serialize(const envoy_config_core_v3_BindConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_BindConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_BindConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_BindConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_BindConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_BindConfig_clear_source_address(const envoy_config_core_v3_BindConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_BindConfig_clear_source_address(envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_source_address(const envoy_config_core_v3_BindConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_SocketAddress*); + const envoy_config_core_v3_SocketAddress* default_val = NULL; + const envoy_config_core_v3_SocketAddress* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_BindConfig_has_freebind(const envoy_config_core_v3_BindConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_BindConfig_has_source_address(const envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_BindConfig_clear_freebind(const envoy_config_core_v3_BindConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_BindConfig_clear_freebind(envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_BindConfig_freebind(const envoy_config_core_v3_BindConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_BindConfig_has_freebind(const envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_BindConfig_clear_socket_options(envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_core_v3_BindConfig_socket_options(const envoy_config_core_v3_BindConfig* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_BindConfig_has_socket_options(const envoy_config_core_v3_BindConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_core_v3_BindConfig_socket_options(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_BindConfig_clear_socket_options(const envoy_config_core_v3_BindConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void envoy_config_core_v3_BindConfig_clear_additional_source_addresses(envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_core_v3_BindConfig_socket_options(const envoy_config_core_v3_BindConfig* msg, size_t* len) { - return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE const envoy_config_core_v3_SocketAddress* const* envoy_config_core_v3_BindConfig_additional_source_addresses(const envoy_config_core_v3_BindConfig* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_SocketAddress* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_BindConfig_has_additional_source_addresses(const envoy_config_core_v3_BindConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + envoy_config_core_v3_BindConfig_additional_source_addresses(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_BindConfig_clear_additional_source_addresses(const envoy_config_core_v3_BindConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE void envoy_config_core_v3_BindConfig_clear_extra_source_addresses(envoy_config_core_v3_BindConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_core_v3_SocketAddress* const* envoy_config_core_v3_BindConfig_additional_source_addresses(const envoy_config_core_v3_BindConfig* msg, size_t* len) { - return (const envoy_config_core_v3_SocketAddress* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE const envoy_config_core_v3_ExtraSourceAddress* const* envoy_config_core_v3_BindConfig_extra_source_addresses(const envoy_config_core_v3_BindConfig* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_ExtraSourceAddress* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_BindConfig_has_extra_source_addresses(const envoy_config_core_v3_BindConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE void envoy_config_core_v3_BindConfig_clear_extra_source_addresses(const envoy_config_core_v3_BindConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE const envoy_config_core_v3_ExtraSourceAddress* const* envoy_config_core_v3_BindConfig_extra_source_addresses(const envoy_config_core_v3_BindConfig* msg, size_t* len) { - return (const envoy_config_core_v3_ExtraSourceAddress* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); + size_t size; + envoy_config_core_v3_BindConfig_extra_source_addresses(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_BindConfig_set_source_address(envoy_config_core_v3_BindConfig *msg, envoy_config_core_v3_SocketAddress* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_SocketAddress*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_mutable_source_address(envoy_config_core_v3_BindConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_BindConfig_source_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_BindConfig_set_source_address(msg, sub); + sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msg_init, arena); + if (sub) envoy_config_core_v3_BindConfig_set_source_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_BindConfig_set_freebind(envoy_config_core_v3_BindConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_BindConfig_mutable_freebind(envoy_config_core_v3_BindConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_BindConfig_freebind(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_BindConfig_set_freebind(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_BindConfig_set_freebind(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_mutable_socket_options(envoy_config_core_v3_BindConfig* msg, size_t* len) { - return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_mutable_socket_options(envoy_config_core_v3_BindConfig* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_SocketOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_resize_socket_options(envoy_config_core_v3_BindConfig* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_SocketOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_resize_socket_options(envoy_config_core_v3_BindConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_SocketOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_core_v3_BindConfig_add_socket_options(envoy_config_core_v3_BindConfig* msg, upb_Arena* arena) { - struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_core_v3_SocketAddress** envoy_config_core_v3_BindConfig_mutable_additional_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t* len) { - return (envoy_config_core_v3_SocketAddress**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_config_core_v3_SocketAddress** envoy_config_core_v3_BindConfig_mutable_additional_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_SocketAddress**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_SocketAddress** envoy_config_core_v3_BindConfig_resize_additional_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_SocketAddress**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_SocketAddress** envoy_config_core_v3_BindConfig_resize_additional_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_SocketAddress**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_add_additional_source_addresses(envoy_config_core_v3_BindConfig* msg, upb_Arena* arena) { - struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_core_v3_ExtraSourceAddress** envoy_config_core_v3_BindConfig_mutable_extra_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t* len) { - return (envoy_config_core_v3_ExtraSourceAddress**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE envoy_config_core_v3_ExtraSourceAddress** envoy_config_core_v3_BindConfig_mutable_extra_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_ExtraSourceAddress**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_ExtraSourceAddress** envoy_config_core_v3_BindConfig_resize_extra_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_ExtraSourceAddress**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_ExtraSourceAddress** envoy_config_core_v3_BindConfig_resize_extra_source_addresses(envoy_config_core_v3_BindConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_ExtraSourceAddress**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_ExtraSourceAddress* envoy_config_core_v3_BindConfig_add_extra_source_addresses(envoy_config_core_v3_BindConfig* msg, upb_Arena* arena) { - struct envoy_config_core_v3_ExtraSourceAddress* sub = (struct envoy_config_core_v3_ExtraSourceAddress*)_upb_Message_New(&envoy_config_core_v3_ExtraSourceAddress_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_ExtraSourceAddress* sub = (struct envoy_config_core_v3_ExtraSourceAddress*)_upb_Message_New(&envoy_config_core_v3_ExtraSourceAddress_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.Address */ UPB_INLINE envoy_config_core_v3_Address* envoy_config_core_v3_Address_new(upb_Arena* arena) { - return (envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); + return (envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Address* envoy_config_core_v3_Address_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Address* ret = envoy_config_core_v3_Address_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Address_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -631,7 +803,7 @@ UPB_INLINE envoy_config_core_v3_Address* envoy_config_core_v3_Address_parse_ex(c int options, upb_Arena* arena) { envoy_config_core_v3_Address* ret = envoy_config_core_v3_Address_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Address_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -639,13 +811,13 @@ UPB_INLINE envoy_config_core_v3_Address* envoy_config_core_v3_Address_parse_ex(c } UPB_INLINE char* envoy_config_core_v3_Address_serialize(const envoy_config_core_v3_Address* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Address_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Address_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Address_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Address_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -655,69 +827,88 @@ typedef enum { envoy_config_core_v3_Address_address_NOT_SET = 0 } envoy_config_core_v3_Address_address_oneofcases; UPB_INLINE envoy_config_core_v3_Address_address_oneofcases envoy_config_core_v3_Address_address_case(const envoy_config_core_v3_Address* msg) { - return (envoy_config_core_v3_Address_address_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_Address_address_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_Address_has_socket_address(const envoy_config_core_v3_Address* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_Address_clear_socket_address(const envoy_config_core_v3_Address* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SocketAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Address_address_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Address_clear_socket_address(envoy_config_core_v3_Address* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_Address_socket_address(const envoy_config_core_v3_Address* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_SocketAddress*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_core_v3_SocketAddress* default_val = NULL; + const envoy_config_core_v3_SocketAddress* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Address_has_pipe(const envoy_config_core_v3_Address* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_Address_has_socket_address(const envoy_config_core_v3_Address* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Address_clear_pipe(const envoy_config_core_v3_Address* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Pipe*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Address_address_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Address_clear_pipe(envoy_config_core_v3_Address* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_Pipe* envoy_config_core_v3_Address_pipe(const envoy_config_core_v3_Address* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Pipe*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_core_v3_Pipe* default_val = NULL; + const envoy_config_core_v3_Pipe* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Address_has_envoy_internal_address(const envoy_config_core_v3_Address* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_core_v3_Address_has_pipe(const envoy_config_core_v3_Address* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Address_clear_envoy_internal_address(const envoy_config_core_v3_Address* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Address_address_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Address_clear_envoy_internal_address(envoy_config_core_v3_Address* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Address_envoy_internal_address(const envoy_config_core_v3_Address* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_core_v3_EnvoyInternalAddress* default_val = NULL; + const envoy_config_core_v3_EnvoyInternalAddress* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_Address_has_envoy_internal_address(const envoy_config_core_v3_Address* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_Address_set_socket_address(envoy_config_core_v3_Address *msg, envoy_config_core_v3_SocketAddress* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SocketAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_Address_mutable_socket_address(envoy_config_core_v3_Address* msg, upb_Arena* arena) { struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_Address_socket_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Address_set_socket_address(msg, sub); + sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msg_init, arena); + if (sub) envoy_config_core_v3_Address_set_socket_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Address_set_pipe(envoy_config_core_v3_Address *msg, envoy_config_core_v3_Pipe* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Pipe*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Pipe* envoy_config_core_v3_Address_mutable_pipe(envoy_config_core_v3_Address* msg, upb_Arena* arena) { struct envoy_config_core_v3_Pipe* sub = (struct envoy_config_core_v3_Pipe*)envoy_config_core_v3_Address_pipe(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Pipe*)_upb_Message_New(&envoy_config_core_v3_Pipe_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Address_set_pipe(msg, sub); + sub = (struct envoy_config_core_v3_Pipe*)_upb_Message_New(&envoy_config_core_v3_Pipe_msg_init, arena); + if (sub) envoy_config_core_v3_Address_set_pipe(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Address_set_envoy_internal_address(envoy_config_core_v3_Address *msg, envoy_config_core_v3_EnvoyInternalAddress* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Address_mutable_envoy_internal_address(envoy_config_core_v3_Address* msg, upb_Arena* arena) { struct envoy_config_core_v3_EnvoyInternalAddress* sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)envoy_config_core_v3_Address_envoy_internal_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)_upb_Message_New(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Address_set_envoy_internal_address(msg, sub); + sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)_upb_Message_New(&envoy_config_core_v3_EnvoyInternalAddress_msg_init, arena); + if (sub) envoy_config_core_v3_Address_set_envoy_internal_address(msg, sub); } return sub; } @@ -725,12 +916,12 @@ UPB_INLINE struct envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v /* envoy.config.core.v3.CidrRange */ UPB_INLINE envoy_config_core_v3_CidrRange* envoy_config_core_v3_CidrRange_new(upb_Arena* arena) { - return (envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); + return (envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); } UPB_INLINE envoy_config_core_v3_CidrRange* envoy_config_core_v3_CidrRange_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_CidrRange* ret = envoy_config_core_v3_CidrRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -740,7 +931,7 @@ UPB_INLINE envoy_config_core_v3_CidrRange* envoy_config_core_v3_CidrRange_parse_ int options, upb_Arena* arena) { envoy_config_core_v3_CidrRange* ret = envoy_config_core_v3_CidrRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -748,54 +939,65 @@ UPB_INLINE envoy_config_core_v3_CidrRange* envoy_config_core_v3_CidrRange_parse_ } UPB_INLINE char* envoy_config_core_v3_CidrRange_serialize(const envoy_config_core_v3_CidrRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_CidrRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_CidrRange_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_CidrRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_CidrRange_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_CidrRange_clear_address_prefix(envoy_config_core_v3_CidrRange* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_CidrRange_address_prefix(const envoy_config_core_v3_CidrRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_CidrRange_has_prefix_len(const envoy_config_core_v3_CidrRange* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_CidrRange_clear_prefix_len(const envoy_config_core_v3_CidrRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_CidrRange_clear_prefix_len(envoy_config_core_v3_CidrRange* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_prefix_len(const envoy_config_core_v3_CidrRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_CidrRange_has_prefix_len(const envoy_config_core_v3_CidrRange* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_CidrRange_set_address_prefix(envoy_config_core_v3_CidrRange *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_CidrRange_set_prefix_len(envoy_config_core_v3_CidrRange *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_mutable_prefix_len(envoy_config_core_v3_CidrRange* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_CidrRange_prefix_len(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_CidrRange_set_prefix_len(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_CidrRange_set_prefix_len(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_address_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_address_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_ */ 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 577a8b07389..aec6bcfa29e 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 @@ -7,36 +7,45 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/backoff.upb.h" #include "google/protobuf/duration.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_BackoffStrategy_submsgs[2] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_BackoffStrategy_submsgs[2] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_BackoffStrategy__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_BackoffStrategy__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msginit = { +const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msg_init = { &envoy_config_core_v3_BackoffStrategy_submsgs[0], &envoy_config_core_v3_BackoffStrategy__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_core_v3_BackoffStrategy_msginit, + &envoy_config_core_v3_BackoffStrategy_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_backoff_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_backoff_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -45,5 +54,5 @@ const upb_MiniTable_File envoy_config_core_v3_backoff_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 78be6084151..d42e698ef22 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_BackoffStrategy; typedef struct envoy_config_core_v3_BackoffStrategy envoy_config_core_v3_BackoffStrategy; -extern const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msginit; +extern const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msg_init; struct google_protobuf_Duration; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* envoy.config.core.v3.BackoffStrategy */ UPB_INLINE envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_BackoffStrategy_new(upb_Arena* arena) { - return (envoy_config_core_v3_BackoffStrategy*)_upb_Message_New(&envoy_config_core_v3_BackoffStrategy_msginit, arena); + return (envoy_config_core_v3_BackoffStrategy*)_upb_Message_New(&envoy_config_core_v3_BackoffStrategy_msg_init, arena); } UPB_INLINE envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_BackoffStrategy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_BackoffStrategy* ret = envoy_config_core_v3_BackoffStrategy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_BackoffStr int options, upb_Arena* arena) { envoy_config_core_v3_BackoffStrategy* ret = envoy_config_core_v3_BackoffStrategy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,67 +58,77 @@ UPB_INLINE envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_BackoffStr } UPB_INLINE char* envoy_config_core_v3_BackoffStrategy_serialize(const envoy_config_core_v3_BackoffStrategy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_BackoffStrategy_clear_base_interval(const envoy_config_core_v3_BackoffStrategy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_BackoffStrategy_clear_base_interval(envoy_config_core_v3_BackoffStrategy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_base_interval(const envoy_config_core_v3_BackoffStrategy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_max_interval(const envoy_config_core_v3_BackoffStrategy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_base_interval(const envoy_config_core_v3_BackoffStrategy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_BackoffStrategy_clear_max_interval(const envoy_config_core_v3_BackoffStrategy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_BackoffStrategy_clear_max_interval(envoy_config_core_v3_BackoffStrategy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_max_interval(const envoy_config_core_v3_BackoffStrategy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_max_interval(const envoy_config_core_v3_BackoffStrategy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_base_interval(envoy_config_core_v3_BackoffStrategy *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_mutable_base_interval(envoy_config_core_v3_BackoffStrategy* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_BackoffStrategy_base_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_BackoffStrategy_set_base_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_BackoffStrategy_set_base_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_max_interval(envoy_config_core_v3_BackoffStrategy *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_mutable_max_interval(envoy_config_core_v3_BackoffStrategy* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_BackoffStrategy_max_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_BackoffStrategy_set_max_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_BackoffStrategy_set_max_interval(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_backoff_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_backoff_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_ */ 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 54654db53b7..9cc9bd5ec62 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/backoff.upb.h" @@ -24,391 +26,548 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_core_v3_Locality__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Locality__fields[3] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Locality_msginit = { +const upb_MiniTable envoy_config_core_v3_Locality_msg_init = { NULL, &envoy_config_core_v3_Locality__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_BuildVersion_submsgs[2] = { - {.submsg = &envoy_type_v3_SemanticVersion_msginit}, - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_BuildVersion_submsgs[2] = { + {.submsg = &envoy_type_v3_SemanticVersion_msg_init}, + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_BuildVersion__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_BuildVersion__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_BuildVersion_msginit = { +const upb_MiniTable envoy_config_core_v3_BuildVersion_msg_init = { &envoy_config_core_v3_BuildVersion_submsgs[0], &envoy_config_core_v3_BuildVersion__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Extension_submsgs[1] = { - {.submsg = &envoy_config_core_v3_BuildVersion_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Extension_submsgs[1] = { + {.submsg = &envoy_config_core_v3_BuildVersion_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Extension__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Extension__fields[6] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Extension_msginit = { +const upb_MiniTable envoy_config_core_v3_Extension_msg_init = { &envoy_config_core_v3_Extension_submsgs[0], &envoy_config_core_v3_Extension__fields[0], - UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_pss_1bt}, + {0x0038000001000022, &upb_psm_1bt_max64b}, + {0x000100003f000028, &upb_psb1_1bt}, + {0x004000003f000032, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Node_submsgs[6] = { - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &envoy_config_core_v3_Locality_msginit}, - {.submsg = &envoy_config_core_v3_BuildVersion_msginit}, - {.submsg = &envoy_config_core_v3_Extension_msginit}, - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_core_v3_Node_DynamicParametersEntry_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Node_submsgs[6] = { + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &envoy_config_core_v3_Locality_msg_init}, + {.submsg = &envoy_config_core_v3_BuildVersion_msg_init}, + {.submsg = &envoy_config_core_v3_Extension_msg_init}, + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_core_v3_Node_DynamicParametersEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Node__fields[11] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(36, 64), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(56, 104), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(60, 112), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Node__fields[11] = { + {1, UPB_SIZE(40, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(48, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(56, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(20, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(24, 104), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Node_msginit = { +const upb_MiniTable envoy_config_core_v3_Node_msg_init = { &envoy_config_core_v3_Node_submsgs[0], &envoy_config_core_v3_Node__fields[0], - UPB_SIZE(64, 120), 11, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(64, 120), 11, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x002800003f000012, &upb_pss_1bt}, + {0x003800000100001a, &upb_psm_1bt_maxmaxb}, + {0x0040000002010022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x004800003f000032, &upb_pss_1bt}, + {0x000800040700003a, &upb_pos_1bt}, + {0x0008000408020042, &upb_pom_1bt_max64b}, + {0x005800003f03004a, &upb_prm_1bt_max128b}, + {0x006000003f000052, &upb_prs_1bt}, + {0x006800003f04005a, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[1] = { - {.submsg = &xds_core_v3_ContextParams_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[1] = { + {.submsg = &xds_core_v3_ContextParams_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Node_DynamicParametersEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Node_DynamicParametersEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Node_DynamicParametersEntry_msginit = { +const upb_MiniTable envoy_config_core_v3_Node_DynamicParametersEntry_msg_init = { &envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[0], &envoy_config_core_v3_Node_DynamicParametersEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Metadata_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Metadata_FilterMetadataEntry_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Metadata__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Metadata__fields[2] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Metadata_msginit = { +const upb_MiniTable envoy_config_core_v3_Metadata_msg_init = { &envoy_config_core_v3_Metadata_submsgs[0], &envoy_config_core_v3_Metadata__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = { - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = { + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit = { +const upb_MiniTable envoy_config_core_v3_Metadata_FilterMetadataEntry_msg_init = { &envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[0], &envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit = { +const upb_MiniTable envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msg_init = { &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[0], &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_RuntimeUInt32__fields[2] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RuntimeUInt32__fields[2] = { + {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit = { +const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msg_init = { NULL, &envoy_config_core_v3_RuntimeUInt32__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x000800003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_RuntimePercent_submsgs[1] = { - {.submsg = &envoy_type_v3_Percent_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_RuntimePercent_submsgs[1] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_RuntimePercent__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RuntimePercent__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RuntimePercent_msginit = { +const upb_MiniTable envoy_config_core_v3_RuntimePercent_msg_init = { &envoy_config_core_v3_RuntimePercent_submsgs[0], &envoy_config_core_v3_RuntimePercent__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_RuntimeDouble__fields[2] = { - {1, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RuntimeDouble__fields[2] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit = { +const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msg_init = { NULL, &envoy_config_core_v3_RuntimeDouble__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + {0x000800003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = { - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msginit = { +const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msg_init = { &envoy_config_core_v3_RuntimeFeatureFlag_submsgs[0], &envoy_config_core_v3_RuntimeFeatureFlag__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_QueryParameter__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_QueryParameter__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_QueryParameter_msginit = { +const upb_MiniTable envoy_config_core_v3_QueryParameter_msg_init = { NULL, &envoy_config_core_v3_QueryParameter__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_HeaderValue__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HeaderValue__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit = { +const upb_MiniTable envoy_config_core_v3_HeaderValue_msg_init = { NULL, &envoy_config_core_v3_HeaderValue__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HeaderValueOption_submsgs[2] = { - {.submsg = &envoy_config_core_v3_HeaderValue_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HeaderValueOption_submsgs[2] = { + {.submsg = &envoy_config_core_v3_HeaderValue_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HeaderValueOption__fields[4] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HeaderValueOption__fields[4] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit = { +const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msg_init = { &envoy_config_core_v3_HeaderValueOption_submsgs[0], &envoy_config_core_v3_HeaderValueOption__fields[0], - UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_max64b}, + {0x0018000002010012, &upb_psm_1bt_maxmaxb}, + {0x000400003f000018, &upb_psv4_1bt}, + {0x000800003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HeaderMap_submsgs[1] = { - {.submsg = &envoy_config_core_v3_HeaderValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HeaderMap_submsgs[1] = { + {.submsg = &envoy_config_core_v3_HeaderValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HeaderMap__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HeaderMap__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HeaderMap_msginit = { +const upb_MiniTable envoy_config_core_v3_HeaderMap_msg_init = { &envoy_config_core_v3_HeaderMap_submsgs[0], &envoy_config_core_v3_HeaderMap__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_WatchedDirectory__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_WatchedDirectory__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit = { +const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msg_init = { NULL, &envoy_config_core_v3_WatchedDirectory__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_DataSource__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_DataSource__fields[4] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_DataSource_msginit = { +const upb_MiniTable envoy_config_core_v3_DataSource_msg_init = { NULL, &envoy_config_core_v3_DataSource__fields[0], - UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pob_1bt}, + {0x000800000300001a, &upb_pos_1bt}, + {0x0008000004000022, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_RetryPolicy_submsgs[2] = { - {.submsg = &envoy_config_core_v3_BackoffStrategy_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_RetryPolicy_submsgs[2] = { + {.submsg = &envoy_config_core_v3_BackoffStrategy_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_RetryPolicy__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RetryPolicy__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RetryPolicy_msginit = { +const upb_MiniTable envoy_config_core_v3_RetryPolicy_msg_init = { &envoy_config_core_v3_RetryPolicy_submsgs[0], &envoy_config_core_v3_RetryPolicy__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_RemoteDataSource_submsgs[2] = { - {.submsg = &envoy_config_core_v3_HttpUri_msginit}, - {.submsg = &envoy_config_core_v3_RetryPolicy_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_RemoteDataSource_submsgs[2] = { + {.submsg = &envoy_config_core_v3_HttpUri_msg_init}, + {.submsg = &envoy_config_core_v3_RetryPolicy_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_RemoteDataSource__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RemoteDataSource__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RemoteDataSource_msginit = { +const upb_MiniTable envoy_config_core_v3_RemoteDataSource_msg_init = { &envoy_config_core_v3_RemoteDataSource_submsgs[0], &envoy_config_core_v3_RemoteDataSource__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_AsyncDataSource_submsgs[2] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_RemoteDataSource_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_AsyncDataSource_submsgs[2] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_RemoteDataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_AsyncDataSource__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_AsyncDataSource__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_AsyncDataSource_msginit = { +const upb_MiniTable envoy_config_core_v3_AsyncDataSource_msg_init = { &envoy_config_core_v3_AsyncDataSource_submsgs[0], &envoy_config_core_v3_AsyncDataSource__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_TransportSocket_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_TransportSocket_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_TransportSocket__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_TransportSocket__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit = { +const upb_MiniTable envoy_config_core_v3_TransportSocket_msg_init = { &envoy_config_core_v3_TransportSocket_submsgs[0], &envoy_config_core_v3_TransportSocket__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = { - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = { + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit = { +const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msg_init = { &envoy_config_core_v3_RuntimeFractionalPercent_submsgs[0], &envoy_config_core_v3_RuntimeFractionalPercent__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_ControlPlane__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ControlPlane__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit = { +const upb_MiniTable envoy_config_core_v3_ControlPlane_msg_init = { NULL, &envoy_config_core_v3_ControlPlane__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[24] = { - &envoy_config_core_v3_Locality_msginit, - &envoy_config_core_v3_BuildVersion_msginit, - &envoy_config_core_v3_Extension_msginit, - &envoy_config_core_v3_Node_msginit, - &envoy_config_core_v3_Node_DynamicParametersEntry_msginit, - &envoy_config_core_v3_Metadata_msginit, - &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit, - &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit, - &envoy_config_core_v3_RuntimeUInt32_msginit, - &envoy_config_core_v3_RuntimePercent_msginit, - &envoy_config_core_v3_RuntimeDouble_msginit, - &envoy_config_core_v3_RuntimeFeatureFlag_msginit, - &envoy_config_core_v3_QueryParameter_msginit, - &envoy_config_core_v3_HeaderValue_msginit, - &envoy_config_core_v3_HeaderValueOption_msginit, - &envoy_config_core_v3_HeaderMap_msginit, - &envoy_config_core_v3_WatchedDirectory_msginit, - &envoy_config_core_v3_DataSource_msginit, - &envoy_config_core_v3_RetryPolicy_msginit, - &envoy_config_core_v3_RemoteDataSource_msginit, - &envoy_config_core_v3_AsyncDataSource_msginit, - &envoy_config_core_v3_TransportSocket_msginit, - &envoy_config_core_v3_RuntimeFractionalPercent_msginit, - &envoy_config_core_v3_ControlPlane_msginit, + &envoy_config_core_v3_Locality_msg_init, + &envoy_config_core_v3_BuildVersion_msg_init, + &envoy_config_core_v3_Extension_msg_init, + &envoy_config_core_v3_Node_msg_init, + &envoy_config_core_v3_Node_DynamicParametersEntry_msg_init, + &envoy_config_core_v3_Metadata_msg_init, + &envoy_config_core_v3_Metadata_FilterMetadataEntry_msg_init, + &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msg_init, + &envoy_config_core_v3_RuntimeUInt32_msg_init, + &envoy_config_core_v3_RuntimePercent_msg_init, + &envoy_config_core_v3_RuntimeDouble_msg_init, + &envoy_config_core_v3_RuntimeFeatureFlag_msg_init, + &envoy_config_core_v3_QueryParameter_msg_init, + &envoy_config_core_v3_HeaderValue_msg_init, + &envoy_config_core_v3_HeaderValueOption_msg_init, + &envoy_config_core_v3_HeaderMap_msg_init, + &envoy_config_core_v3_WatchedDirectory_msg_init, + &envoy_config_core_v3_DataSource_msg_init, + &envoy_config_core_v3_RetryPolicy_msg_init, + &envoy_config_core_v3_RemoteDataSource_msg_init, + &envoy_config_core_v3_AsyncDataSource_msg_init, + &envoy_config_core_v3_TransportSocket_msg_init, + &envoy_config_core_v3_RuntimeFractionalPercent_msg_init, + &envoy_config_core_v3_ControlPlane_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_base_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_base_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -417,5 +576,5 @@ const upb_MiniTable_File envoy_config_core_v3_base_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 c8f18796c7d..8fd62abeb24 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 @@ -9,41 +9,22 @@ #ifndef ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_Locality; -struct envoy_config_core_v3_BuildVersion; -struct envoy_config_core_v3_Extension; -struct envoy_config_core_v3_Node; -struct envoy_config_core_v3_Node_DynamicParametersEntry; -struct envoy_config_core_v3_Metadata; -struct envoy_config_core_v3_Metadata_FilterMetadataEntry; -struct envoy_config_core_v3_Metadata_TypedFilterMetadataEntry; -struct envoy_config_core_v3_RuntimeUInt32; -struct envoy_config_core_v3_RuntimePercent; -struct envoy_config_core_v3_RuntimeDouble; -struct envoy_config_core_v3_RuntimeFeatureFlag; -struct envoy_config_core_v3_QueryParameter; -struct envoy_config_core_v3_HeaderValue; -struct envoy_config_core_v3_HeaderValueOption; -struct envoy_config_core_v3_HeaderMap; -struct envoy_config_core_v3_WatchedDirectory; -struct envoy_config_core_v3_DataSource; -struct envoy_config_core_v3_RetryPolicy; -struct envoy_config_core_v3_RemoteDataSource; -struct envoy_config_core_v3_AsyncDataSource; -struct envoy_config_core_v3_TransportSocket; -struct envoy_config_core_v3_RuntimeFractionalPercent; -struct envoy_config_core_v3_ControlPlane; typedef struct envoy_config_core_v3_Locality envoy_config_core_v3_Locality; typedef struct envoy_config_core_v3_BuildVersion envoy_config_core_v3_BuildVersion; typedef struct envoy_config_core_v3_Extension envoy_config_core_v3_Extension; @@ -68,30 +49,30 @@ typedef struct envoy_config_core_v3_AsyncDataSource envoy_config_core_v3_AsyncDa typedef struct envoy_config_core_v3_TransportSocket envoy_config_core_v3_TransportSocket; typedef struct envoy_config_core_v3_RuntimeFractionalPercent envoy_config_core_v3_RuntimeFractionalPercent; typedef struct envoy_config_core_v3_ControlPlane envoy_config_core_v3_ControlPlane; -extern const upb_MiniTable envoy_config_core_v3_Locality_msginit; -extern const upb_MiniTable envoy_config_core_v3_BuildVersion_msginit; -extern const upb_MiniTable envoy_config_core_v3_Extension_msginit; -extern const upb_MiniTable envoy_config_core_v3_Node_msginit; -extern const upb_MiniTable envoy_config_core_v3_Node_DynamicParametersEntry_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimePercent_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msginit; -extern const upb_MiniTable envoy_config_core_v3_QueryParameter_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderMap_msginit; -extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_RetryPolicy_msginit; -extern const upb_MiniTable envoy_config_core_v3_RemoteDataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_AsyncDataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit; -extern const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit; +extern const upb_MiniTable envoy_config_core_v3_Locality_msg_init; +extern const upb_MiniTable envoy_config_core_v3_BuildVersion_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Extension_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Node_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Node_DynamicParametersEntry_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_FilterMetadataEntry_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimePercent_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msg_init; +extern const upb_MiniTable envoy_config_core_v3_QueryParameter_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValue_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderMap_msg_init; +extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msg_init; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RetryPolicy_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RemoteDataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_AsyncDataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ControlPlane_msg_init; struct envoy_config_core_v3_Address; struct envoy_config_core_v3_BackoffStrategy; struct envoy_config_core_v3_HttpUri; @@ -103,17 +84,17 @@ struct google_protobuf_BoolValue; struct google_protobuf_Struct; struct google_protobuf_UInt32Value; struct xds_core_v3_ContextParams; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msginit; -extern const upb_MiniTable envoy_config_core_v3_HttpUri_msginit; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable envoy_type_v3_SemanticVersion_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable xds_core_v3_ContextParams_msginit; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HttpUri_msg_init; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable envoy_type_v3_SemanticVersion_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable xds_core_v3_ContextParams_msg_init; typedef enum { envoy_config_core_v3_HeaderValueOption_APPEND_IF_EXISTS_OR_ADD = 0, @@ -150,12 +131,12 @@ typedef enum { /* envoy.config.core.v3.Locality */ UPB_INLINE envoy_config_core_v3_Locality* envoy_config_core_v3_Locality_new(upb_Arena* arena) { - return (envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msginit, arena); + return (envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Locality* envoy_config_core_v3_Locality_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Locality* ret = envoy_config_core_v3_Locality_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Locality_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -165,7 +146,7 @@ UPB_INLINE envoy_config_core_v3_Locality* envoy_config_core_v3_Locality_parse_ex int options, upb_Arena* arena) { envoy_config_core_v3_Locality* ret = envoy_config_core_v3_Locality_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Locality_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -173,53 +154,71 @@ UPB_INLINE envoy_config_core_v3_Locality* envoy_config_core_v3_Locality_parse_ex } UPB_INLINE char* envoy_config_core_v3_Locality_serialize(const envoy_config_core_v3_Locality* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Locality_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Locality_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Locality_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Locality_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_Locality_clear_region(envoy_config_core_v3_Locality* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Locality_region(const envoy_config_core_v3_Locality* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Locality_clear_zone(const envoy_config_core_v3_Locality* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Locality_clear_zone(envoy_config_core_v3_Locality* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Locality_zone(const envoy_config_core_v3_Locality* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Locality_clear_sub_zone(const envoy_config_core_v3_Locality* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Locality_clear_sub_zone(envoy_config_core_v3_Locality* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Locality_sub_zone(const envoy_config_core_v3_Locality* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_Locality_set_region(envoy_config_core_v3_Locality *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Locality_set_zone(envoy_config_core_v3_Locality *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Locality_set_sub_zone(envoy_config_core_v3_Locality *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.BuildVersion */ UPB_INLINE envoy_config_core_v3_BuildVersion* envoy_config_core_v3_BuildVersion_new(upb_Arena* arena) { - return (envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msginit, arena); + return (envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msg_init, arena); } UPB_INLINE envoy_config_core_v3_BuildVersion* envoy_config_core_v3_BuildVersion_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_BuildVersion* ret = envoy_config_core_v3_BuildVersion_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -229,7 +228,7 @@ UPB_INLINE envoy_config_core_v3_BuildVersion* envoy_config_core_v3_BuildVersion_ int options, upb_Arena* arena) { envoy_config_core_v3_BuildVersion* ret = envoy_config_core_v3_BuildVersion_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -237,57 +236,67 @@ UPB_INLINE envoy_config_core_v3_BuildVersion* envoy_config_core_v3_BuildVersion_ } UPB_INLINE char* envoy_config_core_v3_BuildVersion_serialize(const envoy_config_core_v3_BuildVersion* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_BuildVersion_clear_version(const envoy_config_core_v3_BuildVersion* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_BuildVersion_clear_version(envoy_config_core_v3_BuildVersion* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_SemanticVersion* envoy_config_core_v3_BuildVersion_version(const envoy_config_core_v3_BuildVersion* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_SemanticVersion*); + const struct envoy_type_v3_SemanticVersion* default_val = NULL; + const struct envoy_type_v3_SemanticVersion* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_metadata(const envoy_config_core_v3_BuildVersion* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_version(const envoy_config_core_v3_BuildVersion* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_BuildVersion_clear_metadata(const envoy_config_core_v3_BuildVersion* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_BuildVersion_clear_metadata(envoy_config_core_v3_BuildVersion* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_metadata(const envoy_config_core_v3_BuildVersion* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_metadata(const envoy_config_core_v3_BuildVersion* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_BuildVersion_set_version(envoy_config_core_v3_BuildVersion *msg, struct envoy_type_v3_SemanticVersion* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_SemanticVersion*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_SemanticVersion* envoy_config_core_v3_BuildVersion_mutable_version(envoy_config_core_v3_BuildVersion* msg, upb_Arena* arena) { struct envoy_type_v3_SemanticVersion* sub = (struct envoy_type_v3_SemanticVersion*)envoy_config_core_v3_BuildVersion_version(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_SemanticVersion*)_upb_Message_New(&envoy_type_v3_SemanticVersion_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_BuildVersion_set_version(msg, sub); + sub = (struct envoy_type_v3_SemanticVersion*)_upb_Message_New(&envoy_type_v3_SemanticVersion_msg_init, arena); + if (sub) envoy_config_core_v3_BuildVersion_set_version(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_BuildVersion_set_metadata(envoy_config_core_v3_BuildVersion *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_mutable_metadata(envoy_config_core_v3_BuildVersion* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_BuildVersion_metadata(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_BuildVersion_set_metadata(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_core_v3_BuildVersion_set_metadata(msg, sub); } return sub; } @@ -295,12 +304,12 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_muta /* envoy.config.core.v3.Extension */ UPB_INLINE envoy_config_core_v3_Extension* envoy_config_core_v3_Extension_new(upb_Arena* arena) { - return (envoy_config_core_v3_Extension*)_upb_Message_New(&envoy_config_core_v3_Extension_msginit, arena); + return (envoy_config_core_v3_Extension*)_upb_Message_New(&envoy_config_core_v3_Extension_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Extension* envoy_config_core_v3_Extension_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Extension* ret = envoy_config_core_v3_Extension_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Extension_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -310,7 +319,7 @@ UPB_INLINE envoy_config_core_v3_Extension* envoy_config_core_v3_Extension_parse_ int options, upb_Arena* arena) { envoy_config_core_v3_Extension* ret = envoy_config_core_v3_Extension_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Extension_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -318,99 +327,157 @@ UPB_INLINE envoy_config_core_v3_Extension* envoy_config_core_v3_Extension_parse_ } UPB_INLINE char* envoy_config_core_v3_Extension_serialize(const envoy_config_core_v3_Extension* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Extension_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Extension_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Extension_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Extension_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_Extension_clear_name(envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Extension_name(const envoy_config_core_v3_Extension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Extension_clear_category(const envoy_config_core_v3_Extension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Extension_clear_category(envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Extension_category(const envoy_config_core_v3_Extension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Extension_clear_type_descriptor(const envoy_config_core_v3_Extension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Extension_clear_type_descriptor(envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Extension_type_descriptor(const envoy_config_core_v3_Extension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Extension_has_version(const envoy_config_core_v3_Extension* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_Extension_clear_version(const envoy_config_core_v3_Extension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Extension_clear_version(envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Extension_version(const envoy_config_core_v3_Extension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const envoy_config_core_v3_BuildVersion*); + const envoy_config_core_v3_BuildVersion* default_val = NULL; + const envoy_config_core_v3_BuildVersion* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Extension_clear_disabled(const envoy_config_core_v3_Extension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Extension_has_version(const envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Extension_clear_disabled(envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Extension_disabled(const envoy_config_core_v3_Extension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Extension_clear_type_urls(const envoy_config_core_v3_Extension* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 64)); +UPB_INLINE void envoy_config_core_v3_Extension_clear_type_urls(envoy_config_core_v3_Extension* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_core_v3_Extension_type_urls(const envoy_config_core_v3_Extension* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_Extension_type_urls(const envoy_config_core_v3_Extension* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_core_v3_Extension_has_type_urls(const envoy_config_core_v3_Extension* msg) { + size_t size; + envoy_config_core_v3_Extension_type_urls(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_Extension_set_name(envoy_config_core_v3_Extension *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Extension_set_category(envoy_config_core_v3_Extension *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Extension_set_type_descriptor(envoy_config_core_v3_Extension *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Extension_set_version(envoy_config_core_v3_Extension *msg, envoy_config_core_v3_BuildVersion* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_core_v3_BuildVersion*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Extension_mutable_version(envoy_config_core_v3_Extension* msg, upb_Arena* arena) { struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Extension_version(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Extension_set_version(msg, sub); + sub = (struct envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msg_init, arena); + if (sub) envoy_config_core_v3_Extension_set_version(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Extension_set_disabled(envoy_config_core_v3_Extension *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_core_v3_Extension_mutable_type_urls(envoy_config_core_v3_Extension* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_Extension_mutable_type_urls(envoy_config_core_v3_Extension* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_Extension_resize_type_urls(envoy_config_core_v3_Extension* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_Extension_resize_type_urls(envoy_config_core_v3_Extension* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_Extension_add_type_urls(envoy_config_core_v3_Extension* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.core.v3.Node */ UPB_INLINE envoy_config_core_v3_Node* envoy_config_core_v3_Node_new(upb_Arena* arena) { - return (envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); + return (envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Node* envoy_config_core_v3_Node_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Node* ret = envoy_config_core_v3_Node_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Node_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -420,7 +487,7 @@ UPB_INLINE envoy_config_core_v3_Node* envoy_config_core_v3_Node_parse_ex(const c int options, upb_Arena* arena) { envoy_config_core_v3_Node* ret = envoy_config_core_v3_Node_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Node_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -428,13 +495,13 @@ UPB_INLINE envoy_config_core_v3_Node* envoy_config_core_v3_Node_parse_ex(const c } UPB_INLINE char* envoy_config_core_v3_Node_serialize(const envoy_config_core_v3_Node* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Node_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Node_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Node_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Node_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -443,194 +510,338 @@ typedef enum { envoy_config_core_v3_Node_user_agent_version_type_NOT_SET = 0 } envoy_config_core_v3_Node_user_agent_version_type_oneofcases; UPB_INLINE envoy_config_core_v3_Node_user_agent_version_type_oneofcases envoy_config_core_v3_Node_user_agent_version_type_case(const envoy_config_core_v3_Node* msg) { - return (envoy_config_core_v3_Node_user_agent_version_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {7, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_Node_user_agent_version_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Node_clear_id(const envoy_config_core_v3_Node* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Node_clear_id(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Node_id(const envoy_config_core_v3_Node* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(40, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Node_clear_cluster(const envoy_config_core_v3_Node* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Node_clear_cluster(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Node_cluster(const envoy_config_core_v3_Node* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(48, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Node_has_metadata(const envoy_config_core_v3_Node* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_Node_clear_metadata(const envoy_config_core_v3_Node* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Node_clear_metadata(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Node_metadata(const envoy_config_core_v3_Node* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_Node_has_metadata(const envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Node_clear_locality(const envoy_config_core_v3_Node* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Node_clear_locality(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_Locality* envoy_config_core_v3_Node_locality(const envoy_config_core_v3_Node* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const envoy_config_core_v3_Locality*); + const envoy_config_core_v3_Locality* default_val = NULL; + const envoy_config_core_v3_Locality* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_name(const envoy_config_core_v3_Node* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_name(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(56, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Node_user_agent_name(const envoy_config_core_v3_Node* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(56, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_version(const envoy_config_core_v3_Node* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; -} -UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_version(const envoy_config_core_v3_Node* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_Node_user_agent_version_type_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_version(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Node_user_agent_version(const envoy_config_core_v3_Node* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 7, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_build_version(const envoy_config_core_v3_Node* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8; +UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_version(const envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_build_version(const envoy_config_core_v3_Node* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_core_v3_Node_user_agent_version_type_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_build_version(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_user_agent_build_version(const envoy_config_core_v3_Node* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_BuildVersion*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 8, NULL); + const envoy_config_core_v3_BuildVersion* default_val = NULL; + const envoy_config_core_v3_BuildVersion* ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_build_version(const envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Node_clear_extensions(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_Extension* const* envoy_config_core_v3_Node_extensions(const envoy_config_core_v3_Node* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_Extension* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_Node_has_extensions(const envoy_config_core_v3_Node* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); + size_t size; + envoy_config_core_v3_Node_extensions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_Node_clear_extensions(const envoy_config_core_v3_Node* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 88)); +UPB_INLINE void envoy_config_core_v3_Node_clear_client_features(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(20, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_core_v3_Extension* const* envoy_config_core_v3_Node_extensions(const envoy_config_core_v3_Node* msg, size_t* len) { - return (const envoy_config_core_v3_Extension* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_Node_client_features(const envoy_config_core_v3_Node* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(20, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_core_v3_Node_clear_client_features(const envoy_config_core_v3_Node* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 96)); +UPB_INLINE bool envoy_config_core_v3_Node_has_client_features(const envoy_config_core_v3_Node* msg) { + size_t size; + envoy_config_core_v3_Node_client_features(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_core_v3_Node_client_features(const envoy_config_core_v3_Node* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE void envoy_config_core_v3_Node_clear_listening_addresses(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 104), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_Node_listening_addresses(const envoy_config_core_v3_Node* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 104), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_Address* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_Node_has_listening_addresses(const envoy_config_core_v3_Node* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 104)); + size_t size; + envoy_config_core_v3_Node_listening_addresses(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_Node_clear_listening_addresses(const envoy_config_core_v3_Node* msg) { - _upb_array_detach(msg, UPB_SIZE(56, 104)); -} -UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_Node_listening_addresses(const envoy_config_core_v3_Node* msg, size_t* len) { - return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(56, 104), len); -} -UPB_INLINE bool envoy_config_core_v3_Node_has_dynamic_parameters(const envoy_config_core_v3_Node* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 112)); -} -UPB_INLINE void envoy_config_core_v3_Node_clear_dynamic_parameters(const envoy_config_core_v3_Node* msg) { - _upb_array_detach(msg, UPB_SIZE(60, 112)); +UPB_INLINE void envoy_config_core_v3_Node_clear_dynamic_parameters(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_core_v3_Node_dynamic_parameters_size(const envoy_config_core_v3_Node* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(60, 112)); + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_get(const envoy_config_core_v3_Node* msg, upb_StringView key, struct xds_core_v3_ContextParams** val) { - return _upb_msg_map_get(msg, UPB_SIZE(60, 112), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_core_v3_Node_DynamicParametersEntry* envoy_config_core_v3_Node_dynamic_parameters_next(const envoy_config_core_v3_Node* msg, size_t* iter) { - return (const envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(60, 112), iter); + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_config_core_v3_Node_has_dynamic_parameters(const envoy_config_core_v3_Node* msg) { + return envoy_config_core_v3_Node_dynamic_parameters_size(msg) != 0; } UPB_INLINE void envoy_config_core_v3_Node_set_id(envoy_config_core_v3_Node *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(40, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Node_set_cluster(envoy_config_core_v3_Node *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(48, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Node_set_metadata(envoy_config_core_v3_Node *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_Node_mutable_metadata(envoy_config_core_v3_Node* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_Node_metadata(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Node_set_metadata(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_core_v3_Node_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Node_set_locality(envoy_config_core_v3_Node *msg, envoy_config_core_v3_Locality* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), envoy_config_core_v3_Locality*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_core_v3_Node_mutable_locality(envoy_config_core_v3_Node* msg, upb_Arena* arena) { struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_core_v3_Node_locality(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Node_set_locality(msg, sub); + sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msg_init, arena); + if (sub) envoy_config_core_v3_Node_set_locality(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_name(envoy_config_core_v3_Node *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(56, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_version(envoy_config_core_v3_Node *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_build_version(envoy_config_core_v3_Node *msg, envoy_config_core_v3_BuildVersion* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 8); + const upb_MiniTableField field = {8, UPB_SIZE(32, 8), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_mutable_user_agent_build_version(envoy_config_core_v3_Node* msg, upb_Arena* arena) { struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Node_user_agent_build_version(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Node_set_user_agent_build_version(msg, sub); + sub = (struct envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msg_init, arena); + if (sub) envoy_config_core_v3_Node_set_user_agent_build_version(msg, sub); } return sub; } -UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_mutable_extensions(envoy_config_core_v3_Node* msg, size_t* len) { - return (envoy_config_core_v3_Extension**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_mutable_extensions(envoy_config_core_v3_Node* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_Extension**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_resize_extensions(envoy_config_core_v3_Node* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_Extension**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_resize_extensions(envoy_config_core_v3_Node* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_Extension**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_Extension* envoy_config_core_v3_Node_add_extensions(envoy_config_core_v3_Node* msg, upb_Arena* arena) { - struct envoy_config_core_v3_Extension* sub = (struct envoy_config_core_v3_Extension*)_upb_Message_New(&envoy_config_core_v3_Extension_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_Extension* sub = (struct envoy_config_core_v3_Extension*)_upb_Message_New(&envoy_config_core_v3_Extension_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_core_v3_Node_mutable_client_features(envoy_config_core_v3_Node* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_Node_mutable_client_features(envoy_config_core_v3_Node* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(20, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_Node_resize_client_features(envoy_config_core_v3_Node* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_Node_resize_client_features(envoy_config_core_v3_Node* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(20, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_Node_add_client_features(envoy_config_core_v3_Node* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {10, UPB_SIZE(20, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_mutable_listening_addresses(envoy_config_core_v3_Node* msg, size_t* len) { - return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 104), len); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_mutable_listening_addresses(envoy_config_core_v3_Node* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(24, 104), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_Address**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_resize_listening_addresses(envoy_config_core_v3_Node* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_Address**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 104), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_resize_listening_addresses(envoy_config_core_v3_Node* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(24, 104), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_Address**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_Node_add_listening_addresses(envoy_config_core_v3_Node* msg, upb_Arena* arena) { - struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 104), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {11, UPB_SIZE(24, 104), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE void envoy_config_core_v3_Node_dynamic_parameters_clear(envoy_config_core_v3_Node* msg) { _upb_msg_map_clear(msg, UPB_SIZE(60, 112)); } +UPB_INLINE void envoy_config_core_v3_Node_dynamic_parameters_clear(envoy_config_core_v3_Node* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_set(envoy_config_core_v3_Node* msg, upb_StringView key, struct xds_core_v3_ContextParams* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(60, 112), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_delete(envoy_config_core_v3_Node* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(60, 112), &key, 0); + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_core_v3_Node_DynamicParametersEntry* envoy_config_core_v3_Node_dynamic_parameters_nextmutable(envoy_config_core_v3_Node* msg, size_t* iter) { - return (envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(60, 112), iter); + const upb_MiniTableField field = {12, UPB_SIZE(28, 112), 0, 5, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_map_next(map, iter); } /* envoy.config.core.v3.Node.DynamicParametersEntry */ @@ -640,14 +851,15 @@ UPB_INLINE upb_StringView envoy_config_core_v3_Node_DynamicParametersEntry_key(c _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_core_v3_Node_DynamicParametersEntry_has_value(const envoy_config_core_v3_Node_DynamicParametersEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct xds_core_v3_ContextParams* envoy_config_core_v3_Node_DynamicParametersEntry_value(const envoy_config_core_v3_Node_DynamicParametersEntry* msg) { struct xds_core_v3_ContextParams* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_core_v3_Node_DynamicParametersEntry_has_value(const envoy_config_core_v3_Node_DynamicParametersEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_core_v3_Node_DynamicParametersEntry_set_value(envoy_config_core_v3_Node_DynamicParametersEntry *msg, struct xds_core_v3_ContextParams* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct xds_core_v3_ContextParams*)); @@ -656,12 +868,12 @@ UPB_INLINE void envoy_config_core_v3_Node_DynamicParametersEntry_set_value(envoy /* envoy.config.core.v3.Metadata */ UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_new(upb_Arena* arena) { - return (envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); + return (envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Metadata* ret = envoy_config_core_v3_Metadata_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Metadata_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -671,7 +883,7 @@ UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_parse_ex int options, upb_Arena* arena) { envoy_config_core_v3_Metadata* ret = envoy_config_core_v3_Metadata_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Metadata_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -679,65 +891,111 @@ UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_parse_ex } UPB_INLINE char* envoy_config_core_v3_Metadata_serialize(const envoy_config_core_v3_Metadata* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Metadata_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Metadata_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Metadata_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Metadata_msg_init, 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)); -} -UPB_INLINE void envoy_config_core_v3_Metadata_clear_filter_metadata(const envoy_config_core_v3_Metadata* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_config_core_v3_Metadata_clear_filter_metadata(envoy_config_core_v3_Metadata* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_core_v3_Metadata_filter_metadata_size(const envoy_config_core_v3_Metadata* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_get(const envoy_config_core_v3_Metadata* msg, upb_StringView key, struct google_protobuf_Struct** val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_next(const envoy_config_core_v3_Metadata* msg, size_t* iter) { - return (const envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool envoy_config_core_v3_Metadata_has_typed_filter_metadata(const envoy_config_core_v3_Metadata* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool envoy_config_core_v3_Metadata_has_filter_metadata(const envoy_config_core_v3_Metadata* msg) { + return envoy_config_core_v3_Metadata_filter_metadata_size(msg) != 0; } -UPB_INLINE void envoy_config_core_v3_Metadata_clear_typed_filter_metadata(const envoy_config_core_v3_Metadata* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void envoy_config_core_v3_Metadata_clear_typed_filter_metadata(envoy_config_core_v3_Metadata* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_core_v3_Metadata_typed_filter_metadata_size(const envoy_config_core_v3_Metadata* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(4, 8)); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_get(const envoy_config_core_v3_Metadata* msg, upb_StringView key, struct google_protobuf_Any** val) { - return _upb_msg_map_get(msg, UPB_SIZE(4, 8), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* envoy_config_core_v3_Metadata_typed_filter_metadata_next(const envoy_config_core_v3_Metadata* msg, size_t* iter) { - return (const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_config_core_v3_Metadata_has_typed_filter_metadata(const envoy_config_core_v3_Metadata* msg) { + return envoy_config_core_v3_Metadata_typed_filter_metadata_size(msg) != 0; } -UPB_INLINE void envoy_config_core_v3_Metadata_filter_metadata_clear(envoy_config_core_v3_Metadata* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } +UPB_INLINE void envoy_config_core_v3_Metadata_filter_metadata_clear(envoy_config_core_v3_Metadata* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_set(envoy_config_core_v3_Metadata* msg, upb_StringView key, struct google_protobuf_Struct* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_delete(envoy_config_core_v3_Metadata* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_nextmutable(envoy_config_core_v3_Metadata* msg, size_t* iter) { - return (envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_map_next(map, iter); +} +UPB_INLINE void envoy_config_core_v3_Metadata_typed_filter_metadata_clear(envoy_config_core_v3_Metadata* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_core_v3_Metadata_typed_filter_metadata_clear(envoy_config_core_v3_Metadata* msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); } UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_set(envoy_config_core_v3_Metadata* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_delete(envoy_config_core_v3_Metadata* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(4, 8), &key, 0); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* envoy_config_core_v3_Metadata_typed_filter_metadata_nextmutable(envoy_config_core_v3_Metadata* msg, size_t* iter) { - return (envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_map_next(map, iter); } /* envoy.config.core.v3.Metadata.FilterMetadataEntry */ @@ -747,14 +1005,15 @@ UPB_INLINE upb_StringView envoy_config_core_v3_Metadata_FilterMetadataEntry_key( _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_core_v3_Metadata_FilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Metadata_FilterMetadataEntry_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry* msg) { struct google_protobuf_Struct* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_core_v3_Metadata_FilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_core_v3_Metadata_FilterMetadataEntry_set_value(envoy_config_core_v3_Metadata_FilterMetadataEntry *msg, struct google_protobuf_Struct* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Struct*)); @@ -767,14 +1026,15 @@ UPB_INLINE upb_StringView envoy_config_core_v3_Metadata_TypedFilterMetadataEntry _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* msg) { struct google_protobuf_Any* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_set_value(envoy_config_core_v3_Metadata_TypedFilterMetadataEntry *msg, struct google_protobuf_Any* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*)); @@ -783,12 +1043,12 @@ UPB_INLINE void envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_set_value /* envoy.config.core.v3.RuntimeUInt32 */ UPB_INLINE envoy_config_core_v3_RuntimeUInt32* envoy_config_core_v3_RuntimeUInt32_new(upb_Arena* arena) { - return (envoy_config_core_v3_RuntimeUInt32*)_upb_Message_New(&envoy_config_core_v3_RuntimeUInt32_msginit, arena); + return (envoy_config_core_v3_RuntimeUInt32*)_upb_Message_New(&envoy_config_core_v3_RuntimeUInt32_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RuntimeUInt32* envoy_config_core_v3_RuntimeUInt32_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RuntimeUInt32* ret = envoy_config_core_v3_RuntimeUInt32_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -798,7 +1058,7 @@ UPB_INLINE envoy_config_core_v3_RuntimeUInt32* envoy_config_core_v3_RuntimeUInt3 int options, upb_Arena* arena) { envoy_config_core_v3_RuntimeUInt32* ret = envoy_config_core_v3_RuntimeUInt32_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -806,44 +1066,56 @@ UPB_INLINE envoy_config_core_v3_RuntimeUInt32* envoy_config_core_v3_RuntimeUInt3 } UPB_INLINE char* envoy_config_core_v3_RuntimeUInt32_serialize(const envoy_config_core_v3_RuntimeUInt32* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msg_init, 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; +UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_clear_default_value(envoy_config_core_v3_RuntimeUInt32* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_core_v3_RuntimeUInt32_default_value(const envoy_config_core_v3_RuntimeUInt32* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_clear_runtime_key(const envoy_config_core_v3_RuntimeUInt32* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_clear_runtime_key(envoy_config_core_v3_RuntimeUInt32* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeUInt32_runtime_key(const envoy_config_core_v3_RuntimeUInt32* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_default_value(envoy_config_core_v3_RuntimeUInt32 *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_runtime_key(envoy_config_core_v3_RuntimeUInt32 *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.RuntimePercent */ UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePercent_new(upb_Arena* arena) { - return (envoy_config_core_v3_RuntimePercent*)_upb_Message_New(&envoy_config_core_v3_RuntimePercent_msginit, arena); + return (envoy_config_core_v3_RuntimePercent*)_upb_Message_New(&envoy_config_core_v3_RuntimePercent_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePercent_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RuntimePercent* ret = envoy_config_core_v3_RuntimePercent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -853,7 +1125,7 @@ UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePerc int options, upb_Arena* arena) { envoy_config_core_v3_RuntimePercent* ret = envoy_config_core_v3_RuntimePercent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -861,57 +1133,68 @@ UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePerc } UPB_INLINE char* envoy_config_core_v3_RuntimePercent_serialize(const envoy_config_core_v3_RuntimePercent* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_RuntimePercent_clear_default_value(const envoy_config_core_v3_RuntimePercent* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RuntimePercent_clear_default_value(envoy_config_core_v3_RuntimePercent* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_RuntimePercent_default_value(const envoy_config_core_v3_RuntimePercent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_RuntimePercent_clear_runtime_key(const envoy_config_core_v3_RuntimePercent* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_RuntimePercent_has_default_value(const envoy_config_core_v3_RuntimePercent* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_RuntimePercent_clear_runtime_key(envoy_config_core_v3_RuntimePercent* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_RuntimePercent_runtime_key(const envoy_config_core_v3_RuntimePercent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_RuntimePercent_set_default_value(envoy_config_core_v3_RuntimePercent *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_core_v3_RuntimePercent_mutable_default_value(envoy_config_core_v3_RuntimePercent* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_core_v3_RuntimePercent_default_value(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RuntimePercent_set_default_value(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_core_v3_RuntimePercent_set_default_value(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_RuntimePercent_set_runtime_key(envoy_config_core_v3_RuntimePercent *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.RuntimeDouble */ UPB_INLINE envoy_config_core_v3_RuntimeDouble* envoy_config_core_v3_RuntimeDouble_new(upb_Arena* arena) { - return (envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msginit, arena); + return (envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RuntimeDouble* envoy_config_core_v3_RuntimeDouble_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RuntimeDouble* ret = envoy_config_core_v3_RuntimeDouble_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -921,7 +1204,7 @@ UPB_INLINE envoy_config_core_v3_RuntimeDouble* envoy_config_core_v3_RuntimeDoubl int options, upb_Arena* arena) { envoy_config_core_v3_RuntimeDouble* ret = envoy_config_core_v3_RuntimeDouble_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -929,44 +1212,56 @@ UPB_INLINE envoy_config_core_v3_RuntimeDouble* envoy_config_core_v3_RuntimeDoubl } UPB_INLINE char* envoy_config_core_v3_RuntimeDouble_serialize(const envoy_config_core_v3_RuntimeDouble* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msg_init, 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; +UPB_INLINE void envoy_config_core_v3_RuntimeDouble_clear_default_value(envoy_config_core_v3_RuntimeDouble* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_config_core_v3_RuntimeDouble_default_value(const envoy_config_core_v3_RuntimeDouble* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_RuntimeDouble_clear_runtime_key(const envoy_config_core_v3_RuntimeDouble* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_RuntimeDouble_clear_runtime_key(envoy_config_core_v3_RuntimeDouble* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeDouble_runtime_key(const envoy_config_core_v3_RuntimeDouble* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_default_value(envoy_config_core_v3_RuntimeDouble *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_runtime_key(envoy_config_core_v3_RuntimeDouble *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.RuntimeFeatureFlag */ UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_core_v3_RuntimeFeatureFlag_new(upb_Arena* arena) { - return (envoy_config_core_v3_RuntimeFeatureFlag*)_upb_Message_New(&envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena); + return (envoy_config_core_v3_RuntimeFeatureFlag*)_upb_Message_New(&envoy_config_core_v3_RuntimeFeatureFlag_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_core_v3_RuntimeFeatureFlag_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RuntimeFeatureFlag* ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -976,7 +1271,7 @@ UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_core_v3_Runtime int options, upb_Arena* arena) { envoy_config_core_v3_RuntimeFeatureFlag* ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -984,57 +1279,68 @@ UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_core_v3_Runtime } UPB_INLINE char* envoy_config_core_v3_RuntimeFeatureFlag_serialize(const envoy_config_core_v3_RuntimeFeatureFlag* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_clear_default_value(const envoy_config_core_v3_RuntimeFeatureFlag* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_clear_default_value(envoy_config_core_v3_RuntimeFeatureFlag* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_RuntimeFeatureFlag_default_value(const envoy_config_core_v3_RuntimeFeatureFlag* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_clear_runtime_key(const envoy_config_core_v3_RuntimeFeatureFlag* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_RuntimeFeatureFlag_has_default_value(const envoy_config_core_v3_RuntimeFeatureFlag* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_clear_runtime_key(envoy_config_core_v3_RuntimeFeatureFlag* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeFeatureFlag_runtime_key(const envoy_config_core_v3_RuntimeFeatureFlag* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(envoy_config_core_v3_RuntimeFeatureFlag *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_RuntimeFeatureFlag_mutable_default_value(envoy_config_core_v3_RuntimeFeatureFlag* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_RuntimeFeatureFlag_default_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_runtime_key(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.QueryParameter */ UPB_INLINE envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParameter_new(upb_Arena* arena) { - return (envoy_config_core_v3_QueryParameter*)_upb_Message_New(&envoy_config_core_v3_QueryParameter_msginit, arena); + return (envoy_config_core_v3_QueryParameter*)_upb_Message_New(&envoy_config_core_v3_QueryParameter_msg_init, arena); } UPB_INLINE envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParameter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_QueryParameter* ret = envoy_config_core_v3_QueryParameter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1044,7 +1350,7 @@ UPB_INLINE envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParame int options, upb_Arena* arena) { envoy_config_core_v3_QueryParameter* ret = envoy_config_core_v3_QueryParameter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1052,44 +1358,56 @@ UPB_INLINE envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParame } UPB_INLINE char* envoy_config_core_v3_QueryParameter_serialize(const envoy_config_core_v3_QueryParameter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_QueryParameter_clear_key(envoy_config_core_v3_QueryParameter* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_QueryParameter_key(const envoy_config_core_v3_QueryParameter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_QueryParameter_clear_value(const envoy_config_core_v3_QueryParameter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_QueryParameter_clear_value(envoy_config_core_v3_QueryParameter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_QueryParameter_value(const envoy_config_core_v3_QueryParameter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_QueryParameter_set_key(envoy_config_core_v3_QueryParameter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_QueryParameter_set_value(envoy_config_core_v3_QueryParameter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.HeaderValue */ UPB_INLINE envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValue_new(upb_Arena* arena) { - return (envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena); + return (envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValue_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HeaderValue* ret = envoy_config_core_v3_HeaderValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1099,7 +1417,7 @@ UPB_INLINE envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValue_pa int options, upb_Arena* arena) { envoy_config_core_v3_HeaderValue* ret = envoy_config_core_v3_HeaderValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1107,44 +1425,56 @@ UPB_INLINE envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValue_pa } UPB_INLINE char* envoy_config_core_v3_HeaderValue_serialize(const envoy_config_core_v3_HeaderValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_HeaderValue_clear_key(envoy_config_core_v3_HeaderValue* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HeaderValue_key(const envoy_config_core_v3_HeaderValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HeaderValue_clear_value(const envoy_config_core_v3_HeaderValue* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_HeaderValue_clear_value(envoy_config_core_v3_HeaderValue* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HeaderValue_value(const envoy_config_core_v3_HeaderValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_HeaderValue_set_key(envoy_config_core_v3_HeaderValue *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HeaderValue_set_value(envoy_config_core_v3_HeaderValue *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.HeaderValueOption */ UPB_INLINE envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HeaderValueOption_new(upb_Arena* arena) { - return (envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); + return (envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HeaderValueOption_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HeaderValueOption* ret = envoy_config_core_v3_HeaderValueOption_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1154,7 +1484,7 @@ UPB_INLINE envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HeaderVa int options, upb_Arena* arena) { envoy_config_core_v3_HeaderValueOption* ret = envoy_config_core_v3_HeaderValueOption_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1162,88 +1492,110 @@ UPB_INLINE envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HeaderVa } UPB_INLINE char* envoy_config_core_v3_HeaderValueOption_serialize(const envoy_config_core_v3_HeaderValueOption* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_header(const envoy_config_core_v3_HeaderValueOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_header(envoy_config_core_v3_HeaderValueOption* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_header(const envoy_config_core_v3_HeaderValueOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const envoy_config_core_v3_HeaderValue*); + const envoy_config_core_v3_HeaderValue* default_val = NULL; + const envoy_config_core_v3_HeaderValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_append(const envoy_config_core_v3_HeaderValueOption* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_append(const envoy_config_core_v3_HeaderValueOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_append(envoy_config_core_v3_HeaderValueOption* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_append(const envoy_config_core_v3_HeaderValueOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_append_action(const envoy_config_core_v3_HeaderValueOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_append(const envoy_config_core_v3_HeaderValueOption* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_append_action(envoy_config_core_v3_HeaderValueOption* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_HeaderValueOption_append_action(const envoy_config_core_v3_HeaderValueOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_keep_empty_value(const envoy_config_core_v3_HeaderValueOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_keep_empty_value(envoy_config_core_v3_HeaderValueOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_keep_empty_value(const envoy_config_core_v3_HeaderValueOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_header(envoy_config_core_v3_HeaderValueOption *msg, envoy_config_core_v3_HeaderValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), envoy_config_core_v3_HeaderValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_mutable_header(envoy_config_core_v3_HeaderValueOption* msg, upb_Arena* arena) { struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)envoy_config_core_v3_HeaderValueOption_header(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HeaderValueOption_set_header(msg, sub); + sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msg_init, arena); + if (sub) envoy_config_core_v3_HeaderValueOption_set_header(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append(envoy_config_core_v3_HeaderValueOption *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_mutable_append(envoy_config_core_v3_HeaderValueOption* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HeaderValueOption_append(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HeaderValueOption_set_append(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_HeaderValueOption_set_append(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append_action(envoy_config_core_v3_HeaderValueOption *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_keep_empty_value(envoy_config_core_v3_HeaderValueOption *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.HeaderMap */ UPB_INLINE envoy_config_core_v3_HeaderMap* envoy_config_core_v3_HeaderMap_new(upb_Arena* arena) { - return (envoy_config_core_v3_HeaderMap*)_upb_Message_New(&envoy_config_core_v3_HeaderMap_msginit, arena); + return (envoy_config_core_v3_HeaderMap*)_upb_Message_New(&envoy_config_core_v3_HeaderMap_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HeaderMap* envoy_config_core_v3_HeaderMap_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HeaderMap* ret = envoy_config_core_v3_HeaderMap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1253,7 +1605,7 @@ UPB_INLINE envoy_config_core_v3_HeaderMap* envoy_config_core_v3_HeaderMap_parse_ int options, upb_Arena* arena) { envoy_config_core_v3_HeaderMap* ret = envoy_config_core_v3_HeaderMap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1261,47 +1613,72 @@ UPB_INLINE envoy_config_core_v3_HeaderMap* envoy_config_core_v3_HeaderMap_parse_ } UPB_INLINE char* envoy_config_core_v3_HeaderMap_serialize(const envoy_config_core_v3_HeaderMap* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_core_v3_HeaderMap_clear_headers(envoy_config_core_v3_HeaderMap* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_HeaderMap_headers(const envoy_config_core_v3_HeaderMap* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_HeaderValue* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_core_v3_HeaderMap_has_headers(const envoy_config_core_v3_HeaderMap* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_core_v3_HeaderMap_clear_headers(const envoy_config_core_v3_HeaderMap* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_HeaderMap_headers(const envoy_config_core_v3_HeaderMap* msg, size_t* len) { - return (const envoy_config_core_v3_HeaderValue* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_core_v3_HeaderMap_headers(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_mutable_headers(envoy_config_core_v3_HeaderMap* msg, size_t* len) { - return (envoy_config_core_v3_HeaderValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_mutable_headers(envoy_config_core_v3_HeaderMap* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_HeaderValue**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_resize_headers(envoy_config_core_v3_HeaderMap* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_HeaderValue**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_resize_headers(envoy_config_core_v3_HeaderMap* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HeaderValue**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderMap_add_headers(envoy_config_core_v3_HeaderMap* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.WatchedDirectory */ UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDirectory_new(upb_Arena* arena) { - return (envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena); + return (envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msg_init, arena); } UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDirectory_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_WatchedDirectory* ret = envoy_config_core_v3_WatchedDirectory_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1311,7 +1688,7 @@ UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDi int options, upb_Arena* arena) { envoy_config_core_v3_WatchedDirectory* ret = envoy_config_core_v3_WatchedDirectory_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1319,35 +1696,41 @@ UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDi } UPB_INLINE char* envoy_config_core_v3_WatchedDirectory_serialize(const envoy_config_core_v3_WatchedDirectory* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_WatchedDirectory_clear_path(envoy_config_core_v3_WatchedDirectory* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_WatchedDirectory_path(const envoy_config_core_v3_WatchedDirectory* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_WatchedDirectory_set_path(envoy_config_core_v3_WatchedDirectory *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.DataSource */ UPB_INLINE envoy_config_core_v3_DataSource* envoy_config_core_v3_DataSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); + return (envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_DataSource* envoy_config_core_v3_DataSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_DataSource* ret = envoy_config_core_v3_DataSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DataSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1357,7 +1740,7 @@ UPB_INLINE envoy_config_core_v3_DataSource* envoy_config_core_v3_DataSource_pars int options, upb_Arena* arena) { envoy_config_core_v3_DataSource* ret = envoy_config_core_v3_DataSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DataSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1365,13 +1748,13 @@ UPB_INLINE envoy_config_core_v3_DataSource* envoy_config_core_v3_DataSource_pars } UPB_INLINE char* envoy_config_core_v3_DataSource_serialize(const envoy_config_core_v3_DataSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_DataSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_DataSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_DataSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_DataSource_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1382,67 +1765,96 @@ typedef enum { envoy_config_core_v3_DataSource_specifier_NOT_SET = 0 } envoy_config_core_v3_DataSource_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_DataSource_specifier_oneofcases envoy_config_core_v3_DataSource_specifier_case(const envoy_config_core_v3_DataSource* msg) { - return (envoy_config_core_v3_DataSource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_DataSource_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_DataSource_has_filename(const envoy_config_core_v3_DataSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_DataSource_clear_filename(const envoy_config_core_v3_DataSource* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_DataSource_clear_filename(envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_filename(const envoy_config_core_v3_DataSource* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_bytes(const envoy_config_core_v3_DataSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_DataSource_has_filename(const envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_DataSource_clear_inline_bytes(const envoy_config_core_v3_DataSource* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_DataSource_clear_inline_bytes(envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_inline_bytes(const envoy_config_core_v3_DataSource* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_string(const envoy_config_core_v3_DataSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_bytes(const envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_DataSource_clear_inline_string(const envoy_config_core_v3_DataSource* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_DataSource_clear_inline_string(envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_inline_string(const envoy_config_core_v3_DataSource* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_DataSource_has_environment_variable(const envoy_config_core_v3_DataSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_string(const envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_DataSource_clear_environment_variable(const envoy_config_core_v3_DataSource* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_DataSource_clear_environment_variable(envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_environment_variable(const envoy_config_core_v3_DataSource* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_DataSource_has_environment_variable(const envoy_config_core_v3_DataSource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_DataSource_set_filename(envoy_config_core_v3_DataSource *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_bytes(envoy_config_core_v3_DataSource *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_string(envoy_config_core_v3_DataSource *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_DataSource_set_environment_variable(envoy_config_core_v3_DataSource *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.RetryPolicy */ UPB_INLINE envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RetryPolicy_new(upb_Arena* arena) { - return (envoy_config_core_v3_RetryPolicy*)_upb_Message_New(&envoy_config_core_v3_RetryPolicy_msginit, arena); + return (envoy_config_core_v3_RetryPolicy*)_upb_Message_New(&envoy_config_core_v3_RetryPolicy_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RetryPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RetryPolicy* ret = envoy_config_core_v3_RetryPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1452,7 +1864,7 @@ UPB_INLINE envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RetryPolicy_pa int options, upb_Arena* arena) { envoy_config_core_v3_RetryPolicy* ret = envoy_config_core_v3_RetryPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1460,57 +1872,67 @@ UPB_INLINE envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RetryPolicy_pa } UPB_INLINE char* envoy_config_core_v3_RetryPolicy_serialize(const envoy_config_core_v3_RetryPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_RetryPolicy_clear_retry_back_off(const envoy_config_core_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RetryPolicy_clear_retry_back_off(envoy_config_core_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_RetryPolicy_retry_back_off(const envoy_config_core_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_BackoffStrategy*); + const struct envoy_config_core_v3_BackoffStrategy* default_val = NULL; + const struct envoy_config_core_v3_BackoffStrategy* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_num_retries(const envoy_config_core_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_retry_back_off(const envoy_config_core_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_RetryPolicy_clear_num_retries(const envoy_config_core_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RetryPolicy_clear_num_retries(envoy_config_core_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_num_retries(const envoy_config_core_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_num_retries(const envoy_config_core_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_retry_back_off(envoy_config_core_v3_RetryPolicy *msg, struct envoy_config_core_v3_BackoffStrategy* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_BackoffStrategy*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_RetryPolicy_mutable_retry_back_off(envoy_config_core_v3_RetryPolicy* msg, upb_Arena* arena) { struct envoy_config_core_v3_BackoffStrategy* sub = (struct envoy_config_core_v3_BackoffStrategy*)envoy_config_core_v3_RetryPolicy_retry_back_off(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_BackoffStrategy*)_upb_Message_New(&envoy_config_core_v3_BackoffStrategy_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RetryPolicy_set_retry_back_off(msg, sub); + sub = (struct envoy_config_core_v3_BackoffStrategy*)_upb_Message_New(&envoy_config_core_v3_BackoffStrategy_msg_init, arena); + if (sub) envoy_config_core_v3_RetryPolicy_set_retry_back_off(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_num_retries(envoy_config_core_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_mutable_num_retries(envoy_config_core_v3_RetryPolicy* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_RetryPolicy_num_retries(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RetryPolicy_set_num_retries(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_RetryPolicy_set_num_retries(msg, sub); } return sub; } @@ -1518,12 +1940,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_ /* envoy.config.core.v3.RemoteDataSource */ UPB_INLINE envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_RemoteDataSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_RemoteDataSource*)_upb_Message_New(&envoy_config_core_v3_RemoteDataSource_msginit, arena); + return (envoy_config_core_v3_RemoteDataSource*)_upb_Message_New(&envoy_config_core_v3_RemoteDataSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_RemoteDataSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RemoteDataSource* ret = envoy_config_core_v3_RemoteDataSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1533,7 +1955,7 @@ UPB_INLINE envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_RemoteDat int options, upb_Arena* arena) { envoy_config_core_v3_RemoteDataSource* ret = envoy_config_core_v3_RemoteDataSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1541,66 +1963,82 @@ UPB_INLINE envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_RemoteDat } UPB_INLINE char* envoy_config_core_v3_RemoteDataSource_serialize(const envoy_config_core_v3_RemoteDataSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_http_uri(const envoy_config_core_v3_RemoteDataSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_http_uri(envoy_config_core_v3_RemoteDataSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_HttpUri* envoy_config_core_v3_RemoteDataSource_http_uri(const envoy_config_core_v3_RemoteDataSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_HttpUri*); + const struct envoy_config_core_v3_HttpUri* default_val = NULL; + const struct envoy_config_core_v3_HttpUri* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_sha256(const envoy_config_core_v3_RemoteDataSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_http_uri(const envoy_config_core_v3_RemoteDataSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_sha256(envoy_config_core_v3_RemoteDataSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_RemoteDataSource_sha256(const envoy_config_core_v3_RemoteDataSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_retry_policy(const envoy_config_core_v3_RemoteDataSource* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_retry_policy(const envoy_config_core_v3_RemoteDataSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_retry_policy(envoy_config_core_v3_RemoteDataSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteDataSource_retry_policy(const envoy_config_core_v3_RemoteDataSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_core_v3_RetryPolicy*); + const envoy_config_core_v3_RetryPolicy* default_val = NULL; + const envoy_config_core_v3_RetryPolicy* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_retry_policy(const envoy_config_core_v3_RemoteDataSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_http_uri(envoy_config_core_v3_RemoteDataSource *msg, struct envoy_config_core_v3_HttpUri* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_HttpUri*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HttpUri* envoy_config_core_v3_RemoteDataSource_mutable_http_uri(envoy_config_core_v3_RemoteDataSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_HttpUri* sub = (struct envoy_config_core_v3_HttpUri*)envoy_config_core_v3_RemoteDataSource_http_uri(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HttpUri*)_upb_Message_New(&envoy_config_core_v3_HttpUri_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RemoteDataSource_set_http_uri(msg, sub); + sub = (struct envoy_config_core_v3_HttpUri*)_upb_Message_New(&envoy_config_core_v3_HttpUri_msg_init, arena); + if (sub) envoy_config_core_v3_RemoteDataSource_set_http_uri(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_sha256(envoy_config_core_v3_RemoteDataSource *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_retry_policy(envoy_config_core_v3_RemoteDataSource *msg, envoy_config_core_v3_RetryPolicy* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_core_v3_RetryPolicy*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteDataSource_mutable_retry_policy(envoy_config_core_v3_RemoteDataSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_RetryPolicy* sub = (struct envoy_config_core_v3_RetryPolicy*)envoy_config_core_v3_RemoteDataSource_retry_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RetryPolicy*)_upb_Message_New(&envoy_config_core_v3_RetryPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RemoteDataSource_set_retry_policy(msg, sub); + sub = (struct envoy_config_core_v3_RetryPolicy*)_upb_Message_New(&envoy_config_core_v3_RetryPolicy_msg_init, arena); + if (sub) envoy_config_core_v3_RemoteDataSource_set_retry_policy(msg, sub); } return sub; } @@ -1608,12 +2046,12 @@ UPB_INLINE struct envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteD /* envoy.config.core.v3.AsyncDataSource */ UPB_INLINE envoy_config_core_v3_AsyncDataSource* envoy_config_core_v3_AsyncDataSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_AsyncDataSource*)_upb_Message_New(&envoy_config_core_v3_AsyncDataSource_msginit, arena); + return (envoy_config_core_v3_AsyncDataSource*)_upb_Message_New(&envoy_config_core_v3_AsyncDataSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_AsyncDataSource* envoy_config_core_v3_AsyncDataSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_AsyncDataSource* ret = envoy_config_core_v3_AsyncDataSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1623,7 +2061,7 @@ UPB_INLINE envoy_config_core_v3_AsyncDataSource* envoy_config_core_v3_AsyncDataS int options, upb_Arena* arena) { envoy_config_core_v3_AsyncDataSource* ret = envoy_config_core_v3_AsyncDataSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1631,13 +2069,13 @@ UPB_INLINE envoy_config_core_v3_AsyncDataSource* envoy_config_core_v3_AsyncDataS } UPB_INLINE char* envoy_config_core_v3_AsyncDataSource_serialize(const envoy_config_core_v3_AsyncDataSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1646,48 +2084,61 @@ typedef enum { envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET = 0 } envoy_config_core_v3_AsyncDataSource_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_AsyncDataSource_specifier_oneofcases envoy_config_core_v3_AsyncDataSource_specifier_case(const envoy_config_core_v3_AsyncDataSource* msg) { - return (envoy_config_core_v3_AsyncDataSource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_AsyncDataSource_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_local(const envoy_config_core_v3_AsyncDataSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_AsyncDataSource_clear_local(const envoy_config_core_v3_AsyncDataSource* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_DataSource*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_AsyncDataSource_clear_local(envoy_config_core_v3_AsyncDataSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_DataSource* envoy_config_core_v3_AsyncDataSource_local(const envoy_config_core_v3_AsyncDataSource* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_DataSource*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_core_v3_DataSource* default_val = NULL; + const envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_remote(const envoy_config_core_v3_AsyncDataSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_local(const envoy_config_core_v3_AsyncDataSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_AsyncDataSource_clear_remote(const envoy_config_core_v3_AsyncDataSource* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_AsyncDataSource_clear_remote(envoy_config_core_v3_AsyncDataSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_AsyncDataSource_remote(const envoy_config_core_v3_AsyncDataSource* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_core_v3_RemoteDataSource* default_val = NULL; + const envoy_config_core_v3_RemoteDataSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_remote(const envoy_config_core_v3_AsyncDataSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_AsyncDataSource_set_local(envoy_config_core_v3_AsyncDataSource *msg, envoy_config_core_v3_DataSource* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_DataSource*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_AsyncDataSource_mutable_local(envoy_config_core_v3_AsyncDataSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_AsyncDataSource_local(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_AsyncDataSource_set_local(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_core_v3_AsyncDataSource_set_local(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_AsyncDataSource_set_remote(envoy_config_core_v3_AsyncDataSource *msg, envoy_config_core_v3_RemoteDataSource* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_AsyncDataSource_mutable_remote(envoy_config_core_v3_AsyncDataSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_RemoteDataSource* sub = (struct envoy_config_core_v3_RemoteDataSource*)envoy_config_core_v3_AsyncDataSource_remote(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RemoteDataSource*)_upb_Message_New(&envoy_config_core_v3_RemoteDataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_AsyncDataSource_set_remote(msg, sub); + sub = (struct envoy_config_core_v3_RemoteDataSource*)_upb_Message_New(&envoy_config_core_v3_RemoteDataSource_msg_init, arena); + if (sub) envoy_config_core_v3_AsyncDataSource_set_remote(msg, sub); } return sub; } @@ -1695,12 +2146,12 @@ UPB_INLINE struct envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_As /* envoy.config.core.v3.TransportSocket */ UPB_INLINE envoy_config_core_v3_TransportSocket* envoy_config_core_v3_TransportSocket_new(upb_Arena* arena) { - return (envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msginit, arena); + return (envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msg_init, arena); } UPB_INLINE envoy_config_core_v3_TransportSocket* envoy_config_core_v3_TransportSocket_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_TransportSocket* ret = envoy_config_core_v3_TransportSocket_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1710,7 +2161,7 @@ UPB_INLINE envoy_config_core_v3_TransportSocket* envoy_config_core_v3_TransportS int options, upb_Arena* arena) { envoy_config_core_v3_TransportSocket* ret = envoy_config_core_v3_TransportSocket_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1718,13 +2169,13 @@ UPB_INLINE envoy_config_core_v3_TransportSocket* envoy_config_core_v3_TransportS } UPB_INLINE char* envoy_config_core_v3_TransportSocket_serialize(const envoy_config_core_v3_TransportSocket* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1732,36 +2183,49 @@ typedef enum { envoy_config_core_v3_TransportSocket_config_type_NOT_SET = 0 } envoy_config_core_v3_TransportSocket_config_type_oneofcases; UPB_INLINE envoy_config_core_v3_TransportSocket_config_type_oneofcases envoy_config_core_v3_TransportSocket_config_type_case(const envoy_config_core_v3_TransportSocket* msg) { - return (envoy_config_core_v3_TransportSocket_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_TransportSocket_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_TransportSocket_clear_name(const envoy_config_core_v3_TransportSocket* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_TransportSocket_clear_name(envoy_config_core_v3_TransportSocket* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_TransportSocket_name(const envoy_config_core_v3_TransportSocket* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_TransportSocket_has_typed_config(const envoy_config_core_v3_TransportSocket* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_core_v3_TransportSocket_clear_typed_config(const envoy_config_core_v3_TransportSocket* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_core_v3_TransportSocket_config_type_NOT_SET); +UPB_INLINE void envoy_config_core_v3_TransportSocket_clear_typed_config(envoy_config_core_v3_TransportSocket* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_typed_config(const envoy_config_core_v3_TransportSocket* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_TransportSocket_has_typed_config(const envoy_config_core_v3_TransportSocket* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_TransportSocket_set_name(envoy_config_core_v3_TransportSocket *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_TransportSocket_set_typed_config(envoy_config_core_v3_TransportSocket *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_mutable_typed_config(envoy_config_core_v3_TransportSocket* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_TransportSocket_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_TransportSocket_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_core_v3_TransportSocket_set_typed_config(msg, sub); } return sub; } @@ -1769,12 +2233,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_muta /* envoy.config.core.v3.RuntimeFractionalPercent */ UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_new(upb_Arena* arena) { - return (envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena); + return (envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RuntimeFractionalPercent* ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1784,7 +2248,7 @@ UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_core_v3_R int options, upb_Arena* arena) { envoy_config_core_v3_RuntimeFractionalPercent* ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1792,57 +2256,68 @@ UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_core_v3_R } UPB_INLINE char* envoy_config_core_v3_RuntimeFractionalPercent_serialize(const envoy_config_core_v3_RuntimeFractionalPercent* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_clear_default_value(const envoy_config_core_v3_RuntimeFractionalPercent* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_clear_default_value(envoy_config_core_v3_RuntimeFractionalPercent* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_default_value(const envoy_config_core_v3_RuntimeFractionalPercent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_clear_runtime_key(const envoy_config_core_v3_RuntimeFractionalPercent* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_RuntimeFractionalPercent_has_default_value(const envoy_config_core_v3_RuntimeFractionalPercent* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_clear_runtime_key(envoy_config_core_v3_RuntimeFractionalPercent* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeFractionalPercent_runtime_key(const envoy_config_core_v3_RuntimeFractionalPercent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(envoy_config_core_v3_RuntimeFractionalPercent *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_mutable_default_value(envoy_config_core_v3_RuntimeFractionalPercent* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_core_v3_RuntimeFractionalPercent_default_value(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_runtime_key(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.ControlPlane */ UPB_INLINE envoy_config_core_v3_ControlPlane* envoy_config_core_v3_ControlPlane_new(upb_Arena* arena) { - return (envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msginit, arena); + return (envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ControlPlane* envoy_config_core_v3_ControlPlane_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ControlPlane* ret = envoy_config_core_v3_ControlPlane_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1852,7 +2327,7 @@ UPB_INLINE envoy_config_core_v3_ControlPlane* envoy_config_core_v3_ControlPlane_ int options, upb_Arena* arena) { envoy_config_core_v3_ControlPlane* ret = envoy_config_core_v3_ControlPlane_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1860,32 +2335,38 @@ UPB_INLINE envoy_config_core_v3_ControlPlane* envoy_config_core_v3_ControlPlane_ } UPB_INLINE char* envoy_config_core_v3_ControlPlane_serialize(const envoy_config_core_v3_ControlPlane* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_ControlPlane_clear_identifier(envoy_config_core_v3_ControlPlane* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_ControlPlane_identifier(const envoy_config_core_v3_ControlPlane* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_ControlPlane_set_identifier(envoy_config_core_v3_ControlPlane *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_core_v3_base_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_base_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_ */ 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 e109fa6ef8d..0abb3a7afc4 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/config_source.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -21,143 +23,206 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_ApiConfigSource_submsgs[5] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_RateLimitSettings_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_ApiConfigSource_submsgs[5] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_RateLimitSettings_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_ApiConfigSource__fields[9] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 48), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 56), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ApiConfigSource__fields[9] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(36, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msginit = { +const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msg_init = { &envoy_config_core_v3_ApiConfigSource_submsgs[0], &envoy_config_core_v3_ApiConfigSource__fields[0], - UPB_SIZE(40, 64), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(40, 64), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x001000003f000012, &upb_prs_1bt}, + {0x001800000100001a, &upb_psm_1bt_maxmaxb}, + {0x002000003f010022, &upb_prm_1bt_maxmaxb}, + {0x002800000202002a, &upb_psm_1bt_maxmaxb}, + {0x0030000003030032, &upb_psm_1bt_max64b}, + {0x000800003f000038, &upb_psb1_1bt}, + {0x000c00003f000040, &upb_psv4_1bt}, + {0x003800003f04004a, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msginit = { +const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Field envoy_config_core_v3_SelfConfigSource__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_SelfConfigSource__fields[1] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msginit = { +const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msg_init = { NULL, &envoy_config_core_v3_SelfConfigSource__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_RateLimitSettings_submsgs[2] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_DoubleValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_RateLimitSettings_submsgs[2] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_DoubleValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_RateLimitSettings__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_RateLimitSettings__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_RateLimitSettings_msginit = { +const upb_MiniTable envoy_config_core_v3_RateLimitSettings_msg_init = { &envoy_config_core_v3_RateLimitSettings_submsgs[0], &envoy_config_core_v3_RateLimitSettings__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_PathConfigSource_submsgs[1] = { - {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_PathConfigSource_submsgs[1] = { + {.submsg = &envoy_config_core_v3_WatchedDirectory_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_PathConfigSource__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_PathConfigSource__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_PathConfigSource_msginit = { +const upb_MiniTable envoy_config_core_v3_PathConfigSource_msg_init = { &envoy_config_core_v3_PathConfigSource_submsgs[0], &envoy_config_core_v3_PathConfigSource__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_ConfigSource_submsgs[6] = { - {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit}, - {.submsg = &envoy_config_core_v3_AggregatedConfigSource_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_SelfConfigSource_msginit}, - {.submsg = &xds_core_v3_Authority_msginit}, - {.submsg = &envoy_config_core_v3_PathConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_ConfigSource_submsgs[6] = { + {.submsg = &envoy_config_core_v3_ApiConfigSource_msg_init}, + {.submsg = &envoy_config_core_v3_AggregatedConfigSource_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_SelfConfigSource_msg_init}, + {.submsg = &xds_core_v3_Authority_msg_init}, + {.submsg = &envoy_config_core_v3_PathConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_ConfigSource__fields[8] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ConfigSource__fields[8] = { + {1, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 32), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit = { +const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init = { &envoy_config_core_v3_ConfigSource_submsgs[0], &envoy_config_core_v3_ConfigSource__fields[0], - UPB_SIZE(32, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(32, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000040100000a, &upb_pos_1bt}, + {0x0010000402000012, &upb_pom_1bt_max128b}, + {0x001000040301001a, &upb_pom_1bt_max64b}, + {0x0020000001020022, &upb_psm_1bt_maxmaxb}, + {0x001000040503002a, &upb_pom_1bt_max64b}, + {0x000800003f000030, &upb_psv4_1bt}, + {0x002800003f04003a, &upb_prm_1bt_maxmaxb}, + {0x0010000408050042, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_ExtensionConfigSource__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ExtensionConfigSource__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit = { +const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msg_init = { &envoy_config_core_v3_ExtensionConfigSource_submsgs[0], &envoy_config_core_v3_ExtensionConfigSource__fields[0], - UPB_SIZE(16, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + {0x001800003f000022, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_core_v3_RestSubscription_msginit = { +const upb_MiniTable envoy_config_core_v3_RestSubscription_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[8] = { - &envoy_config_core_v3_ApiConfigSource_msginit, - &envoy_config_core_v3_AggregatedConfigSource_msginit, - &envoy_config_core_v3_SelfConfigSource_msginit, - &envoy_config_core_v3_RateLimitSettings_msginit, - &envoy_config_core_v3_PathConfigSource_msginit, - &envoy_config_core_v3_ConfigSource_msginit, - &envoy_config_core_v3_ExtensionConfigSource_msginit, - &envoy_config_core_v3_RestSubscription_msginit, + &envoy_config_core_v3_ApiConfigSource_msg_init, + &envoy_config_core_v3_AggregatedConfigSource_msg_init, + &envoy_config_core_v3_SelfConfigSource_msg_init, + &envoy_config_core_v3_RateLimitSettings_msg_init, + &envoy_config_core_v3_PathConfigSource_msg_init, + &envoy_config_core_v3_ConfigSource_msg_init, + &envoy_config_core_v3_ExtensionConfigSource_msg_init, + &envoy_config_core_v3_RestSubscription_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_config_source_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_config_source_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -166,5 +231,5 @@ const upb_MiniTable_File envoy_config_core_v3_config_source_proto_upb_file_layou 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 3114017ab32..b804a21eeb2 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 @@ -9,25 +9,22 @@ #ifndef ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_ApiConfigSource; -struct envoy_config_core_v3_AggregatedConfigSource; -struct envoy_config_core_v3_SelfConfigSource; -struct envoy_config_core_v3_RateLimitSettings; -struct envoy_config_core_v3_PathConfigSource; -struct envoy_config_core_v3_ConfigSource; -struct envoy_config_core_v3_ExtensionConfigSource; -struct envoy_config_core_v3_RestSubscription; typedef struct envoy_config_core_v3_ApiConfigSource envoy_config_core_v3_ApiConfigSource; typedef struct envoy_config_core_v3_AggregatedConfigSource envoy_config_core_v3_AggregatedConfigSource; typedef struct envoy_config_core_v3_SelfConfigSource envoy_config_core_v3_SelfConfigSource; @@ -36,14 +33,14 @@ typedef struct envoy_config_core_v3_PathConfigSource envoy_config_core_v3_PathCo typedef struct envoy_config_core_v3_ConfigSource envoy_config_core_v3_ConfigSource; typedef struct envoy_config_core_v3_ExtensionConfigSource envoy_config_core_v3_ExtensionConfigSource; typedef struct envoy_config_core_v3_RestSubscription envoy_config_core_v3_RestSubscription; -extern const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_RateLimitSettings_msginit; -extern const upb_MiniTable envoy_config_core_v3_PathConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_RestSubscription_msginit; +extern const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RateLimitSettings_msg_init; +extern const upb_MiniTable envoy_config_core_v3_PathConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RestSubscription_msg_init; struct envoy_config_core_v3_GrpcService; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_config_core_v3_WatchedDirectory; @@ -52,14 +49,14 @@ struct google_protobuf_DoubleValue; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; struct xds_core_v3_Authority; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_DoubleValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable xds_core_v3_Authority_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_DoubleValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable xds_core_v3_Authority_msg_init; typedef enum { envoy_config_core_v3_ApiConfigSource_DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0, @@ -81,12 +78,12 @@ typedef enum { /* envoy.config.core.v3.ApiConfigSource */ UPB_INLINE envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena); + return (envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ApiConfigSource* ret = envoy_config_core_v3_ApiConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -96,7 +93,7 @@ UPB_INLINE envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigS int options, upb_Arena* arena) { envoy_config_core_v3_ApiConfigSource* ret = envoy_config_core_v3_ApiConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -104,176 +101,288 @@ UPB_INLINE envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigS } UPB_INLINE char* envoy_config_core_v3_ApiConfigSource_serialize(const envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msg_init, 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; +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_api_type(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_ApiConfigSource_api_type(const envoy_config_core_v3_ApiConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_cluster_names(const envoy_config_core_v3_ApiConfigSource* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 16)); +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_cluster_names(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_core_v3_ApiConfigSource_cluster_names(const envoy_config_core_v3_ApiConfigSource* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 16), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_ApiConfigSource_cluster_names(const envoy_config_core_v3_ApiConfigSource* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_refresh_delay(const envoy_config_core_v3_ApiConfigSource* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_cluster_names(const envoy_config_core_v3_ApiConfigSource* msg) { + size_t size; + envoy_config_core_v3_ApiConfigSource_cluster_names(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_refresh_delay(const envoy_config_core_v3_ApiConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_refresh_delay(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_refresh_delay(const envoy_config_core_v3_ApiConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_refresh_delay(const envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_grpc_services(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_GrpcService* const* envoy_config_core_v3_ApiConfigSource_grpc_services(const envoy_config_core_v3_ApiConfigSource* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_GrpcService* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_grpc_services(const envoy_config_core_v3_ApiConfigSource* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 32)); + size_t size; + envoy_config_core_v3_ApiConfigSource_grpc_services(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_grpc_services(const envoy_config_core_v3_ApiConfigSource* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 32)); -} -UPB_INLINE const struct envoy_config_core_v3_GrpcService* const* envoy_config_core_v3_ApiConfigSource_grpc_services(const envoy_config_core_v3_ApiConfigSource* msg, size_t* len) { - return (const struct envoy_config_core_v3_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(24, 32), len); -} -UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_request_timeout(const envoy_config_core_v3_ApiConfigSource* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_request_timeout(const envoy_config_core_v3_ApiConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_request_timeout(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_request_timeout(const envoy_config_core_v3_ApiConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_request_timeout(const envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_rate_limit_settings(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_ApiConfigSource_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const envoy_config_core_v3_RateLimitSettings*); + const envoy_config_core_v3_RateLimitSettings* default_val = NULL; + const envoy_config_core_v3_RateLimitSettings* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_set_node_on_first_message_only(const envoy_config_core_v3_ApiConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_set_node_on_first_message_only(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_set_node_on_first_message_only(const envoy_config_core_v3_ApiConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_transport_api_version(const envoy_config_core_v3_ApiConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_transport_api_version(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_ApiConfigSource_transport_api_version(const envoy_config_core_v3_ApiConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_config_validators(envoy_config_core_v3_ApiConfigSource* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(36, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_ApiConfigSource_config_validators(const envoy_config_core_v3_ApiConfigSource* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(36, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_config_validators(const envoy_config_core_v3_ApiConfigSource* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 56)); -} -UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_config_validators(const envoy_config_core_v3_ApiConfigSource* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 56)); -} -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_ApiConfigSource_config_validators(const envoy_config_core_v3_ApiConfigSource* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(36, 56), len); + size_t size; + envoy_config_core_v3_ApiConfigSource_config_validators(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_api_type(envoy_config_core_v3_ApiConfigSource *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_core_v3_ApiConfigSource_mutable_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 16), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_ApiConfigSource_mutable_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_ApiConfigSource_resize_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_ApiConfigSource_resize_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_add_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_refresh_delay(envoy_config_core_v3_ApiConfigSource *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_mutable_refresh_delay(envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ApiConfigSource_refresh_delay(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ApiConfigSource_set_refresh_delay(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_ApiConfigSource_set_refresh_delay(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_mutable_grpc_services(envoy_config_core_v3_ApiConfigSource* msg, size_t* len) { - return (struct envoy_config_core_v3_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 32), len); +UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_mutable_grpc_services(envoy_config_core_v3_ApiConfigSource* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_GrpcService**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_resize_grpc_services(envoy_config_core_v3_ApiConfigSource* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_GrpcService**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_resize_grpc_services(envoy_config_core_v3_ApiConfigSource* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_GrpcService**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_ApiConfigSource_add_grpc_services(envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena) { - struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_request_timeout(envoy_config_core_v3_ApiConfigSource *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 40), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_mutable_request_timeout(envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ApiConfigSource_request_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ApiConfigSource_set_request_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_ApiConfigSource_set_request_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(envoy_config_core_v3_ApiConfigSource *msg, envoy_config_core_v3_RateLimitSettings* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), envoy_config_core_v3_RateLimitSettings*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_ApiConfigSource_mutable_rate_limit_settings(envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_RateLimitSettings* sub = (struct envoy_config_core_v3_RateLimitSettings*)envoy_config_core_v3_ApiConfigSource_rate_limit_settings(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RateLimitSettings*)_upb_Message_New(&envoy_config_core_v3_RateLimitSettings_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(msg, sub); + sub = (struct envoy_config_core_v3_RateLimitSettings*)_upb_Message_New(&envoy_config_core_v3_RateLimitSettings_msg_init, arena); + if (sub) envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_set_node_on_first_message_only(envoy_config_core_v3_ApiConfigSource *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_transport_api_version(envoy_config_core_v3_ApiConfigSource *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_ApiConfigSource_mutable_config_validators(envoy_config_core_v3_ApiConfigSource* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 56), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_ApiConfigSource_mutable_config_validators(envoy_config_core_v3_ApiConfigSource* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(36, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_ApiConfigSource_resize_config_validators(envoy_config_core_v3_ApiConfigSource* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_ApiConfigSource_resize_config_validators(envoy_config_core_v3_ApiConfigSource* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(36, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_ApiConfigSource_add_config_validators(envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(36, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.AggregatedConfigSource */ UPB_INLINE envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_AggregatedConfigSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_AggregatedConfigSource*)_upb_Message_New(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena); + return (envoy_config_core_v3_AggregatedConfigSource*)_upb_Message_New(&envoy_config_core_v3_AggregatedConfigSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_AggregatedConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_AggregatedConfigSource* ret = envoy_config_core_v3_AggregatedConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -283,7 +392,7 @@ UPB_INLINE envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_Agg int options, upb_Arena* arena) { envoy_config_core_v3_AggregatedConfigSource* ret = envoy_config_core_v3_AggregatedConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -291,13 +400,13 @@ UPB_INLINE envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_Agg } UPB_INLINE char* envoy_config_core_v3_AggregatedConfigSource_serialize(const envoy_config_core_v3_AggregatedConfigSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msg_init, options, arena, &ptr, len); return ptr; } @@ -305,12 +414,12 @@ UPB_INLINE char* envoy_config_core_v3_AggregatedConfigSource_serialize_ex(const /* envoy.config.core.v3.SelfConfigSource */ UPB_INLINE envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_SelfConfigSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_SelfConfigSource*)_upb_Message_New(&envoy_config_core_v3_SelfConfigSource_msginit, arena); + return (envoy_config_core_v3_SelfConfigSource*)_upb_Message_New(&envoy_config_core_v3_SelfConfigSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_SelfConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_SelfConfigSource* ret = envoy_config_core_v3_SelfConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -320,7 +429,7 @@ UPB_INLINE envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_SelfConfi int options, upb_Arena* arena) { envoy_config_core_v3_SelfConfigSource* ret = envoy_config_core_v3_SelfConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -328,35 +437,41 @@ UPB_INLINE envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_SelfConfi } UPB_INLINE char* envoy_config_core_v3_SelfConfigSource_serialize(const envoy_config_core_v3_SelfConfigSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msg_init, 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; +UPB_INLINE void envoy_config_core_v3_SelfConfigSource_clear_transport_api_version(envoy_config_core_v3_SelfConfigSource* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_SelfConfigSource_transport_api_version(const envoy_config_core_v3_SelfConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_SelfConfigSource_set_transport_api_version(envoy_config_core_v3_SelfConfigSource *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.RateLimitSettings */ UPB_INLINE envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_RateLimitSettings_new(upb_Arena* arena) { - return (envoy_config_core_v3_RateLimitSettings*)_upb_Message_New(&envoy_config_core_v3_RateLimitSettings_msginit, arena); + return (envoy_config_core_v3_RateLimitSettings*)_upb_Message_New(&envoy_config_core_v3_RateLimitSettings_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_RateLimitSettings_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RateLimitSettings* ret = envoy_config_core_v3_RateLimitSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -366,7 +481,7 @@ UPB_INLINE envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_RateLimi int options, upb_Arena* arena) { envoy_config_core_v3_RateLimitSettings* ret = envoy_config_core_v3_RateLimitSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -374,57 +489,67 @@ UPB_INLINE envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_RateLimi } UPB_INLINE char* envoy_config_core_v3_RateLimitSettings_serialize(const envoy_config_core_v3_RateLimitSettings* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_RateLimitSettings_clear_max_tokens(const envoy_config_core_v3_RateLimitSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RateLimitSettings_clear_max_tokens(envoy_config_core_v3_RateLimitSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_RateLimitSettings_max_tokens(const envoy_config_core_v3_RateLimitSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_fill_rate(const envoy_config_core_v3_RateLimitSettings* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_max_tokens(const envoy_config_core_v3_RateLimitSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_RateLimitSettings_clear_fill_rate(const envoy_config_core_v3_RateLimitSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_RateLimitSettings_clear_fill_rate(envoy_config_core_v3_RateLimitSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSettings_fill_rate(const envoy_config_core_v3_RateLimitSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_DoubleValue*); + const struct google_protobuf_DoubleValue* default_val = NULL; + const struct google_protobuf_DoubleValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_fill_rate(const envoy_config_core_v3_RateLimitSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_max_tokens(envoy_config_core_v3_RateLimitSettings *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RateLimitSettings_mutable_max_tokens(envoy_config_core_v3_RateLimitSettings* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_RateLimitSettings_max_tokens(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RateLimitSettings_set_max_tokens(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_RateLimitSettings_set_max_tokens(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_fill_rate(envoy_config_core_v3_RateLimitSettings *msg, struct google_protobuf_DoubleValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_DoubleValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSettings_mutable_fill_rate(envoy_config_core_v3_RateLimitSettings* msg, upb_Arena* arena) { struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_core_v3_RateLimitSettings_fill_rate(msg); if (sub == NULL) { - sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_RateLimitSettings_set_fill_rate(msg, sub); + sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msg_init, arena); + if (sub) envoy_config_core_v3_RateLimitSettings_set_fill_rate(msg, sub); } return sub; } @@ -432,12 +557,12 @@ UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSet /* envoy.config.core.v3.PathConfigSource */ UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfigSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_PathConfigSource*)_upb_Message_New(&envoy_config_core_v3_PathConfigSource_msginit, arena); + return (envoy_config_core_v3_PathConfigSource*)_upb_Message_New(&envoy_config_core_v3_PathConfigSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_PathConfigSource* ret = envoy_config_core_v3_PathConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_PathConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_PathConfigSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -447,7 +572,7 @@ UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfi int options, upb_Arena* arena) { envoy_config_core_v3_PathConfigSource* ret = envoy_config_core_v3_PathConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_PathConfigSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_PathConfigSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -455,44 +580,55 @@ UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfi } UPB_INLINE char* envoy_config_core_v3_PathConfigSource_serialize(const envoy_config_core_v3_PathConfigSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_PathConfigSource_clear_path(envoy_config_core_v3_PathConfigSource* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_PathConfigSource_path(const envoy_config_core_v3_PathConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_PathConfigSource_has_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_PathConfigSource_clear_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_PathConfigSource_clear_watched_directory(envoy_config_core_v3_PathConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_PathConfigSource_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_WatchedDirectory*); + const struct envoy_config_core_v3_WatchedDirectory* default_val = NULL; + const struct envoy_config_core_v3_WatchedDirectory* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_PathConfigSource_has_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_PathConfigSource_set_path(envoy_config_core_v3_PathConfigSource *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_PathConfigSource_set_watched_directory(envoy_config_core_v3_PathConfigSource *msg, struct envoy_config_core_v3_WatchedDirectory* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_WatchedDirectory*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_PathConfigSource_mutable_watched_directory(envoy_config_core_v3_PathConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_WatchedDirectory* sub = (struct envoy_config_core_v3_WatchedDirectory*)envoy_config_core_v3_PathConfigSource_watched_directory(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_PathConfigSource_set_watched_directory(msg, sub); + sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msg_init, arena); + if (sub) envoy_config_core_v3_PathConfigSource_set_watched_directory(msg, sub); } return sub; } @@ -500,12 +636,12 @@ UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_Pa /* envoy.config.core.v3.ConfigSource */ UPB_INLINE envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ConfigSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); + return (envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ConfigSource* ret = envoy_config_core_v3_ConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -515,7 +651,7 @@ UPB_INLINE envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ConfigSource_ int options, upb_Arena* arena) { envoy_config_core_v3_ConfigSource* ret = envoy_config_core_v3_ConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -523,13 +659,13 @@ UPB_INLINE envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ConfigSource_ } UPB_INLINE char* envoy_config_core_v3_ConfigSource_serialize(const envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -541,154 +677,222 @@ typedef enum { envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET = 0 } envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases envoy_config_core_v3_ConfigSource_config_source_specifier_case(const envoy_config_core_v3_ConfigSource* msg) { - return (envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_path(const envoy_config_core_v3_ConfigSource* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_path(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_ConfigSource_path(const envoy_config_core_v3_ConfigSource* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_api_config_source(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path(const envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_api_config_source(const envoy_config_core_v3_ConfigSource* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_api_config_source(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ConfigSource_api_config_source(const envoy_config_core_v3_ConfigSource* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_core_v3_ApiConfigSource* default_val = NULL; + const envoy_config_core_v3_ApiConfigSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_ads(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_api_config_source(const envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_ads(const envoy_config_core_v3_ConfigSource* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_ads(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_ConfigSource_ads(const envoy_config_core_v3_ConfigSource* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const envoy_config_core_v3_AggregatedConfigSource* default_val = NULL; + const envoy_config_core_v3_AggregatedConfigSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_ads(const envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_initial_fetch_timeout(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 32), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ConfigSource_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 32), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_self(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 32), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_self(const envoy_config_core_v3_ConfigSource* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_self(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_ConfigSource_self(const envoy_config_core_v3_ConfigSource* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL); + const envoy_config_core_v3_SelfConfigSource* default_val = NULL; + const envoy_config_core_v3_SelfConfigSource* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_resource_api_version(const envoy_config_core_v3_ConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_self(const envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_resource_api_version(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_ConfigSource_resource_api_version(const envoy_config_core_v3_ConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_authorities(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct xds_core_v3_Authority* const* envoy_config_core_v3_ConfigSource_authorities(const envoy_config_core_v3_ConfigSource* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct xds_core_v3_Authority* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_authorities(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); + size_t size; + envoy_config_core_v3_ConfigSource_authorities(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_authorities(const envoy_config_core_v3_ConfigSource* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); -} -UPB_INLINE const struct xds_core_v3_Authority* const* envoy_config_core_v3_ConfigSource_authorities(const envoy_config_core_v3_ConfigSource* msg, size_t* len) { - return (const struct xds_core_v3_Authority* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); -} -UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path_config_source(const envoy_config_core_v3_ConfigSource* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8; -} -UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_path_config_source(const envoy_config_core_v3_ConfigSource* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_PathConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_path_config_source(envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_ConfigSource_path_config_source(const envoy_config_core_v3_ConfigSource* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_PathConfigSource*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 8, NULL); + const envoy_config_core_v3_PathConfigSource* default_val = NULL; + const envoy_config_core_v3_PathConfigSource* ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path_config_source(const envoy_config_core_v3_ConfigSource* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_path(envoy_config_core_v3_ConfigSource *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_api_config_source(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_ApiConfigSource* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ConfigSource_mutable_api_config_source(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_core_v3_ConfigSource_api_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ConfigSource_set_api_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msg_init, arena); + if (sub) envoy_config_core_v3_ConfigSource_set_api_config_source(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_ads(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_AggregatedConfigSource* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_ConfigSource_mutable_ads(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_AggregatedConfigSource* sub = (struct envoy_config_core_v3_AggregatedConfigSource*)envoy_config_core_v3_ConfigSource_ads(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_AggregatedConfigSource*)_upb_Message_New(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ConfigSource_set_ads(msg, sub); + sub = (struct envoy_config_core_v3_AggregatedConfigSource*)_upb_Message_New(&envoy_config_core_v3_AggregatedConfigSource_msg_init, arena); + if (sub) envoy_config_core_v3_ConfigSource_set_ads(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 32), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ConfigSource_mutable_initial_fetch_timeout(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ConfigSource_initial_fetch_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_self(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_SelfConfigSource* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_ConfigSource_mutable_self(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_SelfConfigSource* sub = (struct envoy_config_core_v3_SelfConfigSource*)envoy_config_core_v3_ConfigSource_self(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SelfConfigSource*)_upb_Message_New(&envoy_config_core_v3_SelfConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ConfigSource_set_self(msg, sub); + sub = (struct envoy_config_core_v3_SelfConfigSource*)_upb_Message_New(&envoy_config_core_v3_SelfConfigSource_msg_init, arena); + if (sub) envoy_config_core_v3_ConfigSource_set_self(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_resource_api_version(envoy_config_core_v3_ConfigSource *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_mutable_authorities(envoy_config_core_v3_ConfigSource* msg, size_t* len) { - return (struct xds_core_v3_Authority**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_mutable_authorities(envoy_config_core_v3_ConfigSource* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(16, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct xds_core_v3_Authority**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_resize_authorities(envoy_config_core_v3_ConfigSource* msg, size_t len, upb_Arena* arena) { - return (struct xds_core_v3_Authority**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_resize_authorities(envoy_config_core_v3_ConfigSource* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(16, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct xds_core_v3_Authority**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_core_v3_Authority* envoy_config_core_v3_ConfigSource_add_authorities(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) { - struct xds_core_v3_Authority* sub = (struct xds_core_v3_Authority*)_upb_Message_New(&xds_core_v3_Authority_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(16, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_core_v3_Authority* sub = (struct xds_core_v3_Authority*)_upb_Message_New(&xds_core_v3_Authority_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_ConfigSource_set_path_config_source(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_PathConfigSource* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_PathConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 8); + const upb_MiniTableField field = {8, UPB_SIZE(20, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_ConfigSource_mutable_path_config_source(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_PathConfigSource* sub = (struct envoy_config_core_v3_PathConfigSource*)envoy_config_core_v3_ConfigSource_path_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_PathConfigSource*)_upb_Message_New(&envoy_config_core_v3_PathConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ConfigSource_set_path_config_source(msg, sub); + sub = (struct envoy_config_core_v3_PathConfigSource*)_upb_Message_New(&envoy_config_core_v3_PathConfigSource_msg_init, arena); + if (sub) envoy_config_core_v3_ConfigSource_set_path_config_source(msg, sub); } return sub; } @@ -696,12 +900,12 @@ UPB_INLINE struct envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_Co /* envoy.config.core.v3.ExtensionConfigSource */ UPB_INLINE envoy_config_core_v3_ExtensionConfigSource* envoy_config_core_v3_ExtensionConfigSource_new(upb_Arena* arena) { - return (envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena); + return (envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ExtensionConfigSource* envoy_config_core_v3_ExtensionConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ExtensionConfigSource* ret = envoy_config_core_v3_ExtensionConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -711,7 +915,7 @@ UPB_INLINE envoy_config_core_v3_ExtensionConfigSource* envoy_config_core_v3_Exte int options, upb_Arena* arena) { envoy_config_core_v3_ExtensionConfigSource* ret = envoy_config_core_v3_ExtensionConfigSource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -719,94 +923,139 @@ UPB_INLINE envoy_config_core_v3_ExtensionConfigSource* envoy_config_core_v3_Exte } UPB_INLINE char* envoy_config_core_v3_ExtensionConfigSource_serialize(const envoy_config_core_v3_ExtensionConfigSource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_config_source(const envoy_config_core_v3_ExtensionConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_config_source(envoy_config_core_v3_ExtensionConfigSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ExtensionConfigSource_config_source(const envoy_config_core_v3_ExtensionConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_ConfigSource*); + const envoy_config_core_v3_ConfigSource* default_val = NULL; + const envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_default_config(const envoy_config_core_v3_ExtensionConfigSource* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_config_source(const envoy_config_core_v3_ExtensionConfigSource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_default_config(const envoy_config_core_v3_ExtensionConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_default_config(envoy_config_core_v3_ExtensionConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_ExtensionConfigSource_default_config(const envoy_config_core_v3_ExtensionConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_apply_default_config_without_warming(const envoy_config_core_v3_ExtensionConfigSource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_default_config(const envoy_config_core_v3_ExtensionConfigSource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_apply_default_config_without_warming(envoy_config_core_v3_ExtensionConfigSource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_apply_default_config_without_warming(const envoy_config_core_v3_ExtensionConfigSource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_type_urls(const envoy_config_core_v3_ExtensionConfigSource* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_core_v3_ExtensionConfigSource_type_urls(const envoy_config_core_v3_ExtensionConfigSource* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_ExtensionConfigSource_type_urls(const envoy_config_core_v3_ExtensionConfigSource* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_type_urls(const envoy_config_core_v3_ExtensionConfigSource* msg) { + size_t size; + envoy_config_core_v3_ExtensionConfigSource_type_urls(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_config_source(envoy_config_core_v3_ExtensionConfigSource *msg, envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ExtensionConfigSource_mutable_config_source(envoy_config_core_v3_ExtensionConfigSource* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_core_v3_ExtensionConfigSource_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ExtensionConfigSource_set_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_core_v3_ExtensionConfigSource_set_config_source(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_default_config(envoy_config_core_v3_ExtensionConfigSource *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_ExtensionConfigSource_mutable_default_config(envoy_config_core_v3_ExtensionConfigSource* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_ExtensionConfigSource_default_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ExtensionConfigSource_set_default_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_core_v3_ExtensionConfigSource_set_default_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_apply_default_config_without_warming(envoy_config_core_v3_ExtensionConfigSource *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_core_v3_ExtensionConfigSource_mutable_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_ExtensionConfigSource_mutable_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_ExtensionConfigSource_resize_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_ExtensionConfigSource_resize_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_add_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.core.v3.RestSubscription */ UPB_INLINE envoy_config_core_v3_RestSubscription* envoy_config_core_v3_RestSubscription_new(upb_Arena* arena) { - return (envoy_config_core_v3_RestSubscription*)_upb_Message_New(&envoy_config_core_v3_RestSubscription_msginit, arena); + return (envoy_config_core_v3_RestSubscription*)_upb_Message_New(&envoy_config_core_v3_RestSubscription_msg_init, arena); } UPB_INLINE envoy_config_core_v3_RestSubscription* envoy_config_core_v3_RestSubscription_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_RestSubscription* ret = envoy_config_core_v3_RestSubscription_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RestSubscription_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RestSubscription_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -816,7 +1065,7 @@ UPB_INLINE envoy_config_core_v3_RestSubscription* envoy_config_core_v3_RestSubsc int options, upb_Arena* arena) { envoy_config_core_v3_RestSubscription* ret = envoy_config_core_v3_RestSubscription_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RestSubscription_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RestSubscription_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -824,23 +1073,23 @@ UPB_INLINE envoy_config_core_v3_RestSubscription* envoy_config_core_v3_RestSubsc } UPB_INLINE char* envoy_config_core_v3_RestSubscription_serialize(const envoy_config_core_v3_RestSubscription* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RestSubscription_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RestSubscription_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_core_v3_RestSubscription_serialize_ex(const envoy_config_core_v3_RestSubscription* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_RestSubscription_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_RestSubscription_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_config_core_v3_config_source_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_config_source_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_ */ 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 c2709636ce5..7c1b792db8f 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 @@ -7,34 +7,41 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/event_service_config.upb.h" #include "envoy/config/core/v3/grpc_service.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_EventServiceConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_EventServiceConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_EventServiceConfig__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_EventServiceConfig__fields[1] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit = { +const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msg_init = { &envoy_config_core_v3_EventServiceConfig_submsgs[0], &envoy_config_core_v3_EventServiceConfig__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_core_v3_EventServiceConfig_msginit, + &envoy_config_core_v3_EventServiceConfig_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_event_service_config_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_event_service_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -43,5 +50,5 @@ const upb_MiniTable_File envoy_config_core_v3_event_service_config_proto_upb_fil 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 93b84f9e3a8..12849aec1fb 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_EventServiceConfig; typedef struct envoy_config_core_v3_EventServiceConfig envoy_config_core_v3_EventServiceConfig; -extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msg_init; struct envoy_config_core_v3_GrpcService; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; /* envoy.config.core.v3.EventServiceConfig */ UPB_INLINE envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_EventServiceConfig_new(upb_Arena* arena) { - return (envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msginit, arena); + return (envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msg_init, arena); } UPB_INLINE envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_EventServiceConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_EventServiceConfig* ret = envoy_config_core_v3_EventServiceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_EventSe int options, upb_Arena* arena) { envoy_config_core_v3_EventServiceConfig* ret = envoy_config_core_v3_EventServiceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,13 +58,13 @@ UPB_INLINE envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_EventSe } UPB_INLINE char* envoy_config_core_v3_EventServiceConfig_serialize(const envoy_config_core_v3_EventServiceConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -68,37 +72,44 @@ typedef enum { envoy_config_core_v3_EventServiceConfig_config_source_specifier_NOT_SET = 0 } envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases envoy_config_core_v3_EventServiceConfig_config_source_specifier_case(const envoy_config_core_v3_EventServiceConfig* msg) { - return (envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_EventServiceConfig_has_grpc_service(const envoy_config_core_v3_EventServiceConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_EventServiceConfig_clear_grpc_service(const envoy_config_core_v3_EventServiceConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_GrpcService*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_EventServiceConfig_config_source_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_EventServiceConfig_clear_grpc_service(envoy_config_core_v3_EventServiceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventServiceConfig_grpc_service(const envoy_config_core_v3_EventServiceConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_GrpcService*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_EventServiceConfig_has_grpc_service(const envoy_config_core_v3_EventServiceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_EventServiceConfig_set_grpc_service(envoy_config_core_v3_EventServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_GrpcService*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventServiceConfig_mutable_grpc_service(envoy_config_core_v3_EventServiceConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_core_v3_EventServiceConfig_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_EventServiceConfig_set_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_core_v3_EventServiceConfig_set_grpc_service(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_event_service_config_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_event_service_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_ */ 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 9aa57e0a0c0..e1280a704a9 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 @@ -7,34 +7,43 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/extension.upb.h" #include "google/protobuf/any.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_TypedExtensionConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_TypedExtensionConfig__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit = { +const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init = { &envoy_config_core_v3_TypedExtensionConfig_submsgs[0], &envoy_config_core_v3_TypedExtensionConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_core_v3_TypedExtensionConfig_msginit, + &envoy_config_core_v3_TypedExtensionConfig_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_extension_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_extension_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -43,5 +52,5 @@ const upb_MiniTable_File envoy_config_core_v3_extension_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 dd48f15cb70..739490affa6 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_TypedExtensionConfig; typedef struct envoy_config_core_v3_TypedExtensionConfig envoy_config_core_v3_TypedExtensionConfig; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* envoy.config.core.v3.TypedExtensionConfig */ UPB_INLINE envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_TypedExtensionConfig_new(upb_Arena* arena) { - return (envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); + return (envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); } UPB_INLINE envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_TypedExtensionConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_TypedExtensionConfig* ret = envoy_config_core_v3_TypedExtensionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Typed int options, upb_Arena* arena) { envoy_config_core_v3_TypedExtensionConfig* ret = envoy_config_core_v3_TypedExtensionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Typed } UPB_INLINE char* envoy_config_core_v3_TypedExtensionConfig_serialize(const envoy_config_core_v3_TypedExtensionConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_clear_name(envoy_config_core_v3_TypedExtensionConfig* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_TypedExtensionConfig_name(const envoy_config_core_v3_TypedExtensionConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_TypedExtensionConfig_has_typed_config(const envoy_config_core_v3_TypedExtensionConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_clear_typed_config(const envoy_config_core_v3_TypedExtensionConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_clear_typed_config(envoy_config_core_v3_TypedExtensionConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_TypedExtensionConfig_typed_config(const envoy_config_core_v3_TypedExtensionConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_TypedExtensionConfig_has_typed_config(const envoy_config_core_v3_TypedExtensionConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_name(envoy_config_core_v3_TypedExtensionConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_typed_config(envoy_config_core_v3_TypedExtensionConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TypedExtensionConfig_mutable_typed_config(envoy_config_core_v3_TypedExtensionConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_TypedExtensionConfig_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_TypedExtensionConfig_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_core_v3_TypedExtensionConfig_set_typed_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_extension_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_extension_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_ */ 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 c4267c31f5a..d0aedf265e2 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 @@ -7,45 +7,58 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/grpc_method_list.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcMethodList_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcMethodList_Service_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcMethodList_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcMethodList_Service_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcMethodList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcMethodList_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcMethodList_msg_init = { &envoy_config_core_v3_GrpcMethodList_submsgs[0], &envoy_config_core_v3_GrpcMethodList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList_Service__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcMethodList_Service__fields[2] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcMethodList_Service_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcMethodList_Service_msg_init = { NULL, &envoy_config_core_v3_GrpcMethodList_Service__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_core_v3_GrpcMethodList_msginit, - &envoy_config_core_v3_GrpcMethodList_Service_msginit, + &envoy_config_core_v3_GrpcMethodList_msg_init, + &envoy_config_core_v3_GrpcMethodList_Service_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_grpc_method_list_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_grpc_method_list_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -54,5 +67,5 @@ const upb_MiniTable_File envoy_config_core_v3_grpc_method_list_proto_upb_file_la 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b500d2893be..7fe8ce1a1a1 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 @@ -9,35 +9,38 @@ #ifndef ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_GrpcMethodList; -struct envoy_config_core_v3_GrpcMethodList_Service; typedef struct envoy_config_core_v3_GrpcMethodList envoy_config_core_v3_GrpcMethodList; typedef struct envoy_config_core_v3_GrpcMethodList_Service envoy_config_core_v3_GrpcMethodList_Service; -extern const upb_MiniTable envoy_config_core_v3_GrpcMethodList_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcMethodList_Service_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcMethodList_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcMethodList_Service_msg_init; /* envoy.config.core.v3.GrpcMethodList */ UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcMethodList*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_msginit, arena); + return (envoy_config_core_v3_GrpcMethodList*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcMethodList* ret = envoy_config_core_v3_GrpcMethodList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +50,7 @@ UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodL int options, upb_Arena* arena) { envoy_config_core_v3_GrpcMethodList* ret = envoy_config_core_v3_GrpcMethodList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,47 +58,72 @@ UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodL } UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_serialize(const envoy_config_core_v3_GrpcMethodList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_core_v3_GrpcMethodList_clear_services(envoy_config_core_v3_GrpcMethodList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_GrpcMethodList_Service* const* envoy_config_core_v3_GrpcMethodList_services(const envoy_config_core_v3_GrpcMethodList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_GrpcMethodList_Service* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_core_v3_GrpcMethodList_has_services(const envoy_config_core_v3_GrpcMethodList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_core_v3_GrpcMethodList_clear_services(const envoy_config_core_v3_GrpcMethodList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_core_v3_GrpcMethodList_Service* const* envoy_config_core_v3_GrpcMethodList_services(const envoy_config_core_v3_GrpcMethodList* msg, size_t* len) { - return (const envoy_config_core_v3_GrpcMethodList_Service* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_core_v3_GrpcMethodList_services(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_mutable_services(envoy_config_core_v3_GrpcMethodList* msg, size_t* len) { - return (envoy_config_core_v3_GrpcMethodList_Service**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_mutable_services(envoy_config_core_v3_GrpcMethodList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_GrpcMethodList_Service**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_resize_services(envoy_config_core_v3_GrpcMethodList* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_GrpcMethodList_Service**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_resize_services(envoy_config_core_v3_GrpcMethodList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcMethodList_Service**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_add_services(envoy_config_core_v3_GrpcMethodList* msg, upb_Arena* arena) { - struct envoy_config_core_v3_GrpcMethodList_Service* sub = (struct envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_Service_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_GrpcMethodList_Service* sub = (struct envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_Service_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.GrpcMethodList.Service */ UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_Service_msginit, arena); + return (envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_Service_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcMethodList_Service* ret = envoy_config_core_v3_GrpcMethodList_Service_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_Service_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_Service_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -105,7 +133,7 @@ UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_Grp int options, upb_Arena* arena) { envoy_config_core_v3_GrpcMethodList_Service* ret = envoy_config_core_v3_GrpcMethodList_Service_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_Service_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_Service_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -113,47 +141,82 @@ UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_Grp } UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_Service_serialize(const envoy_config_core_v3_GrpcMethodList_Service* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_name(envoy_config_core_v3_GrpcMethodList_Service* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcMethodList_Service_name(const envoy_config_core_v3_GrpcMethodList_Service* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_core_v3_GrpcMethodList_Service_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_GrpcMethodList_Service_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_core_v3_GrpcMethodList_Service_has_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg) { + size_t size; + envoy_config_core_v3_GrpcMethodList_Service_method_names(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_set_name(envoy_config_core_v3_GrpcMethodList_Service *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_mutable_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_mutable_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_resize_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_resize_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_GrpcMethodList_Service_add_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File envoy_config_core_v3_grpc_method_list_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_grpc_method_list_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_ */ 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 49f188632fe..1d0701c2f16 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/grpc_service.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "google/protobuf/any.upb.h" @@ -20,243 +22,348 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_submsgs[4] = { - {.submsg = &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_submsgs[4] = { + {.submsg = &envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService__fields[4] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService__fields[4] = { + {1, UPB_SIZE(16, 24), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 16), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init = { &envoy_config_core_v3_GrpcService_submsgs[0], &envoy_config_core_v3_GrpcService__fields[0], - UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800040100000a, &upb_pom_1bt_max64b}, + {0x0018000402010012, &upb_pom_1bt_max128b}, + {0x000800000102001a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f03002a, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init = { NULL, &envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = { - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit}, - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = { + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init}, + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(36, 72), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 80), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(44, 88), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = { + {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 80), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 88), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc__fields[0], - UPB_SIZE(48, 96), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(48, 96), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x002000003f01001a, &upb_prm_1bt_max64b}, + {0x002800003f000022, &upb_pss_1bt}, + {0x003800003f00002a, &upb_pss_1bt}, + {0x0048000002020032, &upb_psm_1bt_maxmaxb}, + {0x005000000303003a, &upb_psm_1bt_maxmaxb}, + {0x0058000004040042, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[3] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[3] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + }) }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = { - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit}, - {.submsg = &google_protobuf_Empty_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = { + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init}, + {.submsg = &google_protobuf_Empty_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[3] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_maxmaxb}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = { - {.submsg = &google_protobuf_Empty_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = { + {.submsg = &google_protobuf_Empty_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[7] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[0], - UPB_SIZE(16, 24), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(16, 24), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pom_1bt_maxmaxb}, + {0x000800000300001a, &upb_pos_1bt}, + {0x0008000004010022, &upb_pom_1bt_max64b}, + {0x000800000502002a, &upb_pom_1bt_max64b}, + {0x0008000006030032, &upb_pom_1bt_max64b}, + {0x000800000704003a, &upb_pom_1bt_max192b}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init = { NULL, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init = { NULL, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(48, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(56, 112), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(64, 128), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(40, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(48, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(56, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(64, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init = { NULL, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[0], - UPB_SIZE(72, 144), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(72, 144), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_pss_1bt}, + {0x003000003f000022, &upb_pss_1bt}, + {0x004000003f00002a, &upb_pss_1bt}, + {0x005000003f000032, &upb_pss_1bt}, + {0x006000003f00003a, &upb_pss_1bt}, + {0x007000003f000042, &upb_pss_1bt}, + {0x008000003f00004a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init = { NULL, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000010, &upb_pov8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msg_init = { &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[0], &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[14] = { - &envoy_config_core_v3_GrpcService_msginit, - &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, - &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit, + &envoy_config_core_v3_GrpcService_msg_init, + &envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init, + &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_grpc_service_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_grpc_service_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -265,5 +372,5 @@ const upb_MiniTable_File envoy_config_core_v3_grpc_service_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 fda73883a43..981a735d446 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 @@ -9,31 +9,22 @@ #ifndef ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_GrpcService; -struct envoy_config_core_v3_GrpcService_EnvoyGrpc; -struct envoy_config_core_v3_GrpcService_GoogleGrpc; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value; -struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry; typedef struct envoy_config_core_v3_GrpcService envoy_config_core_v3_GrpcService; typedef struct envoy_config_core_v3_GrpcService_EnvoyGrpc envoy_config_core_v3_GrpcService_EnvoyGrpc; typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc envoy_config_core_v3_GrpcService_GoogleGrpc; @@ -48,20 +39,20 @@ typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsSe typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs; typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value; typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msg_init; struct envoy_config_core_v3_DataSource; struct envoy_config_core_v3_HeaderValue; struct google_protobuf_Any; @@ -69,25 +60,25 @@ struct google_protobuf_Duration; struct google_protobuf_Empty; struct google_protobuf_Struct; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Empty_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValue_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Empty_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.core.v3.GrpcService */ UPB_INLINE envoy_config_core_v3_GrpcService* envoy_config_core_v3_GrpcService_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); + return (envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService* envoy_config_core_v3_GrpcService_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService* ret = envoy_config_core_v3_GrpcService_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -97,7 +88,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService* envoy_config_core_v3_GrpcService_pa int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService* ret = envoy_config_core_v3_GrpcService_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -105,13 +96,13 @@ UPB_INLINE envoy_config_core_v3_GrpcService* envoy_config_core_v3_GrpcService_pa } UPB_INLINE char* envoy_config_core_v3_GrpcService_serialize(const envoy_config_core_v3_GrpcService* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -120,104 +111,147 @@ typedef enum { envoy_config_core_v3_GrpcService_target_specifier_NOT_SET = 0 } envoy_config_core_v3_GrpcService_target_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_GrpcService_target_specifier_oneofcases envoy_config_core_v3_GrpcService_target_specifier_case(const envoy_config_core_v3_GrpcService* msg) { - return (envoy_config_core_v3_GrpcService_target_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcService_target_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_GrpcService_has_envoy_grpc(const envoy_config_core_v3_GrpcService* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_core_v3_GrpcService_clear_envoy_grpc(const envoy_config_core_v3_GrpcService* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(16, 24), 0, UPB_SIZE(4, 4), envoy_config_core_v3_GrpcService_target_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_clear_envoy_grpc(envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_envoy_grpc(const envoy_config_core_v3_GrpcService* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(16, 24), UPB_SIZE(4, 4), 1, NULL); + const envoy_config_core_v3_GrpcService_EnvoyGrpc* default_val = NULL; + const envoy_config_core_v3_GrpcService_EnvoyGrpc* ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_has_google_grpc(const envoy_config_core_v3_GrpcService* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_core_v3_GrpcService_has_envoy_grpc(const envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_clear_google_grpc(const envoy_config_core_v3_GrpcService* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(16, 24), 0, UPB_SIZE(4, 4), envoy_config_core_v3_GrpcService_target_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_clear_google_grpc(envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_google_grpc(const envoy_config_core_v3_GrpcService* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(16, 24), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc* ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_has_timeout(const envoy_config_core_v3_GrpcService* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_core_v3_GrpcService_has_google_grpc(const envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_clear_timeout(const envoy_config_core_v3_GrpcService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_clear_timeout(envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_GrpcService_timeout(const envoy_config_core_v3_GrpcService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_has_timeout(const envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_GrpcService_clear_initial_metadata(envoy_config_core_v3_GrpcService* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_GrpcService_initial_metadata(const envoy_config_core_v3_GrpcService* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValue* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_GrpcService_has_initial_metadata(const envoy_config_core_v3_GrpcService* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); -} -UPB_INLINE void envoy_config_core_v3_GrpcService_clear_initial_metadata(const envoy_config_core_v3_GrpcService* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); -} -UPB_INLINE const struct envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_GrpcService_initial_metadata(const envoy_config_core_v3_GrpcService* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValue* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); + size_t size; + envoy_config_core_v3_GrpcService_initial_metadata(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_GrpcService_set_envoy_grpc(envoy_config_core_v3_GrpcService *msg, envoy_config_core_v3_GrpcService_EnvoyGrpc* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(16, 24), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_mutable_envoy_grpc(envoy_config_core_v3_GrpcService* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_EnvoyGrpc* sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)envoy_config_core_v3_GrpcService_envoy_grpc(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_set_envoy_grpc(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_set_envoy_grpc(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_set_google_grpc(envoy_config_core_v3_GrpcService *msg, envoy_config_core_v3_GrpcService_GoogleGrpc* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(16, 24), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_mutable_google_grpc(envoy_config_core_v3_GrpcService* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)envoy_config_core_v3_GrpcService_google_grpc(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_set_google_grpc(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_set_google_grpc(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_set_timeout(envoy_config_core_v3_GrpcService *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_GrpcService_mutable_timeout(envoy_config_core_v3_GrpcService* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_GrpcService_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_set_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_set_timeout(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_mutable_initial_metadata(envoy_config_core_v3_GrpcService* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_mutable_initial_metadata(envoy_config_core_v3_GrpcService* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(12, 16), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValue**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_resize_initial_metadata(envoy_config_core_v3_GrpcService* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValue**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_resize_initial_metadata(envoy_config_core_v3_GrpcService* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(12, 16), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValue**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_GrpcService_add_initial_metadata(envoy_config_core_v3_GrpcService* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(12, 16), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.GrpcService.EnvoyGrpc */ UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_EnvoyGrpc_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena); + return (envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_EnvoyGrpc_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_EnvoyGrpc* ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -227,7 +261,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_Grpc int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_EnvoyGrpc* ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -235,44 +269,56 @@ UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_Grpc } UPB_INLINE char* envoy_config_core_v3_GrpcService_EnvoyGrpc_serialize(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_clear_cluster_name(envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_EnvoyGrpc_cluster_name(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_clear_authority(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_clear_authority(envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_EnvoyGrpc_authority(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_cluster_name(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_authority(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.GrpcService.GoogleGrpc */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_GoogleGrpc_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_GoogleGrpc_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -282,7 +328,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_Grp int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -290,149 +336,212 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_Grp } UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_target_uri(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_target_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*); + const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const* envoy_config_core_v3_GrpcService_GoogleGrpc_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + envoy_config_core_v3_GrpcService_GoogleGrpc_call_credentials(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const* envoy_config_core_v3_GrpcService_GoogleGrpc_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg, size_t* len) { - return (const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_stat_prefix(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_stat_prefix(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_stat_prefix(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_credentials_factory_name(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_credentials_factory_name(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_credentials_factory_name(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_config(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_config(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_config(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_GoogleGrpc_config(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_config(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_GoogleGrpc_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*); + const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_target_uri(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(msg, sub); } return sub; } -UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, size_t* len) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_resize_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_resize_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_add_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, upb_Arena* arena) { - struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_stat_prefix(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_credentials_factory_name(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_config(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_GrpcService_GoogleGrpc_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_GrpcService_GoogleGrpc_per_stream_buffer_limit_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)envoy_config_core_v3_GrpcService_GoogleGrpc_channel_args(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(msg, sub); } return sub; } @@ -440,12 +549,12 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy /* envoy.config.core.v3.GrpcService.GoogleGrpc.SslCredentials */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -455,7 +564,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_con int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -463,79 +572,94 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_con } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_root_certs(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_private_key(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_cert_chain(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(msg, sub); } return sub; } @@ -543,12 +667,12 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcServ /* envoy.config.core.v3.GrpcService.GoogleGrpc.GoogleLocalCredentials */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -558,7 +682,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* e int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -566,13 +690,13 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* e } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, options, arena, &ptr, len); return ptr; } @@ -580,12 +704,12 @@ UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredenti /* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelCredentials */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -595,7 +719,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -603,13 +727,13 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -619,69 +743,88 @@ typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET = 0 } envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct google_protobuf_Empty* default_val = NULL; + const struct google_protobuf_Empty* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_ssl_credentials(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, struct google_protobuf_Empty* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg, upb_Arena* arena) { struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_google_default(msg); if (sub == NULL) { - sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(msg, sub); + sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_local_credentials(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(msg, sub); } return sub; } @@ -689,12 +832,12 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredent /* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -704,7 +847,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_co int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -712,13 +855,13 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_co } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -732,135 +875,180 @@ typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET = 0 } envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_access_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct google_protobuf_Empty* default_val = NULL; + const struct google_protobuf_Empty* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_refresh_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* default_val = NULL; + const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_access_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, struct google_protobuf_Empty* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg, upb_Arena* arena) { struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_compute_engine(msg); if (sub == NULL) { - sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(msg, sub); + sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_refresh_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_service_account_jwt_access(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_iam(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_from_plugin(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_sts_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(msg, sub); } return sub; } @@ -868,12 +1056,12 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_St /* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.ServiceAccountJWTAccessCredentials */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -883,7 +1071,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAc int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -891,44 +1079,56 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAc } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_clear_json_key(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_json_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_clear_token_lifetime_seconds(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0; +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_clear_token_lifetime_seconds(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_token_lifetime_seconds(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_set_json_key(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_set_token_lifetime_seconds(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.GoogleIAMCredentials */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -938,7 +1138,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAM int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -946,44 +1146,56 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAM } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_clear_authorization_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_authorization_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_clear_authority_selector(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_clear_authority_selector(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_authority_selector(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authorization_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authority_selector(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.MetadataCredentialsFromPlugin */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -993,7 +1205,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataC int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1001,13 +1213,13 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataC } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1015,36 +1227,49 @@ typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_NOT_SET = 0 } envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases; UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_clear_name(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_clear_name(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_name(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_has_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_clear_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_clear_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_has_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_name(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_mutable_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(msg, sub); } return sub; } @@ -1052,12 +1277,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGr /* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.StsService */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1067,7 +1292,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsServic int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1075,107 +1300,161 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsServic } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_token_exchange_service_uri(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_token_exchange_service_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_resource(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_resource(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_resource(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_audience(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_audience(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_audience(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_scope(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_scope(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_scope(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_requested_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_requested_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_requested_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_subject_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_subject_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(40, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_subject_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(40, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_subject_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_subject_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(48, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_subject_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(48, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_actor_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_actor_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(56, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_actor_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(56, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_actor_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_actor_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(64, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_actor_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(64, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_token_exchange_service_uri(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_resource(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_audience(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_scope(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_requested_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_subject_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(40, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_subject_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(48, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_actor_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(56, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_actor_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView) = value; + const upb_MiniTableField field = {9, UPB_SIZE(64, 128), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1185,7 +1464,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1193,51 +1472,74 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msg_init, 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)); -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_clear_args(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_clear_args(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_size(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_get(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg, upb_StringView key, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value** val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_next(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg, size_t* iter) { - return (const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_has_args(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) { + return envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_size(msg) != 0; } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_clear(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_clear(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_set(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg, upb_StringView key, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_delete(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_nextmutable(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg, size_t* iter) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_map_next(map, iter); } /* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.Value */ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena); + return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1247,7 +1549,7 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_ int options, upb_Arena* arena) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1255,13 +1557,13 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1270,32 +1572,47 @@ typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET = 0 } envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases; UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_clear_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_clear_string_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_clear_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET); +UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_clear_int_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { - return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, _upb_Int64_FromLL(0ll)); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_set_string_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_set_int_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, int64_t value) { - UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.ArgsEntry */ @@ -1305,25 +1622,26 @@ UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArg _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_has_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* msg) { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_has_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_set_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* value) { _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*)); } -extern const upb_MiniTable_File envoy_config_core_v3_grpc_service_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_grpc_service_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_ */ 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 dcdeaea1093..3b7c4964882 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/health_check.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/event_service_config.upb.h" @@ -22,195 +24,284 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_core_v3_HealthStatusSet__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthStatusSet__fields[1] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msg_init = { NULL, &envoy_config_core_v3_HealthStatusSet__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_ppv4_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_submsgs[20] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_TlsOptions_msginit}, - {.submsg = &envoy_config_core_v3_EventServiceConfig_msginit}, - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HealthCheck_submsgs[20] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_TlsOptions_msg_init}, + {.submsg = &envoy_config_core_v3_EventServiceConfig_msg_init}, + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck__fields[23] = { - {1, UPB_SIZE(16, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 48), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(36, 56), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 64), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(44, 72), UPB_SIZE(8, 8), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(48, 80), UPB_SIZE(9, 9), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(52, 88), UPB_SIZE(10, 10), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(56, 96), UPB_SIZE(11, 11), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(60, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(68, 120), UPB_SIZE(12, 12), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(72, 128), UPB_SIZE(13, 13), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(76, 136), UPB_SIZE(14, 14), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(80, 144), UPB_SIZE(15, 15), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(84, 152), UPB_SIZE(16, 16), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck__fields[23] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 64), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(32, 72), 8, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(40, 80), 9, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(44, 88), 10, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(48, 96), 11, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(84, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(52, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(56, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(60, 120), 12, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(64, 128), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(68, 136), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(72, 144), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(76, 152), 16, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_msg_init = { &envoy_config_core_v3_HealthCheck_submsgs[0], &envoy_config_core_v3_HealthCheck__fields[0], - UPB_SIZE(96, 168), 23, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(96, 168), 23, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x0018000002010012, &upb_psm_1bt_maxmaxb}, + {0x002000000302001a, &upb_psm_1bt_maxmaxb}, + {0x0028000004030022, &upb_psm_1bt_maxmaxb}, + {0x003000000504002a, &upb_psm_1bt_maxmaxb}, + {0x0038000006050032, &upb_psm_1bt_maxmaxb}, + {0x004000000706003a, &upb_psm_1bt_maxmaxb}, + {0x00a0000408070042, &upb_pom_1bt_max128b}, + {0x00a000040908004a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x00a000040b09005a, &upb_pom_1bt_max64b}, + {0x00480000080a0062, &upb_psm_1bt_maxmaxb}, + {0x00a000040d0b006a, &upb_pom_1bt_max64b}, + {0x00500000090c0072, &upb_psm_1bt_maxmaxb}, + {0x005800000a0d007a, &upb_psm_1bt_maxmaxb}, + {0x006000000b0e0182, &upb_psm_2bt_maxmaxb}, + {0x006800003f00018a, &upb_pss_2bt}, + {0x000800003f000190, &upb_psv4_2bt}, + {0x000c00003f000198, &upb_psb1_2bt}, + {0x007800000c0f01a2, &upb_psm_2bt_maxmaxb}, + {0x008000000d1001aa, &upb_psm_2bt_max64b}, + {0x008800000e1101b2, &upb_psm_2bt_maxmaxb}, + {0x009000000f1201ba, &upb_psm_2bt_maxmaxb}, + {0x00980000101301c2, &upb_psm_2bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_Payload__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_Payload__fields[2] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msg_init = { NULL, &envoy_config_core_v3_HealthCheck_Payload__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pob_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[7] = { - {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_type_v3_Int64Range_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &envoy_type_v3_Int64Range_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[7] = { + {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_type_v3_Int64Range_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &envoy_type_v3_Int64Range_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[12] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(28, 48), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(48, 88), UPB_SIZE(2, 2), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(52, 96), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(56, 104), UPB_SIZE(3, 3), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[12] = { + {1, UPB_SIZE(44, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(52, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(16, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(20, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(24, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(28, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(32, 96), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(40, 104), 3, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init = { &envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[0], &envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[0], - UPB_SIZE(64, 112), 12, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(64, 112), 12, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_pss_1bt}, + {0x002000003f000012, &upb_pss_1bt}, + {0x003000000100001a, &upb_psm_1bt_max64b}, + {0x003800003f010022, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x004000003f020032, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x004800003f000042, &upb_prs_1bt}, + {0x005000003f03004a, &upb_prm_1bt_maxmaxb}, + {0x000400003f000050, &upb_psv4_1bt}, + {0x005800000204005a, &upb_psm_1bt_maxmaxb}, + {0x006000003f050062, &upb_prm_1bt_maxmaxb}, + {0x000800003f000068, &upb_psv4_1bt}, + {0x0068000003060072, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[2] = { - {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit}, - {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[2] = { + {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msg_init}, + {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init = { &envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[0], &envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init = { NULL, &envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_GrpcHealthCheck_submsgs[1] = { - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HealthCheck_GrpcHealthCheck_submsgs[1] = { + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[3] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init = { &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_submsgs[0], &envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init = { &envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[0], &envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HealthCheck_TlsOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_HealthCheck_TlsOptions_msg_init = { NULL, &envoy_config_core_v3_HealthCheck_TlsOptions__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prs_1bt}, + }) }; static const upb_MiniTable *messages_layout[9] = { - &envoy_config_core_v3_HealthStatusSet_msginit, - &envoy_config_core_v3_HealthCheck_msginit, - &envoy_config_core_v3_HealthCheck_Payload_msginit, - &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, - &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, - &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, - &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, - &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, - &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, + &envoy_config_core_v3_HealthStatusSet_msg_init, + &envoy_config_core_v3_HealthCheck_msg_init, + &envoy_config_core_v3_HealthCheck_Payload_msg_init, + &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, + &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, + &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init, + &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, + &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, + &envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_health_check_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_health_check_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -219,5 +310,5 @@ const upb_MiniTable_File envoy_config_core_v3_health_check_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b5044db6fd3..b1a9fca6992 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 @@ -9,26 +9,22 @@ #ifndef ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_HealthStatusSet; -struct envoy_config_core_v3_HealthCheck; -struct envoy_config_core_v3_HealthCheck_Payload; -struct envoy_config_core_v3_HealthCheck_HttpHealthCheck; -struct envoy_config_core_v3_HealthCheck_TcpHealthCheck; -struct envoy_config_core_v3_HealthCheck_RedisHealthCheck; -struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck; -struct envoy_config_core_v3_HealthCheck_CustomHealthCheck; -struct envoy_config_core_v3_HealthCheck_TlsOptions; typedef struct envoy_config_core_v3_HealthStatusSet envoy_config_core_v3_HealthStatusSet; typedef struct envoy_config_core_v3_HealthCheck envoy_config_core_v3_HealthCheck; typedef struct envoy_config_core_v3_HealthCheck_Payload envoy_config_core_v3_HealthCheck_Payload; @@ -38,15 +34,15 @@ typedef struct envoy_config_core_v3_HealthCheck_RedisHealthCheck envoy_config_co typedef struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck envoy_config_core_v3_HealthCheck_GrpcHealthCheck; typedef struct envoy_config_core_v3_HealthCheck_CustomHealthCheck envoy_config_core_v3_HealthCheck_CustomHealthCheck; typedef struct envoy_config_core_v3_HealthCheck_TlsOptions envoy_config_core_v3_HealthCheck_TlsOptions; -extern const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit; -extern const upb_MiniTable envoy_config_core_v3_HealthCheck_TlsOptions_msginit; +extern const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HealthCheck_TlsOptions_msg_init; struct envoy_config_core_v3_EventServiceConfig; struct envoy_config_core_v3_HeaderValueOption; struct envoy_type_matcher_v3_StringMatcher; @@ -57,16 +53,16 @@ struct google_protobuf_Duration; struct google_protobuf_Struct; struct google_protobuf_UInt32Value; struct google_protobuf_UInt64Value; -extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable envoy_type_v3_Int64Range_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable envoy_type_v3_Int64Range_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; typedef enum { envoy_config_core_v3_UNKNOWN = 0, @@ -82,12 +78,12 @@ typedef enum { /* envoy.config.core.v3.HealthStatusSet */ UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStatusSet_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthStatusSet*)_upb_Message_New(&envoy_config_core_v3_HealthStatusSet_msginit, arena); + return (envoy_config_core_v3_HealthStatusSet*)_upb_Message_New(&envoy_config_core_v3_HealthStatusSet_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStatusSet_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthStatusSet* ret = envoy_config_core_v3_HealthStatusSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthStatusSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthStatusSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -97,7 +93,7 @@ UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStat int options, upb_Arena* arena) { envoy_config_core_v3_HealthStatusSet* ret = envoy_config_core_v3_HealthStatusSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthStatusSet_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthStatusSet_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -105,41 +101,70 @@ UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStat } UPB_INLINE char* envoy_config_core_v3_HealthStatusSet_serialize(const envoy_config_core_v3_HealthStatusSet* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msg_init, 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)); +UPB_INLINE void envoy_config_core_v3_HealthStatusSet_clear_statuses(envoy_config_core_v3_HealthStatusSet* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* envoy_config_core_v3_HealthStatusSet_statuses(const envoy_config_core_v3_HealthStatusSet* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE int32_t const* envoy_config_core_v3_HealthStatusSet_statuses(const envoy_config_core_v3_HealthStatusSet* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_core_v3_HealthStatusSet_has_statuses(const envoy_config_core_v3_HealthStatusSet* msg) { + size_t size; + envoy_config_core_v3_HealthStatusSet_statuses(msg, &size); + return size != 0; } -UPB_INLINE int32_t* envoy_config_core_v3_HealthStatusSet_mutable_statuses(envoy_config_core_v3_HealthStatusSet* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE int32_t* envoy_config_core_v3_HealthStatusSet_mutable_statuses(envoy_config_core_v3_HealthStatusSet* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* envoy_config_core_v3_HealthStatusSet_resize_statuses(envoy_config_core_v3_HealthStatusSet* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, 2, arena); +UPB_INLINE int32_t* envoy_config_core_v3_HealthStatusSet_resize_statuses(envoy_config_core_v3_HealthStatusSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_HealthStatusSet_add_statuses(envoy_config_core_v3_HealthStatusSet* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), 2, &val, arena); + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.core.v3.HealthCheck */ UPB_INLINE envoy_config_core_v3_HealthCheck* envoy_config_core_v3_HealthCheck_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_msginit, arena); + return (envoy_config_core_v3_HealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck* envoy_config_core_v3_HealthCheck_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck* ret = envoy_config_core_v3_HealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -149,7 +174,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck* envoy_config_core_v3_HealthCheck_pa int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck* ret = envoy_config_core_v3_HealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -157,13 +182,13 @@ UPB_INLINE envoy_config_core_v3_HealthCheck* envoy_config_core_v3_HealthCheck_pa } UPB_INLINE char* envoy_config_core_v3_HealthCheck_serialize(const envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -174,469 +199,592 @@ typedef enum { envoy_config_core_v3_HealthCheck_health_checker_NOT_SET = 0 } envoy_config_core_v3_HealthCheck_health_checker_oneofcases; UPB_INLINE envoy_config_core_v3_HealthCheck_health_checker_oneofcases envoy_config_core_v3_HealthCheck_health_checker_case(const envoy_config_core_v3_HealthCheck* msg) { - return (envoy_config_core_v3_HealthCheck_health_checker_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {8, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HealthCheck_health_checker_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_timeout(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_timeout(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_timeout(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_timeout(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_timeout(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_interval(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval_jitter(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval_jitter(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval_jitter(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_interval_jitter(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval_jitter(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_threshold(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_unhealthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_healthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_healthy_threshold(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_healthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_alt_port(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_threshold(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_alt_port(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_alt_port(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_alt_port(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_reuse_connection(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_alt_port(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_reuse_connection(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_reuse_connection(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 64), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HealthCheck_reuse_connection(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 64), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_http_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8; +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_reuse_connection(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 64), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_http_health_check(const envoy_config_core_v3_HealthCheck* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_http_health_check(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_http_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(88, 160), UPB_SIZE(4, 4), 8, NULL); + const envoy_config_core_v3_HealthCheck_HttpHealthCheck* default_val = NULL; + const envoy_config_core_v3_HealthCheck_HttpHealthCheck* ret; + const upb_MiniTableField field = {8, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tcp_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 9; +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_http_health_check(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_tcp_health_check(const envoy_config_core_v3_HealthCheck* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_tcp_health_check(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_tcp_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(88, 160), UPB_SIZE(4, 4), 9, NULL); + const envoy_config_core_v3_HealthCheck_TcpHealthCheck* default_val = NULL; + const envoy_config_core_v3_HealthCheck_TcpHealthCheck* ret; + const upb_MiniTableField field = {9, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_grpc_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11; +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tcp_health_check(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_grpc_health_check(const envoy_config_core_v3_HealthCheck* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_grpc_health_check(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_grpc_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(88, 160), UPB_SIZE(4, 4), 11, NULL); + const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* default_val = NULL; + const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* ret; + const upb_MiniTableField field = {11, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_interval(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_grpc_health_check(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_no_traffic_interval(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_no_traffic_interval(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(32, 72), 8, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_no_traffic_interval(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {12, UPB_SIZE(32, 72), 8, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_custom_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13; +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_interval(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(32, 72), 8, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_custom_health_check(const envoy_config_core_v3_HealthCheck* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_custom_health_check(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_custom_health_check(const envoy_config_core_v3_HealthCheck* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(88, 160), UPB_SIZE(4, 4), 13, NULL); + const envoy_config_core_v3_HealthCheck_CustomHealthCheck* default_val = NULL; + const envoy_config_core_v3_HealthCheck_CustomHealthCheck* ret; + const upb_MiniTableField field = {13, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_interval(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_custom_health_check(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_interval(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_interval(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(40, 80), 9, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_unhealthy_interval(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {14, UPB_SIZE(40, 80), 9, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_interval(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(40, 80), 9, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(44, 88), 10, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {15, UPB_SIZE(44, 88), 10, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(44, 88), 10, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_healthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_healthy_edge_interval(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(48, 96), 11, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_healthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {16, UPB_SIZE(48, 96), 11, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_event_log_path(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(48, 96), 11, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_event_log_path(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(84, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_event_log_path(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {17, UPB_SIZE(84, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval_jitter_percent(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval_jitter_percent(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(52, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_core_v3_HealthCheck_interval_jitter_percent(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {18, UPB_SIZE(52, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_always_log_health_check_failures(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_always_log_health_check_failures(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(56, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_HealthCheck_always_log_health_check_failures(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {19, UPB_SIZE(56, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_initial_jitter(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 12); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_initial_jitter(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_initial_jitter(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(60, 120), 12, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_initial_jitter(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {20, UPB_SIZE(60, 120), 12, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tls_options(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_initial_jitter(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(60, 120), 12, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_tls_options(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_tls_options(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(64, 128), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_tls_options(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const envoy_config_core_v3_HealthCheck_TlsOptions*); + const envoy_config_core_v3_HealthCheck_TlsOptions* default_val = NULL; + const envoy_config_core_v3_HealthCheck_TlsOptions* ret; + const upb_MiniTableField field = {21, UPB_SIZE(64, 128), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_event_service(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tls_options(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(64, 128), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_event_service(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_event_service(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(68, 136), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_HealthCheck_event_service(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const struct envoy_config_core_v3_EventServiceConfig*); + const struct envoy_config_core_v3_EventServiceConfig* default_val = NULL; + const struct envoy_config_core_v3_EventServiceConfig* ret; + const upb_MiniTableField field = {22, UPB_SIZE(68, 136), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 15); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_event_service(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(68, 136), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(72, 144), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 144), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {23, UPB_SIZE(72, 144), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) { - return _upb_hasbit(msg, 16); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(72, 144), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_no_traffic_healthy_interval(envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(76, 152), 16, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {24, UPB_SIZE(76, 152), 16, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(76, 152), 16, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_timeout(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_timeout(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_interval(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_interval_jitter(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_interval_jitter(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_interval_jitter(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_interval_jitter(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(28, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_unhealthy_threshold(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_unhealthy_threshold(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_healthy_threshold(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_healthy_threshold(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_healthy_threshold(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_healthy_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_alt_port(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 56), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_alt_port(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_alt_port(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_alt_port(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_alt_port(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_reuse_connection(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(40, 64), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 64), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HealthCheck_mutable_reuse_connection(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HealthCheck_reuse_connection(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_reuse_connection(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_reuse_connection(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_http_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 8); + const upb_MiniTableField field = {8, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_mutable_http_health_check(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_HttpHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)envoy_config_core_v3_HealthCheck_http_health_check(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_http_health_check(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_http_health_check(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_tcp_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 9); + const upb_MiniTableField field = {9, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_mutable_tcp_health_check(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_TcpHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)envoy_config_core_v3_HealthCheck_tcp_health_check(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_tcp_health_check(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_tcp_health_check(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_grpc_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 11); + const upb_MiniTableField field = {11, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_mutable_grpc_health_check(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)envoy_config_core_v3_HealthCheck_grpc_health_check(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_grpc_health_check(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_grpc_health_check(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_no_traffic_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {12, UPB_SIZE(32, 72), 8, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_no_traffic_interval(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_no_traffic_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_no_traffic_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_no_traffic_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_custom_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 13); + const upb_MiniTableField field = {13, UPB_SIZE(80, 160), UPB_SIZE(-37, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_mutable_custom_health_check(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)envoy_config_core_v3_HealthCheck_custom_health_check(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_custom_health_check(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_custom_health_check(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(40, 80), 9, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_unhealthy_interval(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_unhealthy_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_unhealthy_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_unhealthy_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(52, 88), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(44, 88), 10, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_unhealthy_edge_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(48, 96), 11, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_healthy_edge_interval(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_healthy_edge_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_log_path(envoy_config_core_v3_HealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = value; + const upb_MiniTableField field = {17, UPB_SIZE(84, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter_percent(envoy_config_core_v3_HealthCheck *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value; + const upb_MiniTableField field = {18, UPB_SIZE(52, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_always_log_health_check_failures(envoy_config_core_v3_HealthCheck *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; + const upb_MiniTableField field = {19, UPB_SIZE(56, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_initial_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(68, 120), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {20, UPB_SIZE(60, 120), 12, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_initial_jitter(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_initial_jitter(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_initial_jitter(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_initial_jitter(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_tls_options(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_TlsOptions* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(72, 128), envoy_config_core_v3_HealthCheck_TlsOptions*) = value; + const upb_MiniTableField field = {21, UPB_SIZE(64, 128), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_mutable_tls_options(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_TlsOptions* sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)envoy_config_core_v3_HealthCheck_tls_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_tls_options(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_tls_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_service(envoy_config_core_v3_HealthCheck *msg, struct envoy_config_core_v3_EventServiceConfig* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(76, 136), struct envoy_config_core_v3_EventServiceConfig*) = value; + const upb_MiniTableField field = {22, UPB_SIZE(68, 136), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_HealthCheck_mutable_event_service(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_EventServiceConfig* sub = (struct envoy_config_core_v3_EventServiceConfig*)envoy_config_core_v3_HealthCheck_event_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_event_service(msg, sub); + sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_event_service(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(80, 144), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {23, UPB_SIZE(72, 144), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_mutable_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_HealthCheck_transport_socket_match_criteria(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_set_no_traffic_healthy_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(84, 152), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {24, UPB_SIZE(76, 152), 16, 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_no_traffic_healthy_interval(envoy_config_core_v3_HealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_no_traffic_healthy_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_set_no_traffic_healthy_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_set_no_traffic_healthy_interval(msg, sub); } return sub; } @@ -644,12 +792,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut /* envoy.config.core.v3.HealthCheck.Payload */ UPB_INLINE envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_Payload_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena); + return (envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_Payload_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_Payload* ret = envoy_config_core_v3_HealthCheck_Payload_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -659,7 +807,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_Health int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_Payload* ret = envoy_config_core_v3_HealthCheck_Payload_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -667,13 +815,13 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_Health } UPB_INLINE char* envoy_config_core_v3_HealthCheck_Payload_serialize(const envoy_config_core_v3_HealthCheck_Payload* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -682,43 +830,58 @@ typedef enum { envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET = 0 } envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases; UPB_INLINE envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases envoy_config_core_v3_HealthCheck_Payload_payload_case(const envoy_config_core_v3_HealthCheck_Payload* msg) { - return (envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_text(const envoy_config_core_v3_HealthCheck_Payload* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_clear_text(const envoy_config_core_v3_HealthCheck_Payload* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_clear_text(envoy_config_core_v3_HealthCheck_Payload* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_Payload_text(const envoy_config_core_v3_HealthCheck_Payload* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_binary(const envoy_config_core_v3_HealthCheck_Payload* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_text(const envoy_config_core_v3_HealthCheck_Payload* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_clear_binary(const envoy_config_core_v3_HealthCheck_Payload* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_clear_binary(envoy_config_core_v3_HealthCheck_Payload* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_Payload_binary(const envoy_config_core_v3_HealthCheck_Payload* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_binary(const envoy_config_core_v3_HealthCheck_Payload* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_text(envoy_config_core_v3_HealthCheck_Payload *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_binary(envoy_config_core_v3_HealthCheck_Payload *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.HealthCheck.HttpHealthCheck */ UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena); + return (envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_HttpHealthCheck* ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -728,7 +891,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_HttpHealthCheck* ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -736,214 +899,382 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v } UPB_INLINE char* envoy_config_core_v3_HealthCheck_HttpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msg_init, 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(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_host(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(44, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_HttpHealthCheck_host(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(44, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_path(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_path(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(52, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_HttpHealthCheck_path(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(52, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_core_v3_HealthCheck_Payload*); + const envoy_config_core_v3_HealthCheck_Payload* default_val = NULL; + const envoy_config_core_v3_HealthCheck_Payload* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_HealthCheck_Payload* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); + size_t size; + envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (const envoy_config_core_v3_HealthCheck_Payload* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); + size_t size; + envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 64)); +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 72)); +UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + size_t size; + envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_v3_Int64Range* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); + size_t size; + envoy_config_core_v3_HealthCheck_HttpHealthCheck_expected_statuses(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 80)); -} -UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (const struct envoy_type_v3_Int64Range* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_codec_client_type(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_codec_client_type(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(24, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_HealthCheck_HttpHealthCheck_codec_client_type(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {10, UPB_SIZE(24, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(28, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct envoy_type_matcher_v3_StringMatcher*); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {11, UPB_SIZE(28, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(28, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(32, 96), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {12, UPB_SIZE(32, 96), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_v3_Int64Range* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); + size_t size; + envoy_config_core_v3_HealthCheck_HttpHealthCheck_retriable_statuses(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 96)); -} -UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (const struct envoy_type_v3_Int64Range* const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_method(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_method(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_HealthCheck_HttpHealthCheck_method(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {13, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_response_buffer_size(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_response_buffer_size(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_response_buffer_size(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(40, 104), 3, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_core_v3_HealthCheck_HttpHealthCheck_response_buffer_size(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {14, UPB_SIZE(40, 104), 3, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_response_buffer_size(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(40, 104), 3, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_host(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(44, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_path(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(52, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_core_v3_HealthCheck_Payload*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_send(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(msg, sub); } return sub; } -UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_Payload**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HealthCheck_Payload**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(12, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(16, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(16, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {8, UPB_SIZE(16, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (struct envoy_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(20, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_v3_Int64Range**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_v3_Int64Range**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(20, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_v3_Int64Range**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { - struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(20, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_codec_client_type(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {10, UPB_SIZE(24, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct envoy_type_matcher_v3_StringMatcher*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(28, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(msg, sub); } return sub; } -UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) { - return (struct envoy_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {12, UPB_SIZE(32, 96), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_v3_Int64Range**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_v3_Int64Range**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {12, UPB_SIZE(32, 96), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_v3_Int64Range**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { - struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {12, UPB_SIZE(32, 96), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_method(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {13, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_response_buffer_size(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(40, 104), 3, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_response_buffer_size(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_response_buffer_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_response_buffer_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_response_buffer_size(msg, sub); } return sub; } @@ -951,12 +1282,12 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_core_v3_HealthCheck_ /* envoy.config.core.v3.HealthCheck.TcpHealthCheck */ UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena); + return (envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_TcpHealthCheck* ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -966,7 +1297,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3 int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_TcpHealthCheck* ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -974,69 +1305,99 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3 } UPB_INLINE char* envoy_config_core_v3_HealthCheck_TcpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_clear_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_clear_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_HealthCheck_Payload*); + const envoy_config_core_v3_HealthCheck_Payload* default_val = NULL; + const envoy_config_core_v3_HealthCheck_Payload* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_clear_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* const* envoy_config_core_v3_HealthCheck_TcpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_HealthCheck_Payload* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_clear_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* const* envoy_config_core_v3_HealthCheck_TcpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, size_t* len) { - return (const envoy_config_core_v3_HealthCheck_Payload* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_config_core_v3_HealthCheck_TcpHealthCheck_receive(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_HealthCheck_Payload*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, upb_Arena* arena) { struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_TcpHealthCheck_send(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(msg, sub); + sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(msg, sub); } return sub; } -UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, size_t* len) { - return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_resize_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_Payload**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_resize_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HealthCheck_Payload**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_add_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.HealthCheck.RedisHealthCheck */ UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck* envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_RedisHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena); + return (envoy_config_core_v3_HealthCheck_RedisHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck* envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_RedisHealthCheck* ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1046,7 +1407,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck* envoy_config_core_ int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_RedisHealthCheck* ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1054,35 +1415,41 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck* envoy_config_core_ } UPB_INLINE char* envoy_config_core_v3_HealthCheck_RedisHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_RedisHealthCheck* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_HealthCheck_RedisHealthCheck_clear_key(envoy_config_core_v3_HealthCheck_RedisHealthCheck* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_RedisHealthCheck_key(const envoy_config_core_v3_HealthCheck_RedisHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_HealthCheck_RedisHealthCheck_set_key(envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.HealthCheck.GrpcHealthCheck */ UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena); + return (envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_GrpcHealthCheck* ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1092,7 +1459,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_GrpcHealthCheck* ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1100,65 +1467,102 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v } UPB_INLINE char* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_service_name(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_GrpcHealthCheck_service_name(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_authority(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_authority(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_GrpcHealthCheck_authority(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_HealthCheck_GrpcHealthCheck_has_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + envoy_config_core_v3_HealthCheck_GrpcHealthCheck_initial_metadata(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_service_name(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_authority(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_GrpcHealthCheck_mutable_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_GrpcHealthCheck_mutable_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_GrpcHealthCheck_resize_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_GrpcHealthCheck_resize_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_add_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.core.v3.HealthCheck.CustomHealthCheck */ UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena); + return (envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_CustomHealthCheck* ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1168,7 +1572,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_CustomHealthCheck* ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1176,13 +1580,13 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core } UPB_INLINE char* envoy_config_core_v3_HealthCheck_CustomHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1190,36 +1594,49 @@ typedef enum { envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_NOT_SET = 0 } envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases; UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_case(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { - return (envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_clear_name(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_clear_name(envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_CustomHealthCheck_name(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HealthCheck_CustomHealthCheck_has_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_clear_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_clear_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHealthCheck_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_CustomHealthCheck_has_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_name(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHealthCheck_mutable_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_HealthCheck_CustomHealthCheck_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(msg, sub); } return sub; } @@ -1227,12 +1644,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHe /* envoy.config.core.v3.HealthCheck.TlsOptions */ UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_TlsOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena); + return (envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_TlsOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_TlsOptions* ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1242,7 +1659,7 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_Hea int options, upb_Arena* arena) { envoy_config_core_v3_HealthCheck_TlsOptions* ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1250,38 +1667,67 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_Hea } UPB_INLINE char* envoy_config_core_v3_HealthCheck_TlsOptions_serialize(const envoy_config_core_v3_HealthCheck_TlsOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msg_init, 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)); +UPB_INLINE void envoy_config_core_v3_HealthCheck_TlsOptions_clear_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_core_v3_HealthCheck_TlsOptions_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_HealthCheck_TlsOptions_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_core_v3_HealthCheck_TlsOptions_has_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions* msg) { + size_t size; + envoy_config_core_v3_HealthCheck_TlsOptions_alpn_protocols(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_TlsOptions_mutable_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_TlsOptions_mutable_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_TlsOptions_resize_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_TlsOptions_resize_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_HealthCheck_TlsOptions_add_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File envoy_config_core_v3_health_check_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_health_check_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_ */ 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 a94db60061a..59535d483e0 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 @@ -7,36 +7,45 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/http_uri.upb.h" #include "google/protobuf/duration.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_HttpUri_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HttpUri_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HttpUri__fields[3] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HttpUri__fields[3] = { + {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HttpUri_msginit = { +const upb_MiniTable envoy_config_core_v3_HttpUri_msg_init = { &envoy_config_core_v3_HttpUri_submsgs[0], &envoy_config_core_v3_HttpUri__fields[0], - UPB_SIZE(32, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(32, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x0008000402000012, &upb_pos_1bt}, + {0x002800000100001a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_core_v3_HttpUri_msginit, + &envoy_config_core_v3_HttpUri_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_http_uri_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_http_uri_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -45,5 +54,5 @@ const upb_MiniTable_File envoy_config_core_v3_http_uri_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 6443f43e663..29c019d8e0a 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_HttpUri; typedef struct envoy_config_core_v3_HttpUri envoy_config_core_v3_HttpUri; -extern const upb_MiniTable envoy_config_core_v3_HttpUri_msginit; +extern const upb_MiniTable envoy_config_core_v3_HttpUri_msg_init; struct google_protobuf_Duration; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* envoy.config.core.v3.HttpUri */ UPB_INLINE envoy_config_core_v3_HttpUri* envoy_config_core_v3_HttpUri_new(upb_Arena* arena) { - return (envoy_config_core_v3_HttpUri*)_upb_Message_New(&envoy_config_core_v3_HttpUri_msginit, arena); + return (envoy_config_core_v3_HttpUri*)_upb_Message_New(&envoy_config_core_v3_HttpUri_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HttpUri* envoy_config_core_v3_HttpUri_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HttpUri* ret = envoy_config_core_v3_HttpUri_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_core_v3_HttpUri* envoy_config_core_v3_HttpUri_parse_ex(c int options, upb_Arena* arena) { envoy_config_core_v3_HttpUri* ret = envoy_config_core_v3_HttpUri_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,13 +58,13 @@ UPB_INLINE envoy_config_core_v3_HttpUri* envoy_config_core_v3_HttpUri_parse_ex(c } UPB_INLINE char* envoy_config_core_v3_HttpUri_serialize(const envoy_config_core_v3_HttpUri* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HttpUri_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HttpUri_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HttpUri_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HttpUri_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -68,59 +72,78 @@ typedef enum { envoy_config_core_v3_HttpUri_http_upstream_type_NOT_SET = 0 } envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases; UPB_INLINE envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases envoy_config_core_v3_HttpUri_http_upstream_type_case(const envoy_config_core_v3_HttpUri* msg) { - return (envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HttpUri_clear_uri(const envoy_config_core_v3_HttpUri* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_HttpUri_clear_uri(envoy_config_core_v3_HttpUri* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HttpUri_uri(const envoy_config_core_v3_HttpUri* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HttpUri_has_cluster(const envoy_config_core_v3_HttpUri* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; -} -UPB_INLINE void envoy_config_core_v3_HttpUri_clear_cluster(const envoy_config_core_v3_HttpUri* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_HttpUri_http_upstream_type_NOT_SET); +UPB_INLINE void envoy_config_core_v3_HttpUri_clear_cluster(envoy_config_core_v3_HttpUri* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_HttpUri_cluster(const envoy_config_core_v3_HttpUri* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HttpUri_has_timeout(const envoy_config_core_v3_HttpUri* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_core_v3_HttpUri_has_cluster(const envoy_config_core_v3_HttpUri* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HttpUri_clear_timeout(const envoy_config_core_v3_HttpUri* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HttpUri_clear_timeout(envoy_config_core_v3_HttpUri* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_timeout(const envoy_config_core_v3_HttpUri* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HttpUri_has_timeout(const envoy_config_core_v3_HttpUri* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_HttpUri_set_uri(envoy_config_core_v3_HttpUri *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HttpUri_set_cluster(envoy_config_core_v3_HttpUri *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HttpUri_set_timeout(envoy_config_core_v3_HttpUri *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_mutable_timeout(envoy_config_core_v3_HttpUri* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpUri_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HttpUri_set_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HttpUri_set_timeout(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_http_uri_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_http_uri_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_ */ 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 e4ae856c0af..55a2bb2fbbe 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/protocol.upb.h" #include "envoy/config/core/v3/extension.upb.h" #include "envoy/type/v3/percent.upb.h" @@ -19,301 +21,438 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_core_v3_QuicKeepAliveSettings_submsgs[2] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_QuicKeepAliveSettings_submsgs[2] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_QuicKeepAliveSettings__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_QuicKeepAliveSettings__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_QuicKeepAliveSettings_msginit = { +const upb_MiniTable envoy_config_core_v3_QuicKeepAliveSettings_msg_init = { &envoy_config_core_v3_QuicKeepAliveSettings_submsgs[0], &envoy_config_core_v3_QuicKeepAliveSettings__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_QuicProtocolOptions_submsgs[5] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_QuicKeepAliveSettings_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_QuicProtocolOptions_submsgs[5] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_QuicKeepAliveSettings_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_QuicProtocolOptions__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_QuicProtocolOptions__fields[5] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msg_init = { &envoy_config_core_v3_QuicProtocolOptions_submsgs[0], &envoy_config_core_v3_QuicProtocolOptions__fields[0], - UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800000504002a, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[3] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init = { NULL, &envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x000800003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[3] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[3] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[5] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init = { &envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[0], &envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f00002a, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry__fields[2] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit = { +const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init = { NULL, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_HttpProtocolOptions_submsgs[5] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_HttpProtocolOptions_submsgs[5] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_HttpProtocolOptions__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_HttpProtocolOptions__fields[6] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msg_init = { &envoy_config_core_v3_HttpProtocolOptions_submsgs[0], &envoy_config_core_v3_HttpProtocolOptions__fields[0], - UPB_SIZE(32, 48), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 48), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x0028000005040032, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Http1ProtocolOptions_submsgs[4] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Http1ProtocolOptions_submsgs[4] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Http1ProtocolOptions__fields[9] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(28, 48), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Http1ProtocolOptions__fields[9] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(17, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msg_init = { &envoy_config_core_v3_Http1ProtocolOptions_submsgs[0], &envoy_config_core_v3_Http1ProtocolOptions__fields[0], - UPB_SIZE(32, 56), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(40, 56), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x001000003f00001a, &upb_pss_1bt}, + {0x0020000002010022, &upb_psm_1bt_max64b}, + {0x000200003f000028, &upb_psb1_1bt}, + {0x000300003f000030, &upb_psb1_1bt}, + {0x002800000302003a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000040, &upb_psb1_1bt}, + {0x003000000403004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit = { +const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init = { &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[0], &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000008010042, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = { +const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_core_v3_KeepaliveSettings_submsgs[4] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_KeepaliveSettings_submsgs[4] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_KeepaliveSettings__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_KeepaliveSettings__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_KeepaliveSettings_msginit = { +const upb_MiniTable envoy_config_core_v3_KeepaliveSettings_msg_init = { &envoy_config_core_v3_KeepaliveSettings_submsgs[0], &envoy_config_core_v3_KeepaliveSettings__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Http2ProtocolOptions_submsgs[12] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_KeepaliveSettings_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Http2ProtocolOptions_submsgs[12] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_KeepaliveSettings_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Http2ProtocolOptions__fields[15] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(24, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(28, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(32, 56), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(36, 64), UPB_SIZE(8, 8), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(40, 72), UPB_SIZE(9, 9), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 9, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(48, 88), UPB_SIZE(10, 10), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(52, 96), UPB_SIZE(11, 11), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Http2ProtocolOptions__fields[15] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(21, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(40, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(44, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(48, 80), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(52, 88), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(56, 96), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msg_init = { &envoy_config_core_v3_Http2ProtocolOptions_submsgs[0], &envoy_config_core_v3_Http2ProtocolOptions__fields[0], - UPB_SIZE(56, 104), 15, kUpb_ExtMode_NonExtendable, 15, 255, 0, + UPB_SIZE(64, 104), 15, kUpb_ExtMode_NonExtendable, 15, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x000200003f000028, &upb_psb1_1bt}, + {0x000300003f000030, &upb_psb1_1bt}, + {0x002800000504003a, &upb_psm_1bt_maxmaxb}, + {0x0030000006050042, &upb_psm_1bt_maxmaxb}, + {0x003800000706004a, &upb_psm_1bt_maxmaxb}, + {0x0040000008070052, &upb_psm_1bt_maxmaxb}, + {0x004800000908005a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000060, &upb_psb1_1bt}, + {0x005000003f09006a, &upb_prm_1bt_max64b}, + {0x005800000a0a0072, &upb_psm_1bt_maxmaxb}, + {0x006000000b0b007a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[2] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[2] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit = { +const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init = { &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[0], &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = { - {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = { + {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_GrpcProtocolOptions__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_GrpcProtocolOptions__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_GrpcProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_GrpcProtocolOptions_msg_init = { &envoy_config_core_v3_GrpcProtocolOptions_submsgs[0], &envoy_config_core_v3_GrpcProtocolOptions__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_Http3ProtocolOptions_submsgs[2] = { - {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_Http3ProtocolOptions_submsgs[2] = { + {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_Http3ProtocolOptions__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_Http3ProtocolOptions__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msg_init = { &envoy_config_core_v3_Http3ProtocolOptions_submsgs[0], &envoy_config_core_v3_Http3ProtocolOptions__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000100003f000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_core_v3_SchemeHeaderTransformation__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_SchemeHeaderTransformation__fields[1] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msginit = { +const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msg_init = { NULL, &envoy_config_core_v3_SchemeHeaderTransformation__fields[0], - UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + }) }; static const upb_MiniTable *messages_layout[16] = { - &envoy_config_core_v3_TcpProtocolOptions_msginit, - &envoy_config_core_v3_QuicKeepAliveSettings_msginit, - &envoy_config_core_v3_QuicProtocolOptions_msginit, - &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, - &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, - &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, - &envoy_config_core_v3_HttpProtocolOptions_msginit, - &envoy_config_core_v3_Http1ProtocolOptions_msginit, - &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, - &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, - &envoy_config_core_v3_KeepaliveSettings_msginit, - &envoy_config_core_v3_Http2ProtocolOptions_msginit, - &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, - &envoy_config_core_v3_GrpcProtocolOptions_msginit, - &envoy_config_core_v3_Http3ProtocolOptions_msginit, - &envoy_config_core_v3_SchemeHeaderTransformation_msginit, + &envoy_config_core_v3_TcpProtocolOptions_msg_init, + &envoy_config_core_v3_QuicKeepAliveSettings_msg_init, + &envoy_config_core_v3_QuicProtocolOptions_msg_init, + &envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, + &envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init, + &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, + &envoy_config_core_v3_HttpProtocolOptions_msg_init, + &envoy_config_core_v3_Http1ProtocolOptions_msg_init, + &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, + &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, + &envoy_config_core_v3_KeepaliveSettings_msg_init, + &envoy_config_core_v3_Http2ProtocolOptions_msg_init, + &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, + &envoy_config_core_v3_GrpcProtocolOptions_msg_init, + &envoy_config_core_v3_Http3ProtocolOptions_msg_init, + &envoy_config_core_v3_SchemeHeaderTransformation_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_protocol_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_protocol_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -322,5 +461,5 @@ const upb_MiniTable_File envoy_config_core_v3_protocol_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d7e59f8fbed..548ee6b731b 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 @@ -9,33 +9,22 @@ #ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_TcpProtocolOptions; -struct envoy_config_core_v3_QuicKeepAliveSettings; -struct envoy_config_core_v3_QuicProtocolOptions; -struct envoy_config_core_v3_UpstreamHttpProtocolOptions; -struct envoy_config_core_v3_AlternateProtocolsCacheOptions; -struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry; -struct envoy_config_core_v3_HttpProtocolOptions; -struct envoy_config_core_v3_Http1ProtocolOptions; -struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat; -struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords; -struct envoy_config_core_v3_KeepaliveSettings; -struct envoy_config_core_v3_Http2ProtocolOptions; -struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter; -struct envoy_config_core_v3_GrpcProtocolOptions; -struct envoy_config_core_v3_Http3ProtocolOptions; -struct envoy_config_core_v3_SchemeHeaderTransformation; typedef struct envoy_config_core_v3_TcpProtocolOptions envoy_config_core_v3_TcpProtocolOptions; typedef struct envoy_config_core_v3_QuicKeepAliveSettings envoy_config_core_v3_QuicKeepAliveSettings; typedef struct envoy_config_core_v3_QuicProtocolOptions envoy_config_core_v3_QuicProtocolOptions; @@ -52,32 +41,32 @@ typedef struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter envoy typedef struct envoy_config_core_v3_GrpcProtocolOptions envoy_config_core_v3_GrpcProtocolOptions; typedef struct envoy_config_core_v3_Http3ProtocolOptions envoy_config_core_v3_Http3ProtocolOptions; typedef struct envoy_config_core_v3_SchemeHeaderTransformation envoy_config_core_v3_SchemeHeaderTransformation; -extern const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_QuicKeepAliveSettings_msginit; -extern const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit; -extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit; -extern const upb_MiniTable envoy_config_core_v3_KeepaliveSettings_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msginit; +extern const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_QuicKeepAliveSettings_msg_init; +extern const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init; +extern const upb_MiniTable envoy_config_core_v3_KeepaliveSettings_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msg_init; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_type_v3_Percent; struct google_protobuf_BoolValue; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_config_core_v3_HttpProtocolOptions_ALLOW = 0, @@ -90,12 +79,12 @@ typedef enum { /* envoy.config.core.v3.TcpProtocolOptions */ UPB_INLINE envoy_config_core_v3_TcpProtocolOptions* envoy_config_core_v3_TcpProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_TcpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_TcpProtocolOptions_msginit, arena); + return (envoy_config_core_v3_TcpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_TcpProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_TcpProtocolOptions* envoy_config_core_v3_TcpProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_TcpProtocolOptions* ret = envoy_config_core_v3_TcpProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -105,7 +94,7 @@ UPB_INLINE envoy_config_core_v3_TcpProtocolOptions* envoy_config_core_v3_TcpProt int options, upb_Arena* arena) { envoy_config_core_v3_TcpProtocolOptions* ret = envoy_config_core_v3_TcpProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -113,13 +102,13 @@ UPB_INLINE envoy_config_core_v3_TcpProtocolOptions* envoy_config_core_v3_TcpProt } UPB_INLINE char* envoy_config_core_v3_TcpProtocolOptions_serialize(const envoy_config_core_v3_TcpProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msg_init, options, arena, &ptr, len); return ptr; } @@ -127,12 +116,12 @@ UPB_INLINE char* envoy_config_core_v3_TcpProtocolOptions_serialize_ex(const envo /* envoy.config.core.v3.QuicKeepAliveSettings */ UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicKeepAliveSettings_new(upb_Arena* arena) { - return (envoy_config_core_v3_QuicKeepAliveSettings*)_upb_Message_New(&envoy_config_core_v3_QuicKeepAliveSettings_msginit, arena); + return (envoy_config_core_v3_QuicKeepAliveSettings*)_upb_Message_New(&envoy_config_core_v3_QuicKeepAliveSettings_msg_init, arena); } UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicKeepAliveSettings_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_QuicKeepAliveSettings* ret = envoy_config_core_v3_QuicKeepAliveSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicKeepAliveSettings_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -142,7 +131,7 @@ UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_Quic int options, upb_Arena* arena) { envoy_config_core_v3_QuicKeepAliveSettings* ret = envoy_config_core_v3_QuicKeepAliveSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicKeepAliveSettings_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -150,57 +139,67 @@ UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_Quic } UPB_INLINE char* envoy_config_core_v3_QuicKeepAliveSettings_serialize(const envoy_config_core_v3_QuicKeepAliveSettings* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_clear_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_clear_max_interval(envoy_config_core_v3_QuicKeepAliveSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_QuicKeepAliveSettings_has_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_QuicKeepAliveSettings_has_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_clear_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_clear_initial_interval(envoy_config_core_v3_QuicKeepAliveSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_QuicKeepAliveSettings_has_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_set_max_interval(envoy_config_core_v3_QuicKeepAliveSettings *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_mutable_max_interval(envoy_config_core_v3_QuicKeepAliveSettings* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_QuicKeepAliveSettings_max_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicKeepAliveSettings_set_max_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_QuicKeepAliveSettings_set_max_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_set_initial_interval(envoy_config_core_v3_QuicKeepAliveSettings *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_mutable_initial_interval(envoy_config_core_v3_QuicKeepAliveSettings* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_QuicKeepAliveSettings_initial_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicKeepAliveSettings_set_initial_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_QuicKeepAliveSettings_set_initial_interval(msg, sub); } return sub; } @@ -208,12 +207,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSe /* envoy.config.core.v3.QuicProtocolOptions */ UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena); + return (envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_QuicProtocolOptions* ret = envoy_config_core_v3_QuicProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -223,7 +222,7 @@ UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicPr int options, upb_Arena* arena) { envoy_config_core_v3_QuicProtocolOptions* ret = envoy_config_core_v3_QuicProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -231,123 +230,148 @@ UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicPr } UPB_INLINE char* envoy_config_core_v3_QuicProtocolOptions_serialize(const envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_num_timeouts_to_trigger_port_migration(envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_connection_keepalive(envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicProtocolOptions_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_core_v3_QuicKeepAliveSettings*); + const envoy_config_core_v3_QuicKeepAliveSettings* default_val = NULL; + const envoy_config_core_v3_QuicKeepAliveSettings* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_max_concurrent_streams(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_initial_stream_window_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_initial_connection_window_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_num_timeouts_to_trigger_port_migration(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_num_timeouts_to_trigger_port_migration(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_num_timeouts_to_trigger_port_migration(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicProtocolOptions_set_num_timeouts_to_trigger_port_migration(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_QuicProtocolOptions_set_num_timeouts_to_trigger_port_migration(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_connection_keepalive(envoy_config_core_v3_QuicProtocolOptions *msg, envoy_config_core_v3_QuicKeepAliveSettings* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_core_v3_QuicKeepAliveSettings*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicProtocolOptions_mutable_connection_keepalive(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_QuicKeepAliveSettings* sub = (struct envoy_config_core_v3_QuicKeepAliveSettings*)envoy_config_core_v3_QuicProtocolOptions_connection_keepalive(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_QuicKeepAliveSettings*)_upb_Message_New(&envoy_config_core_v3_QuicKeepAliveSettings_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_QuicProtocolOptions_set_connection_keepalive(msg, sub); + sub = (struct envoy_config_core_v3_QuicKeepAliveSettings*)_upb_Message_New(&envoy_config_core_v3_QuicKeepAliveSettings_msg_init, arena); + if (sub) envoy_config_core_v3_QuicProtocolOptions_set_connection_keepalive(msg, sub); } return sub; } @@ -355,12 +379,12 @@ UPB_INLINE struct envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_ /* envoy.config.core.v3.UpstreamHttpProtocolOptions */ UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_core_v3_UpstreamHttpProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena); + return (envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_core_v3_UpstreamHttpProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_UpstreamHttpProtocolOptions* ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -370,7 +394,7 @@ UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_core_v int options, upb_Arena* arena) { envoy_config_core_v3_UpstreamHttpProtocolOptions* ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -378,53 +402,71 @@ UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_core_v } UPB_INLINE char* envoy_config_core_v3_UpstreamHttpProtocolOptions_serialize(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msg_init, 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; +UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_auto_sni(envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_sni(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_auto_san_validation(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_auto_san_validation(envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_san_validation(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_override_auto_sni_header(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_override_auto_sni_header(envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_UpstreamHttpProtocolOptions_override_auto_sni_header(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_sni(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_san_validation(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_override_auto_sni_header(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.AlternateProtocolsCacheOptions */ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_core_v3_AlternateProtocolsCacheOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_AlternateProtocolsCacheOptions*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, arena); + return (envoy_config_core_v3_AlternateProtocolsCacheOptions*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_core_v3_AlternateProtocolsCacheOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_AlternateProtocolsCacheOptions* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -434,7 +476,7 @@ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_cor int options, upb_Arena* arena) { envoy_config_core_v3_AlternateProtocolsCacheOptions* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -442,115 +484,185 @@ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_cor } UPB_INLINE char* envoy_config_core_v3_AlternateProtocolsCacheOptions_serialize(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_name(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_AlternateProtocolsCacheOptions_name(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_AlternateProtocolsCacheOptions_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_AlternateProtocolsCacheOptions_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* const* envoy_config_core_v3_AlternateProtocolsCacheOptions_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_config_core_v3_AlternateProtocolsCacheOptions_prepopulated_entries(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_canonical_suffixes(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* const* envoy_config_core_v3_AlternateProtocolsCacheOptions_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* len) { - return (const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE upb_StringView const* envoy_config_core_v3_AlternateProtocolsCacheOptions_canonical_suffixes(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_canonical_suffixes(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); -} -UPB_INLINE upb_StringView const* envoy_config_core_v3_AlternateProtocolsCacheOptions_canonical_suffixes(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_canonical_suffixes(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) { + size_t size; + envoy_config_core_v3_AlternateProtocolsCacheOptions_canonical_suffixes(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_name(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_AlternateProtocolsCacheOptions_max_entries(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_core_v3_AlternateProtocolsCacheOptions_key_value_store_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(msg, sub); } return sub; } -UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry** envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* len) { - return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry** envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry** envoy_config_core_v3_AlternateProtocolsCacheOptions_resize_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry** envoy_config_core_v3_AlternateProtocolsCacheOptions_resize_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_add_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena) { - struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* sub = (struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* sub = (struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_canonical_suffixes(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE upb_StringView* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_canonical_suffixes(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_core_v3_AlternateProtocolsCacheOptions_resize_canonical_suffixes(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_core_v3_AlternateProtocolsCacheOptions_resize_canonical_suffixes(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_add_canonical_suffixes(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.core.v3.AlternateProtocolsCacheOptions.AlternateProtocolsCacheEntry */ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_new(upb_Arena* arena) { - return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, arena); + return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, arena); } UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -560,7 +672,7 @@ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocol int options, upb_Arena* arena) { envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -568,44 +680,56 @@ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocol } UPB_INLINE char* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_serialize(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msg_init, 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); +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_clear_hostname(envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_hostname(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_clear_port(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0; +UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_clear_port(envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_port(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_set_hostname(envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_set_port(envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.HttpProtocolOptions */ UPB_INLINE envoy_config_core_v3_HttpProtocolOptions* envoy_config_core_v3_HttpProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena); + return (envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_HttpProtocolOptions* envoy_config_core_v3_HttpProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_HttpProtocolOptions* ret = envoy_config_core_v3_HttpProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -615,7 +739,7 @@ UPB_INLINE envoy_config_core_v3_HttpProtocolOptions* envoy_config_core_v3_HttpPr int options, upb_Arena* arena) { envoy_config_core_v3_HttpProtocolOptions* ret = envoy_config_core_v3_HttpProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -623,132 +747,163 @@ UPB_INLINE envoy_config_core_v3_HttpProtocolOptions* envoy_config_core_v3_HttpPr } UPB_INLINE char* envoy_config_core_v3_HttpProtocolOptions_serialize(const envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_idle_timeout(envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_headers_count(envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_headers_with_underscores_action(const envoy_config_core_v3_HttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_headers_with_underscores_action(envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_HttpProtocolOptions_headers_with_underscores_action(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_idle_timeout(envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_idle_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_mutable_max_headers_count(envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HttpProtocolOptions_max_headers_count(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_max_connection_duration(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_headers_with_underscores_action(envoy_config_core_v3_HttpProtocolOptions *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_mutable_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HttpProtocolOptions_max_requests_per_connection(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(msg, sub); } return sub; } @@ -756,12 +911,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocol /* envoy.config.core.v3.Http1ProtocolOptions */ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions* envoy_config_core_v3_Http1ProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena); + return (envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions* envoy_config_core_v3_Http1ProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Http1ProtocolOptions* ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -771,7 +926,7 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions* envoy_config_core_v3_Http1 int options, upb_Arena* arena) { envoy_config_core_v3_Http1ProtocolOptions* ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -779,146 +934,196 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions* envoy_config_core_v3_Http1 } UPB_INLINE char* envoy_config_core_v3_Http1ProtocolOptions_serialize(const envoy_config_core_v3_Http1ProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_accept_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_accept_http_10(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_accept_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_default_host_for_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_default_host_for_http_10(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_Http1ProtocolOptions_default_host_for_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_header_key_format(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*); + const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* default_val = NULL; + const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_enable_trailers(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_enable_trailers(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_enable_trailers(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_allow_chunked_length(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_allow_chunked_length(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(17, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_allow_chunked_length(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(17, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_send_fully_qualified_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_send_fully_qualified_url(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_send_fully_qualified_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_use_balsa_parser(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_use_balsa_parser(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_use_balsa_parser(envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_use_balsa_parser(const envoy_config_core_v3_Http1ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_use_balsa_parser(const envoy_config_core_v3_Http1ProtocolOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_allow_absolute_url(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_accept_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_default_host_for_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(envoy_config_core_v3_Http1ProtocolOptions *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_mutable_header_key_format(envoy_config_core_v3_Http1ProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)envoy_config_core_v3_Http1ProtocolOptions_header_key_format(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(msg, sub); + sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, arena); + if (sub) envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_enable_trailers(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_allow_chunked_length(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(17, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_override_stream_error_on_invalid_http_message(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_send_fully_qualified_url(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_use_balsa_parser(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_use_balsa_parser(envoy_config_core_v3_Http1ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_use_balsa_parser(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http1ProtocolOptions_set_use_balsa_parser(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_Http1ProtocolOptions_set_use_balsa_parser(msg, sub); } return sub; } @@ -926,12 +1131,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolO /* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat */ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(upb_Arena* arena) { - return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena); + return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -941,7 +1146,7 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_conf int options, upb_Arena* arena) { envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -949,13 +1154,13 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_conf } UPB_INLINE char* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -964,48 +1169,61 @@ typedef enum { envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET = 0 } envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases; UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_case(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_clear_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_clear_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* default_val = NULL; + const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_clear_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET); +UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_clear_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* value) { - UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_mutable_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(msg, sub); + sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, arena); + if (sub) envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_mutable_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_stateful_formatter(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(msg, sub); } return sub; } @@ -1013,12 +1231,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v /* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords */ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(upb_Arena* arena) { - return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena); + return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1028,7 +1246,7 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseW int options, upb_Arena* arena) { envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1036,13 +1254,13 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseW } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msg_init, options, arena, &ptr, len); return ptr; } @@ -1050,12 +1268,12 @@ UPB_INLINE char* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_Prope /* envoy.config.core.v3.KeepaliveSettings */ UPB_INLINE envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_KeepaliveSettings_new(upb_Arena* arena) { - return (envoy_config_core_v3_KeepaliveSettings*)_upb_Message_New(&envoy_config_core_v3_KeepaliveSettings_msginit, arena); + return (envoy_config_core_v3_KeepaliveSettings*)_upb_Message_New(&envoy_config_core_v3_KeepaliveSettings_msg_init, arena); } UPB_INLINE envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_KeepaliveSettings_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_KeepaliveSettings* ret = envoy_config_core_v3_KeepaliveSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1065,7 +1283,7 @@ UPB_INLINE envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Keepaliv int options, upb_Arena* arena) { envoy_config_core_v3_KeepaliveSettings* ret = envoy_config_core_v3_KeepaliveSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1073,101 +1291,121 @@ UPB_INLINE envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Keepaliv } UPB_INLINE char* envoy_config_core_v3_KeepaliveSettings_serialize(const envoy_config_core_v3_KeepaliveSettings* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_interval(envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_config_core_v3_KeepaliveSettings* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_timeout(const envoy_config_core_v3_KeepaliveSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_timeout(envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_timeout(const envoy_config_core_v3_KeepaliveSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval_jitter(const envoy_config_core_v3_KeepaliveSettings* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_interval_jitter(const envoy_config_core_v3_KeepaliveSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_interval_jitter(envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_interval_jitter(const envoy_config_core_v3_KeepaliveSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval_jitter(const envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_interval(envoy_config_core_v3_KeepaliveSettings* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_KeepaliveSettings_set_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_KeepaliveSettings_set_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_timeout(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_timeout(envoy_config_core_v3_KeepaliveSettings* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_KeepaliveSettings_set_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_KeepaliveSettings_set_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(envoy_config_core_v3_KeepaliveSettings *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_mutable_interval_jitter(envoy_config_core_v3_KeepaliveSettings* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_core_v3_KeepaliveSettings_interval_jitter(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_connection_idle_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(msg, sub); } return sub; } @@ -1175,12 +1413,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettin /* envoy.config.core.v3.Http2ProtocolOptions */ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2ProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena); + return (envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2ProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Http2ProtocolOptions* ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1190,7 +1428,7 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2 int options, upb_Arena* arena) { envoy_config_core_v3_Http2ProtocolOptions* ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1198,303 +1436,401 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2 } UPB_INLINE char* envoy_config_core_v3_Http2ProtocolOptions_serialize(const envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_allow_connect(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_allow_connect(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_connect(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_allow_metadata(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_allow_metadata(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(21, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_metadata(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(21, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {9, UPB_SIZE(32, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {10, UPB_SIZE(36, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {11, UPB_SIZE(40, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_stream_error_on_invalid_http_messaging(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_stream_error_on_invalid_http_messaging(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_stream_error_on_invalid_http_messaging(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {12, UPB_SIZE(44, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(48, 80), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const* envoy_config_core_v3_Http2ProtocolOptions_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(48, 80), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); + size_t size; + envoy_config_core_v3_Http2ProtocolOptions_custom_settings_parameters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 80)); -} -UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const* envoy_config_core_v3_Http2ProtocolOptions_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions* msg, size_t* len) { - return (const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); -} -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 10); -} -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(52, 88), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {14, UPB_SIZE(52, 88), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(52, 88), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(56, 96), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Http2ProtocolOptions_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const envoy_config_core_v3_KeepaliveSettings*); + const envoy_config_core_v3_KeepaliveSettings* default_val = NULL; + const envoy_config_core_v3_KeepaliveSettings* ret; + const upb_MiniTableField field = {15, UPB_SIZE(56, 96), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(56, 96), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_hpack_table_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_concurrent_streams(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_initial_stream_window_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_initial_connection_window_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_allow_connect(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_allow_metadata(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(21, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_outbound_frames(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_outbound_control_frames(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(32, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {10, UPB_SIZE(36, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(40, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_stream_error_on_invalid_http_messaging(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {12, UPB_SIZE(44, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_mutable_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions* msg, size_t* len) { - return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_mutable_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(48, 80), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_resize_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_resize_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(48, 80), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_config_core_v3_Http2ProtocolOptions_add_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { - struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* sub = (struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(48, 80), 0, 9, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* sub = (struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(52, 88), 10, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http2ProtocolOptions_override_stream_error_on_invalid_http_message(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions *msg, envoy_config_core_v3_KeepaliveSettings* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), envoy_config_core_v3_KeepaliveSettings*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(56, 96), 11, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Http2ProtocolOptions_mutable_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_KeepaliveSettings* sub = (struct envoy_config_core_v3_KeepaliveSettings*)envoy_config_core_v3_Http2ProtocolOptions_connection_keepalive(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_KeepaliveSettings*)_upb_Message_New(&envoy_config_core_v3_KeepaliveSettings_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(msg, sub); + sub = (struct envoy_config_core_v3_KeepaliveSettings*)_upb_Message_New(&envoy_config_core_v3_KeepaliveSettings_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(msg, sub); } return sub; } @@ -1502,12 +1838,12 @@ UPB_INLINE struct envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_H /* envoy.config.core.v3.Http2ProtocolOptions.SettingsParameter */ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(upb_Arena* arena) { - return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena); + return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1517,7 +1853,7 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_co int options, upb_Arena* arena) { envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1525,57 +1861,67 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_co } UPB_INLINE char* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_serialize(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_clear_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_clear_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_clear_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_clear_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_mutable_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_identifier(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_mutable_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(msg, sub); } return sub; } @@ -1583,12 +1929,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2Protoco /* envoy.config.core.v3.GrpcProtocolOptions */ UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_GrpcProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_GrpcProtocolOptions_msginit, arena); + return (envoy_config_core_v3_GrpcProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_GrpcProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_GrpcProtocolOptions* ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1598,7 +1944,7 @@ UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions* envoy_config_core_v3_GrpcPr int options, upb_Arena* arena) { envoy_config_core_v3_GrpcProtocolOptions* ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1606,35 +1952,40 @@ UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions* envoy_config_core_v3_GrpcPr } UPB_INLINE char* envoy_config_core_v3_GrpcProtocolOptions_serialize(const envoy_config_core_v3_GrpcProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_GrpcProtocolOptions_clear_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_GrpcProtocolOptions_clear_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_Http2ProtocolOptions*); + const envoy_config_core_v3_Http2ProtocolOptions* default_val = NULL; + const envoy_config_core_v3_Http2ProtocolOptions* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_GrpcProtocolOptions_has_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions *msg, envoy_config_core_v3_Http2ProtocolOptions* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_Http2ProtocolOptions*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_mutable_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_config_core_v3_GrpcProtocolOptions_http2_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msg_init, arena); + if (sub) envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(msg, sub); } return sub; } @@ -1642,12 +1993,12 @@ UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v /* envoy.config.core.v3.Http3ProtocolOptions */ UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_Http3ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http3ProtocolOptions_msginit, arena); + return (envoy_config_core_v3_Http3ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http3ProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_Http3ProtocolOptions* ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1657,7 +2008,7 @@ UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3 int options, upb_Arena* arena) { envoy_config_core_v3_Http3ProtocolOptions* ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1665,79 +2016,95 @@ UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3 } UPB_INLINE char* envoy_config_core_v3_Http3ProtocolOptions_serialize(const envoy_config_core_v3_Http3ProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_QuicProtocolOptions*); + const envoy_config_core_v3_QuicProtocolOptions* default_val = NULL; + const envoy_config_core_v3_QuicProtocolOptions* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http3ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_allow_extended_connect(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_allow_extended_connect(envoy_config_core_v3_Http3ProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_allow_extended_connect(const envoy_config_core_v3_Http3ProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions *msg, envoy_config_core_v3_QuicProtocolOptions* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_QuicProtocolOptions*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_mutable_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_QuicProtocolOptions* sub = (struct envoy_config_core_v3_QuicProtocolOptions*)envoy_config_core_v3_Http3ProtocolOptions_quic_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msg_init, arena); + if (sub) envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http3ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http3ProtocolOptions_override_stream_error_on_invalid_http_message(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_allow_extended_connect(envoy_config_core_v3_Http3ProtocolOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.SchemeHeaderTransformation */ UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3_SchemeHeaderTransformation_new(upb_Arena* arena) { - return (envoy_config_core_v3_SchemeHeaderTransformation*)_upb_Message_New(&envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena); + return (envoy_config_core_v3_SchemeHeaderTransformation*)_upb_Message_New(&envoy_config_core_v3_SchemeHeaderTransformation_msg_init, arena); } UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3_SchemeHeaderTransformation_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_SchemeHeaderTransformation* ret = envoy_config_core_v3_SchemeHeaderTransformation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1747,7 +2114,7 @@ UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3 int options, upb_Arena* arena) { envoy_config_core_v3_SchemeHeaderTransformation* ret = envoy_config_core_v3_SchemeHeaderTransformation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1755,13 +2122,13 @@ UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3 } UPB_INLINE char* envoy_config_core_v3_SchemeHeaderTransformation_serialize(const envoy_config_core_v3_SchemeHeaderTransformation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1769,28 +2136,36 @@ typedef enum { envoy_config_core_v3_SchemeHeaderTransformation_transformation_NOT_SET = 0 } envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases; UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases envoy_config_core_v3_SchemeHeaderTransformation_transformation_case(const envoy_config_core_v3_SchemeHeaderTransformation* msg) { - return (envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_SchemeHeaderTransformation_has_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_core_v3_SchemeHeaderTransformation_clear_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_SchemeHeaderTransformation_transformation_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SchemeHeaderTransformation_clear_scheme_to_overwrite(envoy_config_core_v3_SchemeHeaderTransformation* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SchemeHeaderTransformation_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_SchemeHeaderTransformation_has_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_SchemeHeaderTransformation_set_scheme_to_overwrite(envoy_config_core_v3_SchemeHeaderTransformation *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_core_v3_protocol_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_protocol_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_ */ 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 a0548e3eb6d..1f26b748b1d 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 @@ -7,45 +7,60 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/proxy_protocol.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_core_v3_ProxyProtocolPassThroughTLVs__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ProxyProtocolPassThroughTLVs__fields[2] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit = { +const upb_MiniTable envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init = { NULL, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_ppv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_ProxyProtocolConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_ProxyProtocolConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_ProxyProtocolConfig__fields[2] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_ProxyProtocolConfig__fields[2] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit = { +const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msg_init = { &envoy_config_core_v3_ProxyProtocolConfig_submsgs[0], &envoy_config_core_v3_ProxyProtocolConfig__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0008000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, - &envoy_config_core_v3_ProxyProtocolConfig_msginit, + &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, + &envoy_config_core_v3_ProxyProtocolConfig_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_proxy_protocol_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_proxy_protocol_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -54,5 +69,5 @@ const upb_MiniTable_File envoy_config_core_v3_proxy_protocol_proto_upb_file_layo 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 3962285c1c1..905ee8ffe00 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 @@ -9,23 +9,26 @@ #ifndef ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs; -struct envoy_config_core_v3_ProxyProtocolConfig; typedef struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs envoy_config_core_v3_ProxyProtocolPassThroughTLVs; typedef struct envoy_config_core_v3_ProxyProtocolConfig envoy_config_core_v3_ProxyProtocolConfig; -extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit; -extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msg_init; typedef enum { envoy_config_core_v3_ProxyProtocolConfig_V1 = 0, @@ -42,12 +45,12 @@ typedef enum { /* envoy.config.core.v3.ProxyProtocolPassThroughTLVs */ UPB_INLINE envoy_config_core_v3_ProxyProtocolPassThroughTLVs* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_new(upb_Arena* arena) { - return (envoy_config_core_v3_ProxyProtocolPassThroughTLVs*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, arena); + return (envoy_config_core_v3_ProxyProtocolPassThroughTLVs*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ProxyProtocolPassThroughTLVs* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ProxyProtocolPassThroughTLVs* ret = envoy_config_core_v3_ProxyProtocolPassThroughTLVs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -57,7 +60,7 @@ UPB_INLINE envoy_config_core_v3_ProxyProtocolPassThroughTLVs* envoy_config_core_ int options, upb_Arena* arena) { envoy_config_core_v3_ProxyProtocolPassThroughTLVs* ret = envoy_config_core_v3_ProxyProtocolPassThroughTLVs_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -65,50 +68,85 @@ UPB_INLINE envoy_config_core_v3_ProxyProtocolPassThroughTLVs* envoy_config_core_ } UPB_INLINE char* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_serialize(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_serialize_ex(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_config_core_v3_ProxyProtocolPassThroughTLVs_clear_match_type(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_core_v3_ProxyProtocolPassThroughTLVs_clear_match_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_ProxyProtocolPassThroughTLVs_match_type(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_ProxyProtocolPassThroughTLVs_clear_tlv_type(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void envoy_config_core_v3_ProxyProtocolPassThroughTLVs_clear_tlv_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE uint32_t const* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_tlv_type(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE uint32_t const* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_tlv_type(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_core_v3_ProxyProtocolPassThroughTLVs_has_tlv_type(const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg) { + size_t size; + envoy_config_core_v3_ProxyProtocolPassThroughTLVs_tlv_type(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_ProxyProtocolPassThroughTLVs_set_match_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE uint32_t* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_mutable_tlv_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE uint32_t* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_mutable_tlv_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_resize_tlv_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 2, arena); +UPB_INLINE uint32_t* envoy_config_core_v3_ProxyProtocolPassThroughTLVs_resize_tlv_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_core_v3_ProxyProtocolPassThroughTLVs_add_tlv_type(envoy_config_core_v3_ProxyProtocolPassThroughTLVs* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 2, &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.core.v3.ProxyProtocolConfig */ UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig* envoy_config_core_v3_ProxyProtocolConfig_new(upb_Arena* arena) { - return (envoy_config_core_v3_ProxyProtocolConfig*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolConfig_msginit, arena); + return (envoy_config_core_v3_ProxyProtocolConfig*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolConfig_msg_init, arena); } UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig* envoy_config_core_v3_ProxyProtocolConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_ProxyProtocolConfig* ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -118,7 +156,7 @@ UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig* envoy_config_core_v3_ProxyP int options, upb_Arena* arena) { envoy_config_core_v3_ProxyProtocolConfig* ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -126,54 +164,65 @@ UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig* envoy_config_core_v3_ProxyP } UPB_INLINE char* envoy_config_core_v3_ProxyProtocolConfig_serialize(const envoy_config_core_v3_ProxyProtocolConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msg_init, 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(4, 4), int32_t) = 0; +UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_clear_version(envoy_config_core_v3_ProxyProtocolConfig* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_ProxyProtocolConfig_version(const envoy_config_core_v3_ProxyProtocolConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_ProxyProtocolConfig_has_pass_through_tlvs(const envoy_config_core_v3_ProxyProtocolConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_clear_pass_through_tlvs(const envoy_config_core_v3_ProxyProtocolConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_clear_pass_through_tlvs(envoy_config_core_v3_ProxyProtocolConfig* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* envoy_config_core_v3_ProxyProtocolConfig_pass_through_tlvs(const envoy_config_core_v3_ProxyProtocolConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_config_core_v3_ProxyProtocolPassThroughTLVs*); + const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* default_val = NULL; + const envoy_config_core_v3_ProxyProtocolPassThroughTLVs* ret; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_ProxyProtocolConfig_has_pass_through_tlvs(const envoy_config_core_v3_ProxyProtocolConfig* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_set_version(envoy_config_core_v3_ProxyProtocolConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_set_pass_through_tlvs(envoy_config_core_v3_ProxyProtocolConfig *msg, envoy_config_core_v3_ProxyProtocolPassThroughTLVs* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_config_core_v3_ProxyProtocolPassThroughTLVs*) = value; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs* envoy_config_core_v3_ProxyProtocolConfig_mutable_pass_through_tlvs(envoy_config_core_v3_ProxyProtocolConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs* sub = (struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs*)envoy_config_core_v3_ProxyProtocolConfig_pass_through_tlvs(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_ProxyProtocolConfig_set_pass_through_tlvs(msg, sub); + sub = (struct envoy_config_core_v3_ProxyProtocolPassThroughTLVs*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolPassThroughTLVs_msg_init, arena); + if (sub) envoy_config_core_v3_ProxyProtocolConfig_set_pass_through_tlvs(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_proxy_protocol_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_proxy_protocol_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_ */ 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 4badbdae516..5ee0dfcf564 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 @@ -7,47 +7,62 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/resolver.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_core_v3_DnsResolverOptions__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_DnsResolverOptions__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_DnsResolverOptions_msginit = { +const upb_MiniTable envoy_config_core_v3_DnsResolverOptions_msg_init = { NULL, &envoy_config_core_v3_DnsResolverOptions__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_DnsResolutionConfig_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_core_v3_DnsResolverOptions_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_DnsResolutionConfig_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_core_v3_DnsResolverOptions_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_DnsResolutionConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_DnsResolutionConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit = { +const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msg_init = { &envoy_config_core_v3_DnsResolutionConfig_submsgs[0], &envoy_config_core_v3_DnsResolutionConfig__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_maxmaxb}, + {0x0010000001010012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_core_v3_DnsResolverOptions_msginit, - &envoy_config_core_v3_DnsResolutionConfig_msginit, + &envoy_config_core_v3_DnsResolverOptions_msg_init, + &envoy_config_core_v3_DnsResolutionConfig_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_resolver_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_resolver_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -56,5 +71,5 @@ const upb_MiniTable_File envoy_config_core_v3_resolver_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 be2da48bc1f..c78e8f97de8 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_DnsResolverOptions; -struct envoy_config_core_v3_DnsResolutionConfig; typedef struct envoy_config_core_v3_DnsResolverOptions envoy_config_core_v3_DnsResolverOptions; typedef struct envoy_config_core_v3_DnsResolutionConfig envoy_config_core_v3_DnsResolutionConfig; -extern const upb_MiniTable envoy_config_core_v3_DnsResolverOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_DnsResolverOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msg_init; struct envoy_config_core_v3_Address; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; /* envoy.config.core.v3.DnsResolverOptions */ UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolverOptions_new(upb_Arena* arena) { - return (envoy_config_core_v3_DnsResolverOptions*)_upb_Message_New(&envoy_config_core_v3_DnsResolverOptions_msginit, arena); + return (envoy_config_core_v3_DnsResolverOptions*)_upb_Message_New(&envoy_config_core_v3_DnsResolverOptions_msg_init, arena); } UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolverOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_DnsResolverOptions* ret = envoy_config_core_v3_DnsResolverOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsReso int options, upb_Arena* arena) { envoy_config_core_v3_DnsResolverOptions* ret = envoy_config_core_v3_DnsResolverOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,44 +60,56 @@ UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsReso } UPB_INLINE char* envoy_config_core_v3_DnsResolverOptions_serialize(const envoy_config_core_v3_DnsResolverOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msg_init, 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; +UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_clear_use_tcp_for_dns_lookups(envoy_config_core_v3_DnsResolverOptions* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_DnsResolverOptions_use_tcp_for_dns_lookups(const envoy_config_core_v3_DnsResolverOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_clear_no_default_search_domain(const envoy_config_core_v3_DnsResolverOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_clear_no_default_search_domain(envoy_config_core_v3_DnsResolverOptions* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_DnsResolverOptions_no_default_search_domain(const envoy_config_core_v3_DnsResolverOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_set_use_tcp_for_dns_lookups(envoy_config_core_v3_DnsResolverOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_set_no_default_search_domain(envoy_config_core_v3_DnsResolverOptions *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.DnsResolutionConfig */ UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsResolutionConfig_new(upb_Arena* arena) { - return (envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena); + return (envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msg_init, arena); } UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsResolutionConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_DnsResolutionConfig* ret = envoy_config_core_v3_DnsResolutionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -104,7 +119,7 @@ UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsRes int options, upb_Arena* arena) { envoy_config_core_v3_DnsResolutionConfig* ret = envoy_config_core_v3_DnsResolutionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -112,66 +127,96 @@ UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsRes } UPB_INLINE char* envoy_config_core_v3_DnsResolutionConfig_serialize(const envoy_config_core_v3_DnsResolutionConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_clear_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_DnsResolutionConfig_resolvers(const envoy_config_core_v3_DnsResolutionConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_Address* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_core_v3_DnsResolutionConfig_resolvers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_clear_resolvers(const envoy_config_core_v3_DnsResolutionConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_DnsResolutionConfig_resolvers(const envoy_config_core_v3_DnsResolutionConfig* msg, size_t* len) { - return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_config_core_v3_DnsResolutionConfig_has_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_clear_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_clear_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolutionConfig_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_core_v3_DnsResolverOptions*); + const envoy_config_core_v3_DnsResolverOptions* default_val = NULL; + const envoy_config_core_v3_DnsResolverOptions* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_DnsResolutionConfig_has_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_mutable_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, size_t* len) { - return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_mutable_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_Address**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_resize_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_Address**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_resize_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_Address**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_DnsResolutionConfig_add_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, upb_Arena* arena) { - struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig *msg, envoy_config_core_v3_DnsResolverOptions* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_core_v3_DnsResolverOptions*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolutionConfig_mutable_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_DnsResolverOptions* sub = (struct envoy_config_core_v3_DnsResolverOptions*)envoy_config_core_v3_DnsResolutionConfig_dns_resolver_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DnsResolverOptions*)_upb_Message_New(&envoy_config_core_v3_DnsResolverOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(msg, sub); + sub = (struct envoy_config_core_v3_DnsResolverOptions*)_upb_Message_New(&envoy_config_core_v3_DnsResolverOptions_msg_init, arena); + if (sub) envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_resolver_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_resolver_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c index 206f05d8b9d..e48103604bb 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c @@ -7,49 +7,66 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/socket_option.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_core_v3_SocketOption__fields[6] = { - {1, UPB_SIZE(8, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 48), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_SocketOption__fields[6] = { + {1, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 40), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(24, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(32, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(32, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_SocketOption_msginit = { +const upb_MiniTable envoy_config_core_v3_SocketOption_msg_init = { NULL, &envoy_config_core_v3_SocketOption__fields[0], - UPB_SIZE(40, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 56), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x002800003f000010, &upb_psv8_1bt}, + {0x003000003f000018, &upb_psv8_1bt}, + {0x0008000004000020, &upb_pov8_1bt}, + {0x000800000500002a, &upb_pob_1bt}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_core_v3_SocketOptionsOverride_submsgs[1] = { - {.submsg = &envoy_config_core_v3_SocketOption_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_SocketOptionsOverride_submsgs[1] = { + {.submsg = &envoy_config_core_v3_SocketOption_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_SocketOptionsOverride__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_SocketOptionsOverride__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msginit = { +const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msg_init = { &envoy_config_core_v3_SocketOptionsOverride_submsgs[0], &envoy_config_core_v3_SocketOptionsOverride__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_core_v3_SocketOption_msginit, - &envoy_config_core_v3_SocketOptionsOverride_msginit, + &envoy_config_core_v3_SocketOption_msg_init, + &envoy_config_core_v3_SocketOptionsOverride_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_socket_option_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_socket_option_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -58,5 +75,5 @@ const upb_MiniTable_File envoy_config_core_v3_socket_option_proto_upb_file_layou 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d38c47b319f..b439c4d1435 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 @@ -9,23 +9,26 @@ #ifndef ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_SocketOption; -struct envoy_config_core_v3_SocketOptionsOverride; typedef struct envoy_config_core_v3_SocketOption envoy_config_core_v3_SocketOption; typedef struct envoy_config_core_v3_SocketOptionsOverride envoy_config_core_v3_SocketOptionsOverride; -extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msginit; +extern const upb_MiniTable envoy_config_core_v3_SocketOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msg_init; typedef enum { envoy_config_core_v3_SocketOption_STATE_PREBIND = 0, @@ -38,12 +41,12 @@ typedef enum { /* envoy.config.core.v3.SocketOption */ UPB_INLINE envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOption_new(upb_Arena* arena) { - return (envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena); + return (envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msg_init, arena); } UPB_INLINE envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOption_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_SocketOption* ret = envoy_config_core_v3_SocketOption_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOption_ int options, upb_Arena* arena) { envoy_config_core_v3_SocketOption* ret = envoy_config_core_v3_SocketOption_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,13 +64,13 @@ UPB_INLINE envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOption_ } UPB_INLINE char* envoy_config_core_v3_SocketOption_serialize(const envoy_config_core_v3_SocketOption* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SocketOption_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SocketOption_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SocketOption_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SocketOption_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -76,79 +79,118 @@ typedef enum { envoy_config_core_v3_SocketOption_value_NOT_SET = 0 } envoy_config_core_v3_SocketOption_value_oneofcases; UPB_INLINE envoy_config_core_v3_SocketOption_value_oneofcases envoy_config_core_v3_SocketOption_value_case(const envoy_config_core_v3_SocketOption* msg) { - return (envoy_config_core_v3_SocketOption_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(32, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_SocketOption_value_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_core_v3_SocketOption_clear_description(const envoy_config_core_v3_SocketOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_SocketOption_clear_description(envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SocketOption_description(const envoy_config_core_v3_SocketOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SocketOption_clear_level(const envoy_config_core_v3_SocketOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t) = 0; +UPB_INLINE void envoy_config_core_v3_SocketOption_clear_level(envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 40), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_config_core_v3_SocketOption_level(const envoy_config_core_v3_SocketOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 40), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SocketOption_clear_name(const envoy_config_core_v3_SocketOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), int64_t) = 0; +UPB_INLINE void envoy_config_core_v3_SocketOption_clear_name(envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(24, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_config_core_v3_SocketOption_name(const envoy_config_core_v3_SocketOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(24, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_SocketOption_has_int_value(const envoy_config_core_v3_SocketOption* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; -} -UPB_INLINE void envoy_config_core_v3_SocketOption_clear_int_value(const envoy_config_core_v3_SocketOption* msg) { - UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(16, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_SocketOption_value_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SocketOption_clear_int_value(envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_config_core_v3_SocketOption_int_value(const envoy_config_core_v3_SocketOption* msg) { - return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(16, 8), UPB_SIZE(0, 0), 4, _upb_Int64_FromLL(0ll)); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(32, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_core_v3_SocketOption_has_int_value(const envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_SocketOption_clear_buf_value(const envoy_config_core_v3_SocketOption* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(16, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_SocketOption_value_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SocketOption_clear_buf_value(envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SocketOption_buf_value(const envoy_config_core_v3_SocketOption* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(16, 8), UPB_SIZE(0, 0), 5, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(32, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SocketOption_clear_state(const envoy_config_core_v3_SocketOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_SocketOption_clear_state(envoy_config_core_v3_SocketOption* msg) { + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_core_v3_SocketOption_state(const envoy_config_core_v3_SocketOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_core_v3_SocketOption_set_description(envoy_config_core_v3_SocketOption *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketOption_set_level(envoy_config_core_v3_SocketOption *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(16, 40), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketOption_set_name(envoy_config_core_v3_SocketOption *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), int64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(24, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketOption_set_int_value(envoy_config_core_v3_SocketOption *msg, int64_t value) { - UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(16, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(32, 8), -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketOption_set_buf_value(envoy_config_core_v3_SocketOption *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(16, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(32, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SocketOption_set_state(envoy_config_core_v3_SocketOption *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.core.v3.SocketOptionsOverride */ UPB_INLINE envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_v3_SocketOptionsOverride_new(upb_Arena* arena) { - return (envoy_config_core_v3_SocketOptionsOverride*)_upb_Message_New(&envoy_config_core_v3_SocketOptionsOverride_msginit, arena); + return (envoy_config_core_v3_SocketOptionsOverride*)_upb_Message_New(&envoy_config_core_v3_SocketOptionsOverride_msg_init, arena); } UPB_INLINE envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_v3_SocketOptionsOverride_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_SocketOptionsOverride* ret = envoy_config_core_v3_SocketOptionsOverride_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOptionsOverride_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOptionsOverride_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -158,7 +200,7 @@ UPB_INLINE envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_v3_Sock int options, upb_Arena* arena) { envoy_config_core_v3_SocketOptionsOverride* ret = envoy_config_core_v3_SocketOptionsOverride_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOptionsOverride_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOptionsOverride_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -166,44 +208,69 @@ UPB_INLINE envoy_config_core_v3_SocketOptionsOverride* envoy_config_core_v3_Sock } UPB_INLINE char* envoy_config_core_v3_SocketOptionsOverride_serialize(const envoy_config_core_v3_SocketOptionsOverride* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SocketOptionsOverride_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SocketOptionsOverride_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_core_v3_SocketOptionsOverride_serialize_ex(const envoy_config_core_v3_SocketOptionsOverride* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SocketOptionsOverride_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SocketOptionsOverride_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_core_v3_SocketOptionsOverride_clear_socket_options(envoy_config_core_v3_SocketOptionsOverride* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_core_v3_SocketOption* const* envoy_config_core_v3_SocketOptionsOverride_socket_options(const envoy_config_core_v3_SocketOptionsOverride* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_core_v3_SocketOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_core_v3_SocketOptionsOverride_has_socket_options(const envoy_config_core_v3_SocketOptionsOverride* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_core_v3_SocketOptionsOverride_clear_socket_options(const envoy_config_core_v3_SocketOptionsOverride* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_core_v3_SocketOption* const* envoy_config_core_v3_SocketOptionsOverride_socket_options(const envoy_config_core_v3_SocketOptionsOverride* msg, size_t* len) { - return (const envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_core_v3_SocketOptionsOverride_socket_options(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_core_v3_SocketOption** envoy_config_core_v3_SocketOptionsOverride_mutable_socket_options(envoy_config_core_v3_SocketOptionsOverride* msg, size_t* len) { - return (envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_core_v3_SocketOption** envoy_config_core_v3_SocketOptionsOverride_mutable_socket_options(envoy_config_core_v3_SocketOptionsOverride* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_core_v3_SocketOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_core_v3_SocketOption** envoy_config_core_v3_SocketOptionsOverride_resize_socket_options(envoy_config_core_v3_SocketOptionsOverride* msg, size_t len, upb_Arena* arena) { - return (envoy_config_core_v3_SocketOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_core_v3_SocketOption** envoy_config_core_v3_SocketOptionsOverride_resize_socket_options(envoy_config_core_v3_SocketOptionsOverride* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_SocketOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOptionsOverride_add_socket_options(envoy_config_core_v3_SocketOptionsOverride* msg, upb_Arena* arena) { - struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_socket_option_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_socket_option_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_ */ 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 43fcbb2ca86..7f64d421566 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/substitution_format_string.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -16,34 +18,45 @@ #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_SubstitutionFormatString_submsgs[3] = { - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_SubstitutionFormatString_submsgs[3] = { + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_SubstitutionFormatString__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_SubstitutionFormatString__fields[6] = { + {1, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 8), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(8, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msginit = { +const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msg_init = { &envoy_config_core_v3_SubstitutionFormatString_submsgs[0], &envoy_config_core_v3_SubstitutionFormatString__fields[0], - UPB_SIZE(32, 48), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 48), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040100000a, &upb_pos_1bt}, + {0x0008000402000012, &upb_pom_1bt_maxmaxb}, + {0x000000003f000018, &upb_psb1_1bt}, + {0x001800003f000022, &upb_pss_1bt}, + {0x000800040501002a, &upb_pom_1bt_maxmaxb}, + {0x002800003f020032, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_core_v3_SubstitutionFormatString_msginit, + &envoy_config_core_v3_SubstitutionFormatString_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_substitution_format_string_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_substitution_format_string_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -52,5 +65,5 @@ const upb_MiniTable_File envoy_config_core_v3_substitution_format_string_proto_u 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1a113f70031..b62caf77081 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 @@ -9,38 +9,42 @@ #ifndef ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_SubstitutionFormatString; typedef struct envoy_config_core_v3_SubstitutionFormatString envoy_config_core_v3_SubstitutionFormatString; -extern const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msginit; +extern const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msg_init; struct envoy_config_core_v3_DataSource; struct envoy_config_core_v3_TypedExtensionConfig; struct google_protobuf_Struct; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; /* envoy.config.core.v3.SubstitutionFormatString */ UPB_INLINE envoy_config_core_v3_SubstitutionFormatString* envoy_config_core_v3_SubstitutionFormatString_new(upb_Arena* arena) { - return (envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_New(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena); + return (envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_New(&envoy_config_core_v3_SubstitutionFormatString_msg_init, arena); } UPB_INLINE envoy_config_core_v3_SubstitutionFormatString* envoy_config_core_v3_SubstitutionFormatString_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_SubstitutionFormatString* ret = envoy_config_core_v3_SubstitutionFormatString_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +54,7 @@ UPB_INLINE envoy_config_core_v3_SubstitutionFormatString* envoy_config_core_v3_S int options, upb_Arena* arena) { envoy_config_core_v3_SubstitutionFormatString* ret = envoy_config_core_v3_SubstitutionFormatString_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,13 +62,13 @@ UPB_INLINE envoy_config_core_v3_SubstitutionFormatString* envoy_config_core_v3_S } UPB_INLINE char* envoy_config_core_v3_SubstitutionFormatString_serialize(const envoy_config_core_v3_SubstitutionFormatString* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -74,109 +78,166 @@ typedef enum { envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET = 0 } envoy_config_core_v3_SubstitutionFormatString_format_oneofcases; UPB_INLINE envoy_config_core_v3_SubstitutionFormatString_format_oneofcases envoy_config_core_v3_SubstitutionFormatString_format_case(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return (envoy_config_core_v3_SubstitutionFormatString_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_core_v3_SubstitutionFormatString_format_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_text_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_text_format(envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SubstitutionFormatString_text_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_json_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_json_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_json_format(envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_json_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, NULL); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_omit_empty_values(const envoy_config_core_v3_SubstitutionFormatString* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_json_format(const envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_omit_empty_values(envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_omit_empty_values(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_content_type(const envoy_config_core_v3_SubstitutionFormatString* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_content_type(envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_core_v3_SubstitutionFormatString_content_type(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; -} -UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_DataSource*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET); +UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_text_format_source(envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_DataSource*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_formatters(envoy_config_core_v3_SubstitutionFormatString* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_SubstitutionFormatString_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); -} -UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); -} -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_SubstitutionFormatString_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); + size_t size; + envoy_config_core_v3_SubstitutionFormatString_formatters(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, struct google_protobuf_Struct* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_mutable_json_format(envoy_config_core_v3_SubstitutionFormatString* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_SubstitutionFormatString_json_format(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_SubstitutionFormatString_set_json_format(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_core_v3_SubstitutionFormatString_set_json_format(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_omit_empty_values(envoy_config_core_v3_SubstitutionFormatString *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_content_type(envoy_config_core_v3_SubstitutionFormatString *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(envoy_config_core_v3_SubstitutionFormatString *msg, struct envoy_config_core_v3_DataSource* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_DataSource*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_mutable_text_format_source(envoy_config_core_v3_SubstitutionFormatString* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_SubstitutionFormatString_text_format_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_mutable_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_mutable_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(8, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_resize_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_resize_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(8, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_SubstitutionFormatString_add_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(8, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_substitution_format_string_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_substitution_format_string_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_ */ 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 9af56d37e15..c62cbc744a9 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 @@ -7,35 +7,44 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/core/v3/udp_socket_config.upb.h" #include "google/protobuf/wrappers.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_core_v3_UdpSocketConfig_submsgs[2] = { - {.submsg = &google_protobuf_UInt64Value_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_core_v3_UdpSocketConfig_submsgs[2] = { + {.submsg = &google_protobuf_UInt64Value_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_core_v3_UdpSocketConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_core_v3_UdpSocketConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msginit = { +const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msg_init = { &envoy_config_core_v3_UdpSocketConfig_submsgs[0], &envoy_config_core_v3_UdpSocketConfig__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_core_v3_UdpSocketConfig_msginit, + &envoy_config_core_v3_UdpSocketConfig_msg_init, }; -const upb_MiniTable_File envoy_config_core_v3_udp_socket_config_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_core_v3_udp_socket_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -44,5 +53,5 @@ const upb_MiniTable_File envoy_config_core_v3_udp_socket_config_proto_upb_file_l 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d161b4f9f25..e24a120cc53 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 @@ -9,36 +9,40 @@ #ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_ #define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_core_v3_UdpSocketConfig; typedef struct envoy_config_core_v3_UdpSocketConfig envoy_config_core_v3_UdpSocketConfig; -extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msg_init; struct google_protobuf_BoolValue; struct google_protobuf_UInt64Value; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; /* envoy.config.core.v3.UdpSocketConfig */ UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_new(upb_Arena* arena) { - return (envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msginit, arena); + return (envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msg_init, arena); } UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_core_v3_UdpSocketConfig* ret = envoy_config_core_v3_UdpSocketConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -48,7 +52,7 @@ UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketC int options, upb_Arena* arena) { envoy_config_core_v3_UdpSocketConfig* ret = envoy_config_core_v3_UdpSocketConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -56,67 +60,77 @@ UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketC } UPB_INLINE char* envoy_config_core_v3_UdpSocketConfig_serialize(const envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_prefer_gro(envoy_config_core_v3_UdpSocketConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_mutable_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_mutable_prefer_gro(envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_UdpSocketConfig_prefer_gro(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_core_v3_udp_socket_config_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_core_v3_udp_socket_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_ */ 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 edf8a519572..823a7e413a5 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/endpoint/v3/endpoint.upb.h" #include "envoy/config/endpoint/v3/endpoint_components.upb.h" #include "envoy/type/v3/percent.upb.h" @@ -17,83 +19,116 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = { - {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit}, - {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit}, - {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = { + {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init}, + {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init}, + {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init = { &envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[0], &envoy_config_endpoint_v3_ClusterLoadAssignment__fields[0], - UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0020000001010022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = { - {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = { + {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = { + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init = { &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[0], &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x001000000101001a, &upb_psm_1bt_maxmaxb}, + {0x0018000002020022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = { - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = { + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init = { &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[0], &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = { - {.submsg = &envoy_config_endpoint_v3_Endpoint_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = { + {.submsg = &envoy_config_endpoint_v3_Endpoint_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msg_init = { &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[0], &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[4] = { - &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, - &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, - &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, - &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit, + &envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, + &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, + &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, + &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msg_init, }; -const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_endpoint_v3_endpoint_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -102,5 +137,5 @@ const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 2fecd56c75c..cc7d408a1b5 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 @@ -9,51 +9,52 @@ #ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_ #define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_endpoint_v3_ClusterLoadAssignment; -struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy; -struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload; -struct envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry; typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment envoy_config_endpoint_v3_ClusterLoadAssignment; typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy envoy_config_endpoint_v3_ClusterLoadAssignment_Policy; typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload; typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msg_init; struct envoy_config_endpoint_v3_Endpoint; struct envoy_config_endpoint_v3_LocalityLbEndpoints; struct envoy_type_v3_FractionalPercent; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msginit; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.endpoint.v3.ClusterLoadAssignment */ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_endpoint_v3_ClusterLoadAssignment_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena); + return (envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_endpoint_v3_ClusterLoadAssignment_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterLoadAssignment* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -63,7 +64,7 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_endpoint int options, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterLoadAssignment* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -71,103 +72,162 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_endpoint } UPB_INLINE char* envoy_config_endpoint_v3_ClusterLoadAssignment_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msg_init, 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); +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_cluster_name(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const* envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const* envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t* len) { - return (const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_policy(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*); + const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* default_val = NULL; + const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_named_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); +UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_named_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_named_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_size(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(20, 40)); + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_get(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_StringView key, struct envoy_config_endpoint_v3_Endpoint** val) { - return _upb_msg_map_get(msg, UPB_SIZE(20, 40), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_next(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t* iter) { - return (const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_named_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + return envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_size(msg) != 0; } UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_cluster_name(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t* len) { - return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_resize_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_resize_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v3_ClusterLoadAssignment_add_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_LocalityLbEndpoints* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_LocalityLbEndpoints* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_policy(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_Arena* arena) { struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)envoy_config_endpoint_v3_ClusterLoadAssignment_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(msg, sub); + sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, arena); + if (sub) envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(msg, sub); } return sub; } -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_clear(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { _upb_msg_map_clear(msg, UPB_SIZE(20, 40)); } +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_clear(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_set(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_StringView key, struct envoy_config_endpoint_v3_Endpoint* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(20, 40), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_delete(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(20, 40), &key, 0); + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_nextmutable(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, size_t* iter) { - return (envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); + const upb_MiniTableField field = {5, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_map_next(map, iter); } /* envoy.config.endpoint.v3.ClusterLoadAssignment.Policy */ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena); + return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -177,7 +237,7 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_e int options, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -185,78 +245,113 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_e } UPB_INLINE char* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, size_t* len) { - return (const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, size_t* len) { - return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_resize_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_resize_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_add_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_overprovisioning_factor(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_endpoint_stale_after(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(msg, sub); } return sub; } @@ -264,12 +359,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoad /* envoy.config.endpoint.v3.ClusterLoadAssignment.Policy.DropOverload */ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena); + return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -279,7 +374,7 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* e int options, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -287,44 +382,55 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* e } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msg_init, 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); +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_clear_category(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_has_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_clear_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_clear_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_has_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_category(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_mutable_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(msg, sub); } return sub; } @@ -336,25 +442,26 @@ UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEn _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_has_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* msg) { struct envoy_config_endpoint_v3_Endpoint* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_has_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_set_value(envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg, struct envoy_config_endpoint_v3_Endpoint* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct envoy_config_endpoint_v3_Endpoint*)); } -extern const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_endpoint_v3_endpoint_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_ */ 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 c05e335f64e..a3ab65e31b8 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/endpoint/v3/endpoint_components.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/base.upb.h" @@ -18,126 +20,181 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_endpoint_v3_Endpoint_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_Endpoint_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_Endpoint__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msg_init = { &envoy_config_endpoint_v3_Endpoint_submsgs[0], &envoy_config_endpoint_v3_Endpoint__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x001800003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[4] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[4] = { + {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init = { &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_submsgs[0], &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000000100001a, &upb_psm_1bt_maxmaxb}, + {0x000800003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = { - {.submsg = &envoy_config_endpoint_v3_Endpoint_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = { + {.submsg = &envoy_config_endpoint_v3_Endpoint_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_LbEndpoint__fields[5] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -9), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_LbEndpoint__fields[5] = { + {1, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_LbEndpoint_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_LbEndpoint_msg_init = { &envoy_config_endpoint_v3_LbEndpoint_submsgs[0], &envoy_config_endpoint_v3_LbEndpoint__fields[0], - UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000080100000a, &upb_pom_1bt_max64b}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x002000000101001a, &upb_psm_1bt_maxmaxb}, + {0x0028000002020022, &upb_psm_1bt_maxmaxb}, + {0x001000080500002a, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init = { &envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[0], &envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[6] = { - {.submsg = &envoy_config_core_v3_Locality_msginit}, - {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit}, - {.submsg = &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[6] = { + {.submsg = &envoy_config_core_v3_Locality_msg_init}, + {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init}, + {.submsg = &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[7] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 48), UPB_SIZE(-9, -9), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(28, 48), UPB_SIZE(-9, -9), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_LocalityLbEndpoints__fields[7] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init = { &envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[0], &envoy_config_endpoint_v3_LocalityLbEndpoints__fields[0], - UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x001800003f010012, &upb_prm_1bt_max64b}, + {0x002000000202001a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x0028000003030032, &upb_psm_1bt_maxmaxb}, + {0x003000080704003a, &upb_pom_1bt_max64b}, + {0x0030000808050042, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[1] = { - {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[1] = { + {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init = { &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[0], &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[6] = { - &envoy_config_endpoint_v3_Endpoint_msginit, - &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, - &envoy_config_endpoint_v3_LbEndpoint_msginit, - &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, - &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, - &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, + &envoy_config_endpoint_v3_Endpoint_msg_init, + &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, + &envoy_config_endpoint_v3_LbEndpoint_msg_init, + &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, + &envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, + &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, }; -const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -146,5 +203,5 @@ const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_components_proto_upb_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 2a724fd3014..14fbdfe01b7 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 @@ -9,57 +9,56 @@ #ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_ #define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_endpoint_v3_Endpoint; -struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig; -struct envoy_config_endpoint_v3_LbEndpoint; -struct envoy_config_endpoint_v3_LedsClusterLocalityConfig; -struct envoy_config_endpoint_v3_LocalityLbEndpoints; -struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList; typedef struct envoy_config_endpoint_v3_Endpoint envoy_config_endpoint_v3_Endpoint; typedef struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig envoy_config_endpoint_v3_Endpoint_HealthCheckConfig; typedef struct envoy_config_endpoint_v3_LbEndpoint envoy_config_endpoint_v3_LbEndpoint; typedef struct envoy_config_endpoint_v3_LedsClusterLocalityConfig envoy_config_endpoint_v3_LedsClusterLocalityConfig; typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints envoy_config_endpoint_v3_LocalityLbEndpoints; typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList; -extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_LbEndpoint_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit; +extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_LbEndpoint_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init; struct envoy_config_core_v3_Address; struct envoy_config_core_v3_ConfigSource; struct envoy_config_core_v3_Locality; struct envoy_config_core_v3_Metadata; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_Locality_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Locality_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.endpoint.v3.Endpoint */ UPB_INLINE envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_Endpoint_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_Endpoint*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_msginit, arena); + return (envoy_config_endpoint_v3_Endpoint*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_Endpoint_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_Endpoint* ret = envoy_config_endpoint_v3_Endpoint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -69,7 +68,7 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_Endpoint_ int options, upb_Arena* arena) { envoy_config_endpoint_v3_Endpoint* ret = envoy_config_endpoint_v3_Endpoint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -77,79 +76,95 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_Endpoint_ } UPB_INLINE char* envoy_config_endpoint_v3_Endpoint_serialize(const envoy_config_endpoint_v3_Endpoint* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msg_init, 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); -} -UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_address(const envoy_config_endpoint_v3_Endpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_address(envoy_config_endpoint_v3_Endpoint* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_address(const envoy_config_endpoint_v3_Endpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_health_check_config(const envoy_config_endpoint_v3_Endpoint* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_address(const envoy_config_endpoint_v3_Endpoint* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_health_check_config(const envoy_config_endpoint_v3_Endpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_health_check_config(envoy_config_endpoint_v3_Endpoint* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_health_check_config(const envoy_config_endpoint_v3_Endpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*); + const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* default_val = NULL; + const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_hostname(const envoy_config_endpoint_v3_Endpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_health_check_config(const envoy_config_endpoint_v3_Endpoint* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_hostname(envoy_config_endpoint_v3_Endpoint* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_Endpoint_hostname(const envoy_config_endpoint_v3_Endpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_address(envoy_config_endpoint_v3_Endpoint *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_mutable_address(envoy_config_endpoint_v3_Endpoint* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_Endpoint_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_Endpoint_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_endpoint_v3_Endpoint_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_health_check_config(envoy_config_endpoint_v3_Endpoint *msg, envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_mutable_health_check_config(envoy_config_endpoint_v3_Endpoint* msg, upb_Arena* arena) { struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)envoy_config_endpoint_v3_Endpoint_health_check_config(msg); if (sub == NULL) { - sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_Endpoint_set_health_check_config(msg, sub); + sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, arena); + if (sub) envoy_config_endpoint_v3_Endpoint_set_health_check_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_hostname(envoy_config_endpoint_v3_Endpoint *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.Endpoint.HealthCheckConfig */ UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena); + return (envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -159,7 +174,7 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_end int options, upb_Arena* arena) { envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -167,75 +182,98 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_end } UPB_INLINE char* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_serialize(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msg_init, 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(4, 4), uint32_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_port_value(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_port_value(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_hostname(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_hostname(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_hostname(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_has_address(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_address(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_address(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_address(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_disable_active_health_check(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_has_address(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_disable_active_health_check(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_disable_active_health_check(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_port_value(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_hostname(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_address(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_mutable_address(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_disable_active_health_check(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.LbEndpoint */ UPB_INLINE envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpoint_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena); + return (envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpoint_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_LbEndpoint* ret = envoy_config_endpoint_v3_LbEndpoint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -245,7 +283,7 @@ UPB_INLINE envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpo int options, upb_Arena* arena) { envoy_config_endpoint_v3_LbEndpoint* ret = envoy_config_endpoint_v3_LbEndpoint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -253,13 +291,13 @@ UPB_INLINE envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpo } UPB_INLINE char* envoy_config_endpoint_v3_LbEndpoint_serialize(const envoy_config_endpoint_v3_LbEndpoint* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -268,105 +306,135 @@ typedef enum { envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET = 0 } envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases; UPB_INLINE envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases envoy_config_endpoint_v3_LbEndpoint_host_identifier_case(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return (envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 1; -} -UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_endpoint(const envoy_config_endpoint_v3_LbEndpoint* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(12, 16), 0, UPB_SIZE(8, 8), envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET); +UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_endpoint(envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_LbEndpoint_endpoint(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(12, 16), UPB_SIZE(8, 8), 1, NULL); + const envoy_config_endpoint_v3_Endpoint* default_val = NULL; + const envoy_config_endpoint_v3_Endpoint* ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_health_status(const envoy_config_endpoint_v3_LbEndpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint(const envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_health_status(envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_endpoint_v3_LbEndpoint_health_status(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_metadata(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_metadata(const envoy_config_endpoint_v3_LbEndpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_metadata(envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndpoint_metadata(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_metadata(const envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 5; +UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(8, 8), envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET); +UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_endpoint_name(envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_LbEndpoint_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(8, 8), 5, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint(envoy_config_endpoint_v3_LbEndpoint *msg, envoy_config_endpoint_v3_Endpoint* value) { - UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(12, 16), value, UPB_SIZE(8, 8), 1); + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_LbEndpoint_mutable_endpoint(envoy_config_endpoint_v3_LbEndpoint* msg, upb_Arena* arena) { struct envoy_config_endpoint_v3_Endpoint* sub = (struct envoy_config_endpoint_v3_Endpoint*)envoy_config_endpoint_v3_LbEndpoint_endpoint(msg); if (sub == NULL) { - sub = (struct envoy_config_endpoint_v3_Endpoint*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LbEndpoint_set_endpoint(msg, sub); + sub = (struct envoy_config_endpoint_v3_Endpoint*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LbEndpoint_set_endpoint(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_health_status(envoy_config_endpoint_v3_LbEndpoint *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_metadata(envoy_config_endpoint_v3_LbEndpoint *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndpoint_mutable_metadata(envoy_config_endpoint_v3_LbEndpoint* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_endpoint_v3_LbEndpoint_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LbEndpoint_set_metadata(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LbEndpoint_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LbEndpoint_mutable_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint_name(envoy_config_endpoint_v3_LbEndpoint *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(8, 8), 5); + const upb_MiniTableField field = {5, UPB_SIZE(20, 16), UPB_SIZE(-17, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.LedsClusterLocalityConfig */ UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_Message_New(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena); + return (envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_Message_New(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LedsClusterLocalityConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_LedsClusterLocalityConfig* ret = envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -376,7 +444,7 @@ UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endp int options, upb_Arena* arena) { envoy_config_endpoint_v3_LedsClusterLocalityConfig* ret = envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -384,57 +452,68 @@ UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endp } UPB_INLINE char* envoy_config_endpoint_v3_LedsClusterLocalityConfig_serialize(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_clear_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_clear_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_clear_leds_collection_name(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_endpoint_v3_LedsClusterLocalityConfig_has_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_clear_leds_collection_name(envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_collection_name(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_endpoint_v3_LedsClusterLocalityConfig_mutable_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_collection_name(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.LocalityLbEndpoints */ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v3_LocalityLbEndpoints_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_LocalityLbEndpoints*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena); + return (envoy_config_endpoint_v3_LocalityLbEndpoints*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v3_LocalityLbEndpoints_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_LocalityLbEndpoints* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -444,7 +523,7 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v int options, upb_Arena* arena) { envoy_config_endpoint_v3_LocalityLbEndpoints* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -452,13 +531,13 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v } UPB_INLINE char* envoy_config_endpoint_v3_LocalityLbEndpoints_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -467,144 +546,203 @@ typedef enum { envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET = 0 } envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases; UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_case(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return (envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_locality(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_Locality*); + const struct envoy_config_core_v3_Locality* default_val = NULL; + const struct envoy_config_core_v3_Locality* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); + size_t size; + envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); -} -UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg, size_t* len) { - return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); -} -UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_priority(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_endpoint_v3_LocalityLbEndpoints_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 7; +UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(28, 48), 0, UPB_SIZE(8, 8), envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET); +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(28, 48), UPB_SIZE(8, 8), 7, NULL); + const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* default_val = NULL; + const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 8; +UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(8, 8), envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET); +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LocalityLbEndpoints_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(28, 48), UPB_SIZE(8, 8), 8, NULL); + const envoy_config_endpoint_v3_LedsClusterLocalityConfig* default_val = NULL; + const envoy_config_endpoint_v3_LedsClusterLocalityConfig* ret; + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct envoy_config_core_v3_Locality* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_Locality*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_locality(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) { struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_endpoint_v3_LocalityLbEndpoints_locality(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(msg, sub); + sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(msg, sub); } return sub; } -UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, size_t* len) { - return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_LbEndpoint**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_LbEndpoint**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LocalityLbEndpoints_add_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_priority(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* value) { - UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(28, 48), value, UPB_SIZE(8, 8), 7); + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) { struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancer_endpoints(msg); if (sub == NULL) { - sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(msg, sub); + sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(8, 8), 8); + const upb_MiniTableField field = {8, UPB_SIZE(28, 48), UPB_SIZE(-25, -9), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) { struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)envoy_config_endpoint_v3_LocalityLbEndpoints_leds_cluster_locality_config(msg); if (sub == NULL) { - sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_Message_New(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(msg, sub); + sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_Message_New(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msg_init, arena); + if (sub) envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(msg, sub); } return sub; } @@ -612,12 +750,12 @@ UPB_INLINE struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_conf /* envoy.config.endpoint.v3.LocalityLbEndpoints.LbEndpointList */ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena); + return (envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -627,7 +765,7 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_co int options, upb_Arena* arena) { envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -635,44 +773,69 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_co } UPB_INLINE char* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_clear_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_clear_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t* len) { - return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_lb_endpoints(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t* len) { - return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_LbEndpoint**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_LbEndpoint**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_add_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_ */ 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 d1981786757..3af7769253a 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/endpoint/v3/load_report.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/base.upb.h" @@ -17,106 +19,157 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = { - {.submsg = &envoy_config_core_v3_Locality_msginit}, - {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit}, - {.submsg = &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = { + {.submsg = &envoy_config_core_v3_Locality_msg_init}, + {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init}, + {.submsg = &envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(48, 56), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(48, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init = { &envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[0], &envoy_config_endpoint_v3_UpstreamLocalityStats__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x001800003f000018, &upb_psv8_1bt}, + {0x002000003f000020, &upb_psv8_1bt}, + {0x002800003f01002a, &upb_prm_1bt_max64b}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x003000003f02003a, &upb_prm_1bt_max128b}, + {0x003800003f000040, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit}, - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init}, + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 48), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 56), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(40, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_UpstreamEndpointStats_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init = { &envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[0], &envoy_config_endpoint_v3_UpstreamEndpointStats__fields[0], - UPB_SIZE(48, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(48, 64), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x001800003f000018, &upb_psv8_1bt}, + {0x002000003f000020, &upb_psv8_1bt}, + {0x002800003f01002a, &upb_prm_1bt_max64b}, + {0x0030000002020032, &upb_psm_1bt_maxmaxb}, + {0x003800003f000038, &upb_psv8_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init = { NULL, &envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[0], - UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x001800003f000019, &upb_psf8_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterStats_submsgs[3] = { - {.submsg = &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit}, +static const upb_MiniTableSub envoy_config_endpoint_v3_ClusterStats_submsgs[3] = { + {.submsg = &envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init}, }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterStats__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_ClusterStats__fields[6] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(24, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msg_init = { &envoy_config_endpoint_v3_ClusterStats_submsgs[0], &envoy_config_endpoint_v3_ClusterStats__fields[0], - UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000003f000018, &upb_psv8_1bt}, + {0x0028000001010022, &upb_psm_1bt_maxmaxb}, + {0x003000003f02002a, &upb_prm_1bt_max64b}, + {0x003800003f000032, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = { +const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init = { NULL, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, - &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, - &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, - &envoy_config_endpoint_v3_ClusterStats_msginit, - &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, + &envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, + &envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, + &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, + &envoy_config_endpoint_v3_ClusterStats_msg_init, + &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, }; -const upb_MiniTable_File envoy_config_endpoint_v3_load_report_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_endpoint_v3_load_report_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -125,5 +178,5 @@ const upb_MiniTable_File envoy_config_endpoint_v3_load_report_proto_upb_file_lay 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 ff40dee8fb6..d1f236ce9d3 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 @@ -9,52 +9,52 @@ #ifndef ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_ #define ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_endpoint_v3_UpstreamLocalityStats; -struct envoy_config_endpoint_v3_UpstreamEndpointStats; -struct envoy_config_endpoint_v3_EndpointLoadMetricStats; -struct envoy_config_endpoint_v3_ClusterStats; -struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests; typedef struct envoy_config_endpoint_v3_UpstreamLocalityStats envoy_config_endpoint_v3_UpstreamLocalityStats; typedef struct envoy_config_endpoint_v3_UpstreamEndpointStats envoy_config_endpoint_v3_UpstreamEndpointStats; typedef struct envoy_config_endpoint_v3_EndpointLoadMetricStats envoy_config_endpoint_v3_EndpointLoadMetricStats; typedef struct envoy_config_endpoint_v3_ClusterStats envoy_config_endpoint_v3_ClusterStats; typedef struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests envoy_config_endpoint_v3_ClusterStats_DroppedRequests; -extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamEndpointStats_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit; +extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init; struct envoy_config_core_v3_Address; struct envoy_config_core_v3_Locality; struct google_protobuf_Duration; struct google_protobuf_Struct; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_Locality_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Locality_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; /* envoy.config.endpoint.v3.UpstreamLocalityStats */ UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint_v3_UpstreamLocalityStats_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena); + return (envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint_v3_UpstreamLocalityStats_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_UpstreamLocalityStats* ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -64,7 +64,7 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint int options, upb_Arena* arena) { envoy_config_endpoint_v3_UpstreamLocalityStats* ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -72,135 +72,220 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint } UPB_INLINE char* envoy_config_endpoint_v3_UpstreamLocalityStats_serialize(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, 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); -} -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_locality(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_UpstreamLocalityStats_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_Locality*); + const struct envoy_config_core_v3_Locality* default_val = NULL; + const struct envoy_config_core_v3_Locality* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_successful_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0; +UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_successful_requests(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_successful_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_error_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_error_requests(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_error_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); + size_t size; + envoy_config_endpoint_v3_UpstreamLocalityStats_load_metric_stats(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); -} -UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* len) { - return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); -} -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_priority(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_priority(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_endpoint_v3_UpstreamLocalityStats_priority(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_UpstreamEndpointStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_UpstreamEndpointStats* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); + size_t size; + envoy_config_endpoint_v3_UpstreamLocalityStats_upstream_endpoint_stats(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); -} -UPB_INLINE const envoy_config_endpoint_v3_UpstreamEndpointStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* len) { - return (const envoy_config_endpoint_v3_UpstreamEndpointStats* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); -} -UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_issued_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_issued_requests(envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(48, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_issued_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {8, UPB_SIZE(48, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, struct envoy_config_core_v3_Locality* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_Locality*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_locality(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, upb_Arena* arena) { struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_endpoint_v3_UpstreamLocalityStats_locality(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(msg, sub); + sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msg_init, arena); + if (sub) envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_successful_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_error_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* len) { - return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_UpstreamLocalityStats_add_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_priority(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* len) { - return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_UpstreamEndpointStats**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint_v3_UpstreamLocalityStats_add_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_UpstreamEndpointStats* sub = (struct envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_UpstreamEndpointStats* sub = (struct envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_issued_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = value; + const upb_MiniTableField field = {8, UPB_SIZE(48, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.UpstreamEndpointStats */ UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint_v3_UpstreamEndpointStats_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena); + return (envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint_v3_UpstreamEndpointStats_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_UpstreamEndpointStats* ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -210,7 +295,7 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint int options, upb_Arena* arena) { envoy_config_endpoint_v3_UpstreamEndpointStats* ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -218,127 +303,186 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint } UPB_INLINE char* envoy_config_endpoint_v3_UpstreamEndpointStats_serialize(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msg_init, 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); -} -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_address(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_address(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_UpstreamEndpointStats_address(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_successful_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), uint64_t) = 0; +UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_address(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_successful_requests(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_successful_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_error_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_error_requests(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {4, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_error_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamEndpointStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_config_endpoint_v3_UpstreamEndpointStats_load_metric_stats(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamEndpointStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg, size_t* len) { - return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); -} -UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_endpoint_v3_UpstreamEndpointStats_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_issued_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 56), uint64_t) = 0; +UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_issued_requests(envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_issued_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_address(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_UpstreamEndpointStats_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_successful_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), uint64_t) = value; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), uint64_t) = value; + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_error_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), uint64_t) = value; + const upb_MiniTableField field = {4, 32, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, size_t* len) { - return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_UpstreamEndpointStats_add_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(8, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_endpoint_v3_UpstreamEndpointStats_metadata(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_issued_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 56), uint64_t) = value; + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.EndpointLoadMetricStats */ UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_EndpointLoadMetricStats_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena); + return (envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_EndpointLoadMetricStats_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_EndpointLoadMetricStats* ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -348,7 +492,7 @@ UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoi int options, upb_Arena* arena) { envoy_config_endpoint_v3_EndpointLoadMetricStats* ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -356,53 +500,71 @@ UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoi } UPB_INLINE char* envoy_config_endpoint_v3_EndpointLoadMetricStats_serialize(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msg_init, 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); +UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_metric_name(envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_EndpointLoadMetricStats_metric_name(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_num_requests_finished_with_metric(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_num_requests_finished_with_metric(envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_EndpointLoadMetricStats_num_requests_finished_with_metric(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_total_metric_value(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = 0; +UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_total_metric_value(envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_config_endpoint_v3_EndpointLoadMetricStats_total_metric_value(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_metric_name(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_num_requests_finished_with_metric(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_total_metric_value(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.ClusterStats */ UPB_INLINE envoy_config_endpoint_v3_ClusterStats* envoy_config_endpoint_v3_ClusterStats_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterStats*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_msginit, arena); + return (envoy_config_endpoint_v3_ClusterStats*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_ClusterStats* envoy_config_endpoint_v3_ClusterStats_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterStats* ret = envoy_config_endpoint_v3_ClusterStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -412,7 +574,7 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats* envoy_config_endpoint_v3_Clust int options, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterStats* ret = envoy_config_endpoint_v3_ClusterStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -420,117 +582,190 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats* envoy_config_endpoint_v3_Clust } UPB_INLINE char* envoy_config_endpoint_v3_ClusterStats_serialize(const envoy_config_endpoint_v3_ClusterStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msg_init, 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); +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_cluster_name(envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterStats_cluster_name(const envoy_config_endpoint_v3_ClusterStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_UpstreamLocalityStats* const* envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_UpstreamLocalityStats* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_config_endpoint_v3_UpstreamLocalityStats* const* envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats* msg, size_t* len) { - return (const envoy_config_endpoint_v3_UpstreamLocalityStats* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_total_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_total_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_ClusterStats_total_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_load_report_interval(const envoy_config_endpoint_v3_ClusterStats* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_load_report_interval(const envoy_config_endpoint_v3_ClusterStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_load_report_interval(envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterStats_load_report_interval(const envoy_config_endpoint_v3_ClusterStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_load_report_interval(const envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const* envoy_config_endpoint_v3_ClusterStats_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_config_endpoint_v3_ClusterStats_dropped_requests(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const* envoy_config_endpoint_v3_ClusterStats_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg, size_t* len) { - return (const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); -} -UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_cluster_service_name(const envoy_config_endpoint_v3_ClusterStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_cluster_service_name(envoy_config_endpoint_v3_ClusterStats* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterStats_cluster_service_name(const envoy_config_endpoint_v3_ClusterStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_mutable_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats* msg, size_t* len) { - return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_mutable_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_resize_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_resize_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_UpstreamLocalityStats**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint_v3_ClusterStats_add_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_UpstreamLocalityStats* sub = (struct envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_UpstreamLocalityStats* sub = (struct envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_Message_New(&envoy_config_endpoint_v3_UpstreamLocalityStats_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_total_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(envoy_config_endpoint_v3_ClusterStats *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterStats_mutable_load_report_interval(envoy_config_endpoint_v3_ClusterStats* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_endpoint_v3_ClusterStats_load_report_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(msg, sub); } return sub; } -UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_mutable_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg, size_t* len) { - return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_mutable_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(12, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_resize_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg, size_t len, upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_resize_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(12, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_endpoint_v3_ClusterStats_add_dropped_requests(envoy_config_endpoint_v3_ClusterStats* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* sub = (struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(12, 48), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* sub = (struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_service_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.endpoint.v3.ClusterStats.DroppedRequests */ UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(upb_Arena* arena) { - return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena); + return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, arena); } UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterStats_DroppedRequests* ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -540,7 +775,7 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_e int options, upb_Arena* arena) { envoy_config_endpoint_v3_ClusterStats_DroppedRequests* ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -548,41 +783,53 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_e } UPB_INLINE char* envoy_config_endpoint_v3_ClusterStats_DroppedRequests_serialize(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msg_init, 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); +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_clear_category(envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterStats_DroppedRequests_category(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_clear_dropped_count(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0; +UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_clear_dropped_count(envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_endpoint_v3_ClusterStats_DroppedRequests_dropped_count(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_category(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_dropped_count(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_endpoint_v3_load_report_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_endpoint_v3_load_report_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_ */ 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 f5560641b70..9b160839d1e 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 @@ -7,33 +7,40 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/listener/v3/api_listener.upb.h" #include "google/protobuf/any.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_listener_v3_ApiListener_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_ApiListener_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_ApiListener__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_ApiListener__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_ApiListener_msginit = { +const upb_MiniTable envoy_config_listener_v3_ApiListener_msg_init = { &envoy_config_listener_v3_ApiListener_submsgs[0], &envoy_config_listener_v3_ApiListener__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_listener_v3_ApiListener_msginit, + &envoy_config_listener_v3_ApiListener_msg_init, }; -const upb_MiniTable_File envoy_config_listener_v3_api_listener_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_listener_v3_api_listener_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +49,5 @@ const upb_MiniTable_File envoy_config_listener_v3_api_listener_proto_upb_file_la 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d5d726191f5..3c449c2c201 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_ #define ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_listener_v3_ApiListener; typedef struct envoy_config_listener_v3_ApiListener envoy_config_listener_v3_ApiListener; -extern const upb_MiniTable envoy_config_listener_v3_ApiListener_msginit; +extern const upb_MiniTable envoy_config_listener_v3_ApiListener_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* envoy.config.listener.v3.ApiListener */ UPB_INLINE envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_ApiListener_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ApiListener*)_upb_Message_New(&envoy_config_listener_v3_ApiListener_msginit, arena); + return (envoy_config_listener_v3_ApiListener*)_upb_Message_New(&envoy_config_listener_v3_ApiListener_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_ApiListener_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ApiListener* ret = envoy_config_listener_v3_ApiListener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_ApiLis int options, upb_Arena* arena) { envoy_config_listener_v3_ApiListener* ret = envoy_config_listener_v3_ApiListener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,45 +58,50 @@ UPB_INLINE envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_ApiLis } UPB_INLINE char* envoy_config_listener_v3_ApiListener_serialize(const envoy_config_listener_v3_ApiListener* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msg_init, 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); -} -UPB_INLINE void envoy_config_listener_v3_ApiListener_clear_api_listener(const envoy_config_listener_v3_ApiListener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_ApiListener_clear_api_listener(envoy_config_listener_v3_ApiListener* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_api_listener(const envoy_config_listener_v3_ApiListener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_ApiListener_has_api_listener(const envoy_config_listener_v3_ApiListener* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_ApiListener_set_api_listener(envoy_config_listener_v3_ApiListener *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_mutable_api_listener(envoy_config_listener_v3_ApiListener* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_ApiListener_api_listener(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ApiListener_set_api_listener(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_listener_v3_ApiListener_set_api_listener(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_listener_v3_api_listener_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_listener_v3_api_listener_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_ */ 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 66d8ff7d59b..44bb5f58e4a 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/listener/v3/listener.upb.h" #include "envoy/config/accesslog/v3/accesslog.upb.h" #include "envoy/config/core/v3/address.upb.h" @@ -28,178 +30,233 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_listener_v3_AdditionalAddress_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_core_v3_SocketOptionsOverride_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_AdditionalAddress_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_core_v3_SocketOptionsOverride_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_AdditionalAddress__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_AdditionalAddress__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_AdditionalAddress_msginit = { +const upb_MiniTable envoy_config_listener_v3_AdditionalAddress_msg_init = { &envoy_config_listener_v3_AdditionalAddress_submsgs[0], &envoy_config_listener_v3_AdditionalAddress__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerCollection_submsgs[1] = { - {.submsg = &xds_core_v3_CollectionEntry_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_ListenerCollection_submsgs[1] = { + {.submsg = &xds_core_v3_CollectionEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_ListenerCollection__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_ListenerCollection__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_ListenerCollection_msginit = { +const upb_MiniTable envoy_config_listener_v3_ListenerCollection_msg_init = { &envoy_config_listener_v3_ListenerCollection_submsgs[0], &envoy_config_listener_v3_ListenerCollection__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_submsgs[23] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &envoy_config_listener_v3_FilterChain_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &envoy_config_listener_v3_Listener_DeprecatedV1_msginit}, - {.submsg = &envoy_config_listener_v3_ListenerFilter_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_SocketOption_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_listener_v3_UdpListenerConfig_msginit}, - {.submsg = &envoy_config_listener_v3_ApiListener_msginit}, - {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit}, - {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_listener_v3_FilterChain_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_msginit}, - {.submsg = &envoy_config_listener_v3_AdditionalAddress_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_Listener_submsgs[23] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &envoy_config_listener_v3_FilterChain_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &envoy_config_listener_v3_Listener_DeprecatedV1_msg_init}, + {.submsg = &envoy_config_listener_v3_ListenerFilter_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_SocketOption_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_listener_v3_UdpListenerConfig_msg_init}, + {.submsg = &envoy_config_listener_v3_ApiListener_msg_init}, + {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init}, + {.submsg = &envoy_config_accesslog_v3_AccessLog_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_listener_v3_FilterChain_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_msg_init}, + {.submsg = &envoy_config_listener_v3_AdditionalAddress_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_Listener__fields[31] = { - {1, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(32, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(36, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 56), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(44, 64), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(48, 72), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(52, 80), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(56, 88), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(60, 96), UPB_SIZE(6, 6), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(64, 104), UPB_SIZE(7, 7), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(68, 112), UPB_SIZE(8, 8), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(72, 120), UPB_SIZE(0, 0), 10, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(76, 128), UPB_SIZE(9, 9), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(80, 136), UPB_SIZE(10, 10), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(84, 144), UPB_SIZE(11, 11), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(88, 152), UPB_SIZE(12, 12), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(13, 13), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(92, 160), UPB_SIZE(0, 0), 15, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(96, 168), UPB_SIZE(13, 13), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(100, 176), UPB_SIZE(14, 14), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(104, 184), UPB_SIZE(15, 15), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {27, UPB_SIZE(128, 232), UPB_SIZE(-17, -17), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {28, UPB_SIZE(108, 192), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {29, UPB_SIZE(116, 208), UPB_SIZE(16, 16), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {30, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(21, 21), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {32, UPB_SIZE(120, 216), UPB_SIZE(17, 17), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {33, UPB_SIZE(124, 224), UPB_SIZE(0, 0), 22, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_Listener__fields[31] = { + {1, UPB_SIZE(120, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 64), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 80), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 96), 6, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(40, 104), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(44, 112), 8, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(48, 120), 0, 10, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(52, 128), 9, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(56, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(60, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(64, 136), 10, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(68, 144), 11, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(72, 152), 12, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(76, 13), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(80, 160), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(84, 168), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(88, 176), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(92, 184), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {27, UPB_SIZE(116, 232), UPB_SIZE(-97, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {28, UPB_SIZE(128, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {29, UPB_SIZE(100, 208), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {30, UPB_SIZE(104, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {31, UPB_SIZE(105, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {32, UPB_SIZE(108, 216), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {33, UPB_SIZE(112, 224), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_Listener_msginit = { +const upb_MiniTable envoy_config_listener_v3_Listener_msg_init = { &envoy_config_listener_v3_Listener_submsgs[0], &envoy_config_listener_v3_Listener__fields[0], - UPB_SIZE(136, 240), 31, kUpb_ExtMode_NonExtendable, 13, 255, 0, + UPB_SIZE(136, 240), 31, kUpb_ExtMode_NonExtendable, 13, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x0028000001000012, &upb_psm_1bt_maxmaxb}, + {0x003000003f01001a, &upb_prm_1bt_maxmaxb}, + {0x0038000002020022, &upb_psm_1bt_maxmaxb}, + {0x004000000303002a, &upb_psm_1bt_maxmaxb}, + {0x0048000004040032, &upb_psm_1bt_maxmaxb}, + {0x005000000505003a, &upb_psm_1bt_max64b}, + {0x000400003f000040, &upb_psv4_1bt}, + {0x005800003f06004a, &upb_prm_1bt_maxmaxb}, + {0x0060000006070052, &upb_psm_1bt_maxmaxb}, + {0x006800000708005a, &upb_psm_1bt_maxmaxb}, + {0x0070000008090062, &upb_psm_1bt_maxmaxb}, + {0x007800003f0a006a, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x00800000090b007a, &upb_psm_1bt_maxmaxb}, + {0x000800003f000180, &upb_psv4_2bt}, + {0x000c00003f000188, &upb_psb1_2bt}, + {0x008800000a0c0192, &upb_psm_2bt_maxmaxb}, + {0x009000000b0d019a, &upb_psm_2bt_maxmaxb}, + {0x009800000c0e01a2, &upb_psm_2bt_max64b}, + {0x000d00003f0001a8, &upb_psb1_2bt}, + {0x00a000003f0f01b2, &upb_prm_2bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x00a800000d1001c2, &upb_psm_2bt_maxmaxb}, + {0x00b000000e1101ca, &upb_psm_2bt_maxmaxb}, + {0x00b800000f1201d2, &upb_psm_2bt_maxmaxb}, + {0x00e800101b1301da, &upb_pom_2bt_max64b}, + {0x00c000003f0001e2, &upb_pss_2bt}, + {0x00d00000101401ea, &upb_psm_2bt_maxmaxb}, + {0x001400003f0001f0, &upb_psb1_2bt}, + {0x001500003f0001f8, &upb_psb1_2bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = { - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_Listener_DeprecatedV1_msginit = { +const upb_MiniTable envoy_config_listener_v3_Listener_DeprecatedV1_msg_init = { &envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[0], &envoy_config_listener_v3_Listener_DeprecatedV1__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[2] = { - {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[2] = { + {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit = { +const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init = { &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[0], &envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit = { +const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_config_listener_v3_Listener_InternalListenerConfig_msginit = { +const upb_MiniTable envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_config_listener_v3_ListenerManager_msginit = { +const upb_MiniTable envoy_config_listener_v3_ListenerManager_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_config_listener_v3_ValidationListenerManager_msginit = { +const upb_MiniTable envoy_config_listener_v3_ValidationListenerManager_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_config_listener_v3_ApiListenerManager_msginit = { +const upb_MiniTable envoy_config_listener_v3_ApiListenerManager_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[10] = { - &envoy_config_listener_v3_AdditionalAddress_msginit, - &envoy_config_listener_v3_ListenerCollection_msginit, - &envoy_config_listener_v3_Listener_msginit, - &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, - &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, - &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, - &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, - &envoy_config_listener_v3_ListenerManager_msginit, - &envoy_config_listener_v3_ValidationListenerManager_msginit, - &envoy_config_listener_v3_ApiListenerManager_msginit, + &envoy_config_listener_v3_AdditionalAddress_msg_init, + &envoy_config_listener_v3_ListenerCollection_msg_init, + &envoy_config_listener_v3_Listener_msg_init, + &envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, + &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, + &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, + &envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, + &envoy_config_listener_v3_ListenerManager_msg_init, + &envoy_config_listener_v3_ValidationListenerManager_msg_init, + &envoy_config_listener_v3_ApiListenerManager_msg_init, }; -const upb_MiniTable_File envoy_config_listener_v3_listener_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_listener_v3_listener_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -208,5 +265,5 @@ const upb_MiniTable_File envoy_config_listener_v3_listener_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 fdb3609b391..43d39c2211e 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 @@ -9,27 +9,22 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_ #define ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_listener_v3_AdditionalAddress; -struct envoy_config_listener_v3_ListenerCollection; -struct envoy_config_listener_v3_Listener; -struct envoy_config_listener_v3_Listener_DeprecatedV1; -struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig; -struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance; -struct envoy_config_listener_v3_Listener_InternalListenerConfig; -struct envoy_config_listener_v3_ListenerManager; -struct envoy_config_listener_v3_ValidationListenerManager; -struct envoy_config_listener_v3_ApiListenerManager; typedef struct envoy_config_listener_v3_AdditionalAddress envoy_config_listener_v3_AdditionalAddress; typedef struct envoy_config_listener_v3_ListenerCollection envoy_config_listener_v3_ListenerCollection; typedef struct envoy_config_listener_v3_Listener envoy_config_listener_v3_Listener; @@ -40,16 +35,16 @@ typedef struct envoy_config_listener_v3_Listener_InternalListenerConfig envoy_co typedef struct envoy_config_listener_v3_ListenerManager envoy_config_listener_v3_ListenerManager; typedef struct envoy_config_listener_v3_ValidationListenerManager envoy_config_listener_v3_ValidationListenerManager; typedef struct envoy_config_listener_v3_ApiListenerManager envoy_config_listener_v3_ApiListenerManager; -extern const upb_MiniTable envoy_config_listener_v3_AdditionalAddress_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ListenerCollection_msginit; -extern const upb_MiniTable envoy_config_listener_v3_Listener_msginit; -extern const upb_MiniTable envoy_config_listener_v3_Listener_DeprecatedV1_msginit; -extern const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit; -extern const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit; -extern const upb_MiniTable envoy_config_listener_v3_Listener_InternalListenerConfig_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ListenerManager_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ValidationListenerManager_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ApiListenerManager_msginit; +extern const upb_MiniTable envoy_config_listener_v3_AdditionalAddress_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ListenerCollection_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_Listener_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_Listener_DeprecatedV1_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ListenerManager_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ValidationListenerManager_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ApiListenerManager_msg_init; struct envoy_config_accesslog_v3_AccessLog; struct envoy_config_core_v3_Address; struct envoy_config_core_v3_Metadata; @@ -65,21 +60,21 @@ struct google_protobuf_Duration; struct google_protobuf_UInt32Value; struct xds_core_v3_CollectionEntry; struct xds_type_matcher_v3_Matcher; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ApiListener_msginit; -extern const upb_MiniTable envoy_config_listener_v3_FilterChain_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msginit; -extern const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable xds_core_v3_CollectionEntry_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_msginit; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketOptionsOverride_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ApiListener_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_FilterChain_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable xds_core_v3_CollectionEntry_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_msg_init; typedef enum { envoy_config_listener_v3_Listener_DEFAULT = 0, @@ -91,12 +86,12 @@ typedef enum { /* envoy.config.listener.v3.AdditionalAddress */ UPB_INLINE envoy_config_listener_v3_AdditionalAddress* envoy_config_listener_v3_AdditionalAddress_new(upb_Arena* arena) { - return (envoy_config_listener_v3_AdditionalAddress*)_upb_Message_New(&envoy_config_listener_v3_AdditionalAddress_msginit, arena); + return (envoy_config_listener_v3_AdditionalAddress*)_upb_Message_New(&envoy_config_listener_v3_AdditionalAddress_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_AdditionalAddress* envoy_config_listener_v3_AdditionalAddress_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_AdditionalAddress* ret = envoy_config_listener_v3_AdditionalAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_AdditionalAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_AdditionalAddress_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -106,7 +101,7 @@ UPB_INLINE envoy_config_listener_v3_AdditionalAddress* envoy_config_listener_v3_ int options, upb_Arena* arena) { envoy_config_listener_v3_AdditionalAddress* ret = envoy_config_listener_v3_AdditionalAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_AdditionalAddress_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_AdditionalAddress_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -114,57 +109,67 @@ UPB_INLINE envoy_config_listener_v3_AdditionalAddress* envoy_config_listener_v3_ } UPB_INLINE char* envoy_config_listener_v3_AdditionalAddress_serialize(const envoy_config_listener_v3_AdditionalAddress* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_AdditionalAddress_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_AdditionalAddress_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_listener_v3_AdditionalAddress_serialize_ex(const envoy_config_listener_v3_AdditionalAddress* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_AdditionalAddress_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_AdditionalAddress_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_config_listener_v3_AdditionalAddress_has_address(const envoy_config_listener_v3_AdditionalAddress* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_listener_v3_AdditionalAddress_clear_address(const envoy_config_listener_v3_AdditionalAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_AdditionalAddress_clear_address(envoy_config_listener_v3_AdditionalAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_listener_v3_AdditionalAddress_address(const envoy_config_listener_v3_AdditionalAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_AdditionalAddress_has_socket_options(const envoy_config_listener_v3_AdditionalAddress* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_listener_v3_AdditionalAddress_has_address(const envoy_config_listener_v3_AdditionalAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_AdditionalAddress_clear_socket_options(const envoy_config_listener_v3_AdditionalAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_AdditionalAddress_clear_socket_options(envoy_config_listener_v3_AdditionalAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_SocketOptionsOverride* envoy_config_listener_v3_AdditionalAddress_socket_options(const envoy_config_listener_v3_AdditionalAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_SocketOptionsOverride*); + const struct envoy_config_core_v3_SocketOptionsOverride* default_val = NULL; + const struct envoy_config_core_v3_SocketOptionsOverride* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_AdditionalAddress_has_socket_options(const envoy_config_listener_v3_AdditionalAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_AdditionalAddress_set_address(envoy_config_listener_v3_AdditionalAddress *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_listener_v3_AdditionalAddress_mutable_address(envoy_config_listener_v3_AdditionalAddress* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_listener_v3_AdditionalAddress_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_AdditionalAddress_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_listener_v3_AdditionalAddress_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_AdditionalAddress_set_socket_options(envoy_config_listener_v3_AdditionalAddress *msg, struct envoy_config_core_v3_SocketOptionsOverride* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_SocketOptionsOverride*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SocketOptionsOverride* envoy_config_listener_v3_AdditionalAddress_mutable_socket_options(envoy_config_listener_v3_AdditionalAddress* msg, upb_Arena* arena) { struct envoy_config_core_v3_SocketOptionsOverride* sub = (struct envoy_config_core_v3_SocketOptionsOverride*)envoy_config_listener_v3_AdditionalAddress_socket_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SocketOptionsOverride*)_upb_Message_New(&envoy_config_core_v3_SocketOptionsOverride_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_AdditionalAddress_set_socket_options(msg, sub); + sub = (struct envoy_config_core_v3_SocketOptionsOverride*)_upb_Message_New(&envoy_config_core_v3_SocketOptionsOverride_msg_init, arena); + if (sub) envoy_config_listener_v3_AdditionalAddress_set_socket_options(msg, sub); } return sub; } @@ -172,12 +177,12 @@ UPB_INLINE struct envoy_config_core_v3_SocketOptionsOverride* envoy_config_liste /* envoy.config.listener.v3.ListenerCollection */ UPB_INLINE envoy_config_listener_v3_ListenerCollection* envoy_config_listener_v3_ListenerCollection_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ListenerCollection*)_upb_Message_New(&envoy_config_listener_v3_ListenerCollection_msginit, arena); + return (envoy_config_listener_v3_ListenerCollection*)_upb_Message_New(&envoy_config_listener_v3_ListenerCollection_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ListenerCollection* envoy_config_listener_v3_ListenerCollection_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ListenerCollection* ret = envoy_config_listener_v3_ListenerCollection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -187,7 +192,7 @@ UPB_INLINE envoy_config_listener_v3_ListenerCollection* envoy_config_listener_v3 int options, upb_Arena* arena) { envoy_config_listener_v3_ListenerCollection* ret = envoy_config_listener_v3_ListenerCollection_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -195,47 +200,72 @@ UPB_INLINE envoy_config_listener_v3_ListenerCollection* envoy_config_listener_v3 } UPB_INLINE char* envoy_config_listener_v3_ListenerCollection_serialize(const envoy_config_listener_v3_ListenerCollection* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_listener_v3_ListenerCollection_clear_entries(envoy_config_listener_v3_ListenerCollection* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct xds_core_v3_CollectionEntry* const* envoy_config_listener_v3_ListenerCollection_entries(const envoy_config_listener_v3_ListenerCollection* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct xds_core_v3_CollectionEntry* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_listener_v3_ListenerCollection_has_entries(const envoy_config_listener_v3_ListenerCollection* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_listener_v3_ListenerCollection_clear_entries(const envoy_config_listener_v3_ListenerCollection* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const struct xds_core_v3_CollectionEntry* const* envoy_config_listener_v3_ListenerCollection_entries(const envoy_config_listener_v3_ListenerCollection* msg, size_t* len) { - return (const struct xds_core_v3_CollectionEntry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_listener_v3_ListenerCollection_entries(msg, &size); + return size != 0; } -UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_mutable_entries(envoy_config_listener_v3_ListenerCollection* msg, size_t* len) { - return (struct xds_core_v3_CollectionEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_mutable_entries(envoy_config_listener_v3_ListenerCollection* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct xds_core_v3_CollectionEntry**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_resize_entries(envoy_config_listener_v3_ListenerCollection* msg, size_t len, upb_Arena* arena) { - return (struct xds_core_v3_CollectionEntry**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_resize_entries(envoy_config_listener_v3_ListenerCollection* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct xds_core_v3_CollectionEntry**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_listener_v3_ListenerCollection_add_entries(envoy_config_listener_v3_ListenerCollection* msg, upb_Arena* arena) { - struct xds_core_v3_CollectionEntry* sub = (struct xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_core_v3_CollectionEntry* sub = (struct xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.listener.v3.Listener */ UPB_INLINE envoy_config_listener_v3_Listener* envoy_config_listener_v3_Listener_new(upb_Arena* arena) { - return (envoy_config_listener_v3_Listener*)_upb_Message_New(&envoy_config_listener_v3_Listener_msginit, arena); + return (envoy_config_listener_v3_Listener*)_upb_Message_New(&envoy_config_listener_v3_Listener_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_Listener* envoy_config_listener_v3_Listener_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_Listener* ret = envoy_config_listener_v3_Listener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -245,7 +275,7 @@ UPB_INLINE envoy_config_listener_v3_Listener* envoy_config_listener_v3_Listener_ int options, upb_Arena* arena) { envoy_config_listener_v3_Listener* ret = envoy_config_listener_v3_Listener_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -253,13 +283,13 @@ UPB_INLINE envoy_config_listener_v3_Listener* envoy_config_listener_v3_Listener_ } UPB_INLINE char* envoy_config_listener_v3_Listener_serialize(const envoy_config_listener_v3_Listener* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -267,591 +297,856 @@ typedef enum { envoy_config_listener_v3_Listener_listener_specifier_NOT_SET = 0 } envoy_config_listener_v3_Listener_listener_specifier_oneofcases; UPB_INLINE envoy_config_listener_v3_Listener_listener_specifier_oneofcases envoy_config_listener_v3_Listener_listener_specifier_case(const envoy_config_listener_v3_Listener* msg) { - return (envoy_config_listener_v3_Listener_listener_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + const upb_MiniTableField field = {27, UPB_SIZE(116, 232), UPB_SIZE(-97, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_Listener_listener_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_name(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_listener_v3_Listener_clear_name(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(120, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_Listener_name(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(120, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_address(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_address(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_address(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const struct envoy_config_core_v3_Address*); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_filter_chains(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_listener_v3_FilterChain* const* envoy_config_listener_v3_Listener_filter_chains(const envoy_config_listener_v3_Listener* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_listener_v3_FilterChain* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chains(const envoy_config_listener_v3_Listener* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 48)); + size_t size; + envoy_config_listener_v3_Listener_filter_chains(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_filter_chains(const envoy_config_listener_v3_Listener* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 48)); -} -UPB_INLINE const struct envoy_config_listener_v3_FilterChain* const* envoy_config_listener_v3_Listener_filter_chains(const envoy_config_listener_v3_Listener* msg, size_t* len) { - return (const struct envoy_config_listener_v3_FilterChain* const*)_upb_array_accessor(msg, UPB_SIZE(36, 48), len); -} -UPB_INLINE bool envoy_config_listener_v3_Listener_has_use_original_dst(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_use_original_dst(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_use_original_dst(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_use_original_dst(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_use_original_dst(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 64), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 64), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_metadata(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 64), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_metadata(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_metadata(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_metadata(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_deprecated_v1(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_metadata(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_deprecated_v1(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_deprecated_v1(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 80), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_deprecated_v1(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const envoy_config_listener_v3_Listener_DeprecatedV1*); + const envoy_config_listener_v3_Listener_DeprecatedV1* default_val = NULL; + const envoy_config_listener_v3_Listener_DeprecatedV1* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 80), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_drain_type(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_listener_v3_Listener_has_deprecated_v1(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 80), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_drain_type(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_listener_v3_Listener_drain_type(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {8, UPB_SIZE(28, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_listener_filters(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_listener_v3_ListenerFilter* const* envoy_config_listener_v3_Listener_listener_filters(const envoy_config_listener_v3_Listener* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_listener_v3_ListenerFilter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters(const envoy_config_listener_v3_Listener* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 88)); + size_t size; + envoy_config_listener_v3_Listener_listener_filters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_listener_filters(const envoy_config_listener_v3_Listener* msg) { - _upb_array_detach(msg, UPB_SIZE(56, 88)); -} -UPB_INLINE const struct envoy_config_listener_v3_ListenerFilter* const* envoy_config_listener_v3_Listener_listener_filters(const envoy_config_listener_v3_Listener* msg, size_t* len) { - return (const struct envoy_config_listener_v3_ListenerFilter* const*)_upb_array_accessor(msg, UPB_SIZE(56, 88), len); -} -UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 6); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_transparent(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_transparent(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 96), 6, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_transparent(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {10, UPB_SIZE(36, 96), 6, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_freebind(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 96), 6, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_freebind(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_freebind(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 104), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_freebind(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {11, UPB_SIZE(40, 104), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_freebind(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 104), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 112), 8, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {12, UPB_SIZE(44, 112), 8, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 112), 8, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_socket_options(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(48, 120), 0, 10, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_listener_v3_Listener_socket_options(const envoy_config_listener_v3_Listener* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(48, 120), 0, 10, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_Listener_has_socket_options(const envoy_config_listener_v3_Listener* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 120)); + size_t size; + envoy_config_listener_v3_Listener_socket_options(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_socket_options(const envoy_config_listener_v3_Listener* msg) { - _upb_array_detach(msg, UPB_SIZE(72, 120)); -} -UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_listener_v3_Listener_socket_options(const envoy_config_listener_v3_Listener* msg, size_t* len) { - return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(72, 120), len); -} -UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 9); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_listener_filters_timeout(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(52, 128), 9, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_Listener_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {15, UPB_SIZE(52, 128), 9, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_traffic_direction(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(52, 128), 9, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_traffic_direction(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(56, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_listener_v3_Listener_traffic_direction(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {16, UPB_SIZE(56, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_continue_on_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_continue_on_listener_filters_timeout(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(60, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_listener_v3_Listener_continue_on_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {17, UPB_SIZE(60, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 10); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_udp_listener_config(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_udp_listener_config(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(64, 136), 10, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_udp_listener_config(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const struct envoy_config_listener_v3_UdpListenerConfig*); + const struct envoy_config_listener_v3_UdpListenerConfig* default_val = NULL; + const struct envoy_config_listener_v3_UdpListenerConfig* ret; + const upb_MiniTableField field = {18, UPB_SIZE(64, 136), 10, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_api_listener(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(64, 136), 10, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_api_listener(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_api_listener(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(68, 144), 11, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_api_listener(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const struct envoy_config_listener_v3_ApiListener*); + const struct envoy_config_listener_v3_ApiListener* default_val = NULL; + const struct envoy_config_listener_v3_ApiListener* ret; + const upb_MiniTableField field = {19, UPB_SIZE(68, 144), 11, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_connection_balance_config(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 12); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_api_listener(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(68, 144), 11, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_connection_balance_config(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(88, 152), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_connection_balance_config(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(72, 152), 12, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_connection_balance_config(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(88, 152), const envoy_config_listener_v3_Listener_ConnectionBalanceConfig*); + const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* default_val = NULL; + const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* ret; + const upb_MiniTableField field = {20, UPB_SIZE(72, 152), 12, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_reuse_port(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = 0; +UPB_INLINE bool envoy_config_listener_v3_Listener_has_connection_balance_config(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(72, 152), 12, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_reuse_port(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(76, 13), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_listener_v3_Listener_reuse_port(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {21, UPB_SIZE(76, 13), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_access_log(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(80, 160), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_listener_v3_Listener_access_log(const envoy_config_listener_v3_Listener* msg, size_t* size) { + const upb_MiniTableField field = {22, UPB_SIZE(80, 160), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_Listener_has_access_log(const envoy_config_listener_v3_Listener* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 160)); + size_t size; + envoy_config_listener_v3_Listener_access_log(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_access_log(const envoy_config_listener_v3_Listener* msg) { - _upb_array_detach(msg, UPB_SIZE(92, 160)); -} -UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_listener_v3_Listener_access_log(const envoy_config_listener_v3_Listener* msg, size_t* len) { - return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(92, 160), len); -} -UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 13); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_tcp_backlog_size(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_tcp_backlog_size(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(84, 168), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_backlog_size(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {24, UPB_SIZE(84, 168), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_default_filter_chain(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(84, 168), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_default_filter_chain(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(100, 176), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_default_filter_chain(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(88, 176), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_default_filter_chain(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), const struct envoy_config_listener_v3_FilterChain*); + const struct envoy_config_listener_v3_FilterChain* default_val = NULL; + const struct envoy_config_listener_v3_FilterChain* ret; + const upb_MiniTableField field = {25, UPB_SIZE(88, 176), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_bind_to_port(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 15); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_default_filter_chain(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(88, 176), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_bind_to_port(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_bind_to_port(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(92, 184), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_bind_to_port(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {26, UPB_SIZE(92, 184), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_internal_listener(const envoy_config_listener_v3_Listener* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 27; +UPB_INLINE bool envoy_config_listener_v3_Listener_has_bind_to_port(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(92, 184), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_internal_listener(const envoy_config_listener_v3_Listener* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(128, 232), 0, UPB_SIZE(16, 16), envoy_config_listener_v3_Listener_listener_specifier_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_Listener_clear_internal_listener(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(116, 232), UPB_SIZE(-97, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_internal_listener(const envoy_config_listener_v3_Listener* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(128, 232), UPB_SIZE(16, 16), 27, NULL); + const envoy_config_listener_v3_Listener_InternalListenerConfig* default_val = NULL; + const envoy_config_listener_v3_Listener_InternalListenerConfig* ret; + const upb_MiniTableField field = {27, UPB_SIZE(116, 232), UPB_SIZE(-97, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_stat_prefix(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 192), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_listener_v3_Listener_has_internal_listener(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(116, 232), UPB_SIZE(-97, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_stat_prefix(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(128, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_Listener_stat_prefix(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(108, 192), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {28, UPB_SIZE(128, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 16); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_enable_reuse_port(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(100, 208), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {29, UPB_SIZE(100, 208), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_enable_mptcp(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0; +UPB_INLINE bool envoy_config_listener_v3_Listener_has_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(100, 208), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_enable_mptcp(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(104, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_listener_v3_Listener_enable_mptcp(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {30, UPB_SIZE(104, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_Listener_clear_ignore_global_conn_limit(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = 0; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_ignore_global_conn_limit(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(105, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_listener_v3_Listener_ignore_global_conn_limit(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {31, UPB_SIZE(105, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chain_matcher(const envoy_config_listener_v3_Listener* msg) { - return _upb_hasbit(msg, 17); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_filter_chain_matcher(const envoy_config_listener_v3_Listener* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_clear_filter_chain_matcher(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(108, 216), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher* envoy_config_listener_v3_Listener_filter_chain_matcher(const envoy_config_listener_v3_Listener* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const struct xds_type_matcher_v3_Matcher*); + const struct xds_type_matcher_v3_Matcher* default_val = NULL; + const struct xds_type_matcher_v3_Matcher* ret; + const upb_MiniTableField field = {32, UPB_SIZE(108, 216), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chain_matcher(const envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(108, 216), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_Listener_clear_additional_addresses(envoy_config_listener_v3_Listener* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(112, 224), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_listener_v3_AdditionalAddress* const* envoy_config_listener_v3_Listener_additional_addresses(const envoy_config_listener_v3_Listener* msg, size_t* size) { + const upb_MiniTableField field = {33, UPB_SIZE(112, 224), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_listener_v3_AdditionalAddress* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_Listener_has_additional_addresses(const envoy_config_listener_v3_Listener* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(124, 224)); -} -UPB_INLINE void envoy_config_listener_v3_Listener_clear_additional_addresses(const envoy_config_listener_v3_Listener* msg) { - _upb_array_detach(msg, UPB_SIZE(124, 224)); -} -UPB_INLINE const envoy_config_listener_v3_AdditionalAddress* const* envoy_config_listener_v3_Listener_additional_addresses(const envoy_config_listener_v3_Listener* msg, size_t* len) { - return (const envoy_config_listener_v3_AdditionalAddress* const*)_upb_array_accessor(msg, UPB_SIZE(124, 224), len); + size_t size; + envoy_config_listener_v3_Listener_additional_addresses(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_listener_v3_Listener_set_name(envoy_config_listener_v3_Listener *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(120, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Listener_set_address(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Address* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), struct envoy_config_core_v3_Address*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_mutable_address(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_listener_v3_Listener_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_address(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_mutable_filter_chains(envoy_config_listener_v3_Listener* msg, size_t* len) { - return (struct envoy_config_listener_v3_FilterChain**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 48), len); +UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_mutable_filter_chains(envoy_config_listener_v3_Listener* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_listener_v3_FilterChain**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_resize_filter_chains(envoy_config_listener_v3_Listener* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_listener_v3_FilterChain**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_resize_filter_chains(envoy_config_listener_v3_Listener* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_listener_v3_FilterChain**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_add_filter_chains(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { - struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_use_original_dst(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(40, 56), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 56), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_use_original_dst(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_use_original_dst(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_use_original_dst(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_use_original_dst(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(44, 64), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 64), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_metadata(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(48, 72), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_mutable_metadata(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_Listener_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_metadata(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_deprecated_v1(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_DeprecatedV1* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(52, 80), envoy_config_listener_v3_Listener_DeprecatedV1*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 80), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_mutable_deprecated_v1(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_listener_v3_Listener_DeprecatedV1* sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)envoy_config_listener_v3_Listener_deprecated_v1(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_Message_New(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_deprecated_v1(msg, sub); + sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_Message_New(&envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_deprecated_v1(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_drain_type(envoy_config_listener_v3_Listener *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {8, UPB_SIZE(28, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_mutable_listener_filters(envoy_config_listener_v3_Listener* msg, size_t* len) { - return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 88), len); +UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_mutable_listener_filters(envoy_config_listener_v3_Listener* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_resize_listener_filters(envoy_config_listener_v3_Listener* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_listener_v3_ListenerFilter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 88), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_resize_listener_filters(envoy_config_listener_v3_Listener* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_listener_v3_ListenerFilter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Listener_add_listener_filters(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { - struct envoy_config_listener_v3_ListenerFilter* sub = (struct envoy_config_listener_v3_ListenerFilter*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 88), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_listener_v3_ListenerFilter* sub = (struct envoy_config_listener_v3_ListenerFilter*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_transparent(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {10, UPB_SIZE(36, 96), 6, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_transparent(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_transparent(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_transparent(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_transparent(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_freebind(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(64, 104), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(40, 104), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_freebind(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_freebind(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_freebind(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_freebind(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {12, UPB_SIZE(44, 112), 8, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_mutable_socket_options(envoy_config_listener_v3_Listener* msg, size_t* len) { - return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(72, 120), len); +UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_mutable_socket_options(envoy_config_listener_v3_Listener* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(48, 120), 0, 10, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_SocketOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_resize_socket_options(envoy_config_listener_v3_Listener* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_SocketOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(72, 120), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_resize_socket_options(envoy_config_listener_v3_Listener* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(48, 120), 0, 10, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_SocketOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_listener_v3_Listener_add_socket_options(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { - struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(72, 120), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(48, 120), 0, 10, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(76, 128), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(52, 128), 9, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_Listener_mutable_listener_filters_timeout(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_Listener_listener_filters_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_listener_filters_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_listener_filters_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_traffic_direction(envoy_config_listener_v3_Listener *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {16, UPB_SIZE(56, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Listener_set_continue_on_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; + const upb_MiniTableField field = {17, UPB_SIZE(60, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_listener_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_UdpListenerConfig* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(80, 136), struct envoy_config_listener_v3_UdpListenerConfig*) = value; + const upb_MiniTableField field = {18, UPB_SIZE(64, 136), 10, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_mutable_udp_listener_config(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_listener_v3_UdpListenerConfig* sub = (struct envoy_config_listener_v3_UdpListenerConfig*)envoy_config_listener_v3_Listener_udp_listener_config(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_UdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_udp_listener_config(msg, sub); + sub = (struct envoy_config_listener_v3_UdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_UdpListenerConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_udp_listener_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_api_listener(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_ApiListener* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(84, 144), struct envoy_config_listener_v3_ApiListener*) = value; + const upb_MiniTableField field = {19, UPB_SIZE(68, 144), 11, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_mutable_api_listener(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_listener_v3_ApiListener* sub = (struct envoy_config_listener_v3_ApiListener*)envoy_config_listener_v3_Listener_api_listener(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_ApiListener*)_upb_Message_New(&envoy_config_listener_v3_ApiListener_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_api_listener(msg, sub); + sub = (struct envoy_config_listener_v3_ApiListener*)_upb_Message_New(&envoy_config_listener_v3_ApiListener_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_api_listener(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_connection_balance_config(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(88, 152), envoy_config_listener_v3_Listener_ConnectionBalanceConfig*) = value; + const upb_MiniTableField field = {20, UPB_SIZE(72, 152), 12, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_mutable_connection_balance_config(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)envoy_config_listener_v3_Listener_connection_balance_config(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_connection_balance_config(msg, sub); + sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_connection_balance_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_reuse_port(envoy_config_listener_v3_Listener *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value; + const upb_MiniTableField field = {21, UPB_SIZE(76, 13), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_mutable_access_log(envoy_config_listener_v3_Listener* msg, size_t* len) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 160), len); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_mutable_access_log(envoy_config_listener_v3_Listener* msg, size_t* size) { + upb_MiniTableField field = {22, UPB_SIZE(80, 160), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_resize_access_log(envoy_config_listener_v3_Listener* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(92, 160), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_resize_access_log(envoy_config_listener_v3_Listener* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {22, UPB_SIZE(80, 160), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_accesslog_v3_AccessLog**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_listener_v3_Listener_add_access_log(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { - struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(92, 160), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {22, UPB_SIZE(80, 160), 0, 15, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(96, 168), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {24, UPB_SIZE(84, 168), 13, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_backlog_size(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_backlog_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_tcp_backlog_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_tcp_backlog_size(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_default_filter_chain(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_FilterChain* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(100, 176), struct envoy_config_listener_v3_FilterChain*) = value; + const upb_MiniTableField field = {25, UPB_SIZE(88, 176), 14, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_mutable_default_filter_chain(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)envoy_config_listener_v3_Listener_default_filter_chain(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_default_filter_chain(msg, sub); + sub = (struct envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_default_filter_chain(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_bind_to_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(104, 184), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {26, UPB_SIZE(92, 184), 15, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_bind_to_port(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_bind_to_port(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_bind_to_port(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_bind_to_port(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_internal_listener(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_InternalListenerConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(128, 232), value, UPB_SIZE(16, 16), 27); + const upb_MiniTableField field = {27, UPB_SIZE(116, 232), UPB_SIZE(-97, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_mutable_internal_listener(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct envoy_config_listener_v3_Listener_InternalListenerConfig* sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)envoy_config_listener_v3_Listener_internal_listener(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_internal_listener(msg, sub); + sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_internal_listener(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_stat_prefix(envoy_config_listener_v3_Listener *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 192), upb_StringView) = value; + const upb_MiniTableField field = {28, UPB_SIZE(128, 192), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Listener_set_enable_reuse_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(116, 208), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {29, UPB_SIZE(100, 208), 16, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_enable_reuse_port(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_enable_reuse_port(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_enable_reuse_port(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_enable_reuse_port(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_set_enable_mptcp(envoy_config_listener_v3_Listener *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; + const upb_MiniTableField field = {30, UPB_SIZE(104, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Listener_set_ignore_global_conn_limit(envoy_config_listener_v3_Listener *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value; + const upb_MiniTableField field = {31, UPB_SIZE(105, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Listener_set_filter_chain_matcher(envoy_config_listener_v3_Listener *msg, struct xds_type_matcher_v3_Matcher* value) { - _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(120, 216), struct xds_type_matcher_v3_Matcher*) = value; + const upb_MiniTableField field = {32, UPB_SIZE(108, 216), 17, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher* envoy_config_listener_v3_Listener_mutable_filter_chain_matcher(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)envoy_config_listener_v3_Listener_filter_chain_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_set_filter_chain_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_set_filter_chain_matcher(msg, sub); } return sub; } -UPB_INLINE envoy_config_listener_v3_AdditionalAddress** envoy_config_listener_v3_Listener_mutable_additional_addresses(envoy_config_listener_v3_Listener* msg, size_t* len) { - return (envoy_config_listener_v3_AdditionalAddress**)_upb_array_mutable_accessor(msg, UPB_SIZE(124, 224), len); +UPB_INLINE envoy_config_listener_v3_AdditionalAddress** envoy_config_listener_v3_Listener_mutable_additional_addresses(envoy_config_listener_v3_Listener* msg, size_t* size) { + upb_MiniTableField field = {33, UPB_SIZE(112, 224), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_listener_v3_AdditionalAddress**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_listener_v3_AdditionalAddress** envoy_config_listener_v3_Listener_resize_additional_addresses(envoy_config_listener_v3_Listener* msg, size_t len, upb_Arena* arena) { - return (envoy_config_listener_v3_AdditionalAddress**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(124, 224), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_listener_v3_AdditionalAddress** envoy_config_listener_v3_Listener_resize_additional_addresses(envoy_config_listener_v3_Listener* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {33, UPB_SIZE(112, 224), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_AdditionalAddress**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_listener_v3_AdditionalAddress* envoy_config_listener_v3_Listener_add_additional_addresses(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) { - struct envoy_config_listener_v3_AdditionalAddress* sub = (struct envoy_config_listener_v3_AdditionalAddress*)_upb_Message_New(&envoy_config_listener_v3_AdditionalAddress_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(124, 224), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {33, UPB_SIZE(112, 224), 0, 22, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_listener_v3_AdditionalAddress* sub = (struct envoy_config_listener_v3_AdditionalAddress*)_upb_Message_New(&envoy_config_listener_v3_AdditionalAddress_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.listener.v3.Listener.DeprecatedV1 */ UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_DeprecatedV1_new(upb_Arena* arena) { - return (envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_Message_New(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena); + return (envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_Message_New(&envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_DeprecatedV1_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_Listener_DeprecatedV1* ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -861,7 +1156,7 @@ UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener int options, upb_Arena* arena) { envoy_config_listener_v3_Listener_DeprecatedV1* ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -869,35 +1164,40 @@ UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener } UPB_INLINE char* envoy_config_listener_v3_Listener_DeprecatedV1_serialize(const envoy_config_listener_v3_Listener_DeprecatedV1* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msg_init, 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); -} -UPB_INLINE void envoy_config_listener_v3_Listener_DeprecatedV1_clear_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_Listener_DeprecatedV1_clear_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_DeprecatedV1_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_Listener_DeprecatedV1_has_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1 *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_DeprecatedV1_mutable_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_DeprecatedV1_bind_to_port(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(msg, sub); } return sub; } @@ -905,12 +1205,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_D /* envoy.config.listener.v3.Listener.ConnectionBalanceConfig */ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(upb_Arena* arena) { - return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena); + return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_Listener_ConnectionBalanceConfig* ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -920,7 +1220,7 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_conf int options, upb_Arena* arena) { envoy_config_listener_v3_Listener_ConnectionBalanceConfig* ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -928,13 +1228,13 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_conf } UPB_INLINE char* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -943,48 +1243,61 @@ typedef enum { envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_NOT_SET = 0 } envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases; UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_case(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_listener_v3_Listener_ConnectionBalanceConfig_has_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_clear_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_clear_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* default_val = NULL; + const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Listener_ConnectionBalanceConfig_has_extend_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_listener_v3_Listener_ConnectionBalanceConfig_has_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_clear_extend_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_clear_extend_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_extend_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_Listener_ConnectionBalanceConfig_has_extend_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* value) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_mutable_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg, upb_Arena* arena) { struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)envoy_config_listener_v3_Listener_ConnectionBalanceConfig_exact_balance(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(msg, sub); + sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_extend_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_mutable_extend_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_Listener_ConnectionBalanceConfig_extend_balance(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_extend_balance(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_extend_balance(msg, sub); } return sub; } @@ -992,12 +1305,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listen /* envoy.config.listener.v3.Listener.ConnectionBalanceConfig.ExactBalance */ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(upb_Arena* arena) { - return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena); + return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1007,7 +1320,7 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalanc int options, upb_Arena* arena) { envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1015,13 +1328,13 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalanc } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msg_init, options, arena, &ptr, len); return ptr; } @@ -1029,12 +1342,12 @@ UPB_INLINE char* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_Exact /* envoy.config.listener.v3.Listener.InternalListenerConfig */ UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_InternalListenerConfig_new(upb_Arena* arena) { - return (envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena); + return (envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_InternalListenerConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_Listener_InternalListenerConfig* ret = envoy_config_listener_v3_Listener_InternalListenerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1044,7 +1357,7 @@ UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_confi int options, upb_Arena* arena) { envoy_config_listener_v3_Listener_InternalListenerConfig* ret = envoy_config_listener_v3_Listener_InternalListenerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1052,13 +1365,13 @@ UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_confi } UPB_INLINE char* envoy_config_listener_v3_Listener_InternalListenerConfig_serialize(const envoy_config_listener_v3_Listener_InternalListenerConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msg_init, options, arena, &ptr, len); return ptr; } @@ -1066,12 +1379,12 @@ UPB_INLINE char* envoy_config_listener_v3_Listener_InternalListenerConfig_serial /* envoy.config.listener.v3.ListenerManager */ UPB_INLINE envoy_config_listener_v3_ListenerManager* envoy_config_listener_v3_ListenerManager_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ListenerManager*)_upb_Message_New(&envoy_config_listener_v3_ListenerManager_msginit, arena); + return (envoy_config_listener_v3_ListenerManager*)_upb_Message_New(&envoy_config_listener_v3_ListenerManager_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ListenerManager* envoy_config_listener_v3_ListenerManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ListenerManager* ret = envoy_config_listener_v3_ListenerManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1081,7 +1394,7 @@ UPB_INLINE envoy_config_listener_v3_ListenerManager* envoy_config_listener_v3_Li int options, upb_Arena* arena) { envoy_config_listener_v3_ListenerManager* ret = envoy_config_listener_v3_ListenerManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1089,13 +1402,13 @@ UPB_INLINE envoy_config_listener_v3_ListenerManager* envoy_config_listener_v3_Li } UPB_INLINE char* envoy_config_listener_v3_ListenerManager_serialize(const envoy_config_listener_v3_ListenerManager* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerManager_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_listener_v3_ListenerManager_serialize_ex(const envoy_config_listener_v3_ListenerManager* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerManager_msg_init, options, arena, &ptr, len); return ptr; } @@ -1103,12 +1416,12 @@ UPB_INLINE char* envoy_config_listener_v3_ListenerManager_serialize_ex(const env /* envoy.config.listener.v3.ValidationListenerManager */ UPB_INLINE envoy_config_listener_v3_ValidationListenerManager* envoy_config_listener_v3_ValidationListenerManager_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ValidationListenerManager*)_upb_Message_New(&envoy_config_listener_v3_ValidationListenerManager_msginit, arena); + return (envoy_config_listener_v3_ValidationListenerManager*)_upb_Message_New(&envoy_config_listener_v3_ValidationListenerManager_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ValidationListenerManager* envoy_config_listener_v3_ValidationListenerManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ValidationListenerManager* ret = envoy_config_listener_v3_ValidationListenerManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ValidationListenerManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ValidationListenerManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1118,7 +1431,7 @@ UPB_INLINE envoy_config_listener_v3_ValidationListenerManager* envoy_config_list int options, upb_Arena* arena) { envoy_config_listener_v3_ValidationListenerManager* ret = envoy_config_listener_v3_ValidationListenerManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ValidationListenerManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ValidationListenerManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1126,13 +1439,13 @@ UPB_INLINE envoy_config_listener_v3_ValidationListenerManager* envoy_config_list } UPB_INLINE char* envoy_config_listener_v3_ValidationListenerManager_serialize(const envoy_config_listener_v3_ValidationListenerManager* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ValidationListenerManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ValidationListenerManager_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_listener_v3_ValidationListenerManager_serialize_ex(const envoy_config_listener_v3_ValidationListenerManager* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ValidationListenerManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ValidationListenerManager_msg_init, options, arena, &ptr, len); return ptr; } @@ -1140,12 +1453,12 @@ UPB_INLINE char* envoy_config_listener_v3_ValidationListenerManager_serialize_ex /* envoy.config.listener.v3.ApiListenerManager */ UPB_INLINE envoy_config_listener_v3_ApiListenerManager* envoy_config_listener_v3_ApiListenerManager_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ApiListenerManager*)_upb_Message_New(&envoy_config_listener_v3_ApiListenerManager_msginit, arena); + return (envoy_config_listener_v3_ApiListenerManager*)_upb_Message_New(&envoy_config_listener_v3_ApiListenerManager_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ApiListenerManager* envoy_config_listener_v3_ApiListenerManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ApiListenerManager* ret = envoy_config_listener_v3_ApiListenerManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListenerManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListenerManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1155,7 +1468,7 @@ UPB_INLINE envoy_config_listener_v3_ApiListenerManager* envoy_config_listener_v3 int options, upb_Arena* arena) { envoy_config_listener_v3_ApiListenerManager* ret = envoy_config_listener_v3_ApiListenerManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListenerManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListenerManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1163,23 +1476,23 @@ UPB_INLINE envoy_config_listener_v3_ApiListenerManager* envoy_config_listener_v3 } UPB_INLINE char* envoy_config_listener_v3_ApiListenerManager_serialize(const envoy_config_listener_v3_ApiListenerManager* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListenerManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListenerManager_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_listener_v3_ApiListenerManager_serialize_ex(const envoy_config_listener_v3_ApiListenerManager* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListenerManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListenerManager_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_config_listener_v3_listener_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_listener_v3_listener_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_ */ 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 b5b035b8df4..8d36175ae01 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/listener/v3/listener_components.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/base.upb.h" @@ -21,159 +23,234 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_listener_v3_Filter_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_Filter_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_Filter__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_Filter__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_Filter_msginit = { +const upb_MiniTable envoy_config_listener_v3_Filter_msg_init = { &envoy_config_listener_v3_Filter_submsgs[0], &envoy_config_listener_v3_Filter__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0018000004000022, &upb_pom_1bt_maxmaxb}, + {0x001800000501002a, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChainMatch_submsgs[5] = { - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_FilterChainMatch_submsgs[5] = { + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_FilterChainMatch__fields[11] = { - {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 56), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(44, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(48, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(52, 96), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_FilterChainMatch__fields[11] = { + {3, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 48), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 56), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(28, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(36, 96), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_FilterChainMatch_msginit = { +const upb_MiniTable envoy_config_listener_v3_FilterChainMatch_msg_init = { &envoy_config_listener_v3_FilterChainMatch_submsgs[0], &envoy_config_listener_v3_FilterChainMatch__fields[0], - UPB_SIZE(56, 104), 11, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(56, 104), 11, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00001a, &upb_prm_1bt_maxmaxb}, + {0x001000003f000022, &upb_pss_1bt}, + {0x002000000101002a, &upb_psm_1bt_maxmaxb}, + {0x002800003f020032, &upb_prm_1bt_maxmaxb}, + {0x003000003f00003a, &upb_ppv4_1bt}, + {0x0038000002030042, &upb_psm_1bt_maxmaxb}, + {0x004000003f00004a, &upb_pss_1bt}, + {0x005000003f000052, &upb_prs_1bt}, + {0x005800003f00005a, &upb_prs_1bt}, + {0x000400003f000060, &upb_psv4_1bt}, + {0x006000003f04006a, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChain_submsgs[7] = { - {.submsg = &envoy_config_listener_v3_FilterChainMatch_msginit}, - {.submsg = &envoy_config_listener_v3_Filter_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &envoy_config_core_v3_TransportSocket_msginit}, - {.submsg = &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_FilterChain_submsgs[7] = { + {.submsg = &envoy_config_listener_v3_FilterChainMatch_msg_init}, + {.submsg = &envoy_config_listener_v3_Filter_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &envoy_config_core_v3_TransportSocket_msg_init}, + {.submsg = &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_FilterChain__fields[8] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 32), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(20, 40), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 64), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 72), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_FilterChain__fields[8] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 32), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 40), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 64), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 72), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_FilterChain_msginit = { +const upb_MiniTable envoy_config_listener_v3_FilterChain_msg_init = { &envoy_config_listener_v3_FilterChain_submsgs[0], &envoy_config_listener_v3_FilterChain__fields[0], - UPB_SIZE(40, 80), 8, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(40, 80), 8, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f01001a, &upb_prm_1bt_max64b}, + {0x0018000002020022, &upb_psm_1bt_maxmaxb}, + {0x002000000303002a, &upb_psm_1bt_maxmaxb}, + {0x0028000004040032, &upb_psm_1bt_maxmaxb}, + {0x003000003f00003a, &upb_pss_1bt}, + {0x0040000005050042, &upb_psm_1bt_max64b}, + {0x004800000606004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit = { +const upb_MiniTable envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init = { &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[0], &envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[4] = { - {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit}, - {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit}, - {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit}, - {.submsg = &envoy_type_v3_Int32Range_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[4] = { + {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init}, + {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init}, + {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init}, + {.submsg = &envoy_type_v3_Int32Range_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[5] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit = { +const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init = { &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[0], &envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[0], - UPB_SIZE(8, 16), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(8, 16), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004000020, &upb_pob1_1bt}, + {0x000800000503002a, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = { - {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = { + {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit = { +const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init = { &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[0], &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilter_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit}, - {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_ListenerFilter_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init}, + {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilter__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_ListenerFilter__fields[4] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msginit = { +const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msg_init = { &envoy_config_listener_v3_ListenerFilter_submsgs[0], &envoy_config_listener_v3_ListenerFilter__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000040300001a, &upb_pom_1bt_maxmaxb}, + {0x0018000001010022, &upb_psm_1bt_max64b}, + {0x002000040502002a, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[7] = { - &envoy_config_listener_v3_Filter_msginit, - &envoy_config_listener_v3_FilterChainMatch_msginit, - &envoy_config_listener_v3_FilterChain_msginit, - &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, - &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, - &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, - &envoy_config_listener_v3_ListenerFilter_msginit, + &envoy_config_listener_v3_Filter_msg_init, + &envoy_config_listener_v3_FilterChainMatch_msg_init, + &envoy_config_listener_v3_FilterChain_msg_init, + &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, + &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, + &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, + &envoy_config_listener_v3_ListenerFilter_msg_init, }; -const upb_MiniTable_File envoy_config_listener_v3_listener_components_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_listener_v3_listener_components_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -182,5 +259,5 @@ const upb_MiniTable_File envoy_config_listener_v3_listener_components_proto_upb_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 3052fb84ee8..ebf20ffafd3 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 @@ -9,24 +9,22 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_ #define ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_listener_v3_Filter; -struct envoy_config_listener_v3_FilterChainMatch; -struct envoy_config_listener_v3_FilterChain; -struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration; -struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate; -struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet; -struct envoy_config_listener_v3_ListenerFilter; typedef struct envoy_config_listener_v3_Filter envoy_config_listener_v3_Filter; typedef struct envoy_config_listener_v3_FilterChainMatch envoy_config_listener_v3_FilterChainMatch; typedef struct envoy_config_listener_v3_FilterChain envoy_config_listener_v3_FilterChain; @@ -34,13 +32,13 @@ typedef struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration envoy_ typedef struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate envoy_config_listener_v3_ListenerFilterChainMatchPredicate; typedef struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet; typedef struct envoy_config_listener_v3_ListenerFilter envoy_config_listener_v3_ListenerFilter; -extern const upb_MiniTable envoy_config_listener_v3_Filter_msginit; -extern const upb_MiniTable envoy_config_listener_v3_FilterChainMatch_msginit; -extern const upb_MiniTable envoy_config_listener_v3_FilterChain_msginit; -extern const upb_MiniTable envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msginit; +extern const upb_MiniTable envoy_config_listener_v3_Filter_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_FilterChainMatch_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_FilterChain_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msg_init; struct envoy_config_core_v3_CidrRange; struct envoy_config_core_v3_ExtensionConfigSource; struct envoy_config_core_v3_Metadata; @@ -50,15 +48,15 @@ struct google_protobuf_Any; struct google_protobuf_BoolValue; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit; -extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit; -extern const upb_MiniTable envoy_type_v3_Int32Range_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_CidrRange_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msg_init; +extern const upb_MiniTable envoy_type_v3_Int32Range_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_config_listener_v3_FilterChainMatch_ANY = 0, @@ -71,12 +69,12 @@ typedef enum { /* envoy.config.listener.v3.Filter */ UPB_INLINE envoy_config_listener_v3_Filter* envoy_config_listener_v3_Filter_new(upb_Arena* arena) { - return (envoy_config_listener_v3_Filter*)_upb_Message_New(&envoy_config_listener_v3_Filter_msginit, arena); + return (envoy_config_listener_v3_Filter*)_upb_Message_New(&envoy_config_listener_v3_Filter_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_Filter* envoy_config_listener_v3_Filter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_Filter* ret = envoy_config_listener_v3_Filter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Filter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -86,7 +84,7 @@ UPB_INLINE envoy_config_listener_v3_Filter* envoy_config_listener_v3_Filter_pars int options, upb_Arena* arena) { envoy_config_listener_v3_Filter* ret = envoy_config_listener_v3_Filter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Filter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -94,13 +92,13 @@ UPB_INLINE envoy_config_listener_v3_Filter* envoy_config_listener_v3_Filter_pars } UPB_INLINE char* envoy_config_listener_v3_Filter_serialize(const envoy_config_listener_v3_Filter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Filter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Filter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_Filter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_Filter_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -109,57 +107,76 @@ typedef enum { envoy_config_listener_v3_Filter_config_type_NOT_SET = 0 } envoy_config_listener_v3_Filter_config_type_oneofcases; UPB_INLINE envoy_config_listener_v3_Filter_config_type_oneofcases envoy_config_listener_v3_Filter_config_type_case(const envoy_config_listener_v3_Filter* msg) { - return (envoy_config_listener_v3_Filter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_Filter_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Filter_clear_name(const envoy_config_listener_v3_Filter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_listener_v3_Filter_clear_name(envoy_config_listener_v3_Filter* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_Filter_name(const envoy_config_listener_v3_Filter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Filter_has_typed_config(const envoy_config_listener_v3_Filter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; -} -UPB_INLINE void envoy_config_listener_v3_Filter_clear_typed_config(const envoy_config_listener_v3_Filter* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Filter_config_type_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_Filter_clear_typed_config(envoy_config_listener_v3_Filter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_Filter_typed_config(const envoy_config_listener_v3_Filter* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 4, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_Filter_has_config_discovery(const envoy_config_listener_v3_Filter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_listener_v3_Filter_has_typed_config(const envoy_config_listener_v3_Filter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_Filter_clear_config_discovery(const envoy_config_listener_v3_Filter* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Filter_config_type_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_Filter_clear_config_discovery(envoy_config_listener_v3_Filter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_Filter_config_discovery(const envoy_config_listener_v3_Filter* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, NULL); + const struct envoy_config_core_v3_ExtensionConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ExtensionConfigSource* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_Filter_has_config_discovery(const envoy_config_listener_v3_Filter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_Filter_set_name(envoy_config_listener_v3_Filter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_Filter_set_typed_config(envoy_config_listener_v3_Filter *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_Filter_mutable_typed_config(envoy_config_listener_v3_Filter* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_Filter_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Filter_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_listener_v3_Filter_set_typed_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_Filter_set_config_discovery(envoy_config_listener_v3_Filter *msg, struct envoy_config_core_v3_ExtensionConfigSource* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_Filter_mutable_config_discovery(envoy_config_listener_v3_Filter* msg, upb_Arena* arena) { struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_config_listener_v3_Filter_config_discovery(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_Filter_set_config_discovery(msg, sub); + sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msg_init, arena); + if (sub) envoy_config_listener_v3_Filter_set_config_discovery(msg, sub); } return sub; } @@ -167,12 +184,12 @@ UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_liste /* envoy.config.listener.v3.FilterChainMatch */ UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChainMatch_new(upb_Arena* arena) { - return (envoy_config_listener_v3_FilterChainMatch*)_upb_Message_New(&envoy_config_listener_v3_FilterChainMatch_msginit, arena); + return (envoy_config_listener_v3_FilterChainMatch*)_upb_Message_New(&envoy_config_listener_v3_FilterChainMatch_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChainMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_FilterChainMatch* ret = envoy_config_listener_v3_FilterChainMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -182,7 +199,7 @@ UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_F int options, upb_Arena* arena) { envoy_config_listener_v3_FilterChainMatch* ret = envoy_config_listener_v3_FilterChainMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -190,205 +207,395 @@ UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_F } UPB_INLINE char* envoy_config_listener_v3_FilterChainMatch_serialize(const envoy_config_listener_v3_FilterChainMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_listener_v3_FilterChainMatch_prefix_ranges(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 8)); -} -UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); -} -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_address_suffix(const envoy_config_listener_v3_FilterChainMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_address_suffix(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_FilterChainMatch_address_suffix(const envoy_config_listener_v3_FilterChainMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_suffix_len(const envoy_config_listener_v3_FilterChainMatch* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_suffix_len(const envoy_config_listener_v3_FilterChainMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_suffix_len(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_suffix_len(const envoy_config_listener_v3_FilterChainMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_suffix_len(const envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); + size_t size; + envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_ports(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE uint32_t const* envoy_config_listener_v3_FilterChainMatch_source_ports(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_ports(const envoy_config_listener_v3_FilterChainMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 48)); +UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_source_ports(const envoy_config_listener_v3_FilterChainMatch* msg) { + size_t size; + envoy_config_listener_v3_FilterChainMatch_source_ports(msg, &size); + return size != 0; } -UPB_INLINE uint32_t const* envoy_config_listener_v3_FilterChainMatch_source_ports(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); -} -UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_destination_port(const envoy_config_listener_v3_FilterChainMatch* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_destination_port(const envoy_config_listener_v3_FilterChainMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_destination_port(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 56), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_destination_port(const envoy_config_listener_v3_FilterChainMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 56), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_transport_protocol(const envoy_config_listener_v3_FilterChainMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_destination_port(const envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 56), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_transport_protocol(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_FilterChainMatch_transport_protocol(const envoy_config_listener_v3_FilterChainMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_application_protocols(const envoy_config_listener_v3_FilterChainMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 80)); +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_listener_v3_FilterChainMatch_application_protocols(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE upb_StringView const* envoy_config_listener_v3_FilterChainMatch_application_protocols(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_server_names(const envoy_config_listener_v3_FilterChainMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 88)); +UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_application_protocols(const envoy_config_listener_v3_FilterChainMatch* msg) { + size_t size; + envoy_config_listener_v3_FilterChainMatch_application_protocols(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_listener_v3_FilterChainMatch_server_names(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_server_names(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(28, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_type(const envoy_config_listener_v3_FilterChainMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE upb_StringView const* envoy_config_listener_v3_FilterChainMatch_server_names(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(28, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_server_names(const envoy_config_listener_v3_FilterChainMatch* msg) { + size_t size; + envoy_config_listener_v3_FilterChainMatch_server_names(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_type(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_listener_v3_FilterChainMatch_source_type(const envoy_config_listener_v3_FilterChainMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {12, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(36, 96), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(36, 96), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); -} -UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 96)); -} -UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); + size_t size; + envoy_config_listener_v3_FilterChainMatch_direct_source_prefix_ranges(msg, &size); + return size != 0; } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, upb_Arena* arena) { - struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_address_suffix(envoy_config_listener_v3_FilterChainMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_mutable_suffix_len(envoy_config_listener_v3_FilterChainMatch* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_FilterChainMatch_suffix_len(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChainMatch_set_suffix_len(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChainMatch_set_suffix_len(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, upb_Arena* arena) { - struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_mutable_source_ports(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_mutable_source_ports(envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_resize_source_ports(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 48), len, 2, arena); +UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_resize_source_ports(envoy_config_listener_v3_FilterChainMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_source_ports(envoy_config_listener_v3_FilterChainMatch* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(16, 48), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_destination_port(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 56), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_mutable_destination_port(envoy_config_listener_v3_FilterChainMatch* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_FilterChainMatch_destination_port(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChainMatch_set_destination_port(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChainMatch_set_destination_port(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_transport_protocol(envoy_config_listener_v3_FilterChainMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value; + const upb_MiniTableField field = {9, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_mutable_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_mutable_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_resize_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_resize_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {10, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_mutable_server_names(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_mutable_server_names(envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(28, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_resize_server_names(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_resize_server_names(envoy_config_listener_v3_FilterChainMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(28, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_server_names(envoy_config_listener_v3_FilterChainMatch* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {11, UPB_SIZE(28, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_source_type(envoy_config_listener_v3_FilterChainMatch *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {12, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) { - return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(36, 96), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(36, 96), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch* msg, upb_Arena* arena) { - struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(36, 96), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.listener.v3.FilterChain */ UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_FilterChain_new(upb_Arena* arena) { - return (envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msginit, arena); + return (envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_FilterChain_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_FilterChain* ret = envoy_config_listener_v3_FilterChain_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -398,7 +605,7 @@ UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Filter int options, upb_Arena* arena) { envoy_config_listener_v3_FilterChain* ret = envoy_config_listener_v3_FilterChain_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -406,175 +613,236 @@ UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Filter } UPB_INLINE char* envoy_config_listener_v3_FilterChain_serialize(const envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msg_init, 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); -} -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_filter_chain_match(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_filter_chain_match(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChain_filter_chain_match(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_listener_v3_FilterChainMatch*); + const envoy_config_listener_v3_FilterChainMatch* default_val = NULL; + const envoy_config_listener_v3_FilterChainMatch* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filter_chain_match(const envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_filters(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_listener_v3_Filter* const* envoy_config_listener_v3_FilterChain_filters(const envoy_config_listener_v3_FilterChain* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_listener_v3_Filter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filters(const envoy_config_listener_v3_FilterChain* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_config_listener_v3_FilterChain_filters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_filters(const envoy_config_listener_v3_FilterChain* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_config_listener_v3_Filter* const* envoy_config_listener_v3_FilterChain_filters(const envoy_config_listener_v3_FilterChain* msg, size_t* len) { - return (const envoy_config_listener_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); -} -UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_use_proxy_proto(const envoy_config_listener_v3_FilterChain* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_use_proxy_proto(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_use_proxy_proto(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChain_use_proxy_proto(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_metadata(const envoy_config_listener_v3_FilterChain* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_use_proxy_proto(const envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_metadata(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_metadata(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_FilterChain_metadata(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket(const envoy_config_listener_v3_FilterChain* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_metadata(const envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_transport_socket(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_transport_socket(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_listener_v3_FilterChain_transport_socket(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_TransportSocket*); + const struct envoy_config_core_v3_TransportSocket* default_val = NULL; + const struct envoy_config_core_v3_TransportSocket* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_name(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket(const envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_name(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_FilterChain_name(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_on_demand_configuration(const envoy_config_listener_v3_FilterChain* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_on_demand_configuration(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_on_demand_configuration(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 64), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_on_demand_configuration(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_config_listener_v3_FilterChain_OnDemandConfiguration*); + const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* default_val = NULL; + const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 64), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_on_demand_configuration(const envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 64), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_transport_socket_connect_timeout(envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 72), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 72), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 72), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_filter_chain_match(envoy_config_listener_v3_FilterChain *msg, envoy_config_listener_v3_FilterChainMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_listener_v3_FilterChainMatch*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChain_mutable_filter_chain_match(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { struct envoy_config_listener_v3_FilterChainMatch* sub = (struct envoy_config_listener_v3_FilterChainMatch*)envoy_config_listener_v3_FilterChain_filter_chain_match(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_FilterChainMatch*)_upb_Message_New(&envoy_config_listener_v3_FilterChainMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_set_filter_chain_match(msg, sub); + sub = (struct envoy_config_listener_v3_FilterChainMatch*)_upb_Message_New(&envoy_config_listener_v3_FilterChainMatch_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_set_filter_chain_match(msg, sub); } return sub; } -UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_mutable_filters(envoy_config_listener_v3_FilterChain* msg, size_t* len) { - return (envoy_config_listener_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_mutable_filters(envoy_config_listener_v3_FilterChain* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_listener_v3_Filter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_resize_filters(envoy_config_listener_v3_FilterChain* msg, size_t len, upb_Arena* arena) { - return (envoy_config_listener_v3_Filter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_resize_filters(envoy_config_listener_v3_FilterChain* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_Filter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_listener_v3_Filter* envoy_config_listener_v3_FilterChain_add_filters(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { - struct envoy_config_listener_v3_Filter* sub = (struct envoy_config_listener_v3_Filter*)_upb_Message_New(&envoy_config_listener_v3_Filter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_listener_v3_Filter* sub = (struct envoy_config_listener_v3_Filter*)_upb_Message_New(&envoy_config_listener_v3_Filter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_use_proxy_proto(envoy_config_listener_v3_FilterChain *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChain_mutable_use_proxy_proto(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_FilterChain_use_proxy_proto(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_set_use_proxy_proto(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_set_use_proxy_proto(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_metadata(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_FilterChain_mutable_metadata(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_FilterChain_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_set_metadata(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_transport_socket(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_TransportSocket* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_TransportSocket*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_listener_v3_FilterChain_mutable_transport_socket(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_listener_v3_FilterChain_transport_socket(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_set_transport_socket(msg, sub); + sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_set_transport_socket(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_name(envoy_config_listener_v3_FilterChain *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_on_demand_configuration(envoy_config_listener_v3_FilterChain *msg, envoy_config_listener_v3_FilterChain_OnDemandConfiguration* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_config_listener_v3_FilterChain_OnDemandConfiguration*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 64), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_mutable_on_demand_configuration(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)envoy_config_listener_v3_FilterChain_on_demand_configuration(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_set_on_demand_configuration(msg, sub); + sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_set_on_demand_configuration(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_FilterChain_set_transport_socket_connect_timeout(envoy_config_listener_v3_FilterChain *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(28, 72), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_mutable_transport_socket_connect_timeout(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_FilterChain_transport_socket_connect_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_set_transport_socket_connect_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_set_transport_socket_connect_timeout(msg, sub); } return sub; } @@ -582,12 +850,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain /* envoy.config.listener.v3.FilterChain.OnDemandConfiguration */ UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(upb_Arena* arena) { - return (envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena); + return (envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_FilterChain_OnDemandConfiguration* ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -597,7 +865,7 @@ UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_con int options, upb_Arena* arena) { envoy_config_listener_v3_FilterChain_OnDemandConfiguration* ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -605,35 +873,40 @@ UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_con } UPB_INLINE char* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_serialize(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msg_init, 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); -} -UPB_INLINE void envoy_config_listener_v3_FilterChain_OnDemandConfiguration_clear_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_FilterChain_OnDemandConfiguration_clear_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_FilterChain_OnDemandConfiguration_has_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_mutable_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_FilterChain_OnDemandConfiguration_rebuild_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(msg, sub); } return sub; } @@ -641,12 +914,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain /* envoy.config.listener.v3.ListenerFilterChainMatchPredicate */ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena); + return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ListenerFilterChainMatchPredicate* ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -656,7 +929,7 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_con int options, upb_Arena* arena) { envoy_config_listener_v3_ListenerFilterChainMatchPredicate* ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -664,13 +937,13 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_con } UPB_INLINE char* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -682,102 +955,134 @@ typedef enum { envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET = 0 } envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases; UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_case(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* default_val = NULL; + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* default_val = NULL; + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* default_val = NULL; + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_any_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const struct envoy_type_v3_Int32Range* default_val = NULL; + const struct envoy_type_v3_Int32Range* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* value) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg, upb_Arena* arena) { struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_or_match(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(msg, sub); + sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* value) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg, upb_Arena* arena) { struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_and_match(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(msg, sub); + sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) { - UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg, upb_Arena* arena) { struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_not_match(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(msg, sub); + sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_any_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, struct envoy_type_v3_Int32Range* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg, upb_Arena* arena) { struct envoy_type_v3_Int32Range* sub = (struct envoy_type_v3_Int32Range*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_destination_port_range(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(msg, sub); + sub = (struct envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(msg, sub); } return sub; } @@ -785,12 +1090,12 @@ UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFil /* envoy.config.listener.v3.ListenerFilterChainMatchPredicate.MatchSet */ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena); + return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -800,7 +1105,7 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* int options, upb_Arena* arena) { envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -808,47 +1113,72 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* } UPB_INLINE char* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_clear_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_has_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_clear_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, size_t* len) { - return (const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_rules(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_mutable_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, size_t* len) { - return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_mutable_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_resize_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, size_t len, upb_Arena* arena) { - return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_resize_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_add_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, upb_Arena* arena) { - struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.listener.v3.ListenerFilter */ UPB_INLINE envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_ListenerFilter_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ListenerFilter*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilter_msginit, arena); + return (envoy_config_listener_v3_ListenerFilter*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilter_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_ListenerFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ListenerFilter* ret = envoy_config_listener_v3_ListenerFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -858,7 +1188,7 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Lis int options, upb_Arena* arena) { envoy_config_listener_v3_ListenerFilter* ret = envoy_config_listener_v3_ListenerFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -866,13 +1196,13 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Lis } UPB_INLINE char* envoy_config_listener_v3_ListenerFilter_serialize(const envoy_config_listener_v3_ListenerFilter* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -881,89 +1211,113 @@ typedef enum { envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET = 0 } envoy_config_listener_v3_ListenerFilter_config_type_oneofcases; UPB_INLINE envoy_config_listener_v3_ListenerFilter_config_type_oneofcases envoy_config_listener_v3_ListenerFilter_config_type_case(const envoy_config_listener_v3_ListenerFilter* msg) { - return (envoy_config_listener_v3_ListenerFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_listener_v3_ListenerFilter_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_name(const envoy_config_listener_v3_ListenerFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_name(envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_listener_v3_ListenerFilter_name(const envoy_config_listener_v3_ListenerFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_typed_config(const envoy_config_listener_v3_ListenerFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; -} -UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_typed_config(const envoy_config_listener_v3_ListenerFilter* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_typed_config(envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_typed_config(const envoy_config_listener_v3_ListenerFilter* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_filter_disabled(const envoy_config_listener_v3_ListenerFilter* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_typed_config(const envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_filter_disabled(const envoy_config_listener_v3_ListenerFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_filter_disabled(envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilter_filter_disabled(const envoy_config_listener_v3_ListenerFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*); + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* default_val = NULL; + const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_filter_disabled(const envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET); +UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_config_discovery(envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_ListenerFilter_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 5, NULL); + const struct envoy_config_core_v3_ExtensionConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ExtensionConfigSource* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_name(envoy_config_listener_v3_ListenerFilter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_typed_config(envoy_config_listener_v3_ListenerFilter *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_mutable_typed_config(envoy_config_listener_v3_ListenerFilter* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_ListenerFilter_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilter_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilter_set_typed_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_filter_disabled(envoy_config_listener_v3_ListenerFilter *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_config_listener_v3_ListenerFilterChainMatchPredicate*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilter_mutable_filter_disabled(envoy_config_listener_v3_ListenerFilter* msg, upb_Arena* arena) { struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)envoy_config_listener_v3_ListenerFilter_filter_disabled(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilter_set_filter_disabled(msg, sub); + sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilter_set_filter_disabled(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_config_discovery(envoy_config_listener_v3_ListenerFilter *msg, struct envoy_config_core_v3_ExtensionConfigSource* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 32), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_ListenerFilter_mutable_config_discovery(envoy_config_listener_v3_ListenerFilter* msg, upb_Arena* arena) { struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_config_listener_v3_ListenerFilter_config_discovery(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_ListenerFilter_set_config_discovery(msg, sub); + sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msg_init, arena); + if (sub) envoy_config_listener_v3_ListenerFilter_set_config_discovery(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_listener_v3_listener_components_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_listener_v3_listener_components_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_ */ 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 9b691c4eb48..60d23c43059 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/listener/v3/quic_config.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -19,43 +21,62 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_listener_v3_QuicProtocolOptions_submsgs[9] = { - {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeFeatureFlag_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_QuicProtocolOptions_submsgs[9] = { + {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeFeatureFlag_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_QuicProtocolOptions__fields[9] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 56), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 64), UPB_SIZE(8, 8), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 72), UPB_SIZE(9, 9), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_QuicProtocolOptions__fields[9] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msginit = { +const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msg_init = { &envoy_config_listener_v3_QuicProtocolOptions_submsgs[0], &envoy_config_listener_v3_QuicProtocolOptions__fields[0], - UPB_SIZE(40, 80), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(40, 80), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800000504002a, &upb_psm_1bt_maxmaxb}, + {0x0030000006050032, &upb_psm_1bt_maxmaxb}, + {0x003800000706003a, &upb_psm_1bt_maxmaxb}, + {0x0040000008070042, &upb_psm_1bt_maxmaxb}, + {0x004800000908004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_listener_v3_QuicProtocolOptions_msginit, + &envoy_config_listener_v3_QuicProtocolOptions_msg_init, }; -const upb_MiniTable_File envoy_config_listener_v3_quic_config_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_listener_v3_quic_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -64,5 +85,5 @@ const upb_MiniTable_File envoy_config_listener_v3_quic_config_proto_upb_file_lay 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 8cd563fe0d1..2e1b3f432f1 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 @@ -9,42 +9,46 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_ #define ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_listener_v3_QuicProtocolOptions; typedef struct envoy_config_listener_v3_QuicProtocolOptions envoy_config_listener_v3_QuicProtocolOptions; -extern const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msginit; +extern const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msg_init; struct envoy_config_core_v3_QuicProtocolOptions; struct envoy_config_core_v3_RuntimeFeatureFlag; struct envoy_config_core_v3_TypedExtensionConfig; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.listener.v3.QuicProtocolOptions */ UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_new(upb_Arena* arena) { - return (envoy_config_listener_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_listener_v3_QuicProtocolOptions_msginit, arena); + return (envoy_config_listener_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_listener_v3_QuicProtocolOptions_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_QuicProtocolOptions* ret = envoy_config_listener_v3_QuicProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -54,7 +58,7 @@ UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v int options, upb_Arena* arena) { envoy_config_listener_v3_QuicProtocolOptions* ret = envoy_config_listener_v3_QuicProtocolOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -62,221 +66,266 @@ UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v } UPB_INLINE char* envoy_config_listener_v3_QuicProtocolOptions_serialize(const envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_QuicProtocolOptions*); + const struct envoy_config_core_v3_QuicProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_QuicProtocolOptions* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_enabled(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_listener_v3_QuicProtocolOptions_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_RuntimeFeatureFlag*); + const struct envoy_config_core_v3_RuntimeFeatureFlag* default_val = NULL; + const struct envoy_config_core_v3_RuntimeFeatureFlag* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_QuicProtocolOptions_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_connection_id_generator_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_connection_id_generator_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_connection_id_generator_config(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_connection_id_generator_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_server_preferred_address_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_connection_id_generator_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_server_preferred_address_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_server_preferred_address_config(envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_server_preferred_address_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_server_preferred_address_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_QuicProtocolOptions* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_QuicProtocolOptions*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_mutable_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_QuicProtocolOptions* sub = (struct envoy_config_core_v3_QuicProtocolOptions*)envoy_config_listener_v3_QuicProtocolOptions_quic_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_mutable_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_QuicProtocolOptions_idle_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_mutable_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_QuicProtocolOptions_crypto_handshake_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_enabled(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_RuntimeFeatureFlag* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_RuntimeFeatureFlag*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_listener_v3_QuicProtocolOptions_mutable_enabled(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeFeatureFlag* sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)envoy_config_listener_v3_QuicProtocolOptions_enabled(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)_upb_Message_New(&envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_enabled(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)_upb_Message_New(&envoy_config_core_v3_RuntimeFeatureFlag_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_enabled(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_QuicProtocolOptions_mutable_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_QuicProtocolOptions_packets_to_read_to_connection_count_ratio(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_crypto_stream_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 7, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_proof_source_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_connection_id_generator_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 8, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_connection_id_generator_config(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_connection_id_generator_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_connection_id_generator_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_connection_id_generator_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_server_preferred_address_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(36, 72), 9, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_server_preferred_address_config(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_server_preferred_address_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_QuicProtocolOptions_set_server_preferred_address_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_QuicProtocolOptions_set_server_preferred_address_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_listener_v3_quic_config_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_listener_v3_quic_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_ */ 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 13f07cfe3a6..11c38591a34 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/listener/v3/udp_listener_config.upb.h" #include "envoy/config/core/v3/extension.upb.h" #include "envoy/config/core/v3/udp_socket_config.upb.h" @@ -15,38 +17,57 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_listener_v3_UdpListenerConfig_submsgs[3] = { - {.submsg = &envoy_config_core_v3_UdpSocketConfig_msginit}, - {.submsg = &envoy_config_listener_v3_QuicProtocolOptions_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_listener_v3_UdpListenerConfig_submsgs[3] = { + {.submsg = &envoy_config_core_v3_UdpSocketConfig_msg_init}, + {.submsg = &envoy_config_listener_v3_QuicProtocolOptions_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_listener_v3_UdpListenerConfig__fields[3] = { - {5, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_listener_v3_UdpListenerConfig__fields[3] = { + {5, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msginit = { +const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msg_init = { &envoy_config_listener_v3_UdpListenerConfig_submsgs[0], &envoy_config_listener_v3_UdpListenerConfig__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100002a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000201003a, &upb_psm_1bt_maxmaxb}, + {0x0018000003020042, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = { +const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_listener_v3_UdpListenerConfig_msginit, - &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, + &envoy_config_listener_v3_UdpListenerConfig_msg_init, + &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init, }; -const upb_MiniTable_File envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -55,5 +76,5 @@ const upb_MiniTable_File envoy_config_listener_v3_udp_listener_config_proto_upb_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 31cdecec6cb..7b3f27da221 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 @@ -9,41 +9,44 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_ #define ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_listener_v3_UdpListenerConfig; -struct envoy_config_listener_v3_ActiveRawUdpListenerConfig; typedef struct envoy_config_listener_v3_UdpListenerConfig envoy_config_listener_v3_UdpListenerConfig; typedef struct envoy_config_listener_v3_ActiveRawUdpListenerConfig envoy_config_listener_v3_ActiveRawUdpListenerConfig; -extern const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msginit; -extern const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit; +extern const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_config_core_v3_UdpSocketConfig; struct envoy_config_listener_v3_QuicProtocolOptions; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msginit; -extern const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msginit; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msg_init; +extern const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msg_init; /* envoy.config.listener.v3.UdpListenerConfig */ UPB_INLINE envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_UdpListenerConfig_new(upb_Arena* arena) { - return (envoy_config_listener_v3_UdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena); + return (envoy_config_listener_v3_UdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_UdpListenerConfig_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_UdpListenerConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_UdpListenerConfig* ret = envoy_config_listener_v3_UdpListenerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_ int options, upb_Arena* arena) { envoy_config_listener_v3_UdpListenerConfig* ret = envoy_config_listener_v3_UdpListenerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,79 +64,94 @@ UPB_INLINE envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_ } UPB_INLINE char* envoy_config_listener_v3_UdpListenerConfig_serialize(const envoy_config_listener_v3_UdpListenerConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_UdpSocketConfig* envoy_config_listener_v3_UdpListenerConfig_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_UdpSocketConfig*); + const struct envoy_config_core_v3_UdpSocketConfig* default_val = NULL; + const struct envoy_config_core_v3_UdpSocketConfig* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_quic_options(envoy_config_listener_v3_UdpListenerConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_UdpListenerConfig_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_listener_v3_QuicProtocolOptions*); + const struct envoy_config_listener_v3_QuicProtocolOptions* default_val = NULL; + const struct envoy_config_listener_v3_QuicProtocolOptions* ret; + const upb_MiniTableField field = {7, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_udp_packet_packet_writer_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_udp_packet_packet_writer_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_udp_packet_packet_writer_config(envoy_config_listener_v3_UdpListenerConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_UdpListenerConfig_udp_packet_packet_writer_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_udp_packet_packet_writer_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_core_v3_UdpSocketConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_UdpSocketConfig*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_UdpSocketConfig* envoy_config_listener_v3_UdpListenerConfig_mutable_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_UdpSocketConfig* sub = (struct envoy_config_core_v3_UdpSocketConfig*)envoy_config_listener_v3_UdpListenerConfig_downstream_socket_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_UdpListenerConfig_set_downstream_socket_config(msg, sub); + sub = (struct envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_UdpListenerConfig_set_downstream_socket_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_quic_options(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_listener_v3_QuicProtocolOptions* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_listener_v3_QuicProtocolOptions*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_UdpListenerConfig_mutable_quic_options(envoy_config_listener_v3_UdpListenerConfig* msg, upb_Arena* arena) { struct envoy_config_listener_v3_QuicProtocolOptions* sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)envoy_config_listener_v3_UdpListenerConfig_quic_options(msg); if (sub == NULL) { - sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_listener_v3_QuicProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_UdpListenerConfig_set_quic_options(msg, sub); + sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_listener_v3_QuicProtocolOptions_msg_init, arena); + if (sub) envoy_config_listener_v3_UdpListenerConfig_set_quic_options(msg, sub); } return sub; } UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_udp_packet_packet_writer_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_UdpListenerConfig_mutable_udp_packet_packet_writer_config(envoy_config_listener_v3_UdpListenerConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_UdpListenerConfig_udp_packet_packet_writer_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_listener_v3_UdpListenerConfig_set_udp_packet_packet_writer_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_listener_v3_UdpListenerConfig_set_udp_packet_packet_writer_config(msg, sub); } return sub; } @@ -141,12 +159,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listen /* envoy.config.listener.v3.ActiveRawUdpListenerConfig */ UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig* envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(upb_Arena* arena) { - return (envoy_config_listener_v3_ActiveRawUdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena); + return (envoy_config_listener_v3_ActiveRawUdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init, arena); } UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig* envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_listener_v3_ActiveRawUdpListenerConfig* ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -156,7 +174,7 @@ UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig* envoy_config_lis int options, upb_Arena* arena) { envoy_config_listener_v3_ActiveRawUdpListenerConfig* ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -164,23 +182,23 @@ UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig* envoy_config_lis } UPB_INLINE char* envoy_config_listener_v3_ActiveRawUdpListenerConfig_serialize(const envoy_config_listener_v3_ActiveRawUdpListenerConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_ */ 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 fa40c5b29f2..eea2e2be138 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/metrics/v3/metrics_service.upb.h" #include "envoy/config/core/v3/config_source.upb.h" #include "envoy/config/core/v3/grpc_service.upb.h" @@ -16,31 +18,42 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_metrics_v3_MetricsServiceConfig_submsgs[2] = { - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_MetricsServiceConfig_submsgs[2] = { + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_MetricsServiceConfig__fields[4] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_MetricsServiceConfig__fields[4] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_MetricsServiceConfig_msginit = { +const upb_MiniTable envoy_config_metrics_v3_MetricsServiceConfig_msg_init = { &envoy_config_metrics_v3_MetricsServiceConfig_submsgs[0], &envoy_config_metrics_v3_MetricsServiceConfig__fields[0], - UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x0018000002010012, &upb_psm_1bt_maxmaxb}, + {0x000400003f000018, &upb_psv4_1bt}, + {0x000800003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_metrics_v3_MetricsServiceConfig_msginit, + &envoy_config_metrics_v3_MetricsServiceConfig_msg_init, }; -const upb_MiniTable_File envoy_config_metrics_v3_metrics_service_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_metrics_v3_metrics_service_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -49,5 +62,5 @@ const upb_MiniTable_File envoy_config_metrics_v3_metrics_service_proto_upb_file_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 c268f26dc08..e16ad564409 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 @@ -9,36 +9,40 @@ #ifndef ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPB_H_ #define ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_metrics_v3_MetricsServiceConfig; typedef struct envoy_config_metrics_v3_MetricsServiceConfig envoy_config_metrics_v3_MetricsServiceConfig; -extern const upb_MiniTable envoy_config_metrics_v3_MetricsServiceConfig_msginit; +extern const upb_MiniTable envoy_config_metrics_v3_MetricsServiceConfig_msg_init; struct envoy_config_core_v3_GrpcService; struct google_protobuf_BoolValue; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; /* envoy.config.metrics.v3.MetricsServiceConfig */ UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3_MetricsServiceConfig_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_MetricsServiceConfig*)_upb_Message_New(&envoy_config_metrics_v3_MetricsServiceConfig_msginit, arena); + return (envoy_config_metrics_v3_MetricsServiceConfig*)_upb_Message_New(&envoy_config_metrics_v3_MetricsServiceConfig_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3_MetricsServiceConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_MetricsServiceConfig* ret = envoy_config_metrics_v3_MetricsServiceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_MetricsServiceConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -48,7 +52,7 @@ UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3 int options, upb_Arena* arena) { envoy_config_metrics_v3_MetricsServiceConfig* ret = envoy_config_metrics_v3_MetricsServiceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_MetricsServiceConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -56,85 +60,107 @@ UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3 } UPB_INLINE char* envoy_config_metrics_v3_MetricsServiceConfig_serialize(const envoy_config_metrics_v3_MetricsServiceConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_grpc_service(envoy_config_metrics_v3_MetricsServiceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_metrics_v3_MetricsServiceConfig_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_has_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_has_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_report_counters_as_deltas(envoy_config_metrics_v3_MetricsServiceConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_metrics_v3_MetricsServiceConfig_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_transport_api_version(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_has_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_transport_api_version(envoy_config_metrics_v3_MetricsServiceConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_metrics_v3_MetricsServiceConfig_transport_api_version(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_emit_tags_as_labels(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_emit_tags_as_labels(envoy_config_metrics_v3_MetricsServiceConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_emit_tags_as_labels(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_grpc_service(envoy_config_metrics_v3_MetricsServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_metrics_v3_MetricsServiceConfig_mutable_grpc_service(envoy_config_metrics_v3_MetricsServiceConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_metrics_v3_MetricsServiceConfig_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_MetricsServiceConfig_set_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_metrics_v3_MetricsServiceConfig_set_grpc_service(msg, sub); } return sub; } UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_report_counters_as_deltas(envoy_config_metrics_v3_MetricsServiceConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_metrics_v3_MetricsServiceConfig_mutable_report_counters_as_deltas(envoy_config_metrics_v3_MetricsServiceConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_metrics_v3_MetricsServiceConfig_report_counters_as_deltas(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_MetricsServiceConfig_set_report_counters_as_deltas(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_metrics_v3_MetricsServiceConfig_set_report_counters_as_deltas(msg, sub); } return sub; } UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_transport_api_version(envoy_config_metrics_v3_MetricsServiceConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_emit_tags_as_labels(envoy_config_metrics_v3_MetricsServiceConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_metrics_v3_metrics_service_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_metrics_v3_metrics_service_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPB_H_ */ 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 a6cff06fc4e..af913dd3c08 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/metrics/v3/stats.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/type/matcher/v3/string.upb.h" @@ -17,142 +19,197 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsSink_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_StatsSink_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_StatsSink__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_StatsSink__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_StatsSink_msginit = { +const upb_MiniTable envoy_config_metrics_v3_StatsSink_msg_init = { &envoy_config_metrics_v3_StatsSink_submsgs[0], &envoy_config_metrics_v3_StatsSink__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsConfig_submsgs[4] = { - {.submsg = &envoy_config_metrics_v3_TagSpecifier_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_metrics_v3_StatsMatcher_msginit}, - {.submsg = &envoy_config_metrics_v3_HistogramBucketSettings_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_StatsConfig_submsgs[4] = { + {.submsg = &envoy_config_metrics_v3_TagSpecifier_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_metrics_v3_StatsMatcher_msg_init}, + {.submsg = &envoy_config_metrics_v3_HistogramBucketSettings_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_StatsConfig__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_StatsConfig__fields[4] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msginit = { +const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msg_init = { &envoy_config_metrics_v3_StatsConfig_submsgs[0], &envoy_config_metrics_v3_StatsConfig__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x001800000202001a, &upb_psm_1bt_max64b}, + {0x002000003f030022, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsMatcher_submsgs[2] = { - {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_StatsMatcher_submsgs[2] = { + {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_StatsMatcher__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_StatsMatcher__fields[3] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_StatsMatcher_msginit = { +const upb_MiniTable envoy_config_metrics_v3_StatsMatcher_msg_init = { &envoy_config_metrics_v3_StatsMatcher_submsgs[0], &envoy_config_metrics_v3_StatsMatcher__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_pob1_1bt}, + {0x0008000002000012, &upb_pom_1bt_maxmaxb}, + {0x000800000301001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_config_metrics_v3_TagSpecifier__fields[3] = { - {1, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_TagSpecifier__fields[3] = { + {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msginit = { +const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msg_init = { NULL, &envoy_config_metrics_v3_TagSpecifier__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x0008000002000012, &upb_pos_1bt}, + {0x000800000300001a, &upb_pos_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_HistogramBucketSettings__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_HistogramBucketSettings__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_HistogramBucketSettings_msginit = { +const upb_MiniTable envoy_config_metrics_v3_HistogramBucketSettings_msg_init = { &envoy_config_metrics_v3_HistogramBucketSettings_submsgs[0], &envoy_config_metrics_v3_HistogramBucketSettings__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_ppf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsdSink_submsgs[1] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_StatsdSink_submsgs[1] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_StatsdSink__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_StatsdSink__fields[3] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_StatsdSink_msginit = { +const upb_MiniTable envoy_config_metrics_v3_StatsdSink_msg_init = { &envoy_config_metrics_v3_StatsdSink_submsgs[0], &envoy_config_metrics_v3_StatsdSink__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + {0x0008000002000012, &upb_pos_1bt}, + {0x001800003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Address_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, +static const upb_MiniTableSub envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Address_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_metrics_v3_DogStatsdSink__fields[3] = { - {1, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_DogStatsdSink__fields[3] = { + {1, UPB_SIZE(12, 32), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_DogStatsdSink_msginit = { +const upb_MiniTable envoy_config_metrics_v3_DogStatsdSink_msg_init = { &envoy_config_metrics_v3_DogStatsdSink_submsgs[0], &envoy_config_metrics_v3_DogStatsdSink__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000040100000a, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00001a, &upb_pss_1bt}, + {0x0018000001010022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_metrics_v3_HystrixSink__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_metrics_v3_HystrixSink__fields[1] = { + {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_metrics_v3_HystrixSink_msginit = { +const upb_MiniTable envoy_config_metrics_v3_HystrixSink_msg_init = { NULL, &envoy_config_metrics_v3_HystrixSink__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + }) }; static const upb_MiniTable *messages_layout[8] = { - &envoy_config_metrics_v3_StatsSink_msginit, - &envoy_config_metrics_v3_StatsConfig_msginit, - &envoy_config_metrics_v3_StatsMatcher_msginit, - &envoy_config_metrics_v3_TagSpecifier_msginit, - &envoy_config_metrics_v3_HistogramBucketSettings_msginit, - &envoy_config_metrics_v3_StatsdSink_msginit, - &envoy_config_metrics_v3_DogStatsdSink_msginit, - &envoy_config_metrics_v3_HystrixSink_msginit, + &envoy_config_metrics_v3_StatsSink_msg_init, + &envoy_config_metrics_v3_StatsConfig_msg_init, + &envoy_config_metrics_v3_StatsMatcher_msg_init, + &envoy_config_metrics_v3_TagSpecifier_msg_init, + &envoy_config_metrics_v3_HistogramBucketSettings_msg_init, + &envoy_config_metrics_v3_StatsdSink_msg_init, + &envoy_config_metrics_v3_DogStatsdSink_msg_init, + &envoy_config_metrics_v3_HystrixSink_msg_init, }; -const upb_MiniTable_File envoy_config_metrics_v3_stats_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_metrics_v3_stats_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -161,5 +218,5 @@ const upb_MiniTable_File envoy_config_metrics_v3_stats_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 5bba950f025..c47c3a4298e 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 @@ -9,25 +9,22 @@ #ifndef ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_ #define ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_metrics_v3_StatsSink; -struct envoy_config_metrics_v3_StatsConfig; -struct envoy_config_metrics_v3_StatsMatcher; -struct envoy_config_metrics_v3_TagSpecifier; -struct envoy_config_metrics_v3_HistogramBucketSettings; -struct envoy_config_metrics_v3_StatsdSink; -struct envoy_config_metrics_v3_DogStatsdSink; -struct envoy_config_metrics_v3_HystrixSink; typedef struct envoy_config_metrics_v3_StatsSink envoy_config_metrics_v3_StatsSink; typedef struct envoy_config_metrics_v3_StatsConfig envoy_config_metrics_v3_StatsConfig; typedef struct envoy_config_metrics_v3_StatsMatcher envoy_config_metrics_v3_StatsMatcher; @@ -36,38 +33,38 @@ typedef struct envoy_config_metrics_v3_HistogramBucketSettings envoy_config_metr typedef struct envoy_config_metrics_v3_StatsdSink envoy_config_metrics_v3_StatsdSink; typedef struct envoy_config_metrics_v3_DogStatsdSink envoy_config_metrics_v3_DogStatsdSink; typedef struct envoy_config_metrics_v3_HystrixSink envoy_config_metrics_v3_HystrixSink; -extern const upb_MiniTable envoy_config_metrics_v3_StatsSink_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_StatsMatcher_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_HistogramBucketSettings_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_StatsdSink_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_DogStatsdSink_msginit; -extern const upb_MiniTable envoy_config_metrics_v3_HystrixSink_msginit; +extern const upb_MiniTable envoy_config_metrics_v3_StatsSink_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_StatsMatcher_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_HistogramBucketSettings_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_StatsdSink_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_DogStatsdSink_msg_init; +extern const upb_MiniTable envoy_config_metrics_v3_HystrixSink_msg_init; struct envoy_config_core_v3_Address; struct envoy_type_matcher_v3_ListStringMatcher; struct envoy_type_matcher_v3_StringMatcher; struct google_protobuf_Any; struct google_protobuf_BoolValue; struct google_protobuf_UInt64Value; -extern const upb_MiniTable envoy_config_core_v3_Address_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_Address_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; /* envoy.config.metrics.v3.StatsSink */ UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_StatsSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsSink_msginit, arena); + return (envoy_config_metrics_v3_StatsSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsSink_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_StatsSink* ret = envoy_config_metrics_v3_StatsSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -77,7 +74,7 @@ UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_ int options, upb_Arena* arena) { envoy_config_metrics_v3_StatsSink* ret = envoy_config_metrics_v3_StatsSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -85,13 +82,13 @@ UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_ } UPB_INLINE char* envoy_config_metrics_v3_StatsSink_serialize(const envoy_config_metrics_v3_StatsSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -99,36 +96,49 @@ typedef enum { envoy_config_metrics_v3_StatsSink_config_type_NOT_SET = 0 } envoy_config_metrics_v3_StatsSink_config_type_oneofcases; UPB_INLINE envoy_config_metrics_v3_StatsSink_config_type_oneofcases envoy_config_metrics_v3_StatsSink_config_type_case(const envoy_config_metrics_v3_StatsSink* msg) { - return (envoy_config_metrics_v3_StatsSink_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_StatsSink_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_StatsSink_clear_name(const envoy_config_metrics_v3_StatsSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_metrics_v3_StatsSink_clear_name(envoy_config_metrics_v3_StatsSink* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_StatsSink_name(const envoy_config_metrics_v3_StatsSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_StatsSink_has_typed_config(const envoy_config_metrics_v3_StatsSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_metrics_v3_StatsSink_clear_typed_config(const envoy_config_metrics_v3_StatsSink* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsSink_config_type_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_StatsSink_clear_typed_config(envoy_config_metrics_v3_StatsSink* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_typed_config(const envoy_config_metrics_v3_StatsSink* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_metrics_v3_StatsSink_has_typed_config(const envoy_config_metrics_v3_StatsSink* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_metrics_v3_StatsSink_set_name(envoy_config_metrics_v3_StatsSink *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_StatsSink_set_typed_config(envoy_config_metrics_v3_StatsSink *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_mutable_typed_config(envoy_config_metrics_v3_StatsSink* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_metrics_v3_StatsSink_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_StatsSink_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_metrics_v3_StatsSink_set_typed_config(msg, sub); } return sub; } @@ -136,12 +146,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_mutable /* envoy.config.metrics.v3.StatsConfig */ UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsConfig_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_StatsConfig*)_upb_Message_New(&envoy_config_metrics_v3_StatsConfig_msginit, arena); + return (envoy_config_metrics_v3_StatsConfig*)_upb_Message_New(&envoy_config_metrics_v3_StatsConfig_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_StatsConfig* ret = envoy_config_metrics_v3_StatsConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -151,7 +161,7 @@ UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsCon int options, upb_Arena* arena) { envoy_config_metrics_v3_StatsConfig* ret = envoy_config_metrics_v3_StatsConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -159,112 +169,172 @@ UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsCon } UPB_INLINE char* envoy_config_metrics_v3_StatsConfig_serialize(const envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_stats_tags(envoy_config_metrics_v3_StatsConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_metrics_v3_TagSpecifier* const* envoy_config_metrics_v3_StatsConfig_stats_tags(const envoy_config_metrics_v3_StatsConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_metrics_v3_TagSpecifier* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_metrics_v3_StatsConfig_stats_tags(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_stats_tags(const envoy_config_metrics_v3_StatsConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_metrics_v3_TagSpecifier* const* envoy_config_metrics_v3_StatsConfig_stats_tags(const envoy_config_metrics_v3_StatsConfig* msg, size_t* len) { - return (const envoy_config_metrics_v3_TagSpecifier* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_use_all_default_tags(envoy_config_metrics_v3_StatsConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_metrics_v3_StatsConfig_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_stats_matcher(envoy_config_metrics_v3_StatsConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsConfig_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_metrics_v3_StatsMatcher*); + const envoy_config_metrics_v3_StatsMatcher* default_val = NULL; + const envoy_config_metrics_v3_StatsMatcher* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_metrics_v3_HistogramBucketSettings* const* envoy_config_metrics_v3_StatsConfig_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_metrics_v3_HistogramBucketSettings* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_config_metrics_v3_HistogramBucketSettings* const* envoy_config_metrics_v3_StatsConfig_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg, size_t* len) { - return (const envoy_config_metrics_v3_HistogramBucketSettings* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + envoy_config_metrics_v3_StatsConfig_histogram_bucket_settings(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_mutable_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, size_t* len) { - return (envoy_config_metrics_v3_TagSpecifier**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_mutable_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_metrics_v3_TagSpecifier**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_resize_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_metrics_v3_TagSpecifier**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_resize_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_TagSpecifier**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_StatsConfig_add_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) { - struct envoy_config_metrics_v3_TagSpecifier* sub = (struct envoy_config_metrics_v3_TagSpecifier*)_upb_Message_New(&envoy_config_metrics_v3_TagSpecifier_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_metrics_v3_TagSpecifier* sub = (struct envoy_config_metrics_v3_TagSpecifier*)_upb_Message_New(&envoy_config_metrics_v3_TagSpecifier_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_metrics_v3_StatsConfig_set_use_all_default_tags(envoy_config_metrics_v3_StatsConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_metrics_v3_StatsConfig_mutable_use_all_default_tags(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_metrics_v3_StatsConfig_use_all_default_tags(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_StatsConfig_set_use_all_default_tags(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_metrics_v3_StatsConfig_set_use_all_default_tags(msg, sub); } return sub; } UPB_INLINE void envoy_config_metrics_v3_StatsConfig_set_stats_matcher(envoy_config_metrics_v3_StatsConfig *msg, envoy_config_metrics_v3_StatsMatcher* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_metrics_v3_StatsMatcher*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsConfig_mutable_stats_matcher(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) { struct envoy_config_metrics_v3_StatsMatcher* sub = (struct envoy_config_metrics_v3_StatsMatcher*)envoy_config_metrics_v3_StatsConfig_stats_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_metrics_v3_StatsMatcher*)_upb_Message_New(&envoy_config_metrics_v3_StatsMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_StatsConfig_set_stats_matcher(msg, sub); + sub = (struct envoy_config_metrics_v3_StatsMatcher*)_upb_Message_New(&envoy_config_metrics_v3_StatsMatcher_msg_init, arena); + if (sub) envoy_config_metrics_v3_StatsConfig_set_stats_matcher(msg, sub); } return sub; } -UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_mutable_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, size_t* len) { - return (envoy_config_metrics_v3_HistogramBucketSettings**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_mutable_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_metrics_v3_HistogramBucketSettings**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_resize_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_metrics_v3_HistogramBucketSettings**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_resize_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_HistogramBucketSettings**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_StatsConfig_add_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) { - struct envoy_config_metrics_v3_HistogramBucketSettings* sub = (struct envoy_config_metrics_v3_HistogramBucketSettings*)_upb_Message_New(&envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_metrics_v3_HistogramBucketSettings* sub = (struct envoy_config_metrics_v3_HistogramBucketSettings*)_upb_Message_New(&envoy_config_metrics_v3_HistogramBucketSettings_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.metrics.v3.StatsMatcher */ UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMatcher_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_StatsMatcher*)_upb_Message_New(&envoy_config_metrics_v3_StatsMatcher_msginit, arena); + return (envoy_config_metrics_v3_StatsMatcher*)_upb_Message_New(&envoy_config_metrics_v3_StatsMatcher_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_StatsMatcher* ret = envoy_config_metrics_v3_StatsMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -274,7 +344,7 @@ UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMa int options, upb_Arena* arena) { envoy_config_metrics_v3_StatsMatcher* ret = envoy_config_metrics_v3_StatsMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -282,13 +352,13 @@ UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMa } UPB_INLINE char* envoy_config_metrics_v3_StatsMatcher_serialize(const envoy_config_metrics_v3_StatsMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -298,60 +368,80 @@ typedef enum { envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET = 0 } envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases; UPB_INLINE envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases envoy_config_metrics_v3_StatsMatcher_stats_matcher_case(const envoy_config_metrics_v3_StatsMatcher* msg) { - return (envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_reject_all(envoy_config_metrics_v3_StatsMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_exclusion_list(envoy_config_metrics_v3_StatsMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_type_matcher_v3_ListStringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_ListStringMatcher* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_inclusion_list(envoy_config_metrics_v3_StatsMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const struct envoy_type_matcher_v3_ListStringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_ListStringMatcher* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_set_reject_all(envoy_config_metrics_v3_StatsMatcher *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_set_exclusion_list(envoy_config_metrics_v3_StatsMatcher *msg, struct envoy_type_matcher_v3_ListStringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_mutable_exclusion_list(envoy_config_metrics_v3_StatsMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ListStringMatcher* sub = (struct envoy_type_matcher_v3_ListStringMatcher*)envoy_config_metrics_v3_StatsMatcher_exclusion_list(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_StatsMatcher_set_exclusion_list(msg, sub); + sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msg_init, arena); + if (sub) envoy_config_metrics_v3_StatsMatcher_set_exclusion_list(msg, sub); } return sub; } UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_set_inclusion_list(envoy_config_metrics_v3_StatsMatcher *msg, struct envoy_type_matcher_v3_ListStringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_mutable_inclusion_list(envoy_config_metrics_v3_StatsMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ListStringMatcher* sub = (struct envoy_type_matcher_v3_ListStringMatcher*)envoy_config_metrics_v3_StatsMatcher_inclusion_list(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_StatsMatcher_set_inclusion_list(msg, sub); + sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msg_init, arena); + if (sub) envoy_config_metrics_v3_StatsMatcher_set_inclusion_list(msg, sub); } return sub; } @@ -359,12 +449,12 @@ UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_ /* envoy.config.metrics.v3.TagSpecifier */ UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpecifier_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_TagSpecifier*)_upb_Message_New(&envoy_config_metrics_v3_TagSpecifier_msginit, arena); + return (envoy_config_metrics_v3_TagSpecifier*)_upb_Message_New(&envoy_config_metrics_v3_TagSpecifier_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpecifier_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_TagSpecifier* ret = envoy_config_metrics_v3_TagSpecifier_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -374,7 +464,7 @@ UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpec int options, upb_Arena* arena) { envoy_config_metrics_v3_TagSpecifier* ret = envoy_config_metrics_v3_TagSpecifier_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -382,13 +472,13 @@ UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpec } UPB_INLINE char* envoy_config_metrics_v3_TagSpecifier_serialize(const envoy_config_metrics_v3_TagSpecifier* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -397,52 +487,73 @@ typedef enum { envoy_config_metrics_v3_TagSpecifier_tag_value_NOT_SET = 0 } envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases; UPB_INLINE envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases envoy_config_metrics_v3_TagSpecifier_tag_value_case(const envoy_config_metrics_v3_TagSpecifier* msg) { - return (envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_tag_name(const envoy_config_metrics_v3_TagSpecifier* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_tag_name(envoy_config_metrics_v3_TagSpecifier* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_TagSpecifier_tag_name(const envoy_config_metrics_v3_TagSpecifier* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_regex(const envoy_config_metrics_v3_TagSpecifier* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_regex(const envoy_config_metrics_v3_TagSpecifier* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_metrics_v3_TagSpecifier_tag_value_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_regex(envoy_config_metrics_v3_TagSpecifier* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_TagSpecifier_regex(const envoy_config_metrics_v3_TagSpecifier* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_regex(const envoy_config_metrics_v3_TagSpecifier* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_metrics_v3_TagSpecifier_tag_value_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_fixed_value(envoy_config_metrics_v3_TagSpecifier* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_TagSpecifier_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_tag_name(envoy_config_metrics_v3_TagSpecifier *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_regex(envoy_config_metrics_v3_TagSpecifier *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_fixed_value(envoy_config_metrics_v3_TagSpecifier *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.metrics.v3.HistogramBucketSettings */ UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_HistogramBucketSettings_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_HistogramBucketSettings*)_upb_Message_New(&envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena); + return (envoy_config_metrics_v3_HistogramBucketSettings*)_upb_Message_New(&envoy_config_metrics_v3_HistogramBucketSettings_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_HistogramBucketSettings_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_HistogramBucketSettings* ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -452,7 +563,7 @@ UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics int options, upb_Arena* arena) { envoy_config_metrics_v3_HistogramBucketSettings* ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -460,63 +571,97 @@ UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics } UPB_INLINE char* envoy_config_metrics_v3_HistogramBucketSettings_serialize(const envoy_config_metrics_v3_HistogramBucketSettings* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msg_init, 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); -} -UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_clear_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_clear_match(envoy_config_metrics_v3_HistogramBucketSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_metrics_v3_HistogramBucketSettings_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_clear_buckets(const envoy_config_metrics_v3_HistogramBucketSettings* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_has_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE double const* envoy_config_metrics_v3_HistogramBucketSettings_buckets(const envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t* len) { - return (double const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_clear_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE double const* envoy_config_metrics_v3_HistogramBucketSettings_buckets(const envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (double const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_has_buckets(const envoy_config_metrics_v3_HistogramBucketSettings* msg) { + size_t size; + envoy_config_metrics_v3_HistogramBucketSettings_buckets(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_set_match(envoy_config_metrics_v3_HistogramBucketSettings *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_StringMatcher*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_metrics_v3_HistogramBucketSettings_mutable_match(envoy_config_metrics_v3_HistogramBucketSettings* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_metrics_v3_HistogramBucketSettings_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_HistogramBucketSettings_set_match(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_metrics_v3_HistogramBucketSettings_set_match(msg, sub); } return sub; } -UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_mutable_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t* len) { - return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_mutable_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (double*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_resize_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t len, upb_Arena* arena) { - return (double*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_resize_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (double*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_add_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, double val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.config.metrics.v3.StatsdSink */ UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSink_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_StatsdSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsdSink_msginit, arena); + return (envoy_config_metrics_v3_StatsdSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsdSink_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_StatsdSink* ret = envoy_config_metrics_v3_StatsdSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -526,7 +671,7 @@ UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSin int options, upb_Arena* arena) { envoy_config_metrics_v3_StatsdSink* ret = envoy_config_metrics_v3_StatsdSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -534,13 +679,13 @@ UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSin } UPB_INLINE char* envoy_config_metrics_v3_StatsdSink_serialize(const envoy_config_metrics_v3_StatsdSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -549,61 +694,81 @@ typedef enum { envoy_config_metrics_v3_StatsdSink_statsd_specifier_NOT_SET = 0 } envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases; UPB_INLINE envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases envoy_config_metrics_v3_StatsdSink_statsd_specifier_case(const envoy_config_metrics_v3_StatsdSink* msg) { - return (envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_address(const envoy_config_metrics_v3_StatsdSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_address(const envoy_config_metrics_v3_StatsdSink* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsdSink_statsd_specifier_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_address(envoy_config_metrics_v3_StatsdSink* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_metrics_v3_StatsdSink_address(const envoy_config_metrics_v3_StatsdSink* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_Address*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_address(const envoy_config_metrics_v3_StatsdSink* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsdSink_statsd_specifier_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_tcp_cluster_name(envoy_config_metrics_v3_StatsdSink* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_StatsdSink_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_prefix(const envoy_config_metrics_v3_StatsdSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_prefix(envoy_config_metrics_v3_StatsdSink* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_StatsdSink_prefix(const envoy_config_metrics_v3_StatsdSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_address(envoy_config_metrics_v3_StatsdSink *msg, struct envoy_config_core_v3_Address* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_metrics_v3_StatsdSink_mutable_address(envoy_config_metrics_v3_StatsdSink* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_metrics_v3_StatsdSink_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_StatsdSink_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_metrics_v3_StatsdSink_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_tcp_cluster_name(envoy_config_metrics_v3_StatsdSink *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_prefix(envoy_config_metrics_v3_StatsdSink *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.metrics.v3.DogStatsdSink */ UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogStatsdSink_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_DogStatsdSink*)_upb_Message_New(&envoy_config_metrics_v3_DogStatsdSink_msginit, arena); + return (envoy_config_metrics_v3_DogStatsdSink*)_upb_Message_New(&envoy_config_metrics_v3_DogStatsdSink_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogStatsdSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_DogStatsdSink* ret = envoy_config_metrics_v3_DogStatsdSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -613,7 +778,7 @@ UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogSta int options, upb_Arena* arena) { envoy_config_metrics_v3_DogStatsdSink* ret = envoy_config_metrics_v3_DogStatsdSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -621,13 +786,13 @@ UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogSta } UPB_INLINE char* envoy_config_metrics_v3_DogStatsdSink_serialize(const envoy_config_metrics_v3_DogStatsdSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -635,58 +800,76 @@ typedef enum { envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_NOT_SET = 0 } envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases; UPB_INLINE envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_case(const envoy_config_metrics_v3_DogStatsdSink* msg) { - return (envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(12, 32), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_address(const envoy_config_metrics_v3_DogStatsdSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_address(const envoy_config_metrics_v3_DogStatsdSink* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_NOT_SET); +UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_address(envoy_config_metrics_v3_DogStatsdSink* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 32), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_metrics_v3_DogStatsdSink_address(const envoy_config_metrics_v3_DogStatsdSink* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_Address*, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 1, NULL); + const struct envoy_config_core_v3_Address* default_val = NULL; + const struct envoy_config_core_v3_Address* ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 32), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_prefix(const envoy_config_metrics_v3_DogStatsdSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_address(const envoy_config_metrics_v3_DogStatsdSink* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 32), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_prefix(envoy_config_metrics_v3_DogStatsdSink* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_metrics_v3_DogStatsdSink_prefix(const envoy_config_metrics_v3_DogStatsdSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_max_bytes_per_datagram(envoy_config_metrics_v3_DogStatsdSink* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsdSink_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_address(envoy_config_metrics_v3_DogStatsdSink *msg, struct envoy_config_core_v3_Address* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(12, 32), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_metrics_v3_DogStatsdSink_mutable_address(envoy_config_metrics_v3_DogStatsdSink* msg, upb_Arena* arena) { struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_metrics_v3_DogStatsdSink_address(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_DogStatsdSink_set_address(msg, sub); + sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msg_init, arena); + if (sub) envoy_config_metrics_v3_DogStatsdSink_set_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_prefix(envoy_config_metrics_v3_DogStatsdSink *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_max_bytes_per_datagram(envoy_config_metrics_v3_DogStatsdSink *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsdSink_mutable_max_bytes_per_datagram(envoy_config_metrics_v3_DogStatsdSink* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_metrics_v3_DogStatsdSink_max_bytes_per_datagram(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_config_metrics_v3_DogStatsdSink_set_max_bytes_per_datagram(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_config_metrics_v3_DogStatsdSink_set_max_bytes_per_datagram(msg, sub); } return sub; } @@ -694,12 +877,12 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsd /* envoy.config.metrics.v3.HystrixSink */ UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixSink_new(upb_Arena* arena) { - return (envoy_config_metrics_v3_HystrixSink*)_upb_Message_New(&envoy_config_metrics_v3_HystrixSink_msginit, arena); + return (envoy_config_metrics_v3_HystrixSink*)_upb_Message_New(&envoy_config_metrics_v3_HystrixSink_msg_init, arena); } UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_metrics_v3_HystrixSink* ret = envoy_config_metrics_v3_HystrixSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -709,7 +892,7 @@ UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixS int options, upb_Arena* arena) { envoy_config_metrics_v3_HystrixSink* ret = envoy_config_metrics_v3_HystrixSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -717,32 +900,38 @@ UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixS } UPB_INLINE char* envoy_config_metrics_v3_HystrixSink_serialize(const envoy_config_metrics_v3_HystrixSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msg_init, 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; +UPB_INLINE void envoy_config_metrics_v3_HystrixSink_clear_num_buckets(envoy_config_metrics_v3_HystrixSink* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_config_metrics_v3_HystrixSink_num_buckets(const envoy_config_metrics_v3_HystrixSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_metrics_v3_HystrixSink_set_num_buckets(envoy_config_metrics_v3_HystrixSink *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_metrics_v3_stats_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_metrics_v3_stats_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_ */ 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 2344d86cec2..f93d4394908 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/overload/v3/overload.upb.h" #include "envoy/type/v3/percent.upb.h" #include "google/protobuf/any.upb.h" @@ -16,152 +18,205 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_overload_v3_ResourceMonitor_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_overload_v3_ResourceMonitor_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_overload_v3_ResourceMonitor__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_ResourceMonitor__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_ResourceMonitor_msginit = { +const upb_MiniTable envoy_config_overload_v3_ResourceMonitor_msg_init = { &envoy_config_overload_v3_ResourceMonitor_submsgs[0], &envoy_config_overload_v3_ResourceMonitor__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_config_overload_v3_ThresholdTrigger__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_ThresholdTrigger__fields[1] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_ThresholdTrigger_msginit = { +const upb_MiniTable envoy_config_overload_v3_ThresholdTrigger_msg_init = { NULL, &envoy_config_overload_v3_ThresholdTrigger__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_overload_v3_ScaledTrigger__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_ScaledTrigger__fields[2] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msginit = { +const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msg_init = { NULL, &envoy_config_overload_v3_ScaledTrigger__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + {0x000800003f000011, &upb_psf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_overload_v3_Trigger_submsgs[2] = { - {.submsg = &envoy_config_overload_v3_ThresholdTrigger_msginit}, - {.submsg = &envoy_config_overload_v3_ScaledTrigger_msginit}, +static const upb_MiniTableSub envoy_config_overload_v3_Trigger_submsgs[2] = { + {.submsg = &envoy_config_overload_v3_ThresholdTrigger_msg_init}, + {.submsg = &envoy_config_overload_v3_ScaledTrigger_msg_init}, }; -static const upb_MiniTable_Field envoy_config_overload_v3_Trigger__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_Trigger__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_Trigger_msginit = { +const upb_MiniTable envoy_config_overload_v3_Trigger_msg_init = { &envoy_config_overload_v3_Trigger_submsgs[0], &envoy_config_overload_v3_Trigger__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_max64b}, + {0x001800000301001a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = { - {.submsg = &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit}, +static const upb_MiniTableSub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = { + {.submsg = &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init}, }; -static const upb_MiniTable_Field envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit = { +const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init = { &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[0], &envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, +static const upb_MiniTableSub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[3] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit = { +const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init = { &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[0], &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[0], - UPB_SIZE(16, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + 16, 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x0008000402000012, &upb_pom_1bt_maxmaxb}, + {0x000800040301001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_overload_v3_OverloadAction_submsgs[2] = { - {.submsg = &envoy_config_overload_v3_Trigger_msginit}, - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_overload_v3_OverloadAction_submsgs[2] = { + {.submsg = &envoy_config_overload_v3_Trigger_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_overload_v3_OverloadAction__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_OverloadAction__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_OverloadAction_msginit = { +const upb_MiniTable envoy_config_overload_v3_OverloadAction_msg_init = { &envoy_config_overload_v3_OverloadAction_submsgs[0], &envoy_config_overload_v3_OverloadAction__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000101001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_config_overload_v3_BufferFactoryConfig__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_BufferFactoryConfig__fields[1] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_BufferFactoryConfig_msginit = { +const upb_MiniTable envoy_config_overload_v3_BufferFactoryConfig_msg_init = { NULL, &envoy_config_overload_v3_BufferFactoryConfig__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_overload_v3_OverloadManager_submsgs[4] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_overload_v3_ResourceMonitor_msginit}, - {.submsg = &envoy_config_overload_v3_OverloadAction_msginit}, - {.submsg = &envoy_config_overload_v3_BufferFactoryConfig_msginit}, +static const upb_MiniTableSub envoy_config_overload_v3_OverloadManager_submsgs[4] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_overload_v3_ResourceMonitor_msg_init}, + {.submsg = &envoy_config_overload_v3_OverloadAction_msg_init}, + {.submsg = &envoy_config_overload_v3_BufferFactoryConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_overload_v3_OverloadManager__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_overload_v3_OverloadManager__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_overload_v3_OverloadManager_msginit = { +const upb_MiniTable envoy_config_overload_v3_OverloadManager_msg_init = { &envoy_config_overload_v3_OverloadManager_submsgs[0], &envoy_config_overload_v3_OverloadManager__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x001800003f02001a, &upb_prm_1bt_max64b}, + {0x0020000002030022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[9] = { - &envoy_config_overload_v3_ResourceMonitor_msginit, - &envoy_config_overload_v3_ThresholdTrigger_msginit, - &envoy_config_overload_v3_ScaledTrigger_msginit, - &envoy_config_overload_v3_Trigger_msginit, - &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, - &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, - &envoy_config_overload_v3_OverloadAction_msginit, - &envoy_config_overload_v3_BufferFactoryConfig_msginit, - &envoy_config_overload_v3_OverloadManager_msginit, + &envoy_config_overload_v3_ResourceMonitor_msg_init, + &envoy_config_overload_v3_ThresholdTrigger_msg_init, + &envoy_config_overload_v3_ScaledTrigger_msg_init, + &envoy_config_overload_v3_Trigger_msg_init, + &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init, + &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, + &envoy_config_overload_v3_OverloadAction_msg_init, + &envoy_config_overload_v3_BufferFactoryConfig_msg_init, + &envoy_config_overload_v3_OverloadManager_msg_init, }; -const upb_MiniTable_File envoy_config_overload_v3_overload_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_overload_v3_overload_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -170,5 +225,5 @@ const upb_MiniTable_File envoy_config_overload_v3_overload_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 97d02f0b705..1e93c7f6416 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 @@ -9,26 +9,22 @@ #ifndef ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_ #define ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_overload_v3_ResourceMonitor; -struct envoy_config_overload_v3_ThresholdTrigger; -struct envoy_config_overload_v3_ScaledTrigger; -struct envoy_config_overload_v3_Trigger; -struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig; -struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer; -struct envoy_config_overload_v3_OverloadAction; -struct envoy_config_overload_v3_BufferFactoryConfig; -struct envoy_config_overload_v3_OverloadManager; typedef struct envoy_config_overload_v3_ResourceMonitor envoy_config_overload_v3_ResourceMonitor; typedef struct envoy_config_overload_v3_ThresholdTrigger envoy_config_overload_v3_ThresholdTrigger; typedef struct envoy_config_overload_v3_ScaledTrigger envoy_config_overload_v3_ScaledTrigger; @@ -38,21 +34,21 @@ typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTim typedef struct envoy_config_overload_v3_OverloadAction envoy_config_overload_v3_OverloadAction; typedef struct envoy_config_overload_v3_BufferFactoryConfig envoy_config_overload_v3_BufferFactoryConfig; typedef struct envoy_config_overload_v3_OverloadManager envoy_config_overload_v3_OverloadManager; -extern const upb_MiniTable envoy_config_overload_v3_ResourceMonitor_msginit; -extern const upb_MiniTable envoy_config_overload_v3_ThresholdTrigger_msginit; -extern const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msginit; -extern const upb_MiniTable envoy_config_overload_v3_Trigger_msginit; -extern const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit; -extern const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit; -extern const upb_MiniTable envoy_config_overload_v3_OverloadAction_msginit; -extern const upb_MiniTable envoy_config_overload_v3_BufferFactoryConfig_msginit; -extern const upb_MiniTable envoy_config_overload_v3_OverloadManager_msginit; +extern const upb_MiniTable envoy_config_overload_v3_ResourceMonitor_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_ThresholdTrigger_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_Trigger_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_OverloadAction_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_BufferFactoryConfig_msg_init; +extern const upb_MiniTable envoy_config_overload_v3_OverloadManager_msg_init; struct envoy_type_v3_Percent; struct google_protobuf_Any; struct google_protobuf_Duration; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; typedef enum { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_UNSPECIFIED = 0, @@ -66,12 +62,12 @@ typedef enum { /* envoy.config.overload.v3.ResourceMonitor */ UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_ResourceMonitor_new(upb_Arena* arena) { - return (envoy_config_overload_v3_ResourceMonitor*)_upb_Message_New(&envoy_config_overload_v3_ResourceMonitor_msginit, arena); + return (envoy_config_overload_v3_ResourceMonitor*)_upb_Message_New(&envoy_config_overload_v3_ResourceMonitor_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_ResourceMonitor_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_ResourceMonitor* ret = envoy_config_overload_v3_ResourceMonitor_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -81,7 +77,7 @@ UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_Re int options, upb_Arena* arena) { envoy_config_overload_v3_ResourceMonitor* ret = envoy_config_overload_v3_ResourceMonitor_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -89,13 +85,13 @@ UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_Re } UPB_INLINE char* envoy_config_overload_v3_ResourceMonitor_serialize(const envoy_config_overload_v3_ResourceMonitor* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -103,36 +99,49 @@ typedef enum { envoy_config_overload_v3_ResourceMonitor_config_type_NOT_SET = 0 } envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases; UPB_INLINE envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases envoy_config_overload_v3_ResourceMonitor_config_type_case(const envoy_config_overload_v3_ResourceMonitor* msg) { - return (envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_clear_name(const envoy_config_overload_v3_ResourceMonitor* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_clear_name(envoy_config_overload_v3_ResourceMonitor* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_overload_v3_ResourceMonitor_name(const envoy_config_overload_v3_ResourceMonitor* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_overload_v3_ResourceMonitor_has_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_clear_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_overload_v3_ResourceMonitor_config_type_NOT_SET); +UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_clear_typed_config(envoy_config_overload_v3_ResourceMonitor* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_overload_v3_ResourceMonitor_has_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_name(envoy_config_overload_v3_ResourceMonitor *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_typed_config(envoy_config_overload_v3_ResourceMonitor *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_mutable_typed_config(envoy_config_overload_v3_ResourceMonitor* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_overload_v3_ResourceMonitor_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_ResourceMonitor_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_overload_v3_ResourceMonitor_set_typed_config(msg, sub); } return sub; } @@ -140,12 +149,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_ /* envoy.config.overload.v3.ThresholdTrigger */ UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_ThresholdTrigger_new(upb_Arena* arena) { - return (envoy_config_overload_v3_ThresholdTrigger*)_upb_Message_New(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena); + return (envoy_config_overload_v3_ThresholdTrigger*)_upb_Message_New(&envoy_config_overload_v3_ThresholdTrigger_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_ThresholdTrigger_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_ThresholdTrigger* ret = envoy_config_overload_v3_ThresholdTrigger_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -155,7 +164,7 @@ UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_T int options, upb_Arena* arena) { envoy_config_overload_v3_ThresholdTrigger* ret = envoy_config_overload_v3_ThresholdTrigger_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -163,35 +172,41 @@ UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_T } UPB_INLINE char* envoy_config_overload_v3_ThresholdTrigger_serialize(const envoy_config_overload_v3_ThresholdTrigger* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msg_init, 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; +UPB_INLINE void envoy_config_overload_v3_ThresholdTrigger_clear_value(envoy_config_overload_v3_ThresholdTrigger* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_config_overload_v3_ThresholdTrigger_value(const envoy_config_overload_v3_ThresholdTrigger* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_overload_v3_ThresholdTrigger_set_value(envoy_config_overload_v3_ThresholdTrigger *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.overload.v3.ScaledTrigger */ UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_ScaledTrigger_new(upb_Arena* arena) { - return (envoy_config_overload_v3_ScaledTrigger*)_upb_Message_New(&envoy_config_overload_v3_ScaledTrigger_msginit, arena); + return (envoy_config_overload_v3_ScaledTrigger*)_upb_Message_New(&envoy_config_overload_v3_ScaledTrigger_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_ScaledTrigger_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_ScaledTrigger* ret = envoy_config_overload_v3_ScaledTrigger_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -201,7 +216,7 @@ UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Scal int options, upb_Arena* arena) { envoy_config_overload_v3_ScaledTrigger* ret = envoy_config_overload_v3_ScaledTrigger_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -209,44 +224,56 @@ UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Scal } UPB_INLINE char* envoy_config_overload_v3_ScaledTrigger_serialize(const envoy_config_overload_v3_ScaledTrigger* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msg_init, 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; +UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_clear_scaling_threshold(envoy_config_overload_v3_ScaledTrigger* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_scaling_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_clear_saturation_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = 0; +UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_clear_saturation_threshold(envoy_config_overload_v3_ScaledTrigger* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_saturation_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_set_scaling_threshold(envoy_config_overload_v3_ScaledTrigger *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_set_saturation_threshold(envoy_config_overload_v3_ScaledTrigger *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.overload.v3.Trigger */ UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_new(upb_Arena* arena) { - return (envoy_config_overload_v3_Trigger*)_upb_Message_New(&envoy_config_overload_v3_Trigger_msginit, arena); + return (envoy_config_overload_v3_Trigger*)_upb_Message_New(&envoy_config_overload_v3_Trigger_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_Trigger* ret = envoy_config_overload_v3_Trigger_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -256,7 +283,7 @@ UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_pa int options, upb_Arena* arena) { envoy_config_overload_v3_Trigger* ret = envoy_config_overload_v3_Trigger_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -264,13 +291,13 @@ UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_pa } UPB_INLINE char* envoy_config_overload_v3_Trigger_serialize(const envoy_config_overload_v3_Trigger* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_Trigger_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_Trigger_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_Trigger_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_Trigger_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -279,57 +306,76 @@ typedef enum { envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET = 0 } envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases; UPB_INLINE envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases envoy_config_overload_v3_Trigger_trigger_oneof_case(const envoy_config_overload_v3_Trigger* msg) { - return (envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_overload_v3_Trigger_clear_name(const envoy_config_overload_v3_Trigger* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_overload_v3_Trigger_clear_name(envoy_config_overload_v3_Trigger* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_overload_v3_Trigger_name(const envoy_config_overload_v3_Trigger* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_overload_v3_Trigger_has_threshold(const envoy_config_overload_v3_Trigger* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_config_overload_v3_Trigger_clear_threshold(const envoy_config_overload_v3_Trigger* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET); +UPB_INLINE void envoy_config_overload_v3_Trigger_clear_threshold(envoy_config_overload_v3_Trigger* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_threshold(const envoy_config_overload_v3_Trigger* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_overload_v3_ThresholdTrigger* default_val = NULL; + const envoy_config_overload_v3_ThresholdTrigger* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_overload_v3_Trigger_has_scaled(const envoy_config_overload_v3_Trigger* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_overload_v3_Trigger_has_threshold(const envoy_config_overload_v3_Trigger* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_overload_v3_Trigger_clear_scaled(const envoy_config_overload_v3_Trigger* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET); +UPB_INLINE void envoy_config_overload_v3_Trigger_clear_scaled(envoy_config_overload_v3_Trigger* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_scaled(const envoy_config_overload_v3_Trigger* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_overload_v3_ScaledTrigger* default_val = NULL; + const envoy_config_overload_v3_ScaledTrigger* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_overload_v3_Trigger_has_scaled(const envoy_config_overload_v3_Trigger* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_overload_v3_Trigger_set_name(envoy_config_overload_v3_Trigger *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_overload_v3_Trigger_set_threshold(envoy_config_overload_v3_Trigger *msg, envoy_config_overload_v3_ThresholdTrigger* value) { - UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_mutable_threshold(envoy_config_overload_v3_Trigger* msg, upb_Arena* arena) { struct envoy_config_overload_v3_ThresholdTrigger* sub = (struct envoy_config_overload_v3_ThresholdTrigger*)envoy_config_overload_v3_Trigger_threshold(msg); if (sub == NULL) { - sub = (struct envoy_config_overload_v3_ThresholdTrigger*)_upb_Message_New(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_Trigger_set_threshold(msg, sub); + sub = (struct envoy_config_overload_v3_ThresholdTrigger*)_upb_Message_New(&envoy_config_overload_v3_ThresholdTrigger_msg_init, arena); + if (sub) envoy_config_overload_v3_Trigger_set_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_overload_v3_Trigger_set_scaled(envoy_config_overload_v3_Trigger *msg, envoy_config_overload_v3_ScaledTrigger* value) { - UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_mutable_scaled(envoy_config_overload_v3_Trigger* msg, upb_Arena* arena) { struct envoy_config_overload_v3_ScaledTrigger* sub = (struct envoy_config_overload_v3_ScaledTrigger*)envoy_config_overload_v3_Trigger_scaled(msg); if (sub == NULL) { - sub = (struct envoy_config_overload_v3_ScaledTrigger*)_upb_Message_New(&envoy_config_overload_v3_ScaledTrigger_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_Trigger_set_scaled(msg, sub); + sub = (struct envoy_config_overload_v3_ScaledTrigger*)_upb_Message_New(&envoy_config_overload_v3_ScaledTrigger_msg_init, arena); + if (sub) envoy_config_overload_v3_Trigger_set_scaled(msg, sub); } return sub; } @@ -337,12 +383,12 @@ UPB_INLINE struct envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_ /* envoy.config.overload.v3.ScaleTimersOverloadActionConfig */ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(upb_Arena* arena) { - return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena); + return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_ScaleTimersOverloadActionConfig* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -352,7 +398,7 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_confi int options, upb_Arena* arena) { envoy_config_overload_v3_ScaleTimersOverloadActionConfig* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -360,47 +406,72 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_confi } UPB_INLINE char* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_clear_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_has_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_clear_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t* len) { - return (const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_overload_v3_ScaleTimersOverloadActionConfig_timer_scale_factors(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_mutable_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t* len) { - return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_mutable_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_resize_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_resize_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_add_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, upb_Arena* arena) { - struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* sub = (struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* sub = (struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer */ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(upb_Arena* arena) { - return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena); + return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -410,7 +481,7 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* int options, upb_Arena* arena) { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -418,13 +489,13 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* } UPB_INLINE char* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -433,57 +504,76 @@ typedef enum { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET = 0 } envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases; UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_case(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_timer(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_timer(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_timer(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; -} -UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET); +UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, NULL); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Percent*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET); +UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Percent*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, NULL); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_timer(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, struct google_protobuf_Duration* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, struct envoy_type_v3_Percent* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Percent*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(msg, sub); } return sub; } @@ -491,12 +581,12 @@ UPB_INLINE struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOve /* envoy.config.overload.v3.OverloadAction */ UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadAction_new(upb_Arena* arena) { - return (envoy_config_overload_v3_OverloadAction*)_upb_Message_New(&envoy_config_overload_v3_OverloadAction_msginit, arena); + return (envoy_config_overload_v3_OverloadAction*)_upb_Message_New(&envoy_config_overload_v3_OverloadAction_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_OverloadAction* ret = envoy_config_overload_v3_OverloadAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -506,7 +596,7 @@ UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_Ove int options, upb_Arena* arena) { envoy_config_overload_v3_OverloadAction* ret = envoy_config_overload_v3_OverloadAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -514,65 +604,101 @@ UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_Ove } UPB_INLINE char* envoy_config_overload_v3_OverloadAction_serialize(const envoy_config_overload_v3_OverloadAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msg_init, 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); +UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_name(envoy_config_overload_v3_OverloadAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_overload_v3_OverloadAction_name(const envoy_config_overload_v3_OverloadAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_triggers(envoy_config_overload_v3_OverloadAction* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_overload_v3_Trigger* const* envoy_config_overload_v3_OverloadAction_triggers(const envoy_config_overload_v3_OverloadAction* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_overload_v3_Trigger* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_triggers(const envoy_config_overload_v3_OverloadAction* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_overload_v3_OverloadAction_triggers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_triggers(const envoy_config_overload_v3_OverloadAction* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_config_overload_v3_Trigger* const* envoy_config_overload_v3_OverloadAction_triggers(const envoy_config_overload_v3_OverloadAction* msg, size_t* len) { - return (const envoy_config_overload_v3_Trigger* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_typed_config(const envoy_config_overload_v3_OverloadAction* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_typed_config(const envoy_config_overload_v3_OverloadAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_typed_config(envoy_config_overload_v3_OverloadAction* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_typed_config(const envoy_config_overload_v3_OverloadAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_typed_config(const envoy_config_overload_v3_OverloadAction* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_name(envoy_config_overload_v3_OverloadAction *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_mutable_triggers(envoy_config_overload_v3_OverloadAction* msg, size_t* len) { - return (envoy_config_overload_v3_Trigger**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_mutable_triggers(envoy_config_overload_v3_OverloadAction* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_overload_v3_Trigger**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_resize_triggers(envoy_config_overload_v3_OverloadAction* msg, size_t len, upb_Arena* arena) { - return (envoy_config_overload_v3_Trigger**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_resize_triggers(envoy_config_overload_v3_OverloadAction* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_Trigger**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_overload_v3_Trigger* envoy_config_overload_v3_OverloadAction_add_triggers(envoy_config_overload_v3_OverloadAction* msg, upb_Arena* arena) { - struct envoy_config_overload_v3_Trigger* sub = (struct envoy_config_overload_v3_Trigger*)_upb_Message_New(&envoy_config_overload_v3_Trigger_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_overload_v3_Trigger* sub = (struct envoy_config_overload_v3_Trigger*)_upb_Message_New(&envoy_config_overload_v3_Trigger_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_typed_config(envoy_config_overload_v3_OverloadAction *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_mutable_typed_config(envoy_config_overload_v3_OverloadAction* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_overload_v3_OverloadAction_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_OverloadAction_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_overload_v3_OverloadAction_set_typed_config(msg, sub); } return sub; } @@ -580,12 +706,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_m /* envoy.config.overload.v3.BufferFactoryConfig */ UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_BufferFactoryConfig_new(upb_Arena* arena) { - return (envoy_config_overload_v3_BufferFactoryConfig*)_upb_Message_New(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena); + return (envoy_config_overload_v3_BufferFactoryConfig*)_upb_Message_New(&envoy_config_overload_v3_BufferFactoryConfig_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_BufferFactoryConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_BufferFactoryConfig* ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -595,7 +721,7 @@ UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v int options, upb_Arena* arena) { envoy_config_overload_v3_BufferFactoryConfig* ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -603,35 +729,41 @@ UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v } UPB_INLINE char* envoy_config_overload_v3_BufferFactoryConfig_serialize(const envoy_config_overload_v3_BufferFactoryConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msg_init, 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; +UPB_INLINE void envoy_config_overload_v3_BufferFactoryConfig_clear_minimum_account_to_track_power_of_two(envoy_config_overload_v3_BufferFactoryConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_overload_v3_BufferFactoryConfig_minimum_account_to_track_power_of_two(const envoy_config_overload_v3_BufferFactoryConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_overload_v3_BufferFactoryConfig_set_minimum_account_to_track_power_of_two(envoy_config_overload_v3_BufferFactoryConfig *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.overload.v3.OverloadManager */ UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_OverloadManager_new(upb_Arena* arena) { - return (envoy_config_overload_v3_OverloadManager*)_upb_Message_New(&envoy_config_overload_v3_OverloadManager_msginit, arena); + return (envoy_config_overload_v3_OverloadManager*)_upb_Message_New(&envoy_config_overload_v3_OverloadManager_msg_init, arena); } UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_OverloadManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_overload_v3_OverloadManager* ret = envoy_config_overload_v3_OverloadManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -641,7 +773,7 @@ UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_Ov int options, upb_Arena* arena) { envoy_config_overload_v3_OverloadManager* ret = envoy_config_overload_v3_OverloadManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -649,109 +781,169 @@ UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_Ov } UPB_INLINE char* envoy_config_overload_v3_OverloadManager_serialize(const envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msg_init, 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); -} -UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_refresh_interval(envoy_config_overload_v3_OverloadManager* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_resource_monitors(envoy_config_overload_v3_OverloadManager* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_overload_v3_ResourceMonitor* const* envoy_config_overload_v3_OverloadManager_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_overload_v3_ResourceMonitor* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_config_overload_v3_OverloadManager_resource_monitors(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_actions(envoy_config_overload_v3_OverloadManager* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_overload_v3_ResourceMonitor* const* envoy_config_overload_v3_OverloadManager_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg, size_t* len) { - return (const envoy_config_overload_v3_ResourceMonitor* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE const envoy_config_overload_v3_OverloadAction* const* envoy_config_overload_v3_OverloadManager_actions(const envoy_config_overload_v3_OverloadManager* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_overload_v3_OverloadAction* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_actions(const envoy_config_overload_v3_OverloadManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_overload_v3_OverloadManager_actions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_actions(const envoy_config_overload_v3_OverloadManager* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_config_overload_v3_OverloadAction* const* envoy_config_overload_v3_OverloadManager_actions(const envoy_config_overload_v3_OverloadManager* msg, size_t* len) { - return (const envoy_config_overload_v3_OverloadAction* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_buffer_factory_config(envoy_config_overload_v3_OverloadManager* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_overload_v3_BufferFactoryConfig*); + const envoy_config_overload_v3_BufferFactoryConfig* default_val = NULL; + const envoy_config_overload_v3_BufferFactoryConfig* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_refresh_interval(envoy_config_overload_v3_OverloadManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_mutable_refresh_interval(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_overload_v3_OverloadManager_refresh_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_OverloadManager_set_refresh_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_overload_v3_OverloadManager_set_refresh_interval(msg, sub); } return sub; } -UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_mutable_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, size_t* len) { - return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_mutable_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_resize_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, size_t len, upb_Arena* arena) { - return (envoy_config_overload_v3_ResourceMonitor**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_resize_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_ResourceMonitor**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_OverloadManager_add_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) { - struct envoy_config_overload_v3_ResourceMonitor* sub = (struct envoy_config_overload_v3_ResourceMonitor*)_upb_Message_New(&envoy_config_overload_v3_ResourceMonitor_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_overload_v3_ResourceMonitor* sub = (struct envoy_config_overload_v3_ResourceMonitor*)_upb_Message_New(&envoy_config_overload_v3_ResourceMonitor_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_mutable_actions(envoy_config_overload_v3_OverloadManager* msg, size_t* len) { - return (envoy_config_overload_v3_OverloadAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_mutable_actions(envoy_config_overload_v3_OverloadManager* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_overload_v3_OverloadAction**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_resize_actions(envoy_config_overload_v3_OverloadManager* msg, size_t len, upb_Arena* arena) { - return (envoy_config_overload_v3_OverloadAction**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_resize_actions(envoy_config_overload_v3_OverloadManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_overload_v3_OverloadAction**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadManager_add_actions(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) { - struct envoy_config_overload_v3_OverloadAction* sub = (struct envoy_config_overload_v3_OverloadAction*)_upb_Message_New(&envoy_config_overload_v3_OverloadAction_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_overload_v3_OverloadAction* sub = (struct envoy_config_overload_v3_OverloadAction*)_upb_Message_New(&envoy_config_overload_v3_OverloadAction_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(envoy_config_overload_v3_OverloadManager *msg, envoy_config_overload_v3_BufferFactoryConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_overload_v3_BufferFactoryConfig*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_mutable_buffer_factory_config(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) { struct envoy_config_overload_v3_BufferFactoryConfig* sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)envoy_config_overload_v3_OverloadManager_buffer_factory_config(msg); if (sub == NULL) { - sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)_upb_Message_New(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(msg, sub); + sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)_upb_Message_New(&envoy_config_overload_v3_BufferFactoryConfig_msg_init, arena); + if (sub) envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_overload_v3_overload_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_overload_v3_overload_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_ */ 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 3604fc0a146..d6c4755488b 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/rbac/v3/rbac.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -25,227 +27,318 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_rbac_v3_RBAC_submsgs[2] = { - {.submsg = &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit}, - {.submsg = &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_RBAC_submsgs[2] = { + {.submsg = &envoy_config_rbac_v3_RBAC_PoliciesEntry_msg_init}, + {.submsg = &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC__fields[3] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_RBAC__fields[3] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_RBAC_msginit = { +const upb_MiniTable envoy_config_rbac_v3_RBAC_msg_init = { &envoy_config_rbac_v3_RBAC_submsgs[0], &envoy_config_rbac_v3_RBAC__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000101001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_RBAC_AuditLoggingOptions_submsgs[1] = { - {.submsg = &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_RBAC_AuditLoggingOptions_submsgs[1] = { + {.submsg = &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC_AuditLoggingOptions__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_RBAC_AuditLoggingOptions__fields[2] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit = { +const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init = { &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_submsgs[0], &envoy_config_rbac_v3_RBAC_AuditLoggingOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit = { +const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init = { &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_submsgs[0], &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = { - {.submsg = &envoy_config_rbac_v3_Policy_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = { + {.submsg = &envoy_config_rbac_v3_Policy_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit = { +const upb_MiniTable envoy_config_rbac_v3_RBAC_PoliciesEntry_msg_init = { &envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[0], &envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_Policy_submsgs[4] = { - {.submsg = &envoy_config_rbac_v3_Permission_msginit}, - {.submsg = &envoy_config_rbac_v3_Principal_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_CheckedExpr_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_Policy_submsgs[4] = { + {.submsg = &envoy_config_rbac_v3_Permission_msg_init}, + {.submsg = &envoy_config_rbac_v3_Principal_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_CheckedExpr_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Policy__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Policy__fields[4] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Policy_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Policy_msg_init = { &envoy_config_rbac_v3_Policy_submsgs[0], &envoy_config_rbac_v3_Policy__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x001800000102001a, &upb_psm_1bt_maxmaxb}, + {0x0020000002030022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_Permission_submsgs[10] = { - {.submsg = &envoy_config_rbac_v3_Permission_Set_msginit}, - {.submsg = &envoy_config_rbac_v3_Permission_Set_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit}, - {.submsg = &envoy_config_rbac_v3_Permission_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_PathMatcher_msginit}, - {.submsg = &envoy_type_v3_Int32Range_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_Permission_submsgs[10] = { + {.submsg = &envoy_config_rbac_v3_Permission_Set_msg_init}, + {.submsg = &envoy_config_rbac_v3_Permission_Set_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msg_init}, + {.submsg = &envoy_config_rbac_v3_Permission_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_PathMatcher_msg_init}, + {.submsg = &envoy_type_v3_Int32Range_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Permission__fields[12] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Permission__fields[12] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Permission_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Permission_msg_init = { &envoy_config_rbac_v3_Permission_submsgs[0], &envoy_config_rbac_v3_Permission__fields[0], - UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0008000003000018, &upb_pob1_1bt}, + {0x0008000004020022, &upb_pom_1bt_maxmaxb}, + {0x000800000503002a, &upb_pom_1bt_maxmaxb}, + {0x0008000006000030, &upb_pov4_1bt}, + {0x000800000704003a, &upb_pom_1bt_maxmaxb}, + {0x0008000008050042, &upb_pom_1bt_max64b}, + {0x000800000906004a, &upb_pom_1bt_maxmaxb}, + {0x000800000a070052, &upb_pom_1bt_maxmaxb}, + {0x000800000b08005a, &upb_pom_1bt_maxmaxb}, + {0x000800000c090062, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_Permission_Set_submsgs[1] = { - {.submsg = &envoy_config_rbac_v3_Permission_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_Permission_Set_submsgs[1] = { + {.submsg = &envoy_config_rbac_v3_Permission_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Permission_Set__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Permission_Set__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Permission_Set_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Permission_Set_msg_init = { &envoy_config_rbac_v3_Permission_Set_submsgs[0], &envoy_config_rbac_v3_Permission_Set__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_submsgs[11] = { - {.submsg = &envoy_config_rbac_v3_Principal_Set_msginit}, - {.submsg = &envoy_config_rbac_v3_Principal_Set_msginit}, - {.submsg = &envoy_config_rbac_v3_Principal_Authenticated_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit}, - {.submsg = &envoy_config_rbac_v3_Principal_msginit}, - {.submsg = &envoy_type_matcher_v3_PathMatcher_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &envoy_type_matcher_v3_FilterStateMatcher_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_Principal_submsgs[11] = { + {.submsg = &envoy_config_rbac_v3_Principal_Set_msg_init}, + {.submsg = &envoy_config_rbac_v3_Principal_Set_msg_init}, + {.submsg = &envoy_config_rbac_v3_Principal_Authenticated_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msg_init}, + {.submsg = &envoy_config_rbac_v3_Principal_msg_init}, + {.submsg = &envoy_type_matcher_v3_PathMatcher_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &envoy_type_matcher_v3_FilterStateMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Principal__fields[12] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Principal__fields[12] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Principal_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Principal_msg_init = { &envoy_config_rbac_v3_Principal_submsgs[0], &envoy_config_rbac_v3_Principal__fields[0], - UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0008000003000018, &upb_pob1_1bt}, + {0x0008000004020022, &upb_pom_1bt_max64b}, + {0x000800000503002a, &upb_pom_1bt_maxmaxb}, + {0x0008000006040032, &upb_pom_1bt_maxmaxb}, + {0x000800000705003a, &upb_pom_1bt_maxmaxb}, + {0x0008000008060042, &upb_pom_1bt_max64b}, + {0x000800000907004a, &upb_pom_1bt_maxmaxb}, + {0x000800000a080052, &upb_pom_1bt_maxmaxb}, + {0x000800000b09005a, &upb_pom_1bt_maxmaxb}, + {0x000800000c0a0062, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_Set_submsgs[1] = { - {.submsg = &envoy_config_rbac_v3_Principal_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_Principal_Set_submsgs[1] = { + {.submsg = &envoy_config_rbac_v3_Principal_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Principal_Set__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Principal_Set__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Principal_Set_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Principal_Set_msg_init = { &envoy_config_rbac_v3_Principal_Set_submsgs[0], &envoy_config_rbac_v3_Principal_Set__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Principal_Authenticated__fields[1] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Principal_Authenticated__fields[1] = { + {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Principal_Authenticated_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Principal_Authenticated_msg_init = { &envoy_config_rbac_v3_Principal_Authenticated_submsgs[0], &envoy_config_rbac_v3_Principal_Authenticated__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_rbac_v3_Action__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_rbac_v3_Action__fields[2] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_rbac_v3_Action_msginit = { +const upb_MiniTable envoy_config_rbac_v3_Action_msg_init = { NULL, &envoy_config_rbac_v3_Action__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[11] = { - &envoy_config_rbac_v3_RBAC_msginit, - &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, - &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, - &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit, - &envoy_config_rbac_v3_Policy_msginit, - &envoy_config_rbac_v3_Permission_msginit, - &envoy_config_rbac_v3_Permission_Set_msginit, - &envoy_config_rbac_v3_Principal_msginit, - &envoy_config_rbac_v3_Principal_Set_msginit, - &envoy_config_rbac_v3_Principal_Authenticated_msginit, - &envoy_config_rbac_v3_Action_msginit, + &envoy_config_rbac_v3_RBAC_msg_init, + &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, + &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, + &envoy_config_rbac_v3_RBAC_PoliciesEntry_msg_init, + &envoy_config_rbac_v3_Policy_msg_init, + &envoy_config_rbac_v3_Permission_msg_init, + &envoy_config_rbac_v3_Permission_Set_msg_init, + &envoy_config_rbac_v3_Principal_msg_init, + &envoy_config_rbac_v3_Principal_Set_msg_init, + &envoy_config_rbac_v3_Principal_Authenticated_msg_init, + &envoy_config_rbac_v3_Action_msg_init, }; -const upb_MiniTable_File envoy_config_rbac_v3_rbac_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_rbac_v3_rbac_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -254,5 +347,5 @@ const upb_MiniTable_File envoy_config_rbac_v3_rbac_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 09f51e024a6..3e738084bed 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 @@ -9,28 +9,22 @@ #ifndef ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_ #define ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_rbac_v3_RBAC; -struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions; -struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig; -struct envoy_config_rbac_v3_RBAC_PoliciesEntry; -struct envoy_config_rbac_v3_Policy; -struct envoy_config_rbac_v3_Permission; -struct envoy_config_rbac_v3_Permission_Set; -struct envoy_config_rbac_v3_Principal; -struct envoy_config_rbac_v3_Principal_Set; -struct envoy_config_rbac_v3_Principal_Authenticated; -struct envoy_config_rbac_v3_Action; typedef struct envoy_config_rbac_v3_RBAC envoy_config_rbac_v3_RBAC; typedef struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions envoy_config_rbac_v3_RBAC_AuditLoggingOptions; typedef struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig; @@ -42,17 +36,17 @@ typedef struct envoy_config_rbac_v3_Principal envoy_config_rbac_v3_Principal; typedef struct envoy_config_rbac_v3_Principal_Set envoy_config_rbac_v3_Principal_Set; typedef struct envoy_config_rbac_v3_Principal_Authenticated envoy_config_rbac_v3_Principal_Authenticated; typedef struct envoy_config_rbac_v3_Action envoy_config_rbac_v3_Action; -extern const upb_MiniTable envoy_config_rbac_v3_RBAC_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Policy_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Permission_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Permission_Set_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Principal_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Principal_Set_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Principal_Authenticated_msginit; -extern const upb_MiniTable envoy_config_rbac_v3_Action_msginit; +extern const upb_MiniTable envoy_config_rbac_v3_RBAC_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_RBAC_PoliciesEntry_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Policy_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Permission_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Permission_Set_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Principal_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Principal_Set_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Principal_Authenticated_msg_init; +extern const upb_MiniTable envoy_config_rbac_v3_Action_msg_init; struct envoy_config_core_v3_CidrRange; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_config_route_v3_HeaderMatcher; @@ -63,16 +57,16 @@ struct envoy_type_matcher_v3_StringMatcher; struct envoy_type_v3_Int32Range; struct google_api_expr_v1alpha1_CheckedExpr; struct google_api_expr_v1alpha1_Expr; -extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_FilterStateMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable envoy_type_v3_Int32Range_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit; +extern const upb_MiniTable envoy_config_core_v3_CidrRange_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_FilterStateMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable envoy_type_v3_Int32Range_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msg_init; typedef enum { envoy_config_rbac_v3_RBAC_ALLOW = 0, @@ -92,12 +86,12 @@ typedef enum { /* envoy.config.rbac.v3.RBAC */ UPB_INLINE envoy_config_rbac_v3_RBAC* envoy_config_rbac_v3_RBAC_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msginit, arena); + return (envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_RBAC* envoy_config_rbac_v3_RBAC_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_RBAC* ret = envoy_config_rbac_v3_RBAC_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -107,7 +101,7 @@ UPB_INLINE envoy_config_rbac_v3_RBAC* envoy_config_rbac_v3_RBAC_parse_ex(const c int options, upb_Arena* arena) { envoy_config_rbac_v3_RBAC* ret = envoy_config_rbac_v3_RBAC_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -115,69 +109,103 @@ UPB_INLINE envoy_config_rbac_v3_RBAC* envoy_config_rbac_v3_RBAC_parse_ex(const c } UPB_INLINE char* envoy_config_rbac_v3_RBAC_serialize(const envoy_config_rbac_v3_RBAC* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msg_init, 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(4, 4), int32_t) = 0; +UPB_INLINE void envoy_config_rbac_v3_RBAC_clear_action(envoy_config_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_rbac_v3_RBAC_action(const envoy_config_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_RBAC_has_policies(const envoy_config_rbac_v3_RBAC* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); -} -UPB_INLINE void envoy_config_rbac_v3_RBAC_clear_policies(const envoy_config_rbac_v3_RBAC* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 8)); +UPB_INLINE void envoy_config_rbac_v3_RBAC_clear_policies(envoy_config_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_rbac_v3_RBAC_policies_size(const envoy_config_rbac_v3_RBAC* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(8, 8)); + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_get(const envoy_config_rbac_v3_RBAC* msg, upb_StringView key, envoy_config_rbac_v3_Policy** val) { - return _upb_msg_map_get(msg, UPB_SIZE(8, 8), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_rbac_v3_RBAC_PoliciesEntry* envoy_config_rbac_v3_RBAC_policies_next(const envoy_config_rbac_v3_RBAC* msg, size_t* iter) { - return (const envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 8), iter); + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool envoy_config_rbac_v3_RBAC_has_audit_logging_options(const envoy_config_rbac_v3_RBAC* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_rbac_v3_RBAC_has_policies(const envoy_config_rbac_v3_RBAC* msg) { + return envoy_config_rbac_v3_RBAC_policies_size(msg) != 0; } -UPB_INLINE void envoy_config_rbac_v3_RBAC_clear_audit_logging_options(const envoy_config_rbac_v3_RBAC* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_rbac_v3_RBAC_clear_audit_logging_options(envoy_config_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rbac_v3_RBAC_audit_logging_options(const envoy_config_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const envoy_config_rbac_v3_RBAC_AuditLoggingOptions*); + const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* default_val = NULL; + const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_rbac_v3_RBAC_has_audit_logging_options(const envoy_config_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_rbac_v3_RBAC_set_action(envoy_config_rbac_v3_RBAC *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void envoy_config_rbac_v3_RBAC_policies_clear(envoy_config_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_rbac_v3_RBAC_policies_clear(envoy_config_rbac_v3_RBAC* msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 8)); } UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_set(envoy_config_rbac_v3_RBAC* msg, upb_StringView key, envoy_config_rbac_v3_Policy* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(8, 8), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_delete(envoy_config_rbac_v3_RBAC* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(8, 8), &key, 0); + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_rbac_v3_RBAC_PoliciesEntry* envoy_config_rbac_v3_RBAC_policies_nextmutable(envoy_config_rbac_v3_RBAC* msg, size_t* iter) { - return (envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 8), iter); + const upb_MiniTableField field = {2, 8, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_map_next(map, iter); } UPB_INLINE void envoy_config_rbac_v3_RBAC_set_audit_logging_options(envoy_config_rbac_v3_RBAC *msg, envoy_config_rbac_v3_RBAC_AuditLoggingOptions* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), envoy_config_rbac_v3_RBAC_AuditLoggingOptions*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rbac_v3_RBAC_mutable_audit_logging_options(envoy_config_rbac_v3_RBAC* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions* sub = (struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions*)envoy_config_rbac_v3_RBAC_audit_logging_options(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_RBAC_set_audit_logging_options(msg, sub); + sub = (struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, arena); + if (sub) envoy_config_rbac_v3_RBAC_set_audit_logging_options(msg, sub); } return sub; } @@ -185,12 +213,12 @@ UPB_INLINE struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rb /* envoy.config.rbac.v3.RBAC.AuditLoggingOptions */ UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, arena); + return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_RBAC_AuditLoggingOptions* ret = envoy_config_rbac_v3_RBAC_AuditLoggingOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -200,7 +228,7 @@ UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rbac_v3_R int options, upb_Arena* arena) { envoy_config_rbac_v3_RBAC_AuditLoggingOptions* ret = envoy_config_rbac_v3_RBAC_AuditLoggingOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -208,56 +236,87 @@ UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions* envoy_config_rbac_v3_R } UPB_INLINE char* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_serialize(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_serialize_ex(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_clear_audit_condition(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_clear_audit_condition(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_rbac_v3_RBAC_AuditLoggingOptions_audit_condition(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_clear_logger_configs(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* const* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_logger_configs(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_rbac_v3_RBAC_AuditLoggingOptions_has_logger_configs(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_clear_logger_configs(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* const* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_logger_configs(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, size_t* len) { - return (const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_config_rbac_v3_RBAC_AuditLoggingOptions_logger_configs(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_set_audit_condition(envoy_config_rbac_v3_RBAC_AuditLoggingOptions *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig** envoy_config_rbac_v3_RBAC_AuditLoggingOptions_mutable_logger_configs(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, size_t* len) { - return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig** envoy_config_rbac_v3_RBAC_AuditLoggingOptions_mutable_logger_configs(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig** envoy_config_rbac_v3_RBAC_AuditLoggingOptions_resize_logger_configs(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, size_t len, upb_Arena* arena) { - return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig** envoy_config_rbac_v3_RBAC_AuditLoggingOptions_resize_logger_configs(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_add_logger_configs(envoy_config_rbac_v3_RBAC_AuditLoggingOptions* msg, upb_Arena* arena) { - struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* sub = (struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* sub = (struct envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig */ UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, arena); + return (envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* ret = envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -267,7 +326,7 @@ UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* envo int options, upb_Arena* arena) { envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* ret = envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -275,46 +334,57 @@ UPB_INLINE envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* envo } UPB_INLINE char* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_serialize(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_serialize_ex(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_has_audit_logger(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_clear_audit_logger(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_clear_audit_logger(envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_audit_logger(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_clear_is_optional(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_has_audit_logger(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_clear_is_optional(envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_is_optional(const envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_set_audit_logger(envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_mutable_audit_logger(envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_audit_logger(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_set_audit_logger(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_set_audit_logger(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig_set_is_optional(envoy_config_rbac_v3_RBAC_AuditLoggingOptions_AuditLoggerConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.rbac.v3.RBAC.PoliciesEntry */ @@ -324,14 +394,15 @@ UPB_INLINE upb_StringView envoy_config_rbac_v3_RBAC_PoliciesEntry_key(const envo _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_rbac_v3_RBAC_PoliciesEntry_has_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_RBAC_PoliciesEntry_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry* msg) { envoy_config_rbac_v3_Policy* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_rbac_v3_RBAC_PoliciesEntry_has_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_rbac_v3_RBAC_PoliciesEntry_set_value(envoy_config_rbac_v3_RBAC_PoliciesEntry *msg, envoy_config_rbac_v3_Policy* value) { _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_rbac_v3_Policy*)); @@ -340,12 +411,12 @@ UPB_INLINE void envoy_config_rbac_v3_RBAC_PoliciesEntry_set_value(envoy_config_r /* envoy.config.rbac.v3.Policy */ UPB_INLINE envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_Policy_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Policy*)_upb_Message_New(&envoy_config_rbac_v3_Policy_msginit, arena); + return (envoy_config_rbac_v3_Policy*)_upb_Message_New(&envoy_config_rbac_v3_Policy_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_Policy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Policy* ret = envoy_config_rbac_v3_Policy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -355,7 +426,7 @@ UPB_INLINE envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_Policy_parse_ex(con int options, upb_Arena* arena) { envoy_config_rbac_v3_Policy* ret = envoy_config_rbac_v3_Policy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -363,99 +434,159 @@ UPB_INLINE envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_Policy_parse_ex(con } UPB_INLINE char* envoy_config_rbac_v3_Policy_serialize(const envoy_config_rbac_v3_Policy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Policy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Policy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Policy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Policy_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_rbac_v3_Policy_clear_permissions(envoy_config_rbac_v3_Policy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Policy_permissions(const envoy_config_rbac_v3_Policy* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_rbac_v3_Permission* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_rbac_v3_Policy_permissions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_rbac_v3_Policy_clear_permissions(const envoy_config_rbac_v3_Policy* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void envoy_config_rbac_v3_Policy_clear_principals(envoy_config_rbac_v3_Policy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Policy_permissions(const envoy_config_rbac_v3_Policy* msg, size_t* len) { - return (const envoy_config_rbac_v3_Permission* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Policy_principals(const envoy_config_rbac_v3_Policy* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_rbac_v3_Principal* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_rbac_v3_Policy_has_principals(const envoy_config_rbac_v3_Policy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_config_rbac_v3_Policy_principals(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_rbac_v3_Policy_clear_principals(const envoy_config_rbac_v3_Policy* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Policy_principals(const envoy_config_rbac_v3_Policy* msg, size_t* len) { - return (const envoy_config_rbac_v3_Principal* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); -} -UPB_INLINE bool envoy_config_rbac_v3_Policy_has_condition(const envoy_config_rbac_v3_Policy* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_rbac_v3_Policy_clear_condition(const envoy_config_rbac_v3_Policy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_rbac_v3_Policy_clear_condition(envoy_config_rbac_v3_Policy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_condition(const envoy_config_rbac_v3_Policy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_api_expr_v1alpha1_Expr*); + const struct google_api_expr_v1alpha1_Expr* default_val = NULL; + const struct google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Policy_has_checked_condition(const envoy_config_rbac_v3_Policy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_rbac_v3_Policy_has_condition(const envoy_config_rbac_v3_Policy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Policy_clear_checked_condition(const envoy_config_rbac_v3_Policy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_rbac_v3_Policy_clear_checked_condition(envoy_config_rbac_v3_Policy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Policy_checked_condition(const envoy_config_rbac_v3_Policy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_api_expr_v1alpha1_CheckedExpr*); + const struct google_api_expr_v1alpha1_CheckedExpr* default_val = NULL; + const struct google_api_expr_v1alpha1_CheckedExpr* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_rbac_v3_Policy_has_checked_condition(const envoy_config_rbac_v3_Policy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_mutable_permissions(envoy_config_rbac_v3_Policy* msg, size_t* len) { - return (envoy_config_rbac_v3_Permission**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_mutable_permissions(envoy_config_rbac_v3_Policy* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_rbac_v3_Permission**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_resize_permissions(envoy_config_rbac_v3_Policy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_rbac_v3_Permission**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_resize_permissions(envoy_config_rbac_v3_Policy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_Permission**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Policy_add_permissions(envoy_config_rbac_v3_Policy* msg, upb_Arena* arena) { - struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_mutable_principals(envoy_config_rbac_v3_Policy* msg, size_t* len) { - return (envoy_config_rbac_v3_Principal**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_mutable_principals(envoy_config_rbac_v3_Policy* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_rbac_v3_Principal**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_resize_principals(envoy_config_rbac_v3_Policy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_rbac_v3_Principal**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_resize_principals(envoy_config_rbac_v3_Policy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_Principal**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Policy_add_principals(envoy_config_rbac_v3_Policy* msg, upb_Arena* arena) { - struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_rbac_v3_Policy_set_condition(envoy_config_rbac_v3_Policy *msg, struct google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_mutable_condition(envoy_config_rbac_v3_Policy* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)envoy_config_rbac_v3_Policy_condition(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Policy_set_condition(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) envoy_config_rbac_v3_Policy_set_condition(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Policy_set_checked_condition(envoy_config_rbac_v3_Policy *msg, struct google_api_expr_v1alpha1_CheckedExpr* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_api_expr_v1alpha1_CheckedExpr*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Policy_mutable_checked_condition(envoy_config_rbac_v3_Policy* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_CheckedExpr* sub = (struct google_api_expr_v1alpha1_CheckedExpr*)envoy_config_rbac_v3_Policy_checked_condition(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Policy_set_checked_condition(msg, sub); + sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msg_init, arena); + if (sub) envoy_config_rbac_v3_Policy_set_checked_condition(msg, sub); } return sub; } @@ -463,12 +594,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Pol /* envoy.config.rbac.v3.Permission */ UPB_INLINE envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msginit, arena); + return (envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Permission* ret = envoy_config_rbac_v3_Permission_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -478,7 +609,7 @@ UPB_INLINE envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_pars int options, upb_Arena* arena) { envoy_config_rbac_v3_Permission* ret = envoy_config_rbac_v3_Permission_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -486,13 +617,13 @@ UPB_INLINE envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_pars } UPB_INLINE char* envoy_config_rbac_v3_Permission_serialize(const envoy_config_rbac_v3_Permission* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -511,240 +642,315 @@ typedef enum { envoy_config_rbac_v3_Permission_rule_NOT_SET = 0 } envoy_config_rbac_v3_Permission_rule_oneofcases; UPB_INLINE envoy_config_rbac_v3_Permission_rule_oneofcases envoy_config_rbac_v3_Permission_rule_case(const envoy_config_rbac_v3_Permission* msg) { - return (envoy_config_rbac_v3_Permission_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_Permission_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_and_rules(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_and_rules(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_and_rules(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_and_rules(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_rbac_v3_Permission_Set* default_val = NULL; + const envoy_config_rbac_v3_Permission_Set* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_or_rules(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_and_rules(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_or_rules(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_or_rules(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_or_rules(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_rbac_v3_Permission_Set* default_val = NULL; + const envoy_config_rbac_v3_Permission_Set* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_any(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_or_rules(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_any(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_any(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_rbac_v3_Permission_any(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_header(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_any(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_header(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_header(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Permission_header(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const struct envoy_config_route_v3_HeaderMatcher* default_val = NULL; + const struct envoy_config_route_v3_HeaderMatcher* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_ip(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_header(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_ip(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_ip(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Permission_destination_ip(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const struct envoy_config_core_v3_CidrRange* default_val = NULL; + const struct envoy_config_core_v3_CidrRange* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_ip(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_port(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_port(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_rbac_v3_Permission_destination_port(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, _upb_UInt32_FromU(0u)); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_metadata(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_metadata(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_metadata(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Permission_metadata(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const struct envoy_type_matcher_v3_MetadataMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_MetadataMatcher* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_not_rule(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_metadata(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_not_rule(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_not_rule(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_not_rule(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const envoy_config_rbac_v3_Permission* default_val = NULL; + const envoy_config_rbac_v3_Permission* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_requested_server_name(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_not_rule(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_requested_server_name(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_requested_server_name(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_requested_server_name(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_url_path(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_requested_server_name(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_url_path(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_url_path(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_url_path(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL); + const struct envoy_type_matcher_v3_PathMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_PathMatcher* ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port_range(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_url_path(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_port_range(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_port_range(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Int32Range* envoy_config_rbac_v3_Permission_destination_port_range(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 11, NULL); + const struct envoy_type_v3_Int32Range* default_val = NULL; + const struct envoy_type_v3_Int32Range* ret; + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Permission_has_matcher(const envoy_config_rbac_v3_Permission* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 12; +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port_range(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Permission_clear_matcher(const envoy_config_rbac_v3_Permission* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Permission_clear_matcher(envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_Permission_matcher(const envoy_config_rbac_v3_Permission* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 12, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_rbac_v3_Permission_has_matcher(const envoy_config_rbac_v3_Permission* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_rbac_v3_Permission_set_and_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_mutable_and_rules(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Permission_Set* sub = (struct envoy_config_rbac_v3_Permission_Set*)envoy_config_rbac_v3_Permission_and_rules(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_Message_New(&envoy_config_rbac_v3_Permission_Set_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_and_rules(msg, sub); + sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_Message_New(&envoy_config_rbac_v3_Permission_Set_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_and_rules(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_or_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_mutable_or_rules(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Permission_Set* sub = (struct envoy_config_rbac_v3_Permission_Set*)envoy_config_rbac_v3_Permission_or_rules(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_Message_New(&envoy_config_rbac_v3_Permission_Set_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_or_rules(msg, sub); + sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_Message_New(&envoy_config_rbac_v3_Permission_Set_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_or_rules(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_any(envoy_config_rbac_v3_Permission *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_rbac_v3_Permission_set_header(envoy_config_rbac_v3_Permission *msg, struct envoy_config_route_v3_HeaderMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Permission_mutable_header(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_rbac_v3_Permission_header(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_header(msg, sub); + sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_header(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_ip(envoy_config_rbac_v3_Permission *msg, struct envoy_config_core_v3_CidrRange* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Permission_mutable_destination_ip(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Permission_destination_ip(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_destination_ip(msg, sub); + sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_destination_ip(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_port(envoy_config_rbac_v3_Permission *msg, uint32_t value) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_rbac_v3_Permission_set_metadata(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Permission_mutable_metadata(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_rbac_v3_Permission_metadata(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_metadata(msg, sub); + sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_not_rule(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_mutable_not_rule(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)envoy_config_rbac_v3_Permission_not_rule(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_not_rule(msg, sub); + sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_not_rule(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_requested_server_name(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_mutable_requested_server_name(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_rbac_v3_Permission_requested_server_name(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_requested_server_name(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_requested_server_name(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_url_path(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_PathMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_mutable_url_path(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_PathMatcher* sub = (struct envoy_type_matcher_v3_PathMatcher*)envoy_config_rbac_v3_Permission_url_path(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_url_path(msg, sub); + sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_url_path(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_port_range(envoy_config_rbac_v3_Permission *msg, struct envoy_type_v3_Int32Range* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 11); + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_rbac_v3_Permission_mutable_destination_port_range(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_type_v3_Int32Range* sub = (struct envoy_type_v3_Int32Range*)envoy_config_rbac_v3_Permission_destination_port_range(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_destination_port_range(msg, sub); + sub = (struct envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_destination_port_range(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Permission_set_matcher(envoy_config_rbac_v3_Permission *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 12); + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_Permission_mutable_matcher(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_rbac_v3_Permission_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Permission_set_matcher(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_rbac_v3_Permission_set_matcher(msg, sub); } return sub; } @@ -752,12 +958,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v /* envoy.config.rbac.v3.Permission.Set */ UPB_INLINE envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_Set_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Permission_Set*)_upb_Message_New(&envoy_config_rbac_v3_Permission_Set_msginit, arena); + return (envoy_config_rbac_v3_Permission_Set*)_upb_Message_New(&envoy_config_rbac_v3_Permission_Set_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_Set_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Permission_Set* ret = envoy_config_rbac_v3_Permission_Set_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -767,7 +973,7 @@ UPB_INLINE envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_ int options, upb_Arena* arena) { envoy_config_rbac_v3_Permission_Set* ret = envoy_config_rbac_v3_Permission_Set_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -775,47 +981,72 @@ UPB_INLINE envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_ } UPB_INLINE char* envoy_config_rbac_v3_Permission_Set_serialize(const envoy_config_rbac_v3_Permission_Set* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_rbac_v3_Permission_Set_clear_rules(envoy_config_rbac_v3_Permission_Set* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Permission_Set_rules(const envoy_config_rbac_v3_Permission_Set* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_rbac_v3_Permission* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_rbac_v3_Permission_Set_has_rules(const envoy_config_rbac_v3_Permission_Set* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_rbac_v3_Permission_Set_clear_rules(const envoy_config_rbac_v3_Permission_Set* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Permission_Set_rules(const envoy_config_rbac_v3_Permission_Set* msg, size_t* len) { - return (const envoy_config_rbac_v3_Permission* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_rbac_v3_Permission_Set_rules(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_mutable_rules(envoy_config_rbac_v3_Permission_Set* msg, size_t* len) { - return (envoy_config_rbac_v3_Permission**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_mutable_rules(envoy_config_rbac_v3_Permission_Set* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_rbac_v3_Permission**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_resize_rules(envoy_config_rbac_v3_Permission_Set* msg, size_t len, upb_Arena* arena) { - return (envoy_config_rbac_v3_Permission**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_resize_rules(envoy_config_rbac_v3_Permission_Set* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_Permission**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_Set_add_rules(envoy_config_rbac_v3_Permission_Set* msg, upb_Arena* arena) { - struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_New(&envoy_config_rbac_v3_Permission_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.rbac.v3.Principal */ UPB_INLINE envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msginit, arena); + return (envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Principal* ret = envoy_config_rbac_v3_Principal_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -825,7 +1056,7 @@ UPB_INLINE envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_parse_ int options, upb_Arena* arena) { envoy_config_rbac_v3_Principal* ret = envoy_config_rbac_v3_Principal_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -833,13 +1064,13 @@ UPB_INLINE envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_parse_ } UPB_INLINE char* envoy_config_rbac_v3_Principal_serialize(const envoy_config_rbac_v3_Principal* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -858,249 +1089,323 @@ typedef enum { envoy_config_rbac_v3_Principal_identifier_NOT_SET = 0 } envoy_config_rbac_v3_Principal_identifier_oneofcases; UPB_INLINE envoy_config_rbac_v3_Principal_identifier_oneofcases envoy_config_rbac_v3_Principal_identifier_case(const envoy_config_rbac_v3_Principal* msg) { - return (envoy_config_rbac_v3_Principal_identifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_Principal_identifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_and_ids(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_and_ids(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_and_ids(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_and_ids(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_rbac_v3_Principal_Set* default_val = NULL; + const envoy_config_rbac_v3_Principal_Set* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_or_ids(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_and_ids(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_or_ids(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_or_ids(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_or_ids(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_rbac_v3_Principal_Set* default_val = NULL; + const envoy_config_rbac_v3_Principal_Set* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_any(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_or_ids(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_any(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_any(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_rbac_v3_Principal_any(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_authenticated(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_any(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_authenticated(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_authenticated(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_authenticated(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_config_rbac_v3_Principal_Authenticated* default_val = NULL; + const envoy_config_rbac_v3_Principal_Authenticated* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_source_ip(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_authenticated(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_source_ip(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_source_ip(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_source_ip(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const struct envoy_config_core_v3_CidrRange* default_val = NULL; + const struct envoy_config_core_v3_CidrRange* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_header(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_source_ip(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_header(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_header(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Principal_header(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const struct envoy_config_route_v3_HeaderMatcher* default_val = NULL; + const struct envoy_config_route_v3_HeaderMatcher* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_metadata(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_header(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_metadata(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_metadata(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Principal_metadata(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const struct envoy_type_matcher_v3_MetadataMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_MetadataMatcher* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_not_id(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_metadata(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_not_id(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_not_id(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_not_id(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const envoy_config_rbac_v3_Principal* default_val = NULL; + const envoy_config_rbac_v3_Principal* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_url_path(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_not_id(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_url_path(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_url_path(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Principal_url_path(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const struct envoy_type_matcher_v3_PathMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_PathMatcher* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_direct_remote_ip(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_url_path(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_direct_remote_ip(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_direct_remote_ip(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_direct_remote_ip(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL); + const struct envoy_config_core_v3_CidrRange* default_val = NULL; + const struct envoy_config_core_v3_CidrRange* ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_remote_ip(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_direct_remote_ip(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_remote_ip(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_remote_ip(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_remote_ip(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 11, NULL); + const struct envoy_config_core_v3_CidrRange* default_val = NULL; + const struct envoy_config_core_v3_CidrRange* ret; + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_rbac_v3_Principal_has_filter_state(const envoy_config_rbac_v3_Principal* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 12; +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_remote_ip(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_rbac_v3_Principal_clear_filter_state(const envoy_config_rbac_v3_Principal* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_FilterStateMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET); +UPB_INLINE void envoy_config_rbac_v3_Principal_clear_filter_state(envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_FilterStateMatcher* envoy_config_rbac_v3_Principal_filter_state(const envoy_config_rbac_v3_Principal* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_FilterStateMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 12, NULL); + const struct envoy_type_matcher_v3_FilterStateMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_FilterStateMatcher* ret; + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_rbac_v3_Principal_has_filter_state(const envoy_config_rbac_v3_Principal* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_rbac_v3_Principal_set_and_ids(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Set* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_mutable_and_ids(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Principal_Set* sub = (struct envoy_config_rbac_v3_Principal_Set*)envoy_config_rbac_v3_Principal_and_ids(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Set_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_and_ids(msg, sub); + sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Set_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_and_ids(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_or_ids(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Set* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_mutable_or_ids(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Principal_Set* sub = (struct envoy_config_rbac_v3_Principal_Set*)envoy_config_rbac_v3_Principal_or_ids(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Set_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_or_ids(msg, sub); + sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Set_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_or_ids(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_any(envoy_config_rbac_v3_Principal *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_rbac_v3_Principal_set_authenticated(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Authenticated* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_mutable_authenticated(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Principal_Authenticated* sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)envoy_config_rbac_v3_Principal_authenticated(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Authenticated_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_authenticated(msg, sub); + sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Authenticated_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_authenticated(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_source_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_source_ip(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_source_ip(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_source_ip(msg, sub); + sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_source_ip(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_header(envoy_config_rbac_v3_Principal *msg, struct envoy_config_route_v3_HeaderMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Principal_mutable_header(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_rbac_v3_Principal_header(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_header(msg, sub); + sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_header(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_metadata(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Principal_mutable_metadata(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_rbac_v3_Principal_metadata(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_metadata(msg, sub); + sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_not_id(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal* value) { - UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_mutable_not_id(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)envoy_config_rbac_v3_Principal_not_id(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_not_id(msg, sub); + sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_not_id(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_url_path(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_PathMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Principal_mutable_url_path(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_PathMatcher* sub = (struct envoy_type_matcher_v3_PathMatcher*)envoy_config_rbac_v3_Principal_url_path(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_url_path(msg, sub); + sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_url_path(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_direct_remote_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_direct_remote_ip(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_direct_remote_ip(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_direct_remote_ip(msg, sub); + sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_direct_remote_ip(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_remote_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 11); + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_remote_ip(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_remote_ip(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_remote_ip(msg, sub); + sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_remote_ip(msg, sub); } return sub; } UPB_INLINE void envoy_config_rbac_v3_Principal_set_filter_state(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_FilterStateMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_FilterStateMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 12); + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_FilterStateMatcher* envoy_config_rbac_v3_Principal_mutable_filter_state(envoy_config_rbac_v3_Principal* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_FilterStateMatcher* sub = (struct envoy_type_matcher_v3_FilterStateMatcher*)envoy_config_rbac_v3_Principal_filter_state(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_FilterStateMatcher*)_upb_Message_New(&envoy_type_matcher_v3_FilterStateMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_set_filter_state(msg, sub); + sub = (struct envoy_type_matcher_v3_FilterStateMatcher*)_upb_Message_New(&envoy_type_matcher_v3_FilterStateMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_set_filter_state(msg, sub); } return sub; } @@ -1108,12 +1413,12 @@ UPB_INLINE struct envoy_type_matcher_v3_FilterStateMatcher* envoy_config_rbac_v3 /* envoy.config.rbac.v3.Principal.Set */ UPB_INLINE envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_Set_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Principal_Set*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Set_msginit, arena); + return (envoy_config_rbac_v3_Principal_Set*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Set_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_Set_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Principal_Set* ret = envoy_config_rbac_v3_Principal_Set_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1123,7 +1428,7 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_Se int options, upb_Arena* arena) { envoy_config_rbac_v3_Principal_Set* ret = envoy_config_rbac_v3_Principal_Set_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1131,47 +1436,72 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_Se } UPB_INLINE char* envoy_config_rbac_v3_Principal_Set_serialize(const envoy_config_rbac_v3_Principal_Set* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_rbac_v3_Principal_Set_clear_ids(envoy_config_rbac_v3_Principal_Set* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Principal_Set_ids(const envoy_config_rbac_v3_Principal_Set* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_rbac_v3_Principal* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_rbac_v3_Principal_Set_has_ids(const envoy_config_rbac_v3_Principal_Set* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_rbac_v3_Principal_Set_clear_ids(const envoy_config_rbac_v3_Principal_Set* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Principal_Set_ids(const envoy_config_rbac_v3_Principal_Set* msg, size_t* len) { - return (const envoy_config_rbac_v3_Principal* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_rbac_v3_Principal_Set_ids(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_mutable_ids(envoy_config_rbac_v3_Principal_Set* msg, size_t* len) { - return (envoy_config_rbac_v3_Principal**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_mutable_ids(envoy_config_rbac_v3_Principal_Set* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_rbac_v3_Principal**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_resize_ids(envoy_config_rbac_v3_Principal_Set* msg, size_t len, upb_Arena* arena) { - return (envoy_config_rbac_v3_Principal**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_resize_ids(envoy_config_rbac_v3_Principal_Set* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_rbac_v3_Principal**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_Set_add_ids(envoy_config_rbac_v3_Principal_Set* msg, upb_Arena* arena) { - struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_New(&envoy_config_rbac_v3_Principal_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.rbac.v3.Principal.Authenticated */ UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_Authenticated_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Principal_Authenticated*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Authenticated_msginit, arena); + return (envoy_config_rbac_v3_Principal_Authenticated*)_upb_Message_New(&envoy_config_rbac_v3_Principal_Authenticated_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_Authenticated_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Principal_Authenticated* ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1181,7 +1511,7 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Pr int options, upb_Arena* arena) { envoy_config_rbac_v3_Principal_Authenticated* ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1189,35 +1519,40 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Pr } UPB_INLINE char* envoy_config_rbac_v3_Principal_Authenticated_serialize(const envoy_config_rbac_v3_Principal_Authenticated* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msg_init, 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); -} -UPB_INLINE void envoy_config_rbac_v3_Principal_Authenticated_clear_principal_name(const envoy_config_rbac_v3_Principal_Authenticated* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_rbac_v3_Principal_Authenticated_clear_principal_name(envoy_config_rbac_v3_Principal_Authenticated* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Principal_Authenticated_principal_name(const envoy_config_rbac_v3_Principal_Authenticated* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_rbac_v3_Principal_Authenticated_has_principal_name(const envoy_config_rbac_v3_Principal_Authenticated* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(envoy_config_rbac_v3_Principal_Authenticated *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_StringMatcher*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Principal_Authenticated_mutable_principal_name(envoy_config_rbac_v3_Principal_Authenticated* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_rbac_v3_Principal_Authenticated_principal_name(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(msg, sub); } return sub; } @@ -1225,12 +1560,12 @@ UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Prin /* envoy.config.rbac.v3.Action */ UPB_INLINE envoy_config_rbac_v3_Action* envoy_config_rbac_v3_Action_new(upb_Arena* arena) { - return (envoy_config_rbac_v3_Action*)_upb_Message_New(&envoy_config_rbac_v3_Action_msginit, arena); + return (envoy_config_rbac_v3_Action*)_upb_Message_New(&envoy_config_rbac_v3_Action_msg_init, arena); } UPB_INLINE envoy_config_rbac_v3_Action* envoy_config_rbac_v3_Action_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_rbac_v3_Action* ret = envoy_config_rbac_v3_Action_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Action_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Action_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1240,7 +1575,7 @@ UPB_INLINE envoy_config_rbac_v3_Action* envoy_config_rbac_v3_Action_parse_ex(con int options, upb_Arena* arena) { envoy_config_rbac_v3_Action* ret = envoy_config_rbac_v3_Action_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Action_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Action_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1248,41 +1583,53 @@ UPB_INLINE envoy_config_rbac_v3_Action* envoy_config_rbac_v3_Action_parse_ex(con } UPB_INLINE char* envoy_config_rbac_v3_Action_serialize(const envoy_config_rbac_v3_Action* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Action_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Action_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_rbac_v3_Action_serialize_ex(const envoy_config_rbac_v3_Action* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_rbac_v3_Action_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_rbac_v3_Action_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_config_rbac_v3_Action_clear_name(const envoy_config_rbac_v3_Action* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_rbac_v3_Action_clear_name(envoy_config_rbac_v3_Action* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_rbac_v3_Action_name(const envoy_config_rbac_v3_Action* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_rbac_v3_Action_clear_action(const envoy_config_rbac_v3_Action* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_rbac_v3_Action_clear_action(envoy_config_rbac_v3_Action* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_rbac_v3_Action_action(const envoy_config_rbac_v3_Action* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_rbac_v3_Action_set_name(envoy_config_rbac_v3_Action *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_rbac_v3_Action_set_action(envoy_config_rbac_v3_Action *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_rbac_v3_rbac_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_rbac_v3_rbac_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_ */ 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 5d7bc740b72..6eebd56d0f9 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/route/v3/route.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/config_source.upb.h" @@ -18,81 +20,110 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_route_v3_RouteConfiguration_submsgs[9] = { - {.submsg = &envoy_config_route_v3_VirtualHost_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_route_v3_Vhds_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_route_v3_ClusterSpecifierPlugin_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit}, - {.submsg = &envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteConfiguration_submsgs[9] = { + {.submsg = &envoy_config_route_v3_VirtualHost_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_route_v3_Vhds_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init}, + {.submsg = &envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteConfiguration__fields[16] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 64), UPB_SIZE(1, 1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(40, 80), UPB_SIZE(2, 2), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(44, 88), UPB_SIZE(3, 3), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(48, 96), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(52, 104), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(56, 112), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteConfiguration__fields[16] = { + {1, UPB_SIZE(60, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 64), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 80), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(40, 88), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(44, 96), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(48, 104), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(52, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(53, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msg_init = { &envoy_config_route_v3_RouteConfiguration_submsgs[0], &envoy_config_route_v3_RouteConfiguration__fields[0], - UPB_SIZE(64, 120), 16, kUpb_ExtMode_NonExtendable, 16, 255, 0, + UPB_SIZE(72, 120), 16, kUpb_ExtMode_NonExtendable, 16, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_maxmaxb}, + {0x002000003f00001a, &upb_prs_1bt}, + {0x002800003f010022, &upb_prm_1bt_maxmaxb}, + {0x003000003f00002a, &upb_prs_1bt}, + {0x003800003f020032, &upb_prm_1bt_maxmaxb}, + {0x004000000103003a, &upb_psm_1bt_maxmaxb}, + {0x004800003f000042, &upb_prs_1bt}, + {0x005000000204004a, &upb_psm_1bt_max64b}, + {0x000100003f000050, &upb_psb1_1bt}, + {0x005800000305005a, &upb_psm_1bt_maxmaxb}, + {0x006000003f060062, &upb_prm_1bt_maxmaxb}, + {0x006800003f07006a, &upb_prm_1bt_maxmaxb}, + {0x000200003f000070, &upb_psb1_1bt}, + {0x000300003f000078, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msg_init = { &envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_submsgs[0], &envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_Vhds_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_Vhds_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_Vhds__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_Vhds__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_Vhds_msginit = { +const upb_MiniTable envoy_config_route_v3_Vhds_msg_init = { &envoy_config_route_v3_Vhds_submsgs[0], &envoy_config_route_v3_Vhds__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_config_route_v3_RouteConfiguration_msginit, - &envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msginit, - &envoy_config_route_v3_Vhds_msginit, + &envoy_config_route_v3_RouteConfiguration_msg_init, + &envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msg_init, + &envoy_config_route_v3_Vhds_msg_init, }; -const upb_MiniTable_File envoy_config_route_v3_route_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_route_v3_route_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -101,5 +132,5 @@ const upb_MiniTable_File envoy_config_route_v3_route_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 15703174687..d2599bf0f3b 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 @@ -9,26 +9,28 @@ #ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_ #define ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_route_v3_RouteConfiguration; -struct envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry; -struct envoy_config_route_v3_Vhds; typedef struct envoy_config_route_v3_RouteConfiguration envoy_config_route_v3_RouteConfiguration; typedef struct envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry; typedef struct envoy_config_route_v3_Vhds envoy_config_route_v3_Vhds; -extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msginit; -extern const upb_MiniTable envoy_config_route_v3_Vhds_msginit; +extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_msg_init; +extern const upb_MiniTable envoy_config_route_v3_Vhds_msg_init; struct envoy_config_core_v3_ConfigSource; struct envoy_config_core_v3_HeaderValueOption; struct envoy_config_route_v3_ClusterSpecifierPlugin; @@ -37,26 +39,26 @@ struct envoy_config_route_v3_VirtualHost; struct google_protobuf_Any; struct google_protobuf_BoolValue; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit; -extern const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_VirtualHost_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msg_init; +extern const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_VirtualHost_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.route.v3.RouteConfiguration */ UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_RouteConfiguration_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msginit, arena); + return (envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_RouteConfiguration_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteConfiguration* ret = envoy_config_route_v3_RouteConfiguration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -66,7 +68,7 @@ UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_Route int options, upb_Arena* arena) { envoy_config_route_v3_RouteConfiguration* ret = envoy_config_route_v3_RouteConfiguration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -74,292 +76,566 @@ UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_Route } UPB_INLINE char* envoy_config_route_v3_RouteConfiguration_serialize(const envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_name(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(60, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteConfiguration_name(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(60, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_virtual_hosts(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_route_v3_VirtualHost* const* envoy_config_route_v3_RouteConfiguration_virtual_hosts(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_VirtualHost* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_virtual_hosts(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_route_v3_RouteConfiguration_virtual_hosts(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_virtual_hosts(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_route_v3_VirtualHost* const* envoy_config_route_v3_RouteConfiguration_virtual_hosts(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (const struct envoy_config_route_v3_VirtualHost* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_internal_only_headers(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_internal_only_headers(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_internal_only_headers(const envoy_config_route_v3_RouteConfiguration* msg) { + size_t size; + envoy_config_route_v3_RouteConfiguration_internal_only_headers(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_internal_only_headers(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_response_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_config_route_v3_RouteConfiguration_response_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg) { + size_t size; + envoy_config_route_v3_RouteConfiguration_response_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); + size_t size; + envoy_config_route_v3_RouteConfiguration_request_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); -} -UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_validate_clusters(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_validate_clusters(const envoy_config_route_v3_RouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_validate_clusters(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteConfiguration_validate_clusters(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 72)); +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_validate_clusters(const envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_vhds(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_vhds(const envoy_config_route_v3_RouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL; +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg) { + size_t size; + envoy_config_route_v3_RouteConfiguration_request_headers_to_remove(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_vhds(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfiguration_vhds(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const envoy_config_route_v3_Vhds*); + const envoy_config_route_v3_Vhds* default_val = NULL; + const envoy_config_route_v3_Vhds* ret; + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_most_specific_header_mutations_wins(const envoy_config_route_v3_RouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_vhds(const envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_most_specific_header_mutations_wins(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_most_specific_header_mutations_wins(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {10, UPB_SIZE(36, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_max_direct_response_body_size_bytes(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 88), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfiguration_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {11, UPB_SIZE(40, 88), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 88), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 96), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_route_v3_ClusterSpecifierPlugin* const* envoy_config_route_v3_RouteConfiguration_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 96), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_ClusterSpecifierPlugin* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); + size_t size; + envoy_config_route_v3_RouteConfiguration_cluster_specifier_plugins(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 96)); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(48, 104), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_route_v3_ClusterSpecifierPlugin* const* envoy_config_route_v3_RouteConfiguration_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (const struct envoy_config_route_v3_ClusterSpecifierPlugin* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); +UPB_INLINE const struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteConfiguration_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(48, 104), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); + size_t size; + envoy_config_route_v3_RouteConfiguration_request_mirror_policies(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 104)); -} -UPB_INLINE const struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteConfiguration_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (const struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); -} -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_ignore_port_in_host_matching(const envoy_config_route_v3_RouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_ignore_port_in_host_matching(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(52, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_ignore_port_in_host_matching(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {14, UPB_SIZE(52, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_ignore_path_parameters_in_path_matching(const envoy_config_route_v3_RouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_ignore_path_parameters_in_path_matching(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(53, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_ignore_path_parameters_in_path_matching(const envoy_config_route_v3_RouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {15, UPB_SIZE(53, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_typed_per_filter_config(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 112)); -} -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_typed_per_filter_config(const envoy_config_route_v3_RouteConfiguration* msg) { - _upb_array_detach(msg, UPB_SIZE(56, 112)); +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_typed_per_filter_config(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_size(const envoy_config_route_v3_RouteConfiguration* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(56, 112)); + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_get(const envoy_config_route_v3_RouteConfiguration* msg, upb_StringView key, struct google_protobuf_Any** val) { - return _upb_msg_map_get(msg, UPB_SIZE(56, 112), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry* envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_next(const envoy_config_route_v3_RouteConfiguration* msg, size_t* iter) { - return (const envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(56, 112), iter); + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_typed_per_filter_config(const envoy_config_route_v3_RouteConfiguration* msg) { + return envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_size(msg) != 0; } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_name(envoy_config_route_v3_RouteConfiguration *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(60, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_mutable_virtual_hosts(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (struct envoy_config_route_v3_VirtualHost**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_mutable_virtual_hosts(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_VirtualHost**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_resize_virtual_hosts(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_VirtualHost**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_resize_virtual_hosts(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_VirtualHost**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_VirtualHost* envoy_config_route_v3_RouteConfiguration_add_virtual_hosts(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { - struct envoy_config_route_v3_VirtualHost* sub = (struct envoy_config_route_v3_VirtualHost*)_upb_Message_New(&envoy_config_route_v3_VirtualHost_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_VirtualHost* sub = (struct envoy_config_route_v3_VirtualHost*)_upb_Message_New(&envoy_config_route_v3_VirtualHost_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_RouteConfiguration_add_response_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_RouteConfiguration_add_request_headers_to_add(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_validate_clusters(envoy_config_route_v3_RouteConfiguration *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteConfiguration_mutable_validate_clusters(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteConfiguration_validate_clusters(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteConfiguration_set_validate_clusters(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteConfiguration_set_validate_clusters(msg, sub); } return sub; } -UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_vhds(envoy_config_route_v3_RouteConfiguration *msg, envoy_config_route_v3_Vhds* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), envoy_config_route_v3_Vhds*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfiguration_mutable_vhds(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { struct envoy_config_route_v3_Vhds* sub = (struct envoy_config_route_v3_Vhds*)envoy_config_route_v3_RouteConfiguration_vhds(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_Vhds*)_upb_Message_New(&envoy_config_route_v3_Vhds_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteConfiguration_set_vhds(msg, sub); + sub = (struct envoy_config_route_v3_Vhds*)_upb_Message_New(&envoy_config_route_v3_Vhds_msg_init, arena); + if (sub) envoy_config_route_v3_RouteConfiguration_set_vhds(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_most_specific_header_mutations_wins(envoy_config_route_v3_RouteConfiguration *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {10, UPB_SIZE(36, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_max_direct_response_body_size_bytes(envoy_config_route_v3_RouteConfiguration *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(40, 88), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfiguration_mutable_max_direct_response_body_size_bytes(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RouteConfiguration_max_direct_response_body_size_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteConfiguration_set_max_direct_response_body_size_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_RouteConfiguration_set_max_direct_response_body_size_bytes(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_mutable_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (struct envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len); +UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_mutable_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {12, UPB_SIZE(44, 96), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_resize_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_resize_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {12, UPB_SIZE(44, 96), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_ClusterSpecifierPlugin**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_RouteConfiguration_add_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { - struct envoy_config_route_v3_ClusterSpecifierPlugin* sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {12, UPB_SIZE(44, 96), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_ClusterSpecifierPlugin* sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteConfiguration_mutable_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) { - return (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len); +UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteConfiguration_mutable_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(48, 104), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteConfiguration_resize_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 104), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteConfiguration_resize_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(48, 104), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteConfiguration_add_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(48, 104), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_ignore_port_in_host_matching(envoy_config_route_v3_RouteConfiguration *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {14, UPB_SIZE(52, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_ignore_path_parameters_in_path_matching(envoy_config_route_v3_RouteConfiguration *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {15, UPB_SIZE(53, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_clear(envoy_config_route_v3_RouteConfiguration* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_clear(envoy_config_route_v3_RouteConfiguration* msg) { _upb_msg_map_clear(msg, UPB_SIZE(56, 112)); } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_set(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(56, 112), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_delete(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(56, 112), &key, 0); + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry* envoy_config_route_v3_RouteConfiguration_typed_per_filter_config_nextmutable(envoy_config_route_v3_RouteConfiguration* msg, size_t* iter) { - return (envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(56, 112), iter); + const upb_MiniTableField field = {16, UPB_SIZE(56, 112), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } /* envoy.config.route.v3.RouteConfiguration.TypedPerFilterConfigEntry */ @@ -369,14 +645,15 @@ UPB_INLINE upb_StringView envoy_config_route_v3_RouteConfiguration_TypedPerFilte _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry* msg) { struct google_protobuf_Any* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*)); @@ -385,12 +662,12 @@ UPB_INLINE void envoy_config_route_v3_RouteConfiguration_TypedPerFilterConfigEnt /* envoy.config.route.v3.Vhds */ UPB_INLINE envoy_config_route_v3_Vhds* envoy_config_route_v3_Vhds_new(upb_Arena* arena) { - return (envoy_config_route_v3_Vhds*)_upb_Message_New(&envoy_config_route_v3_Vhds_msginit, arena); + return (envoy_config_route_v3_Vhds*)_upb_Message_New(&envoy_config_route_v3_Vhds_msg_init, arena); } UPB_INLINE envoy_config_route_v3_Vhds* envoy_config_route_v3_Vhds_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_Vhds* ret = envoy_config_route_v3_Vhds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Vhds_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -400,7 +677,7 @@ UPB_INLINE envoy_config_route_v3_Vhds* envoy_config_route_v3_Vhds_parse_ex(const int options, upb_Arena* arena) { envoy_config_route_v3_Vhds* ret = envoy_config_route_v3_Vhds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Vhds_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -408,45 +685,50 @@ UPB_INLINE envoy_config_route_v3_Vhds* envoy_config_route_v3_Vhds_parse_ex(const } UPB_INLINE char* envoy_config_route_v3_Vhds_serialize(const envoy_config_route_v3_Vhds* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Vhds_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Vhds_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Vhds_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Vhds_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_Vhds_clear_config_source(const envoy_config_route_v3_Vhds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Vhds_clear_config_source(envoy_config_route_v3_Vhds* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_config_source(const envoy_config_route_v3_Vhds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_Vhds_has_config_source(const envoy_config_route_v3_Vhds* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_Vhds_set_config_source(envoy_config_route_v3_Vhds *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_mutable_config_source(envoy_config_route_v3_Vhds* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_route_v3_Vhds_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Vhds_set_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_config_route_v3_Vhds_set_config_source(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_route_v3_route_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_route_v3_route_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_ */ 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 d2b3c084a3a..e67856dffda 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/route/v3/route_components.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -30,1103 +32,1608 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_route_v3_VirtualHost_submsgs[13] = { - {.submsg = &envoy_config_route_v3_Route_msginit}, - {.submsg = &envoy_config_route_v3_VirtualCluster_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_route_v3_CorsPolicy_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit}, - {.submsg = &envoy_config_route_v3_RetryPolicy_msginit}, - {.submsg = &envoy_config_route_v3_HedgePolicy_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_VirtualHost_submsgs[13] = { + {.submsg = &envoy_config_route_v3_Route_msg_init}, + {.submsg = &envoy_config_route_v3_VirtualCluster_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_route_v3_CorsPolicy_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msg_init}, + {.submsg = &envoy_config_route_v3_RetryPolicy_msg_init}, + {.submsg = &envoy_config_route_v3_HedgePolicy_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_VirtualHost__fields[21] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(40, 72), UPB_SIZE(1, 1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(48, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(56, 104), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(60, 112), UPB_SIZE(2, 2), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(64, 120), UPB_SIZE(3, 3), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(68, 128), UPB_SIZE(4, 4), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(72, 136), UPB_SIZE(5, 5), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(76, 144), UPB_SIZE(6, 6), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(80, 152), UPB_SIZE(0, 0), 12, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(10, 10), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_VirtualHost__fields[21] = { + {1, UPB_SIZE(84, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 72), 1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(32, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(36, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(40, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(44, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(52, 112), 2, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(56, 120), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(60, 128), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(64, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(68, 136), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(72, 144), 6, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(76, 152), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(80, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_VirtualHost_msginit = { +const upb_MiniTable envoy_config_route_v3_VirtualHost_msg_init = { &envoy_config_route_v3_VirtualHost_submsgs[0], &envoy_config_route_v3_VirtualHost__fields[0], - UPB_SIZE(88, 160), 21, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(96, 160), 21, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_pss_1bt}, + {0x002000003f000012, &upb_prs_1bt}, + {0x002800003f00001a, &upb_prm_1bt_max192b}, + {0x000400003f000020, &upb_psv4_1bt}, + {0x003000003f01002a, &upb_prm_1bt_max64b}, + {0x003800003f020032, &upb_prm_1bt_max64b}, + {0x004000003f03003a, &upb_prm_1bt_maxmaxb}, + {0x0048000001040042, &upb_psm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x005000003f050052, &upb_prm_1bt_maxmaxb}, + {0x005800003f00005a, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x006000003f00006a, &upb_prs_1bt}, + {0x000800003f000070, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0070000002070182, &upb_psm_2bt_max128b}, + {0x007800000308018a, &upb_psm_2bt_max64b}, + {0x0080000004090192, &upb_psm_2bt_maxmaxb}, + {0x000900003f000198, &upb_psb1_2bt}, + {0x00880000050a01a2, &upb_psm_2bt_maxmaxb}, + {0x00900000060b01aa, &upb_psm_2bt_maxmaxb}, + {0x009800003f0c01b2, &upb_prm_2bt_max64b}, + {0x000a00003f0001b8, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit = { +const upb_MiniTable envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msg_init = { &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[0], &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_FilterAction_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_FilterAction_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_FilterAction__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_FilterAction__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_FilterAction_msginit = { +const upb_MiniTable envoy_config_route_v3_FilterAction_msg_init = { &envoy_config_route_v3_FilterAction_submsgs[0], &envoy_config_route_v3_FilterAction__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteList_submsgs[1] = { - {.submsg = &envoy_config_route_v3_Route_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteList_submsgs[1] = { + {.submsg = &envoy_config_route_v3_Route_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteList_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteList_msg_init = { &envoy_config_route_v3_RouteList_submsgs[0], &envoy_config_route_v3_RouteList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max192b}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_Route_submsgs[13] = { - {.submsg = &envoy_config_route_v3_RouteMatch_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_msginit}, - {.submsg = &envoy_config_route_v3_RedirectAction_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &envoy_config_route_v3_Decorator_msginit}, - {.submsg = &envoy_config_route_v3_DirectResponseAction_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit}, - {.submsg = &envoy_config_route_v3_Tracing_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_route_v3_FilterAction_msginit}, - {.submsg = &envoy_config_route_v3_NonForwardingAction_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_Route_submsgs[13] = { + {.submsg = &envoy_config_route_v3_RouteMatch_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_msg_init}, + {.submsg = &envoy_config_route_v3_RedirectAction_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &envoy_config_route_v3_Decorator_msg_init}, + {.submsg = &envoy_config_route_v3_DirectResponseAction_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msg_init}, + {.submsg = &envoy_config_route_v3_Tracing_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_route_v3_FilterAction_msg_init}, + {.submsg = &envoy_config_route_v3_NonForwardingAction_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_Route__fields[17] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(64, 120), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(64, 120), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(64, 120), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(48, 88), UPB_SIZE(4, 4), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(52, 96), UPB_SIZE(5, 5), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(64, 120), UPB_SIZE(-5, -5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(64, 120), UPB_SIZE(-5, -5), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(56, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_Route__fields[17] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 16), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 24), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(16, 32), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(20, 40), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(52, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(36, 88), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(40, 96), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(60, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_Route_msginit = { +const upb_MiniTable envoy_config_route_v3_Route_msg_init = { &envoy_config_route_v3_Route_submsgs[0], &envoy_config_route_v3_Route__fields[0], - UPB_SIZE(72, 128), 17, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(72, 128), 17, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + {0x0078000402010012, &upb_pom_1bt_max256b}, + {0x007800040302001a, &upb_pom_1bt_max128b}, + {0x0010000002030022, &upb_psm_1bt_maxmaxb}, + {0x001800000304002a, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x007800040705003a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f06004a, &upb_prm_1bt_maxmaxb}, + {0x002800003f070052, &upb_prm_1bt_maxmaxb}, + {0x003000003f00005a, &upb_prs_1bt}, + {0x003800003f000062, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x004800003f000072, &upb_pss_1bt}, + {0x005800000409007a, &upb_psm_1bt_max64b}, + {0x00600000050a0182, &upb_psm_2bt_maxmaxb}, + {0x00780004110b018a, &upb_pom_2bt_max64b}, + {0x00780004120c0192, &upb_pom_2bt_max64b}, + {0x006800003f00019a, &upb_pss_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit = { +const upb_MiniTable envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msg_init = { &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[0], &envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_WeightedCluster_submsgs[2] = { - {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_WeightedCluster_submsgs[2] = { + {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster__fields[4] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(28, 48), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_WeightedCluster__fields[4] = { + {1, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_WeightedCluster_msginit = { +const upb_MiniTable envoy_config_route_v3_WeightedCluster_msg_init = { &envoy_config_route_v3_WeightedCluster_submsgs[0], &envoy_config_route_v3_WeightedCluster__fields[0], - UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_prm_1bt_max128b}, + {0x002000003f000012, &upb_pss_1bt}, + {0x003000000101001a, &upb_psm_1bt_maxmaxb}, + {0x0008000404000022, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[5] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, - {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[5] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, + {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[10] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(44, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[10] = { + {1, UPB_SIZE(44, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(52, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit = { +const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init = { &envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[0], &envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[0], - UPB_SIZE(64, 112), 10, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(64, 112), 10, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x0028000001000012, &upb_psm_1bt_maxmaxb}, + {0x003000000201001a, &upb_psm_1bt_maxmaxb}, + {0x003800003f020022, &upb_prm_1bt_maxmaxb}, + {0x004000003f03002a, &upb_prm_1bt_maxmaxb}, + {0x004800003f000032, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x005000003f00004a, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040b00005a, &upb_pos_1bt}, + {0x006000003f000062, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit = { +const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msg_init = { &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[0], &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_ClusterSpecifierPlugin__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_ClusterSpecifierPlugin__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msginit = { +const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msg_init = { &envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[0], &envoy_config_route_v3_ClusterSpecifierPlugin__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteMatch_submsgs[10] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, - {.submsg = &envoy_config_route_v3_QueryParameterMatcher_msginit}, - {.submsg = &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit}, - {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit}, - {.submsg = &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit}, - {.submsg = &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteMatch_submsgs[10] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, + {.submsg = &envoy_config_route_v3_QueryParameterMatcher_msg_init}, + {.submsg = &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msg_init}, + {.submsg = &envoy_type_matcher_v3_RegexMatcher_msg_init}, + {.submsg = &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init}, + {.submsg = &envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteMatch__fields[13] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(40, 72), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteMatch__fields[13] = { + {1, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(24, 64), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(28, 72), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteMatch_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteMatch_msg_init = { &envoy_config_route_v3_RouteMatch_submsgs[0], &envoy_config_route_v3_RouteMatch__fields[0], - UPB_SIZE(48, 80), 13, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(48, 80), 13, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040100000a, &upb_pos_1bt}, + {0x0008000402000012, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0018000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f010032, &upb_prm_1bt_max64b}, + {0x002800003f02003a, &upb_prm_1bt_max64b}, + {0x0030000002030042, &upb_psm_1bt_max64b}, + {0x003800000304004a, &upb_psm_1bt_maxmaxb}, + {0x000800040a050052, &upb_pom_1bt_maxmaxb}, + {0x004000000406005a, &upb_psm_1bt_max64b}, + {0x000800040c070062, &upb_pom_1bt_max64b}, + {0x004800003f08006a, &upb_prm_1bt_maxmaxb}, + {0x000800040e000072, &upb_pos_1bt}, + {0x000800040f09007a, &upb_pom_1bt_maxmaxb}, + }) }; -const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[2] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[2] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init = { &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[0], &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_route_v3_CorsPolicy_submsgs[5] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_CorsPolicy_submsgs[5] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_CorsPolicy__fields[9] = { - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 72), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(56, 104), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(44, 80), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(52, 96), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_CorsPolicy__fields[9] = { + {2, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(36, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(44, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(52, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(24, 104), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(12, 80), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(20, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_CorsPolicy_msginit = { +const upb_MiniTable envoy_config_route_v3_CorsPolicy_msg_init = { &envoy_config_route_v3_CorsPolicy_submsgs[0], &envoy_config_route_v3_CorsPolicy__fields[0], - UPB_SIZE(64, 112), 9, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(64, 112), 9, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_pss_1bt}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x002800003f000022, &upb_pss_1bt}, + {0x003800003f00002a, &upb_pss_1bt}, + {0x0048000001000032, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x006800040901004a, &upb_pom_1bt_maxmaxb}, + {0x0050000002020052, &upb_psm_1bt_maxmaxb}, + {0x005800003f03005a, &upb_prm_1bt_maxmaxb}, + {0x0060000003040062, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_submsgs[24] = { - {.submsg = &envoy_config_route_v3_WeightedCluster_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_route_v3_RetryPolicy_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_msginit}, - {.submsg = &envoy_config_route_v3_CorsPolicy_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit}, - {.submsg = &envoy_config_route_v3_HedgePolicy_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit}, - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &envoy_config_route_v3_InternalRedirectPolicy_msginit}, - {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit}, - {.submsg = &envoy_config_route_v3_ClusterSpecifierPlugin_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_submsgs[24] = { + {.submsg = &envoy_config_route_v3_WeightedCluster_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_route_v3_RetryPolicy_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_msg_init}, + {.submsg = &envoy_config_route_v3_CorsPolicy_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init}, + {.submsg = &envoy_config_route_v3_HedgePolicy_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &envoy_config_route_v3_InternalRedirectPolicy_msg_init}, + {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init}, + {.submsg = &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction__fields[34] = { - {1, UPB_SIZE(36, 48), UPB_SIZE(-25, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(36, 48), UPB_SIZE(-25, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(36, 48), UPB_SIZE(-25, -25), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(44, 64), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(56, 88), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(60, 96), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(64, 104), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(68, 112), UPB_SIZE(4, 4), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(72, 120), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(76, 128), UPB_SIZE(5, 5), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(80, 136), UPB_SIZE(6, 6), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(84, 144), UPB_SIZE(7, 7), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(88, 152), UPB_SIZE(0, 0), 11, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {27, UPB_SIZE(92, 160), UPB_SIZE(8, 8), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {28, UPB_SIZE(96, 168), UPB_SIZE(9, 9), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {29, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {30, UPB_SIZE(100, 176), UPB_SIZE(0, 0), 14, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(104, 184), UPB_SIZE(10, 10), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {32, UPB_SIZE(108, 192), UPB_SIZE(11, 11), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {33, UPB_SIZE(112, 200), UPB_SIZE(12, 12), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {34, UPB_SIZE(116, 208), UPB_SIZE(13, 13), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {35, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(120, 216), UPB_SIZE(14, 14), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(36, 48), UPB_SIZE(-25, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {38, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {39, UPB_SIZE(36, 48), UPB_SIZE(-25, -25), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {40, UPB_SIZE(124, 224), UPB_SIZE(15, 15), 22, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {41, UPB_SIZE(128, 232), UPB_SIZE(16, 16), 23, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction__fields[34] = { + {1, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(124, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(8, 88), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(12, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(20, 104), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(24, 112), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(28, 120), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(32, 128), 5, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(40, 136), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(44, 144), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(48, 152), 0, 11, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(52, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {27, UPB_SIZE(56, 160), 8, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {28, UPB_SIZE(60, 168), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {29, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {30, UPB_SIZE(64, 176), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {31, UPB_SIZE(68, 184), 10, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {32, UPB_SIZE(72, 192), 11, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {33, UPB_SIZE(76, 200), 12, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(80, 208), 13, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {35, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(88, 216), 14, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {38, UPB_SIZE(92, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(100, 224), 15, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(104, 232), 16, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_msg_init = { &envoy_config_route_v3_RouteAction_submsgs[0], &envoy_config_route_v3_RouteAction__fields[0], - UPB_SIZE(136, 240), 34, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(136, 240), 34, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003000180100000a, &upb_pos_1bt}, + {0x0030001802000012, &upb_pos_1bt}, + {0x003000180300001a, &upb_pom_1bt_max64b}, + {0x0040000001010022, &upb_psm_1bt_maxmaxb}, + {0x004800003f00002a, &upb_pss_1bt}, + {0x0020001006000032, &upb_pos_1bt}, + {0x002000100702003a, &upb_pom_1bt_maxmaxb}, + {0x0058000002030042, &upb_psm_1bt_maxmaxb}, + {0x006000000304004a, &upb_psm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000058, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x006800003f05006a, &upb_prm_1bt_max64b}, + {0x0070000004060072, &upb_psm_1bt_maxmaxb}, + {0x007800003f07007a, &upb_prm_1bt_max64b}, + {0x00c000000b100282, &upb_psm_2bt_maxmaxb}, + {0x008000000508018a, &upb_psm_2bt_max128b}, + {0x00d000000d120292, &upb_psm_2bt_max64b}, + {0x002000102313029a, &upb_pom_2bt_maxmaxb}, + {0x000800003f0001a0, &upb_psv4_2bt}, + {0x00300018250002aa, &upb_pos_2bt}, + {0x001400003f0002b0, &upb_psb1_2bt}, + {0x00880000060901ba, &upb_psm_2bt_maxmaxb}, + {0x00900000070a01c2, &upb_psm_2bt_maxmaxb}, + {0x009800003f0b01ca, &upb_prm_2bt_max64b}, + {0x000c00003f0001d0, &upb_psv4_2bt}, + {0x00a00000080c01da, &upb_psm_2bt_max64b}, + {0x00a80000090d01e2, &upb_psm_2bt_maxmaxb}, + {0x002000101d0001ea, &upb_pos_2bt}, + {0x00b000003f0e01f2, &upb_prm_2bt_max64b}, + {0x00b800000a0f01fa, &upb_psm_2bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = { - {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = { + {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[4] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init = { &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[0], &envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[0], - UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100001a, &upb_psm_1bt_maxmaxb}, + {0x0020000002010022, &upb_psm_1bt_maxmaxb}, + {0x002800003f00002a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = { - {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = { + {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_HashPolicy__fields[6] = { + {1, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 8, -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_msg_init = { &envoy_config_route_v3_RouteAction_HashPolicy_submsgs[0], &envoy_config_route_v3_RouteAction_HashPolicy__fields[0], - UPB_SIZE(16, 16), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + 16, 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040100000a, &upb_pom_1bt_max64b}, + {0x0008000402010012, &upb_pom_1bt_max64b}, + {0x000800040302001a, &upb_pom_1bt_max64b}, + {0x000000003f000020, &upb_psb1_1bt}, + {0x000800040503002a, &upb_pom_1bt_max64b}, + {0x0008000406040032, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init = { &envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[0], &envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init = { &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[0], &envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init = { NULL, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init = { NULL, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init = { NULL, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init = { &envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[0], &envoy_config_route_v3_RouteAction_UpgradeConfig__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ProxyProtocolConfig_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ProxyProtocolConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init = { &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[0], &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[3] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[3] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit = { +const upb_MiniTable envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init = { &envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[0], &envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_submsgs[10] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit}, - {.submsg = &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit}, - {.submsg = &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, - {.submsg = &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RetryPolicy_submsgs[10] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init}, + {.submsg = &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init}, + {.submsg = &envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, + {.submsg = &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy__fields[13] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(56, 112), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 72), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(44, 88), UPB_SIZE(5, 5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(48, 96), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(52, 104), UPB_SIZE(6, 6), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RetryPolicy__fields[13] = { + {1, UPB_SIZE(48, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 56, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(36, 96), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(40, 104), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(44, 112), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RetryPolicy_msginit = { +const upb_MiniTable envoy_config_route_v3_RetryPolicy_msg_init = { &envoy_config_route_v3_RetryPolicy_submsgs[0], &envoy_config_route_v3_RetryPolicy__fields[0], - UPB_SIZE(64, 120), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0, + UPB_SIZE(64, 120), 13, kUpb_ExtMode_NonExtendable, 13, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x003000003f03002a, &upb_prm_1bt_max64b}, + {0x003800003f000030, &upb_psv8_1bt}, + {0x004000003f00003a, &upb_ppv4_1bt}, + {0x0048000004040042, &upb_psm_1bt_max64b}, + {0x005000003f05004a, &upb_prm_1bt_max64b}, + {0x005800003f060052, &upb_prm_1bt_max64b}, + {0x006000000507005a, &upb_psm_1bt_max64b}, + {0x006800003f080062, &upb_prm_1bt_maxmaxb}, + {0x007000000609006a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryPriority__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RetryPolicy_RetryPriority__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryPriority_msginit = { +const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init = { &envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[0], &envoy_config_route_v3_RetryPolicy_RetryPriority__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit = { +const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init = { &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[0], &envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[2] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[2] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit = { +const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init = { &envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[0], &envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = { +const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init = { NULL, &envoy_config_route_v3_RetryPolicy_ResetHeader__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = { - {.submsg = &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = { + {.submsg = &envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit = { +const upb_MiniTable envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init = { &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[0], &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_HedgePolicy_submsgs[2] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_HedgePolicy_submsgs[2] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_HedgePolicy__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_HedgePolicy__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_HedgePolicy_msginit = { +const upb_MiniTable envoy_config_route_v3_HedgePolicy_msg_init = { &envoy_config_route_v3_HedgePolicy_submsgs[0], &envoy_config_route_v3_HedgePolicy__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RedirectAction_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RedirectAction_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RedirectAction__fields[9] = { - {1, UPB_SIZE(36, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(28, 40), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 24), UPB_SIZE(-9, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 40), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(20, 24), UPB_SIZE(-9, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(28, 40), UPB_SIZE(-17, -17), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RedirectAction__fields[9] = { + {1, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(20, 24), -9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 24), -9, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, 12, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 40), -17, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RedirectAction_msginit = { +const upb_MiniTable envoy_config_route_v3_RedirectAction_msg_init = { &envoy_config_route_v3_RedirectAction_submsgs[0], &envoy_config_route_v3_RedirectAction__fields[0], - UPB_SIZE(48, 72), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(48, 72), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f00000a, &upb_pss_1bt}, + {0x0028001002000012, &upb_pos_1bt}, + {0x000000003f000018, &upb_psv4_1bt}, + {0x0018000804000020, &upb_pob1_1bt}, + {0x002800100500002a, &upb_pos_1bt}, + {0x000400003f000030, &upb_psb1_1bt}, + {0x001800080700003a, &upb_pos_1bt}, + {0x000c00003f000040, &upb_psv4_1bt}, + {0x002800100900004a, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_DirectResponseAction_submsgs[1] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_DirectResponseAction_submsgs[1] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_DirectResponseAction__fields[2] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_DirectResponseAction__fields[2] = { + {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_DirectResponseAction_msginit = { +const upb_MiniTable envoy_config_route_v3_DirectResponseAction_msg_init = { &envoy_config_route_v3_DirectResponseAction_submsgs[0], &envoy_config_route_v3_DirectResponseAction__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msginit = { +const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_route_v3_Decorator_submsgs[1] = { - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_Decorator_submsgs[1] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_Decorator__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_Decorator__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_Decorator_msginit = { +const upb_MiniTable envoy_config_route_v3_Decorator_msg_init = { &envoy_config_route_v3_Decorator_submsgs[0], &envoy_config_route_v3_Decorator__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_Tracing_submsgs[4] = { - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, - {.submsg = &envoy_type_tracing_v3_CustomTag_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_Tracing_submsgs[4] = { + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, + {.submsg = &envoy_type_tracing_v3_CustomTag_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_Tracing__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_Tracing__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_Tracing_msginit = { +const upb_MiniTable envoy_config_route_v3_Tracing_msg_init = { &envoy_config_route_v3_Tracing_submsgs[0], &envoy_config_route_v3_Tracing__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x002000003f030022, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_VirtualCluster_submsgs[1] = { - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_VirtualCluster_submsgs[1] = { + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_VirtualCluster__fields[2] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_VirtualCluster__fields[2] = { + {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_VirtualCluster_msginit = { +const upb_MiniTable envoy_config_route_v3_VirtualCluster_msg_init = { &envoy_config_route_v3_VirtualCluster_submsgs[0], &envoy_config_route_v3_VirtualCluster__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f000022, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_submsgs[3] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Override_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_submsgs[3] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Override_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_msg_init = { &envoy_config_route_v3_RateLimit_submsgs[0], &envoy_config_route_v3_RateLimit__fields[0], - UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f01001a, &upb_prm_1bt_max64b}, + {0x0028000002020022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_submsgs[11] = { - {.submsg = &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_MetaData_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit}, - {.submsg = &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Action_submsgs[11] = { + {.submsg = &envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_MetaData_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init}, + {.submsg = &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action__fields[11] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action__fields[11] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_msg_init = { &envoy_config_route_v3_RateLimit_Action_submsgs[0], &envoy_config_route_v3_RateLimit_Action__fields[0], - UPB_SIZE(8, 16), 11, kUpb_ExtMode_NonExtendable, 11, 255, 0, + UPB_SIZE(8, 16), 11, kUpb_ExtMode_NonExtendable, 11, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004030022, &upb_pom_1bt_max64b}, + {0x000800000504002a, &upb_pom_1bt_max64b}, + {0x0008000006050032, &upb_pom_1bt_max64b}, + {0x000800000706003a, &upb_pom_1bt_max64b}, + {0x0008000008070042, &upb_pom_1bt_max64b}, + {0x000800000908004a, &upb_pom_1bt_maxmaxb}, + {0x000800000a090052, &upb_pom_1bt_max64b}, + {0x000800000b0a005a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init = { NULL, &envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x000000003f000018, &upb_psb1_1bt}, + }) }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_submsgs[2] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_submsgs[2] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init = { &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_submsgs[0], &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init = { NULL, &envoy_config_route_v3_RateLimit_Action_GenericKey__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[4] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init = { &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[0], &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[0], - UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f01001a, &upb_prm_1bt_max64b}, + {0x002800003f000022, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = { - {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = { + {.submsg = &envoy_type_metadata_v3_MetadataKey_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init = { &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[0], &envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = { - {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = { + {.submsg = &envoy_type_metadata_v3_MetadataKey_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_MetaData__fields[5] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_MetaData__fields[5] = { + {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MetaData_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MetaData_msg_init = { &envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[0], &envoy_config_route_v3_RateLimit_Action_MetaData__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_pss_1bt}, + {0x0020000001000012, &upb_psm_1bt_maxmaxb}, + {0x002800003f00001a, &upb_pss_1bt}, + {0x000400003f000020, &upb_psv4_1bt}, + {0x000800003f000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_submsgs[2] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_route_v3_QueryParameterMatcher_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_submsgs[2] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_route_v3_QueryParameterMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch__fields[4] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init = { &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_submsgs[0], &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch__fields[0], - UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f01001a, &upb_prm_1bt_max64b}, + {0x002800003f000022, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Override_submsgs[1] = { - {.submsg = &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Override_submsgs[1] = { + {.submsg = &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Override__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Override__fields[1] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Override_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Override_msg_init = { &envoy_config_route_v3_RateLimit_Override_submsgs[0], &envoy_config_route_v3_RateLimit_Override__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = { - {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = { + {.submsg = &envoy_type_metadata_v3_MetadataKey_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit = { +const upb_MiniTable envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init = { &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[0], &envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_HeaderMatcher_submsgs[3] = { - {.submsg = &envoy_type_v3_Int64Range_msginit}, - {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_HeaderMatcher_submsgs[3] = { + {.submsg = &envoy_type_v3_Int64Range_msg_init}, + {.submsg = &envoy_type_matcher_v3_RegexMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_HeaderMatcher__fields[11] = { - {1, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_HeaderMatcher__fields[11] = { + {1, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(12, 16), -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit = { +const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init = { &envoy_config_route_v3_HeaderMatcher_submsgs[0], &envoy_config_route_v3_HeaderMatcher__fields[0], - UPB_SIZE(32, 48), 11, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(32, 48), 11, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000404000022, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000406000032, &upb_pom_1bt_maxmaxb}, + {0x0010000407000038, &upb_pob1_1bt}, + {0x000000003f000040, &upb_psb1_1bt}, + {0x001000040900004a, &upb_pos_1bt}, + {0x001000040a000052, &upb_pos_1bt}, + {0x001000040b01005a, &upb_pom_1bt_maxmaxb}, + {0x001000040c000062, &upb_pos_1bt}, + {0x001000040d02006a, &upb_pom_1bt_maxmaxb}, + {0x000800003f000070, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_QueryParameterMatcher__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_QueryParameterMatcher__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 24), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_QueryParameterMatcher_msginit = { +const upb_MiniTable envoy_config_route_v3_QueryParameterMatcher_msg_init = { &envoy_config_route_v3_QueryParameterMatcher_submsgs[0], &envoy_config_route_v3_QueryParameterMatcher__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000500002a, &upb_pom_1bt_maxmaxb}, + {0x0018000006000030, &upb_pob1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_InternalRedirectPolicy__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_InternalRedirectPolicy__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_InternalRedirectPolicy_msginit = { +const upb_MiniTable envoy_config_route_v3_InternalRedirectPolicy_msg_init = { &envoy_config_route_v3_InternalRedirectPolicy_submsgs[0], &envoy_config_route_v3_InternalRedirectPolicy__fields[0], - UPB_SIZE(16, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_ppv4_1bt}, + {0x001800003f01001a, &upb_prm_1bt_maxmaxb}, + {0x000100003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_FilterConfig_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_FilterConfig_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_FilterConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_FilterConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_FilterConfig_msginit = { +const upb_MiniTable envoy_config_route_v3_FilterConfig_msg_init = { &envoy_config_route_v3_FilterConfig_submsgs[0], &envoy_config_route_v3_FilterConfig__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + 16, 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x000200003f000018, &upb_psb1_1bt}, + }) }; static const upb_MiniTable *messages_layout[57] = { - &envoy_config_route_v3_VirtualHost_msginit, - &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit, - &envoy_config_route_v3_FilterAction_msginit, - &envoy_config_route_v3_RouteList_msginit, - &envoy_config_route_v3_Route_msginit, - &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit, - &envoy_config_route_v3_WeightedCluster_msginit, - &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, - &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit, - &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, - &envoy_config_route_v3_RouteMatch_msginit, - &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, - &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, - &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, - &envoy_config_route_v3_CorsPolicy_msginit, - &envoy_config_route_v3_RouteAction_msginit, - &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, - &envoy_config_route_v3_RouteAction_HashPolicy_msginit, - &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, - &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, - &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, - &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, - &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, - &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, - &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, - &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, - &envoy_config_route_v3_RetryPolicy_msginit, - &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, - &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, - &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, - &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, - &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, - &envoy_config_route_v3_HedgePolicy_msginit, - &envoy_config_route_v3_RedirectAction_msginit, - &envoy_config_route_v3_DirectResponseAction_msginit, - &envoy_config_route_v3_NonForwardingAction_msginit, - &envoy_config_route_v3_Decorator_msginit, - &envoy_config_route_v3_Tracing_msginit, - &envoy_config_route_v3_VirtualCluster_msginit, - &envoy_config_route_v3_RateLimit_msginit, - &envoy_config_route_v3_RateLimit_Action_msginit, - &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, - &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, - &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, - &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, - &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, - &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, - &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, - &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, - &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, - &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, - &envoy_config_route_v3_RateLimit_Override_msginit, - &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, - &envoy_config_route_v3_HeaderMatcher_msginit, - &envoy_config_route_v3_QueryParameterMatcher_msginit, - &envoy_config_route_v3_InternalRedirectPolicy_msginit, - &envoy_config_route_v3_FilterConfig_msginit, + &envoy_config_route_v3_VirtualHost_msg_init, + &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msg_init, + &envoy_config_route_v3_FilterAction_msg_init, + &envoy_config_route_v3_RouteList_msg_init, + &envoy_config_route_v3_Route_msg_init, + &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msg_init, + &envoy_config_route_v3_WeightedCluster_msg_init, + &envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, + &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msg_init, + &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, + &envoy_config_route_v3_RouteMatch_msg_init, + &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, + &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, + &envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, + &envoy_config_route_v3_CorsPolicy_msg_init, + &envoy_config_route_v3_RouteAction_msg_init, + &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, + &envoy_config_route_v3_RouteAction_HashPolicy_msg_init, + &envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, + &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, + &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, + &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, + &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, + &envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, + &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, + &envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, + &envoy_config_route_v3_RetryPolicy_msg_init, + &envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, + &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, + &envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, + &envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, + &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, + &envoy_config_route_v3_HedgePolicy_msg_init, + &envoy_config_route_v3_RedirectAction_msg_init, + &envoy_config_route_v3_DirectResponseAction_msg_init, + &envoy_config_route_v3_NonForwardingAction_msg_init, + &envoy_config_route_v3_Decorator_msg_init, + &envoy_config_route_v3_Tracing_msg_init, + &envoy_config_route_v3_VirtualCluster_msg_init, + &envoy_config_route_v3_RateLimit_msg_init, + &envoy_config_route_v3_RateLimit_Action_msg_init, + &envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, + &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, + &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, + &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, + &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, + &envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, + &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, + &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, + &envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, + &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, + &envoy_config_route_v3_RateLimit_Override_msg_init, + &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, + &envoy_config_route_v3_HeaderMatcher_msg_init, + &envoy_config_route_v3_QueryParameterMatcher_msg_init, + &envoy_config_route_v3_InternalRedirectPolicy_msg_init, + &envoy_config_route_v3_FilterConfig_msg_init, }; -const upb_MiniTable_File envoy_config_route_v3_route_components_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_route_v3_route_components_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -1135,5 +1642,5 @@ const upb_MiniTable_File envoy_config_route_v3_route_components_proto_upb_file_l 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 fe44a874be3..cdbe46e2cfc 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 @@ -9,74 +9,22 @@ #ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_ #define ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_route_v3_VirtualHost; -struct envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry; -struct envoy_config_route_v3_FilterAction; -struct envoy_config_route_v3_RouteList; -struct envoy_config_route_v3_Route; -struct envoy_config_route_v3_Route_TypedPerFilterConfigEntry; -struct envoy_config_route_v3_WeightedCluster; -struct envoy_config_route_v3_WeightedCluster_ClusterWeight; -struct envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry; -struct envoy_config_route_v3_ClusterSpecifierPlugin; -struct envoy_config_route_v3_RouteMatch; -struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions; -struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions; -struct envoy_config_route_v3_RouteMatch_ConnectMatcher; -struct envoy_config_route_v3_CorsPolicy; -struct envoy_config_route_v3_RouteAction; -struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy; -struct envoy_config_route_v3_RouteAction_HashPolicy; -struct envoy_config_route_v3_RouteAction_HashPolicy_Header; -struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie; -struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties; -struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter; -struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState; -struct envoy_config_route_v3_RouteAction_UpgradeConfig; -struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig; -struct envoy_config_route_v3_RouteAction_MaxStreamDuration; -struct envoy_config_route_v3_RetryPolicy; -struct envoy_config_route_v3_RetryPolicy_RetryPriority; -struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate; -struct envoy_config_route_v3_RetryPolicy_RetryBackOff; -struct envoy_config_route_v3_RetryPolicy_ResetHeader; -struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff; -struct envoy_config_route_v3_HedgePolicy; -struct envoy_config_route_v3_RedirectAction; -struct envoy_config_route_v3_DirectResponseAction; -struct envoy_config_route_v3_NonForwardingAction; -struct envoy_config_route_v3_Decorator; -struct envoy_config_route_v3_Tracing; -struct envoy_config_route_v3_VirtualCluster; -struct envoy_config_route_v3_RateLimit; -struct envoy_config_route_v3_RateLimit_Action; -struct envoy_config_route_v3_RateLimit_Action_SourceCluster; -struct envoy_config_route_v3_RateLimit_Action_DestinationCluster; -struct envoy_config_route_v3_RateLimit_Action_RequestHeaders; -struct envoy_config_route_v3_RateLimit_Action_RemoteAddress; -struct envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress; -struct envoy_config_route_v3_RateLimit_Action_GenericKey; -struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch; -struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData; -struct envoy_config_route_v3_RateLimit_Action_MetaData; -struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch; -struct envoy_config_route_v3_RateLimit_Override; -struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata; -struct envoy_config_route_v3_HeaderMatcher; -struct envoy_config_route_v3_QueryParameterMatcher; -struct envoy_config_route_v3_InternalRedirectPolicy; -struct envoy_config_route_v3_FilterConfig; typedef struct envoy_config_route_v3_VirtualHost envoy_config_route_v3_VirtualHost; typedef struct envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry; typedef struct envoy_config_route_v3_FilterAction envoy_config_route_v3_FilterAction; @@ -134,63 +82,63 @@ typedef struct envoy_config_route_v3_HeaderMatcher envoy_config_route_v3_HeaderM typedef struct envoy_config_route_v3_QueryParameterMatcher envoy_config_route_v3_QueryParameterMatcher; typedef struct envoy_config_route_v3_InternalRedirectPolicy envoy_config_route_v3_InternalRedirectPolicy; typedef struct envoy_config_route_v3_FilterConfig envoy_config_route_v3_FilterConfig; -extern const upb_MiniTable envoy_config_route_v3_VirtualHost_msginit; -extern const upb_MiniTable envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit; -extern const upb_MiniTable envoy_config_route_v3_FilterAction_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteList_msginit; -extern const upb_MiniTable envoy_config_route_v3_Route_msginit; -extern const upb_MiniTable envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit; -extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_msginit; -extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit; -extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit; -extern const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteMatch_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit; -extern const upb_MiniTable envoy_config_route_v3_CorsPolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit; -extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryPriority_msginit; -extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit; -extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit; -extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msginit; -extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit; -extern const upb_MiniTable envoy_config_route_v3_HedgePolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_RedirectAction_msginit; -extern const upb_MiniTable envoy_config_route_v3_DirectResponseAction_msginit; -extern const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msginit; -extern const upb_MiniTable envoy_config_route_v3_Decorator_msginit; -extern const upb_MiniTable envoy_config_route_v3_Tracing_msginit; -extern const upb_MiniTable envoy_config_route_v3_VirtualCluster_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MetaData_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Override_msginit; -extern const upb_MiniTable envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit; -extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit; -extern const upb_MiniTable envoy_config_route_v3_QueryParameterMatcher_msginit; -extern const upb_MiniTable envoy_config_route_v3_InternalRedirectPolicy_msginit; -extern const upb_MiniTable envoy_config_route_v3_FilterConfig_msginit; +extern const upb_MiniTable envoy_config_route_v3_VirtualHost_msg_init; +extern const upb_MiniTable envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msg_init; +extern const upb_MiniTable envoy_config_route_v3_FilterAction_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteList_msg_init; +extern const upb_MiniTable envoy_config_route_v3_Route_msg_init; +extern const upb_MiniTable envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msg_init; +extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_msg_init; +extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init; +extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msg_init; +extern const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteMatch_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init; +extern const upb_MiniTable envoy_config_route_v3_CorsPolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init; +extern const upb_MiniTable envoy_config_route_v3_HedgePolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RedirectAction_msg_init; +extern const upb_MiniTable envoy_config_route_v3_DirectResponseAction_msg_init; +extern const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msg_init; +extern const upb_MiniTable envoy_config_route_v3_Decorator_msg_init; +extern const upb_MiniTable envoy_config_route_v3_Tracing_msg_init; +extern const upb_MiniTable envoy_config_route_v3_VirtualCluster_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MetaData_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Override_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init; +extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init; +extern const upb_MiniTable envoy_config_route_v3_QueryParameterMatcher_msg_init; +extern const upb_MiniTable envoy_config_route_v3_InternalRedirectPolicy_msg_init; +extern const upb_MiniTable envoy_config_route_v3_FilterConfig_msg_init; struct envoy_config_core_v3_DataSource; struct envoy_config_core_v3_HeaderValueOption; struct envoy_config_core_v3_Metadata; @@ -210,25 +158,25 @@ struct google_protobuf_BoolValue; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; struct xds_type_matcher_v3_Matcher; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; -extern const upb_MiniTable envoy_type_v3_Int64Range_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msg_init; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msg_init; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; +extern const upb_MiniTable envoy_type_v3_Int64Range_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_msg_init; typedef enum { envoy_config_route_v3_RateLimit_Action_MetaData_DYNAMIC = 0, @@ -270,12 +218,12 @@ typedef enum { /* envoy.config.route.v3.VirtualHost */ UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_new(upb_Arena* arena) { - return (envoy_config_route_v3_VirtualHost*)_upb_Message_New(&envoy_config_route_v3_VirtualHost_msginit, arena); + return (envoy_config_route_v3_VirtualHost*)_upb_Message_New(&envoy_config_route_v3_VirtualHost_msg_init, arena); } UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_VirtualHost* ret = envoy_config_route_v3_VirtualHost_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -285,7 +233,7 @@ UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_ int options, upb_Arena* arena) { envoy_config_route_v3_VirtualHost* ret = envoy_config_route_v3_VirtualHost_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -293,388 +241,708 @@ UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_ } UPB_INLINE char* envoy_config_route_v3_VirtualHost_serialize(const envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_name(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(84, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_VirtualHost_name(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(84, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_domains(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_domains(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_domains(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_domains(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_domains(const envoy_config_route_v3_VirtualHost* msg) { + size_t size; + envoy_config_route_v3_VirtualHost_domains(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_routes(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_Route* const* envoy_config_route_v3_VirtualHost_routes(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_Route* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_routes(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); + size_t size; + envoy_config_route_v3_VirtualHost_routes(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_routes(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); -} -UPB_INLINE const envoy_config_route_v3_Route* const* envoy_config_route_v3_VirtualHost_routes(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (const envoy_config_route_v3_Route* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); -} -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_require_tls(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_require_tls(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_VirtualHost_require_tls(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_virtual_clusters(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_VirtualCluster* const* envoy_config_route_v3_VirtualHost_virtual_clusters(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_VirtualCluster* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_virtual_clusters(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); + size_t size; + envoy_config_route_v3_VirtualHost_virtual_clusters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_virtual_clusters(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 48)); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_rate_limits(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_route_v3_VirtualCluster* const* envoy_config_route_v3_VirtualHost_virtual_clusters(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (const envoy_config_route_v3_VirtualCluster* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_VirtualHost_rate_limits(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RateLimit* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_rate_limits(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); + size_t size; + envoy_config_route_v3_VirtualHost_rate_limits(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_rate_limits(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_headers_to_add(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_VirtualHost_rate_limits(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (const envoy_config_route_v3_RateLimit* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_request_headers_to_add(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_request_headers_to_add(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); + size_t size; + envoy_config_route_v3_VirtualHost_request_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_headers_to_add(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 64)); -} -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_request_headers_to_add(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); -} -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_cors(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_cors(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_cors(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_VirtualHost_cors(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const envoy_config_route_v3_CorsPolicy*); + const envoy_config_route_v3_CorsPolicy* default_val = NULL; + const envoy_config_route_v3_CorsPolicy* ret; + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_cors(const envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_response_headers_to_add(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_response_headers_to_add(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_response_headers_to_add(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); + size_t size; + envoy_config_route_v3_VirtualHost_response_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_response_headers_to_add(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 80)); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_response_headers_to_add(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_response_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_response_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 88)); +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_response_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg) { + size_t size; + envoy_config_route_v3_VirtualHost_response_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_response_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(40, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 96)); +UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_request_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(40, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_request_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_request_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg) { + size_t size; + envoy_config_route_v3_VirtualHost_request_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_request_attempt_count(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_request_attempt_count(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(44, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_request_attempt_count(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {14, UPB_SIZE(44, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_typed_per_filter_config(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 104)); -} -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_typed_per_filter_config(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(56, 104)); +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_typed_per_filter_config(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_route_v3_VirtualHost_typed_per_filter_config_size(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(56, 104)); + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_get(const envoy_config_route_v3_VirtualHost* msg, upb_StringView key, struct google_protobuf_Any** val) { - return _upb_msg_map_get(msg, UPB_SIZE(56, 104), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* envoy_config_route_v3_VirtualHost_typed_per_filter_config_next(const envoy_config_route_v3_VirtualHost* msg, size_t* iter) { - return (const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(56, 104), iter); + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_typed_per_filter_config(const envoy_config_route_v3_VirtualHost* msg) { + return envoy_config_route_v3_VirtualHost_typed_per_filter_config_size(msg) != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_retry_policy(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_retry_policy(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(52, 112), 2, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_VirtualHost_retry_policy(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const envoy_config_route_v3_RetryPolicy*); + const envoy_config_route_v3_RetryPolicy* default_val = NULL; + const envoy_config_route_v3_RetryPolicy* ret; + const upb_MiniTableField field = {16, UPB_SIZE(52, 112), 2, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_hedge_policy(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy(const envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(52, 112), 2, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_hedge_policy(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_hedge_policy(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(56, 120), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_VirtualHost_hedge_policy(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const envoy_config_route_v3_HedgePolicy*); + const envoy_config_route_v3_HedgePolicy* default_val = NULL; + const envoy_config_route_v3_HedgePolicy* ret; + const upb_MiniTableField field = {17, UPB_SIZE(56, 120), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_hedge_policy(const envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(56, 120), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(60, 128), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_VirtualHost_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {18, UPB_SIZE(60, 128), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_attempt_count_in_response(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(60, 128), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_attempt_count_in_response(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(64, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_attempt_count_in_response(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {19, UPB_SIZE(64, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 136), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_retry_policy_typed_config(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(68, 136), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 136), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {20, UPB_SIZE(68, 136), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_matcher(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(68, 136), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_matcher(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_matcher(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(72, 144), 6, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher* envoy_config_route_v3_VirtualHost_matcher(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 144), const struct xds_type_matcher_v3_Matcher*); + const struct xds_type_matcher_v3_Matcher* default_val = NULL; + const struct xds_type_matcher_v3_Matcher* ret; + const upb_MiniTableField field = {21, UPB_SIZE(72, 144), 6, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_matcher(const envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(72, 144), 6, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(76, 152), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_VirtualHost_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg, size_t* size) { + const upb_MiniTableField field = {22, UPB_SIZE(76, 152), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 152)); + size_t size; + envoy_config_route_v3_VirtualHost_request_mirror_policies(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg) { - _upb_array_detach(msg, UPB_SIZE(80, 152)); -} -UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_VirtualHost_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(80, 152), len); -} -UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_is_timeout_retry_header(const envoy_config_route_v3_VirtualHost* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0; +UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_is_timeout_retry_header(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(80, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_is_timeout_retry_header(const envoy_config_route_v3_VirtualHost* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {23, UPB_SIZE(80, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_name(envoy_config_route_v3_VirtualHost *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(84, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_domains(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_domains(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_domains(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_domains(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_domains(envoy_config_route_v3_VirtualHost* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(4, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_mutable_routes(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (envoy_config_route_v3_Route**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_mutable_routes(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_Route**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_resize_routes(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_Route**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_resize_routes(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_Route**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_Route* envoy_config_route_v3_VirtualHost_add_routes(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { - struct envoy_config_route_v3_Route* sub = (struct envoy_config_route_v3_Route*)_upb_Message_New(&envoy_config_route_v3_Route_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 40), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_Route* sub = (struct envoy_config_route_v3_Route*)_upb_Message_New(&envoy_config_route_v3_Route_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_require_tls(envoy_config_route_v3_VirtualHost *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_mutable_virtual_clusters(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (envoy_config_route_v3_VirtualCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_mutable_virtual_clusters(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_VirtualCluster**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_resize_virtual_clusters(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_VirtualCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_resize_virtual_clusters(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_VirtualCluster**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualHost_add_virtual_clusters(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { - struct envoy_config_route_v3_VirtualCluster* sub = (struct envoy_config_route_v3_VirtualCluster*)_upb_Message_New(&envoy_config_route_v3_VirtualCluster_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_VirtualCluster* sub = (struct envoy_config_route_v3_VirtualCluster*)_upb_Message_New(&envoy_config_route_v3_VirtualCluster_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_mutable_rate_limits(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (envoy_config_route_v3_RateLimit**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_mutable_rate_limits(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RateLimit**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_resize_rate_limits(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_resize_rate_limits(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RateLimit**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RateLimit* envoy_config_route_v3_VirtualHost_add_rate_limits(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_Message_New(&envoy_config_route_v3_RateLimit_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_Message_New(&envoy_config_route_v3_RateLimit_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_request_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_request_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(24, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_request_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_request_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(24, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_VirtualHost_add_request_headers_to_add(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(24, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_cors(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_CorsPolicy* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), envoy_config_route_v3_CorsPolicy*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_VirtualHost_mutable_cors(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { struct envoy_config_route_v3_CorsPolicy* sub = (struct envoy_config_route_v3_CorsPolicy*)envoy_config_route_v3_VirtualHost_cors(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_VirtualHost_set_cors(msg, sub); + sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msg_init, arena); + if (sub) envoy_config_route_v3_VirtualHost_set_cors(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_response_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_response_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(32, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_response_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_response_headers_to_add(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(32, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_VirtualHost_add_response_headers_to_add(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {10, UPB_SIZE(32, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(36, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(36, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {11, UPB_SIZE(36, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(40, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(40, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {13, UPB_SIZE(40, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_request_attempt_count(envoy_config_route_v3_VirtualHost *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {14, UPB_SIZE(44, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void envoy_config_route_v3_VirtualHost_typed_per_filter_config_clear(envoy_config_route_v3_VirtualHost* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_route_v3_VirtualHost_typed_per_filter_config_clear(envoy_config_route_v3_VirtualHost* msg) { _upb_msg_map_clear(msg, UPB_SIZE(56, 104)); } UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_set(envoy_config_route_v3_VirtualHost* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(56, 104), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_delete(envoy_config_route_v3_VirtualHost* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(56, 104), &key, 0); + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* envoy_config_route_v3_VirtualHost_typed_per_filter_config_nextmutable(envoy_config_route_v3_VirtualHost* msg, size_t* iter) { - return (envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(56, 104), iter); + const upb_MiniTableField field = {15, UPB_SIZE(48, 104), 0, 6, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_retry_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_RetryPolicy* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(60, 112), envoy_config_route_v3_RetryPolicy*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(52, 112), 2, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_VirtualHost_mutable_retry_policy(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { struct envoy_config_route_v3_RetryPolicy* sub = (struct envoy_config_route_v3_RetryPolicy*)envoy_config_route_v3_VirtualHost_retry_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_VirtualHost_set_retry_policy(msg, sub); + sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msg_init, arena); + if (sub) envoy_config_route_v3_VirtualHost_set_retry_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_hedge_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_HedgePolicy* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(64, 120), envoy_config_route_v3_HedgePolicy*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(56, 120), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_VirtualHost_mutable_hedge_policy(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { struct envoy_config_route_v3_HedgePolicy* sub = (struct envoy_config_route_v3_HedgePolicy*)envoy_config_route_v3_VirtualHost_hedge_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_VirtualHost_set_hedge_policy(msg, sub); + sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msg_init, arena); + if (sub) envoy_config_route_v3_VirtualHost_set_hedge_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(68, 128), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {18, UPB_SIZE(60, 128), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_VirtualHost_mutable_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_VirtualHost_per_request_buffer_limit_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_attempt_count_in_response(envoy_config_route_v3_VirtualHost *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {19, UPB_SIZE(64, 9), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(envoy_config_route_v3_VirtualHost *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(72, 136), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {20, UPB_SIZE(68, 136), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_mutable_retry_policy_typed_config(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_VirtualHost_retry_policy_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_matcher(envoy_config_route_v3_VirtualHost *msg, struct xds_type_matcher_v3_Matcher* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(76, 144), struct xds_type_matcher_v3_Matcher*) = value; + const upb_MiniTableField field = {21, UPB_SIZE(72, 144), 6, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher* envoy_config_route_v3_VirtualHost_mutable_matcher(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)envoy_config_route_v3_VirtualHost_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_VirtualHost_set_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msg_init, arena); + if (sub) envoy_config_route_v3_VirtualHost_set_matcher(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_VirtualHost_mutable_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, size_t* len) { - return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(80, 152), len); +UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_VirtualHost_mutable_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, size_t* size) { + upb_MiniTableField field = {22, UPB_SIZE(76, 152), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_VirtualHost_resize_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(80, 152), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_VirtualHost_resize_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {22, UPB_SIZE(76, 152), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_VirtualHost_add_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(80, 152), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {22, UPB_SIZE(76, 152), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_is_timeout_retry_header(envoy_config_route_v3_VirtualHost *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value; + const upb_MiniTableField field = {23, UPB_SIZE(80, 10), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.VirtualHost.TypedPerFilterConfigEntry */ @@ -684,14 +952,15 @@ UPB_INLINE upb_StringView envoy_config_route_v3_VirtualHost_TypedPerFilterConfig _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* msg) { struct google_protobuf_Any* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*)); @@ -700,12 +969,12 @@ UPB_INLINE void envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_set_ /* envoy.config.route.v3.FilterAction */ UPB_INLINE envoy_config_route_v3_FilterAction* envoy_config_route_v3_FilterAction_new(upb_Arena* arena) { - return (envoy_config_route_v3_FilterAction*)_upb_Message_New(&envoy_config_route_v3_FilterAction_msginit, arena); + return (envoy_config_route_v3_FilterAction*)_upb_Message_New(&envoy_config_route_v3_FilterAction_msg_init, arena); } UPB_INLINE envoy_config_route_v3_FilterAction* envoy_config_route_v3_FilterAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_FilterAction* ret = envoy_config_route_v3_FilterAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -715,7 +984,7 @@ UPB_INLINE envoy_config_route_v3_FilterAction* envoy_config_route_v3_FilterActio int options, upb_Arena* arena) { envoy_config_route_v3_FilterAction* ret = envoy_config_route_v3_FilterAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -723,35 +992,40 @@ UPB_INLINE envoy_config_route_v3_FilterAction* envoy_config_route_v3_FilterActio } UPB_INLINE char* envoy_config_route_v3_FilterAction_serialize(const envoy_config_route_v3_FilterAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_FilterAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_FilterAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_FilterAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_FilterAction_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_FilterAction_clear_action(const envoy_config_route_v3_FilterAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_FilterAction_clear_action(envoy_config_route_v3_FilterAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_FilterAction_action(const envoy_config_route_v3_FilterAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_FilterAction_has_action(const envoy_config_route_v3_FilterAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_FilterAction_set_action(envoy_config_route_v3_FilterAction *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterAction_mutable_action(envoy_config_route_v3_FilterAction* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_FilterAction_action(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_FilterAction_set_action(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_route_v3_FilterAction_set_action(msg, sub); } return sub; } @@ -759,12 +1033,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterAction_mutabl /* envoy.config.route.v3.RouteList */ UPB_INLINE envoy_config_route_v3_RouteList* envoy_config_route_v3_RouteList_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteList*)_upb_Message_New(&envoy_config_route_v3_RouteList_msginit, arena); + return (envoy_config_route_v3_RouteList*)_upb_Message_New(&envoy_config_route_v3_RouteList_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteList* envoy_config_route_v3_RouteList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteList* ret = envoy_config_route_v3_RouteList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -774,7 +1048,7 @@ UPB_INLINE envoy_config_route_v3_RouteList* envoy_config_route_v3_RouteList_pars int options, upb_Arena* arena) { envoy_config_route_v3_RouteList* ret = envoy_config_route_v3_RouteList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -782,47 +1056,72 @@ UPB_INLINE envoy_config_route_v3_RouteList* envoy_config_route_v3_RouteList_pars } UPB_INLINE char* envoy_config_route_v3_RouteList_serialize(const envoy_config_route_v3_RouteList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteList_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_route_v3_RouteList_serialize_ex(const envoy_config_route_v3_RouteList* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_route_v3_RouteList_clear_routes(envoy_config_route_v3_RouteList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_Route* const* envoy_config_route_v3_RouteList_routes(const envoy_config_route_v3_RouteList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_Route* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_route_v3_RouteList_has_routes(const envoy_config_route_v3_RouteList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_route_v3_RouteList_clear_routes(const envoy_config_route_v3_RouteList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_route_v3_Route* const* envoy_config_route_v3_RouteList_routes(const envoy_config_route_v3_RouteList* msg, size_t* len) { - return (const envoy_config_route_v3_Route* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_route_v3_RouteList_routes(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_RouteList_mutable_routes(envoy_config_route_v3_RouteList* msg, size_t* len) { - return (envoy_config_route_v3_Route**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_RouteList_mutable_routes(envoy_config_route_v3_RouteList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_Route**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_RouteList_resize_routes(envoy_config_route_v3_RouteList* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_Route**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_RouteList_resize_routes(envoy_config_route_v3_RouteList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_Route**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_Route* envoy_config_route_v3_RouteList_add_routes(envoy_config_route_v3_RouteList* msg, upb_Arena* arena) { - struct envoy_config_route_v3_Route* sub = (struct envoy_config_route_v3_Route*)_upb_Message_New(&envoy_config_route_v3_Route_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_Route* sub = (struct envoy_config_route_v3_Route*)_upb_Message_New(&envoy_config_route_v3_Route_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.route.v3.Route */ UPB_INLINE envoy_config_route_v3_Route* envoy_config_route_v3_Route_new(upb_Arena* arena) { - return (envoy_config_route_v3_Route*)_upb_Message_New(&envoy_config_route_v3_Route_msginit, arena); + return (envoy_config_route_v3_Route*)_upb_Message_New(&envoy_config_route_v3_Route_msg_init, arena); } UPB_INLINE envoy_config_route_v3_Route* envoy_config_route_v3_Route_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_Route* ret = envoy_config_route_v3_Route_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Route_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -832,7 +1131,7 @@ UPB_INLINE envoy_config_route_v3_Route* envoy_config_route_v3_Route_parse_ex(con int options, upb_Arena* arena) { envoy_config_route_v3_Route* ret = envoy_config_route_v3_Route_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Route_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -840,13 +1139,13 @@ UPB_INLINE envoy_config_route_v3_Route* envoy_config_route_v3_Route_parse_ex(con } UPB_INLINE char* envoy_config_route_v3_Route_serialize(const envoy_config_route_v3_Route* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Route_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Route_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Route_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Route_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -858,338 +1157,537 @@ typedef enum { envoy_config_route_v3_Route_action_NOT_SET = 0 } envoy_config_route_v3_Route_action_oneofcases; UPB_INLINE envoy_config_route_v3_Route_action_oneofcases envoy_config_route_v3_Route_action_case(const envoy_config_route_v3_Route* msg) { - return (envoy_config_route_v3_Route_action_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_Route_action_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_Route_has_match(const envoy_config_route_v3_Route* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_Route_clear_match(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Route_clear_match(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteMatch* envoy_config_route_v3_Route_match(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_config_route_v3_RouteMatch*); + const envoy_config_route_v3_RouteMatch* default_val = NULL; + const envoy_config_route_v3_RouteMatch* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_route(const envoy_config_route_v3_Route* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_route_v3_Route_has_match(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_route(const envoy_config_route_v3_Route* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction*, UPB_SIZE(64, 120), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET); +UPB_INLINE void envoy_config_route_v3_Route_clear_route(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction* envoy_config_route_v3_Route_route(const envoy_config_route_v3_Route* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction*, UPB_SIZE(64, 120), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_route_v3_RouteAction* default_val = NULL; + const envoy_config_route_v3_RouteAction* ret; + const upb_MiniTableField field = {2, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_redirect(const envoy_config_route_v3_Route* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_route_v3_Route_has_route(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_redirect(const envoy_config_route_v3_Route* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RedirectAction*, UPB_SIZE(64, 120), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET); +UPB_INLINE void envoy_config_route_v3_Route_clear_redirect(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Route_redirect(const envoy_config_route_v3_Route* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RedirectAction*, UPB_SIZE(64, 120), UPB_SIZE(4, 4), 3, NULL); + const envoy_config_route_v3_RedirectAction* default_val = NULL; + const envoy_config_route_v3_RedirectAction* ret; + const upb_MiniTableField field = {3, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_metadata(const envoy_config_route_v3_Route* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_Route_has_redirect(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_metadata(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Route_clear_metadata(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_metadata(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_decorator(const envoy_config_route_v3_Route* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_Route_has_metadata(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_decorator(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Route_clear_decorator(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_Decorator* envoy_config_route_v3_Route_decorator(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_config_route_v3_Decorator*); + const envoy_config_route_v3_Decorator* default_val = NULL; + const envoy_config_route_v3_Decorator* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_direct_response(const envoy_config_route_v3_Route* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; +UPB_INLINE bool envoy_config_route_v3_Route_has_decorator(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_direct_response(const envoy_config_route_v3_Route* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(64, 120), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET); +UPB_INLINE void envoy_config_route_v3_Route_clear_direct_response(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Route_direct_response(const envoy_config_route_v3_Route* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(64, 120), UPB_SIZE(4, 4), 7, NULL); + const envoy_config_route_v3_DirectResponseAction* default_val = NULL; + const envoy_config_route_v3_DirectResponseAction* ret; + const upb_MiniTableField field = {7, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_Route_has_direct_response(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_Route_clear_request_headers_to_add(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(16, 32), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_request_headers_to_add(const envoy_config_route_v3_Route* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(16, 32), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_Route_has_request_headers_to_add(const envoy_config_route_v3_Route* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); + size_t size; + envoy_config_route_v3_Route_request_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_Route_clear_request_headers_to_add(const envoy_config_route_v3_Route* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); +UPB_INLINE void envoy_config_route_v3_Route_clear_response_headers_to_add(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(20, 40), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_request_headers_to_add(const envoy_config_route_v3_Route* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_response_headers_to_add(const envoy_config_route_v3_Route* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(20, 40), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_Route_has_response_headers_to_add(const envoy_config_route_v3_Route* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); + size_t size; + envoy_config_route_v3_Route_response_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_Route_clear_response_headers_to_add(const envoy_config_route_v3_Route* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); +UPB_INLINE void envoy_config_route_v3_Route_clear_response_headers_to_remove(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_response_headers_to_add(const envoy_config_route_v3_Route* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE upb_StringView const* envoy_config_route_v3_Route_response_headers_to_remove(const envoy_config_route_v3_Route* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_route_v3_Route_clear_response_headers_to_remove(const envoy_config_route_v3_Route* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 48)); +UPB_INLINE bool envoy_config_route_v3_Route_has_response_headers_to_remove(const envoy_config_route_v3_Route* msg) { + size_t size; + envoy_config_route_v3_Route_response_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_route_v3_Route_response_headers_to_remove(const envoy_config_route_v3_Route* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE void envoy_config_route_v3_Route_clear_request_headers_to_remove(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_request_headers_to_remove(const envoy_config_route_v3_Route* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); +UPB_INLINE upb_StringView const* envoy_config_route_v3_Route_request_headers_to_remove(const envoy_config_route_v3_Route* msg, size_t* size) { + const upb_MiniTableField field = {12, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* envoy_config_route_v3_Route_request_headers_to_remove(const envoy_config_route_v3_Route* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE bool envoy_config_route_v3_Route_has_request_headers_to_remove(const envoy_config_route_v3_Route* msg) { + size_t size; + envoy_config_route_v3_Route_request_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE bool envoy_config_route_v3_Route_has_typed_per_filter_config(const envoy_config_route_v3_Route* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); -} -UPB_INLINE void envoy_config_route_v3_Route_clear_typed_per_filter_config(const envoy_config_route_v3_Route* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 64)); +UPB_INLINE void envoy_config_route_v3_Route_clear_typed_per_filter_config(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_route_v3_Route_typed_per_filter_config_size(const envoy_config_route_v3_Route* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(36, 64)); + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_get(const envoy_config_route_v3_Route* msg, upb_StringView key, struct google_protobuf_Any** val) { - return _upb_msg_map_get(msg, UPB_SIZE(36, 64), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* envoy_config_route_v3_Route_typed_per_filter_config_next(const envoy_config_route_v3_Route* msg, size_t* iter) { - return (const envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(36, 64), iter); + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } -UPB_INLINE void envoy_config_route_v3_Route_clear_name(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_Route_has_typed_per_filter_config(const envoy_config_route_v3_Route* msg) { + return envoy_config_route_v3_Route_typed_per_filter_config_size(msg) != 0; +} +UPB_INLINE void envoy_config_route_v3_Route_clear_name(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(52, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_Route_name(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {14, UPB_SIZE(52, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_tracing(const envoy_config_route_v3_Route* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_config_route_v3_Route_clear_tracing(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Route_clear_tracing(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(36, 88), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_tracing(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const envoy_config_route_v3_Tracing*); + const envoy_config_route_v3_Tracing* default_val = NULL; + const envoy_config_route_v3_Tracing* ret; + const upb_MiniTableField field = {15, UPB_SIZE(36, 88), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_config_route_v3_Route_has_tracing(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(36, 88), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Route_clear_per_request_buffer_limit_bytes(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(40, 96), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {16, UPB_SIZE(40, 96), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_filter_action(const envoy_config_route_v3_Route* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 17; +UPB_INLINE bool envoy_config_route_v3_Route_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(40, 96), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_filter_action(const envoy_config_route_v3_Route* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_FilterAction*, UPB_SIZE(64, 120), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET); +UPB_INLINE void envoy_config_route_v3_Route_clear_filter_action(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_filter_action(const envoy_config_route_v3_Route* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_FilterAction*, UPB_SIZE(64, 120), UPB_SIZE(4, 4), 17, NULL); + const envoy_config_route_v3_FilterAction* default_val = NULL; + const envoy_config_route_v3_FilterAction* ret; + const upb_MiniTableField field = {17, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_has_non_forwarding_action(const envoy_config_route_v3_Route* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 18; +UPB_INLINE bool envoy_config_route_v3_Route_has_filter_action(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Route_clear_non_forwarding_action(const envoy_config_route_v3_Route* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(64, 120), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET); +UPB_INLINE void envoy_config_route_v3_Route_clear_non_forwarding_action(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_Route_non_forwarding_action(const envoy_config_route_v3_Route* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(64, 120), UPB_SIZE(4, 4), 18, NULL); + const envoy_config_route_v3_NonForwardingAction* default_val = NULL; + const envoy_config_route_v3_NonForwardingAction* ret; + const upb_MiniTableField field = {18, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_Route_clear_stat_prefix(const envoy_config_route_v3_Route* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_Route_has_non_forwarding_action(const envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_Route_clear_stat_prefix(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(60, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_Route_stat_prefix(const envoy_config_route_v3_Route* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {19, UPB_SIZE(60, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_Route_set_match(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_config_route_v3_RouteMatch*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteMatch* envoy_config_route_v3_Route_mutable_match(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteMatch* sub = (struct envoy_config_route_v3_RouteMatch*)envoy_config_route_v3_Route_match(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteMatch*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_match(msg, sub); + sub = (struct envoy_config_route_v3_RouteMatch*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_route(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteAction* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction*, UPB_SIZE(64, 120), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction* envoy_config_route_v3_Route_mutable_route(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction* sub = (struct envoy_config_route_v3_RouteAction*)envoy_config_route_v3_Route_route(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction*)_upb_Message_New(&envoy_config_route_v3_RouteAction_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_route(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction*)_upb_Message_New(&envoy_config_route_v3_RouteAction_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_route(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_redirect(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RedirectAction* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RedirectAction*, UPB_SIZE(64, 120), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Route_mutable_redirect(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_RedirectAction* sub = (struct envoy_config_route_v3_RedirectAction*)envoy_config_route_v3_Route_redirect(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RedirectAction*)_upb_Message_New(&envoy_config_route_v3_RedirectAction_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_redirect(msg, sub); + sub = (struct envoy_config_route_v3_RedirectAction*)_upb_Message_New(&envoy_config_route_v3_RedirectAction_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_redirect(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_metadata(envoy_config_route_v3_Route *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_mutable_metadata(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_Route_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_metadata(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_decorator(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Decorator* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_config_route_v3_Decorator*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_Decorator* envoy_config_route_v3_Route_mutable_decorator(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_Decorator* sub = (struct envoy_config_route_v3_Decorator*)envoy_config_route_v3_Route_decorator(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_Decorator*)_upb_Message_New(&envoy_config_route_v3_Decorator_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_decorator(msg, sub); + sub = (struct envoy_config_route_v3_Decorator*)_upb_Message_New(&envoy_config_route_v3_Decorator_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_decorator(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_direct_response(envoy_config_route_v3_Route *msg, envoy_config_route_v3_DirectResponseAction* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(64, 120), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Route_mutable_direct_response(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_DirectResponseAction* sub = (struct envoy_config_route_v3_DirectResponseAction*)envoy_config_route_v3_Route_direct_response(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_DirectResponseAction*)_upb_Message_New(&envoy_config_route_v3_DirectResponseAction_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_direct_response(msg, sub); + sub = (struct envoy_config_route_v3_DirectResponseAction*)_upb_Message_New(&envoy_config_route_v3_DirectResponseAction_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_direct_response(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_request_headers_to_add(envoy_config_route_v3_Route* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_request_headers_to_add(envoy_config_route_v3_Route* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(16, 32), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_request_headers_to_add(envoy_config_route_v3_Route* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_request_headers_to_add(envoy_config_route_v3_Route* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(16, 32), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_Route_add_request_headers_to_add(envoy_config_route_v3_Route* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(16, 32), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_response_headers_to_add(envoy_config_route_v3_Route* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_response_headers_to_add(envoy_config_route_v3_Route* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(20, 40), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_response_headers_to_add(envoy_config_route_v3_Route* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_response_headers_to_add(envoy_config_route_v3_Route* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(20, 40), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_Route_add_response_headers_to_add(envoy_config_route_v3_Route* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {10, UPB_SIZE(20, 40), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_route_v3_Route_mutable_response_headers_to_remove(envoy_config_route_v3_Route* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_Route_mutable_response_headers_to_remove(envoy_config_route_v3_Route* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_Route_resize_response_headers_to_remove(envoy_config_route_v3_Route* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_Route_resize_response_headers_to_remove(envoy_config_route_v3_Route* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_Route_add_response_headers_to_remove(envoy_config_route_v3_Route* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {11, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_config_route_v3_Route_mutable_request_headers_to_remove(envoy_config_route_v3_Route* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_Route_mutable_request_headers_to_remove(envoy_config_route_v3_Route* msg, size_t* size) { + upb_MiniTableField field = {12, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_Route_resize_request_headers_to_remove(envoy_config_route_v3_Route* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_Route_resize_request_headers_to_remove(envoy_config_route_v3_Route* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {12, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_Route_add_request_headers_to_remove(envoy_config_route_v3_Route* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {12, UPB_SIZE(28, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void envoy_config_route_v3_Route_typed_per_filter_config_clear(envoy_config_route_v3_Route* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_route_v3_Route_typed_per_filter_config_clear(envoy_config_route_v3_Route* msg) { _upb_msg_map_clear(msg, UPB_SIZE(36, 64)); } UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_set(envoy_config_route_v3_Route* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(36, 64), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_delete(envoy_config_route_v3_Route* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(36, 64), &key, 0); + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_route_v3_Route_TypedPerFilterConfigEntry* envoy_config_route_v3_Route_typed_per_filter_config_nextmutable(envoy_config_route_v3_Route* msg, size_t* iter) { - return (envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(36, 64), iter); + const upb_MiniTableField field = {13, UPB_SIZE(32, 64), 0, 8, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } UPB_INLINE void envoy_config_route_v3_Route_set_name(envoy_config_route_v3_Route *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = value; + const upb_MiniTableField field = {14, UPB_SIZE(52, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_Route_set_tracing(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Tracing* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), envoy_config_route_v3_Tracing*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(36, 88), 4, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_mutable_tracing(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_Tracing* sub = (struct envoy_config_route_v3_Tracing*)envoy_config_route_v3_Route_tracing(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_Tracing*)_upb_Message_New(&envoy_config_route_v3_Tracing_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_tracing(msg, sub); + sub = (struct envoy_config_route_v3_Tracing*)_upb_Message_New(&envoy_config_route_v3_Tracing_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_tracing(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(envoy_config_route_v3_Route *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(40, 96), 5, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_mutable_per_request_buffer_limit_bytes(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_Route_per_request_buffer_limit_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_filter_action(envoy_config_route_v3_Route *msg, envoy_config_route_v3_FilterAction* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_FilterAction*, UPB_SIZE(64, 120), value, UPB_SIZE(4, 4), 17); + const upb_MiniTableField field = {17, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_mutable_filter_action(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_FilterAction* sub = (struct envoy_config_route_v3_FilterAction*)envoy_config_route_v3_Route_filter_action(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_FilterAction*)_upb_Message_New(&envoy_config_route_v3_FilterAction_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_filter_action(msg, sub); + sub = (struct envoy_config_route_v3_FilterAction*)_upb_Message_New(&envoy_config_route_v3_FilterAction_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_filter_action(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_non_forwarding_action(envoy_config_route_v3_Route *msg, envoy_config_route_v3_NonForwardingAction* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(64, 120), value, UPB_SIZE(4, 4), 18); + const upb_MiniTableField field = {18, UPB_SIZE(48, 120), UPB_SIZE(-45, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_Route_mutable_non_forwarding_action(envoy_config_route_v3_Route* msg, upb_Arena* arena) { struct envoy_config_route_v3_NonForwardingAction* sub = (struct envoy_config_route_v3_NonForwardingAction*)envoy_config_route_v3_Route_non_forwarding_action(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_NonForwardingAction*)_upb_Message_New(&envoy_config_route_v3_NonForwardingAction_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Route_set_non_forwarding_action(msg, sub); + sub = (struct envoy_config_route_v3_NonForwardingAction*)_upb_Message_New(&envoy_config_route_v3_NonForwardingAction_msg_init, arena); + if (sub) envoy_config_route_v3_Route_set_non_forwarding_action(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Route_set_stat_prefix(envoy_config_route_v3_Route *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), upb_StringView) = value; + const upb_MiniTableField field = {19, UPB_SIZE(60, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.Route.TypedPerFilterConfigEntry */ @@ -1199,14 +1697,15 @@ UPB_INLINE upb_StringView envoy_config_route_v3_Route_TypedPerFilterConfigEntry_ _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_route_v3_Route_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_Route_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* msg) { struct google_protobuf_Any* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_route_v3_Route_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_route_v3_Route_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*)); @@ -1215,12 +1714,12 @@ UPB_INLINE void envoy_config_route_v3_Route_TypedPerFilterConfigEntry_set_value( /* envoy.config.route.v3.WeightedCluster */ UPB_INLINE envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_WeightedCluster_new(upb_Arena* arena) { - return (envoy_config_route_v3_WeightedCluster*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_msginit, arena); + return (envoy_config_route_v3_WeightedCluster*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_msg_init, arena); } UPB_INLINE envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_WeightedCluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_WeightedCluster* ret = envoy_config_route_v3_WeightedCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1230,7 +1729,7 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_Weighted int options, upb_Arena* arena) { envoy_config_route_v3_WeightedCluster* ret = envoy_config_route_v3_WeightedCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1238,13 +1737,13 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_Weighted } UPB_INLINE char* envoy_config_route_v3_WeightedCluster_serialize(const envoy_config_route_v3_WeightedCluster* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1252,83 +1751,127 @@ typedef enum { envoy_config_route_v3_WeightedCluster_random_value_specifier_NOT_SET = 0 } envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases envoy_config_route_v3_WeightedCluster_random_value_specifier_case(const envoy_config_route_v3_WeightedCluster* msg) { - return (envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_clusters(envoy_config_route_v3_WeightedCluster* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight* const* envoy_config_route_v3_WeightedCluster_clusters(const envoy_config_route_v3_WeightedCluster* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_WeightedCluster_ClusterWeight* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_clusters(const envoy_config_route_v3_WeightedCluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); + size_t size; + envoy_config_route_v3_WeightedCluster_clusters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_clusters(const envoy_config_route_v3_WeightedCluster* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); -} -UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight* const* envoy_config_route_v3_WeightedCluster_clusters(const envoy_config_route_v3_WeightedCluster* msg, size_t* len) { - return (const envoy_config_route_v3_WeightedCluster_ClusterWeight* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); -} -UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_runtime_key_prefix(const envoy_config_route_v3_WeightedCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_runtime_key_prefix(envoy_config_route_v3_WeightedCluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_runtime_key_prefix(const envoy_config_route_v3_WeightedCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_total_weight(const envoy_config_route_v3_WeightedCluster* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_total_weight(const envoy_config_route_v3_WeightedCluster* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_total_weight(envoy_config_route_v3_WeightedCluster* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_total_weight(const envoy_config_route_v3_WeightedCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_header_name(const envoy_config_route_v3_WeightedCluster* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_total_weight(const envoy_config_route_v3_WeightedCluster* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_header_name(const envoy_config_route_v3_WeightedCluster* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_WeightedCluster_random_value_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_header_name(envoy_config_route_v3_WeightedCluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_header_name(const envoy_config_route_v3_WeightedCluster* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 4, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_header_name(const envoy_config_route_v3_WeightedCluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_mutable_clusters(envoy_config_route_v3_WeightedCluster* msg, size_t* len) { - return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_mutable_clusters(envoy_config_route_v3_WeightedCluster* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_resize_clusters(envoy_config_route_v3_WeightedCluster* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_resize_clusters(envoy_config_route_v3_WeightedCluster* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_route_v3_WeightedCluster_add_clusters(envoy_config_route_v3_WeightedCluster* msg, upb_Arena* arena) { - struct envoy_config_route_v3_WeightedCluster_ClusterWeight* sub = (struct envoy_config_route_v3_WeightedCluster_ClusterWeight*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_WeightedCluster_ClusterWeight* sub = (struct envoy_config_route_v3_WeightedCluster_ClusterWeight*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_runtime_key_prefix(envoy_config_route_v3_WeightedCluster *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_total_weight(envoy_config_route_v3_WeightedCluster *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_mutable_total_weight(envoy_config_route_v3_WeightedCluster* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_total_weight(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_WeightedCluster_set_total_weight(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_WeightedCluster_set_total_weight(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_header_name(envoy_config_route_v3_WeightedCluster *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), UPB_SIZE(-13, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.WeightedCluster.ClusterWeight */ UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_route_v3_WeightedCluster_ClusterWeight_new(upb_Arena* arena) { - return (envoy_config_route_v3_WeightedCluster_ClusterWeight*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena); + return (envoy_config_route_v3_WeightedCluster_ClusterWeight*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, arena); } UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_route_v3_WeightedCluster_ClusterWeight_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_WeightedCluster_ClusterWeight* ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1338,7 +1881,7 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_rou int options, upb_Arena* arena) { envoy_config_route_v3_WeightedCluster_ClusterWeight* ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1346,13 +1889,13 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_rou } UPB_INLINE char* envoy_config_route_v3_WeightedCluster_ClusterWeight_serialize(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1360,179 +1903,340 @@ typedef enum { envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_NOT_SET = 0 } envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_case(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return (envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {11, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_name(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(44, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(44, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); + size_t size; + envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); + size_t size; + envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 64)); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); +UPB_INLINE upb_StringView const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 72)); +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + size_t size; + envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 80)); +UPB_INLINE upb_StringView const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + size_t size; + envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(msg, &size); + return size != 0; } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); -} -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 88)); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_typed_per_filter_config(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_size(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(48, 88)); + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_get(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView key, struct google_protobuf_Any** val) { - return _upb_msg_map_get(msg, UPB_SIZE(48, 88), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* iter) { - return (const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(48, 88), iter); + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11; +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + return envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_size(msg) != 0; } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_host_rewrite_literal(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 11, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {11, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_cluster_header(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_cluster_header(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(52, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_cluster_header(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(52, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_name(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(44, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 56), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(16, 64), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(20, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(20, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len); +UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {9, UPB_SIZE(24, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_clear(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_clear(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { _upb_msg_map_clear(msg, UPB_SIZE(48, 88)); } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_set(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(48, 88), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_delete(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(48, 88), &key, 0); + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_nextmutable(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* iter) { - return (envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(48, 88), iter); + const upb_MiniTableField field = {10, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_map_next(map, iter); } UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_host_rewrite_literal(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 11); + const upb_MiniTableField field = {11, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_cluster_header(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), upb_StringView) = value; + const upb_MiniTableField field = {12, UPB_SIZE(52, 96), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.WeightedCluster.ClusterWeight.TypedPerFilterConfigEntry */ @@ -1542,14 +2246,15 @@ UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_Ty _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* msg) { struct google_protobuf_Any* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) { _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*)); @@ -1558,12 +2263,12 @@ UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilt /* envoy.config.route.v3.ClusterSpecifierPlugin */ UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_ClusterSpecifierPlugin_new(upb_Arena* arena) { - return (envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena); + return (envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, arena); } UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_ClusterSpecifierPlugin_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_ClusterSpecifierPlugin* ret = envoy_config_route_v3_ClusterSpecifierPlugin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1573,7 +2278,7 @@ UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_C int options, upb_Arena* arena) { envoy_config_route_v3_ClusterSpecifierPlugin* ret = envoy_config_route_v3_ClusterSpecifierPlugin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1581,57 +2286,68 @@ UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_C } UPB_INLINE char* envoy_config_route_v3_ClusterSpecifierPlugin_serialize(const envoy_config_route_v3_ClusterSpecifierPlugin* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_clear_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_clear_extension(envoy_config_route_v3_ClusterSpecifierPlugin* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_ClusterSpecifierPlugin_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_clear_is_optional(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_ClusterSpecifierPlugin_has_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_clear_is_optional(envoy_config_route_v3_ClusterSpecifierPlugin* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_ClusterSpecifierPlugin_is_optional(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(envoy_config_route_v3_ClusterSpecifierPlugin *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_ClusterSpecifierPlugin_mutable_extension(envoy_config_route_v3_ClusterSpecifierPlugin* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_ClusterSpecifierPlugin_extension(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_set_is_optional(envoy_config_route_v3_ClusterSpecifierPlugin *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteMatch */ UPB_INLINE envoy_config_route_v3_RouteMatch* envoy_config_route_v3_RouteMatch_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteMatch*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_msginit, arena); + return (envoy_config_route_v3_RouteMatch*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteMatch* envoy_config_route_v3_RouteMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteMatch* ret = envoy_config_route_v3_RouteMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1641,7 +2357,7 @@ UPB_INLINE envoy_config_route_v3_RouteMatch* envoy_config_route_v3_RouteMatch_pa int options, upb_Arena* arena) { envoy_config_route_v3_RouteMatch* ret = envoy_config_route_v3_RouteMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1649,13 +2365,13 @@ UPB_INLINE envoy_config_route_v3_RouteMatch* envoy_config_route_v3_RouteMatch_pa } UPB_INLINE char* envoy_config_route_v3_RouteMatch_serialize(const envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1668,256 +2384,391 @@ typedef enum { envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET = 0 } envoy_config_route_v3_RouteMatch_path_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RouteMatch_path_specifier_oneofcases envoy_config_route_v3_RouteMatch_path_specifier_case(const envoy_config_route_v3_RouteMatch* msg) { - return (envoy_config_route_v3_RouteMatch_path_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteMatch_path_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_prefix(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_prefix(const envoy_config_route_v3_RouteMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_prefix(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteMatch_prefix(const envoy_config_route_v3_RouteMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_prefix(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path(const envoy_config_route_v3_RouteMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteMatch_path(const envoy_config_route_v3_RouteMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_case_sensitive(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_case_sensitive(const envoy_config_route_v3_RouteMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_case_sensitive(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_case_sensitive(const envoy_config_route_v3_RouteMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_case_sensitive(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_headers(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RouteMatch_headers(const envoy_config_route_v3_RouteMatch* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_headers(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); + size_t size; + envoy_config_route_v3_RouteMatch_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_headers(const envoy_config_route_v3_RouteMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_query_parameters(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RouteMatch_headers(const envoy_config_route_v3_RouteMatch* msg, size_t* len) { - return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE const envoy_config_route_v3_QueryParameterMatcher* const* envoy_config_route_v3_RouteMatch_query_parameters(const envoy_config_route_v3_RouteMatch* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_QueryParameterMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_query_parameters(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); + size_t size; + envoy_config_route_v3_RouteMatch_query_parameters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_query_parameters(const envoy_config_route_v3_RouteMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 40)); -} -UPB_INLINE const envoy_config_route_v3_QueryParameterMatcher* const* envoy_config_route_v3_RouteMatch_query_parameters(const envoy_config_route_v3_RouteMatch* msg, size_t* len) { - return (const envoy_config_route_v3_QueryParameterMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); -} -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_grpc(const envoy_config_route_v3_RouteMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_grpc(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_grpc(const envoy_config_route_v3_RouteMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*); + const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* default_val = NULL; + const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* ret; + const upb_MiniTableField field = {8, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_runtime_fraction(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_runtime_fraction(const envoy_config_route_v3_RouteMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_runtime_fraction(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_runtime_fraction(const envoy_config_route_v3_RouteMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_config_core_v3_RuntimeFractionalPercent*); + const struct envoy_config_core_v3_RuntimeFractionalPercent* default_val = NULL; + const struct envoy_config_core_v3_RuntimeFractionalPercent* ret; + const upb_MiniTableField field = {9, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_safe_regex(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10; +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_runtime_fraction(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_safe_regex(const envoy_config_route_v3_RouteMatch* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_safe_regex(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_safe_regex(const envoy_config_route_v3_RouteMatch* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 10, NULL); + const struct envoy_type_matcher_v3_RegexMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatcher* ret; + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_safe_regex(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_tls_context(const envoy_config_route_v3_RouteMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_tls_context(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 64), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_tls_context(const envoy_config_route_v3_RouteMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*); + const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* default_val = NULL; + const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* ret; + const upb_MiniTableField field = {11, UPB_SIZE(24, 64), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_connect_matcher(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12; +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 64), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_connect_matcher(const envoy_config_route_v3_RouteMatch* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_connect_matcher(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_connect_matcher(const envoy_config_route_v3_RouteMatch* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 12, NULL); + const envoy_config_route_v3_RouteMatch_ConnectMatcher* default_val = NULL; + const envoy_config_route_v3_RouteMatch_ConnectMatcher* ret; + const upb_MiniTableField field = {12, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_connect_matcher(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(28, 72), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* const* envoy_config_route_v3_RouteMatch_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(28, 72), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_matcher_v3_MetadataMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); + size_t size; + envoy_config_route_v3_RouteMatch_dynamic_metadata(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 72)); -} -UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* const* envoy_config_route_v3_RouteMatch_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg, size_t* len) { - return (const struct envoy_type_matcher_v3_MetadataMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); -} -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path_separated_prefix(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 14; -} -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path_separated_prefix(const envoy_config_route_v3_RouteMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path_separated_prefix(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteMatch_path_separated_prefix(const envoy_config_route_v3_RouteMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 14, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {14, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path_match_policy(const envoy_config_route_v3_RouteMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 15; +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path_separated_prefix(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path_match_policy(const envoy_config_route_v3_RouteMatch* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path_match_policy(envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RouteMatch_path_match_policy(const envoy_config_route_v3_RouteMatch* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 15, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {15, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path_match_policy(const envoy_config_route_v3_RouteMatch* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_prefix(envoy_config_route_v3_RouteMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path(envoy_config_route_v3_RouteMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_case_sensitive(envoy_config_route_v3_RouteMatch *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_mutable_case_sensitive(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_case_sensitive(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_case_sensitive(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_case_sensitive(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_mutable_headers(envoy_config_route_v3_RouteMatch* msg, size_t* len) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_mutable_headers(envoy_config_route_v3_RouteMatch* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_resize_headers(envoy_config_route_v3_RouteMatch* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_resize_headers(envoy_config_route_v3_RouteMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RouteMatch_add_headers(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_mutable_query_parameters(envoy_config_route_v3_RouteMatch* msg, size_t* len) { - return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); +UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_mutable_query_parameters(envoy_config_route_v3_RouteMatch* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_resize_query_parameters(envoy_config_route_v3_RouteMatch* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_QueryParameterMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_resize_query_parameters(envoy_config_route_v3_RouteMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_QueryParameterMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_RouteMatch_add_query_parameters(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { - struct envoy_config_route_v3_QueryParameterMatcher* sub = (struct envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_QueryParameterMatcher* sub = (struct envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_grpc(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_mutable_grpc(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)envoy_config_route_v3_RouteMatch_grpc(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_grpc(msg, sub); + sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_grpc(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_runtime_fraction(envoy_config_route_v3_RouteMatch *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_mutable_runtime_fraction(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_RouteMatch_runtime_fraction(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_runtime_fraction(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_runtime_fraction(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_safe_regex(envoy_config_route_v3_RouteMatch *msg, struct envoy_type_matcher_v3_RegexMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 10); + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_mutable_safe_regex(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_RouteMatch_safe_regex(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_safe_regex(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_safe_regex(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_tls_context(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(24, 64), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_mutable_tls_context(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)envoy_config_route_v3_RouteMatch_tls_context(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_tls_context(msg, sub); + sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_tls_context(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_connect_matcher(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_ConnectMatcher* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 12); + const upb_MiniTableField field = {12, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_mutable_connect_matcher(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteMatch_ConnectMatcher* sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)envoy_config_route_v3_RouteMatch_connect_matcher(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_connect_matcher(msg, sub); + sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_connect_matcher(msg, sub); } return sub; } -UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_mutable_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, size_t* len) { - return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len); +UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_mutable_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(28, 72), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_resize_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_resize_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(28, 72), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_matcher_v3_MetadataMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_route_v3_RouteMatch_add_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(28, 72), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path_separated_prefix(envoy_config_route_v3_RouteMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 14); + const upb_MiniTableField field = {14, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path_match_policy(envoy_config_route_v3_RouteMatch *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 15); + const upb_MiniTableField field = {15, UPB_SIZE(36, 8), UPB_SIZE(-33, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RouteMatch_mutable_path_match_policy(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_RouteMatch_path_match_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_set_path_match_policy(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_set_path_match_policy(msg, sub); } return sub; } @@ -1925,12 +2776,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_ /* envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions */ UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena); + return (envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1940,7 +2791,7 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_ int options, upb_Arena* arena) { envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1948,13 +2799,13 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_ } UPB_INLINE char* envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msg_init, options, arena, &ptr, len); return ptr; } @@ -1962,12 +2813,12 @@ UPB_INLINE char* envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_serializ /* envoy.config.route.v3.RouteMatch.TlsContextMatchOptions */ UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena); + return (envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1977,7 +2828,7 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config int options, upb_Arena* arena) { envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1985,57 +2836,67 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config } UPB_INLINE char* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_clear_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_clear_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_clear_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_clear_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_mutable_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_presented(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_mutable_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_validated(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(msg, sub); } return sub; } @@ -2043,12 +2904,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_Tl /* envoy.config.route.v3.RouteMatch.ConnectMatcher */ UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_ConnectMatcher_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena); + return (envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_ConnectMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteMatch_ConnectMatcher* ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2058,7 +2919,7 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v int options, upb_Arena* arena) { envoy_config_route_v3_RouteMatch_ConnectMatcher* ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2066,13 +2927,13 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v } UPB_INLINE char* envoy_config_route_v3_RouteMatch_ConnectMatcher_serialize(const envoy_config_route_v3_RouteMatch_ConnectMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msg_init, options, arena, &ptr, len); return ptr; } @@ -2080,12 +2941,12 @@ UPB_INLINE char* envoy_config_route_v3_RouteMatch_ConnectMatcher_serialize_ex(co /* envoy.config.route.v3.CorsPolicy */ UPB_INLINE envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_CorsPolicy_new(upb_Arena* arena) { - return (envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msginit, arena); + return (envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msg_init, arena); } UPB_INLINE envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_CorsPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_CorsPolicy* ret = envoy_config_route_v3_CorsPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2095,7 +2956,7 @@ UPB_INLINE envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_CorsPolicy_pa int options, upb_Arena* arena) { envoy_config_route_v3_CorsPolicy* ret = envoy_config_route_v3_CorsPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2103,13 +2964,13 @@ UPB_INLINE envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_CorsPolicy_pa } UPB_INLINE char* envoy_config_route_v3_CorsPolicy_serialize(const envoy_config_route_v3_CorsPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2117,150 +2978,221 @@ typedef enum { envoy_config_route_v3_CorsPolicy_enabled_specifier_NOT_SET = 0 } envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases envoy_config_route_v3_CorsPolicy_enabled_specifier_case(const envoy_config_route_v3_CorsPolicy* msg) { - return (envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_methods(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_methods(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_allow_methods(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_headers(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_headers(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(36, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_allow_headers(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(36, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_expose_headers(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_expose_headers(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(44, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_expose_headers(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(44, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_max_age(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_max_age(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(52, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_max_age(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(52, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_credentials(const envoy_config_route_v3_CorsPolicy* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_credentials(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_credentials(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_allow_credentials(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_filter_enabled(const envoy_config_route_v3_CorsPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 9; +UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_credentials(const envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_filter_enabled(const envoy_config_route_v3_CorsPolicy* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(56, 104), 0, UPB_SIZE(4, 4), envoy_config_route_v3_CorsPolicy_enabled_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_filter_enabled(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_filter_enabled(const envoy_config_route_v3_CorsPolicy* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(56, 104), UPB_SIZE(4, 4), 9, NULL); + const struct envoy_config_core_v3_RuntimeFractionalPercent* default_val = NULL; + const struct envoy_config_core_v3_RuntimeFractionalPercent* ret; + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_shadow_enabled(const envoy_config_route_v3_CorsPolicy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_filter_enabled(const envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_shadow_enabled(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_shadow_enabled(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(12, 80), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_shadow_enabled(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const struct envoy_config_core_v3_RuntimeFractionalPercent*); + const struct envoy_config_core_v3_RuntimeFractionalPercent* default_val = NULL; + const struct envoy_config_core_v3_RuntimeFractionalPercent* ret; + const upb_MiniTableField field = {10, UPB_SIZE(12, 80), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_shadow_enabled(const envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(12, 80), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_origin_string_match(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_config_route_v3_CorsPolicy_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); + size_t size; + envoy_config_route_v3_CorsPolicy_allow_origin_string_match(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 88)); -} -UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_config_route_v3_CorsPolicy_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy* msg, size_t* len) { - return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); -} -UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_private_network_access(const envoy_config_route_v3_CorsPolicy* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_private_network_access(const envoy_config_route_v3_CorsPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_private_network_access(envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(20, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_allow_private_network_access(const envoy_config_route_v3_CorsPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {12, UPB_SIZE(20, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_private_network_access(const envoy_config_route_v3_CorsPolicy* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(20, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_methods(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_headers(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(36, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_expose_headers(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(44, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_max_age(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(52, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(4, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_mutable_allow_credentials(envoy_config_route_v3_CorsPolicy* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_CorsPolicy_allow_credentials(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_CorsPolicy_set_allow_credentials(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_CorsPolicy_set_allow_credentials(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_filter_enabled(envoy_config_route_v3_CorsPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(56, 104), value, UPB_SIZE(4, 4), 9); + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_mutable_filter_enabled(envoy_config_route_v3_CorsPolicy* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_CorsPolicy_filter_enabled(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_CorsPolicy_set_filter_enabled(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_CorsPolicy_set_filter_enabled(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_shadow_enabled(envoy_config_route_v3_CorsPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value; + const upb_MiniTableField field = {10, UPB_SIZE(12, 80), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_mutable_shadow_enabled(envoy_config_route_v3_CorsPolicy* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_CorsPolicy_shadow_enabled(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_CorsPolicy_set_shadow_enabled(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_CorsPolicy_set_shadow_enabled(msg, sub); } return sub; } -UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_mutable_allow_origin_string_match(envoy_config_route_v3_CorsPolicy* msg, size_t* len) { - return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_mutable_allow_origin_string_match(envoy_config_route_v3_CorsPolicy* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_resize_allow_origin_string_match(envoy_config_route_v3_CorsPolicy* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_matcher_v3_StringMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_resize_allow_origin_string_match(envoy_config_route_v3_CorsPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_matcher_v3_StringMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_CorsPolicy_add_allow_origin_string_match(envoy_config_route_v3_CorsPolicy* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {11, UPB_SIZE(16, 88), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_private_network_access(envoy_config_route_v3_CorsPolicy *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {12, UPB_SIZE(20, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_mutable_allow_private_network_access(envoy_config_route_v3_CorsPolicy* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_CorsPolicy_allow_private_network_access(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_CorsPolicy_set_allow_private_network_access(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_CorsPolicy_set_allow_private_network_access(msg, sub); } return sub; } @@ -2268,12 +3200,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_mu /* envoy.config.route.v3.RouteAction */ UPB_INLINE envoy_config_route_v3_RouteAction* envoy_config_route_v3_RouteAction_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction*)_upb_Message_New(&envoy_config_route_v3_RouteAction_msginit, arena); + return (envoy_config_route_v3_RouteAction*)_upb_Message_New(&envoy_config_route_v3_RouteAction_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction* envoy_config_route_v3_RouteAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction* ret = envoy_config_route_v3_RouteAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2283,7 +3215,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction* envoy_config_route_v3_RouteAction_ int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction* ret = envoy_config_route_v3_RouteAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2291,13 +3223,13 @@ UPB_INLINE envoy_config_route_v3_RouteAction* envoy_config_route_v3_RouteAction_ } UPB_INLINE char* envoy_config_route_v3_RouteAction_serialize(const envoy_config_route_v3_RouteAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2309,7 +3241,8 @@ typedef enum { envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET = 0 } envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases envoy_config_route_v3_RouteAction_cluster_specifier_case(const envoy_config_route_v3_RouteAction* msg) { - return (envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } typedef enum { envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_literal = 6, @@ -2319,631 +3252,901 @@ typedef enum { envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET = 0 } envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases envoy_config_route_v3_RouteAction_host_rewrite_specifier_case(const envoy_config_route_v3_RouteAction* msg) { - return (envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + const upb_MiniTableField field = {6, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 1; -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(24, 24), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_cluster(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), UPB_SIZE(24, 24), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_header(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 2; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_header(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(24, 24), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_header(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_cluster_header(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), UPB_SIZE(24, 24), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_weighted_clusters(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 3; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_header(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_weighted_clusters(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_WeightedCluster*, UPB_SIZE(36, 48), 0, UPB_SIZE(24, 24), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_weighted_clusters(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_RouteAction_weighted_clusters(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_WeightedCluster*, UPB_SIZE(36, 48), UPB_SIZE(24, 24), 3, NULL); + const envoy_config_route_v3_WeightedCluster* default_val = NULL; + const envoy_config_route_v3_WeightedCluster* ret; + const upb_MiniTableField field = {3, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_metadata_match(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_weighted_clusters(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_metadata_match(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_metadata_match(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_RouteAction_metadata_match(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_prefix_rewrite(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_metadata_match(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_prefix_rewrite(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(124, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_prefix_rewrite(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(124, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_literal(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 6; -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_literal(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_literal(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_host_rewrite_literal(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), UPB_SIZE(16, 16), 6, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_auto_host_rewrite(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 7; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_literal(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_auto_host_rewrite(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_BoolValue*, UPB_SIZE(28, 32), 0, UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_auto_host_rewrite(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_auto_host_rewrite(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_BoolValue*, UPB_SIZE(28, 32), UPB_SIZE(16, 16), 7, NULL); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {7, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_timeout(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_auto_host_rewrite(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_timeout(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_timeout(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(8, 88), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_timeout(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {8, UPB_SIZE(8, 88), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_timeout(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(8, 88), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_retry_policy(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_retry_policy(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(12, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RouteAction_retry_policy(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const envoy_config_route_v3_RetryPolicy*); + const envoy_config_route_v3_RetryPolicy* default_val = NULL; + const envoy_config_route_v3_RetryPolicy* ret; + const upb_MiniTableField field = {9, UPB_SIZE(12, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_priority(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(12, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_priority(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_RouteAction_priority(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {11, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_rate_limits(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(20, 104), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_RouteAction_rate_limits(const envoy_config_route_v3_RouteAction* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(20, 104), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RateLimit* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteAction_has_rate_limits(const envoy_config_route_v3_RouteAction* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 104)); + size_t size; + envoy_config_route_v3_RouteAction_rate_limits(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_rate_limits(const envoy_config_route_v3_RouteAction* msg) { - _upb_array_detach(msg, UPB_SIZE(64, 104)); -} -UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_RouteAction_rate_limits(const envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (const envoy_config_route_v3_RateLimit* const*)_upb_array_accessor(msg, UPB_SIZE(64, 104), len); -} -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_include_vh_rate_limits(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_include_vh_rate_limits(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_include_vh_rate_limits(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(24, 112), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_include_vh_rate_limits(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {14, UPB_SIZE(24, 112), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_include_vh_rate_limits(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(24, 112), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_hash_policy(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(28, 120), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy* const* envoy_config_route_v3_RouteAction_hash_policy(const envoy_config_route_v3_RouteAction* msg, size_t* size) { + const upb_MiniTableField field = {15, UPB_SIZE(28, 120), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RouteAction_HashPolicy* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hash_policy(const envoy_config_route_v3_RouteAction* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 120)); + size_t size; + envoy_config_route_v3_RouteAction_hash_policy(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_hash_policy(const envoy_config_route_v3_RouteAction* msg) { - _upb_array_detach(msg, UPB_SIZE(72, 120)); -} -UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy* const* envoy_config_route_v3_RouteAction_hash_policy(const envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (const envoy_config_route_v3_RouteAction_HashPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(72, 120), len); -} -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cors(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cors(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cors(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(32, 128), 5, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_RouteAction_cors(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const envoy_config_route_v3_CorsPolicy*); + const envoy_config_route_v3_CorsPolicy* default_val = NULL; + const envoy_config_route_v3_CorsPolicy* ret; + const upb_MiniTableField field = {17, UPB_SIZE(32, 128), 5, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_not_found_response_code(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cors(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(32, 128), 5, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_not_found_response_code(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_RouteAction_cluster_not_found_response_code(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {20, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_grpc_timeout(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 6); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_grpc_timeout(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_grpc_timeout(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(40, 136), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_max_grpc_timeout(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {23, UPB_SIZE(40, 136), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_idle_timeout(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_grpc_timeout(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(40, 136), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_idle_timeout(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_idle_timeout(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(44, 144), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_idle_timeout(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {24, UPB_SIZE(44, 144), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_idle_timeout(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(44, 144), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_upgrade_configs(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(48, 152), 0, 11, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig* const* envoy_config_route_v3_RouteAction_upgrade_configs(const envoy_config_route_v3_RouteAction* msg, size_t* size) { + const upb_MiniTableField field = {25, UPB_SIZE(48, 152), 0, 11, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RouteAction_UpgradeConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteAction_has_upgrade_configs(const envoy_config_route_v3_RouteAction* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 152)); + size_t size; + envoy_config_route_v3_RouteAction_upgrade_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_upgrade_configs(const envoy_config_route_v3_RouteAction* msg) { - _upb_array_detach(msg, UPB_SIZE(88, 152)); -} -UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig* const* envoy_config_route_v3_RouteAction_upgrade_configs(const envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (const envoy_config_route_v3_RouteAction_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(88, 152), len); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_internal_redirect_action(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_internal_redirect_action(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(52, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_RouteAction_internal_redirect_action(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {26, UPB_SIZE(52, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hedge_policy(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 8); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_hedge_policy(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(92, 160), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_hedge_policy(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(56, 160), 8, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_RouteAction_hedge_policy(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), const envoy_config_route_v3_HedgePolicy*); + const envoy_config_route_v3_HedgePolicy* default_val = NULL; + const envoy_config_route_v3_HedgePolicy* ret; + const upb_MiniTableField field = {27, UPB_SIZE(56, 160), 8, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_grpc_timeout_offset(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hedge_policy(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {27, UPB_SIZE(56, 160), 8, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_grpc_timeout_offset(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_grpc_timeout_offset(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(60, 168), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_grpc_timeout_offset(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {28, UPB_SIZE(60, 168), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_header(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 29; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_grpc_timeout_offset(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(60, 168), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_header(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_header(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_host_rewrite_header(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), UPB_SIZE(16, 16), 29, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {29, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_header(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_request_mirror_policies(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(64, 176), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteAction_request_mirror_policies(const envoy_config_route_v3_RouteAction* msg, size_t* size) { + const upb_MiniTableField field = {30, UPB_SIZE(64, 176), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RouteAction_has_request_mirror_policies(const envoy_config_route_v3_RouteAction* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 176)); + size_t size; + envoy_config_route_v3_RouteAction_request_mirror_policies(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_request_mirror_policies(const envoy_config_route_v3_RouteAction* msg) { - _upb_array_detach(msg, UPB_SIZE(100, 176)); -} -UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteAction_request_mirror_policies(const envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(100, 176), len); -} -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_internal_redirects(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 10); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_internal_redirects(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_internal_redirects(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(68, 184), 10, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction_max_internal_redirects(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {31, UPB_SIZE(68, 184), 10, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_regex_rewrite(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_internal_redirects(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(68, 184), 10, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_regex_rewrite(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 192), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_regex_rewrite(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(72, 192), 11, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_regex_rewrite(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(108, 192), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*); + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* ret; + const upb_MiniTableField field = {32, UPB_SIZE(72, 192), 11, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy_typed_config(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 12); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_regex_rewrite(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(72, 192), 11, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_retry_policy_typed_config(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(112, 200), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_retry_policy_typed_config(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(76, 200), 12, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RouteAction_retry_policy_typed_config(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(112, 200), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {33, UPB_SIZE(76, 200), 12, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_internal_redirect_policy(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy_typed_config(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(76, 200), 12, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_internal_redirect_policy(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_internal_redirect_policy(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(80, 208), 13, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_RouteAction_internal_redirect_policy(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const envoy_config_route_v3_InternalRedirectPolicy*); + const envoy_config_route_v3_InternalRedirectPolicy* default_val = NULL; + const envoy_config_route_v3_InternalRedirectPolicy* ret; + const upb_MiniTableField field = {34, UPB_SIZE(80, 208), 13, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 35; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_internal_redirect_policy(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(80, 208), 13, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 32), 0, UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_path_regex(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 32), UPB_SIZE(16, 16), 35, NULL); + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* ret; + const upb_MiniTableField field = {35, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_stream_duration(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_stream_duration(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(88, 216), 14, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_max_stream_duration(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const envoy_config_route_v3_RouteAction_MaxStreamDuration*); + const envoy_config_route_v3_RouteAction_MaxStreamDuration* default_val = NULL; + const envoy_config_route_v3_RouteAction_MaxStreamDuration* ret; + const upb_MiniTableField field = {36, UPB_SIZE(88, 216), 14, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 37; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(88, 216), 14, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(24, 24), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_specifier_plugin(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), UPB_SIZE(24, 24), 37, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {37, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_append_x_forwarded_host(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_append_x_forwarded_host(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {38, UPB_SIZE(92, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteAction_append_x_forwarded_host(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {38, UPB_SIZE(92, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_inline_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 39; -} -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_inline_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_ClusterSpecifierPlugin*, UPB_SIZE(36, 48), 0, UPB_SIZE(24, 24), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_inline_cluster_specifier_plugin(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_RouteAction_inline_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_ClusterSpecifierPlugin*, UPB_SIZE(36, 48), UPB_SIZE(24, 24), 39, NULL); + const envoy_config_route_v3_ClusterSpecifierPlugin* default_val = NULL; + const envoy_config_route_v3_ClusterSpecifierPlugin* ret; + const upb_MiniTableField field = {39, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_early_data_policy(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 15); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_inline_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_early_data_policy(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(124, 224), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_early_data_policy(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(100, 224), 15, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RouteAction_early_data_policy(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(124, 224), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {40, UPB_SIZE(100, 224), 15, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_has_path_rewrite_policy(const envoy_config_route_v3_RouteAction* msg) { - return _upb_hasbit(msg, 16); +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_early_data_policy(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(100, 224), 15, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_clear_path_rewrite_policy(const envoy_config_route_v3_RouteAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(128, 232), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_clear_path_rewrite_policy(envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(104, 232), 16, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RouteAction_path_rewrite_policy(const envoy_config_route_v3_RouteAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(128, 232), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {41, UPB_SIZE(104, 232), 16, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_has_path_rewrite_policy(const envoy_config_route_v3_RouteAction* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(104, 232), 16, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster(envoy_config_route_v3_RouteAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), value, UPB_SIZE(24, 24), 1); + const upb_MiniTableField field = {1, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_header(envoy_config_route_v3_RouteAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), value, UPB_SIZE(24, 24), 2); + const upb_MiniTableField field = {2, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_weighted_clusters(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_WeightedCluster* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_WeightedCluster*, UPB_SIZE(36, 48), value, UPB_SIZE(24, 24), 3); + const upb_MiniTableField field = {3, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_RouteAction_mutable_weighted_clusters(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_WeightedCluster* sub = (struct envoy_config_route_v3_WeightedCluster*)envoy_config_route_v3_RouteAction_weighted_clusters(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_WeightedCluster*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_weighted_clusters(msg, sub); + sub = (struct envoy_config_route_v3_WeightedCluster*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_weighted_clusters(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_metadata_match(envoy_config_route_v3_RouteAction *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(44, 64), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_RouteAction_mutable_metadata_match(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_RouteAction_metadata_match(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_metadata_match(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_metadata_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_prefix_rewrite(envoy_config_route_v3_RouteAction *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(124, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_literal(envoy_config_route_v3_RouteAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 6); + const upb_MiniTableField field = {6, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_auto_host_rewrite(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_BoolValue* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_BoolValue*, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 7); + const upb_MiniTableField field = {7, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_mutable_auto_host_rewrite(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_auto_host_rewrite(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_auto_host_rewrite(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_auto_host_rewrite(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(56, 88), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(8, 88), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_timeout(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RetryPolicy* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), envoy_config_route_v3_RetryPolicy*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(12, 96), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RouteAction_mutable_retry_policy(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_RetryPolicy* sub = (struct envoy_config_route_v3_RetryPolicy*)envoy_config_route_v3_RouteAction_retry_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_retry_policy(msg, sub); + sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_retry_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_priority(envoy_config_route_v3_RouteAction *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {11, UPB_SIZE(16, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_mutable_rate_limits(envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (envoy_config_route_v3_RateLimit**)_upb_array_mutable_accessor(msg, UPB_SIZE(64, 104), len); +UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_mutable_rate_limits(envoy_config_route_v3_RouteAction* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(20, 104), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RateLimit**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_resize_rate_limits(envoy_config_route_v3_RouteAction* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(64, 104), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_resize_rate_limits(envoy_config_route_v3_RouteAction* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(20, 104), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RateLimit**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RateLimit* envoy_config_route_v3_RouteAction_add_rate_limits(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_Message_New(&envoy_config_route_v3_RateLimit_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(64, 104), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(20, 104), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_Message_New(&envoy_config_route_v3_RateLimit_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(24, 112), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_mutable_include_vh_rate_limits(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_include_vh_rate_limits(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_mutable_hash_policy(envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(72, 120), len); +UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_mutable_hash_policy(envoy_config_route_v3_RouteAction* msg, size_t* size) { + upb_MiniTableField field = {15, UPB_SIZE(28, 120), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_resize_hash_policy(envoy_config_route_v3_RouteAction* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(72, 120), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_resize_hash_policy(envoy_config_route_v3_RouteAction* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {15, UPB_SIZE(28, 120), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_HashPolicy**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_RouteAction_add_hash_policy(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RouteAction_HashPolicy* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(72, 120), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {15, UPB_SIZE(28, 120), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RouteAction_HashPolicy* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_cors(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_CorsPolicy* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(76, 128), envoy_config_route_v3_CorsPolicy*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(32, 128), 5, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_RouteAction_mutable_cors(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_CorsPolicy* sub = (struct envoy_config_route_v3_CorsPolicy*)envoy_config_route_v3_RouteAction_cors(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_cors(msg, sub); + sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_cors(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_not_found_response_code(envoy_config_route_v3_RouteAction *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {20, UPB_SIZE(36, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_grpc_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(80, 136), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {23, UPB_SIZE(40, 136), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_max_grpc_timeout(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_max_grpc_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_max_grpc_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_max_grpc_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_idle_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(84, 144), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {24, UPB_SIZE(44, 144), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_idle_timeout(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_idle_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_idle_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_idle_timeout(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_mutable_upgrade_configs(envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 152), len); +UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_mutable_upgrade_configs(envoy_config_route_v3_RouteAction* msg, size_t* size) { + upb_MiniTableField field = {25, UPB_SIZE(48, 152), 0, 11, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_resize_upgrade_configs(envoy_config_route_v3_RouteAction* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(88, 152), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_resize_upgrade_configs(envoy_config_route_v3_RouteAction* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {25, UPB_SIZE(48, 152), 0, 11, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_UpgradeConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v3_RouteAction_add_upgrade_configs(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RouteAction_UpgradeConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(88, 152), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {25, UPB_SIZE(48, 152), 0, 11, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RouteAction_UpgradeConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_action(envoy_config_route_v3_RouteAction *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {26, UPB_SIZE(52, 12), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_hedge_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_HedgePolicy* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(92, 160), envoy_config_route_v3_HedgePolicy*) = value; + const upb_MiniTableField field = {27, UPB_SIZE(56, 160), 8, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_RouteAction_mutable_hedge_policy(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_HedgePolicy* sub = (struct envoy_config_route_v3_HedgePolicy*)envoy_config_route_v3_RouteAction_hedge_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_hedge_policy(msg, sub); + sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_hedge_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(96, 168), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {28, UPB_SIZE(60, 168), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_grpc_timeout_offset(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_grpc_timeout_offset(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_header(envoy_config_route_v3_RouteAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 29); + const upb_MiniTableField field = {29, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_mutable_request_mirror_policies(envoy_config_route_v3_RouteAction* msg, size_t* len) { - return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 176), len); +UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_mutable_request_mirror_policies(envoy_config_route_v3_RouteAction* msg, size_t* size) { + upb_MiniTableField field = {30, UPB_SIZE(64, 176), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_resize_request_mirror_policies(envoy_config_route_v3_RouteAction* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(100, 176), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_resize_request_mirror_policies(envoy_config_route_v3_RouteAction* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {30, UPB_SIZE(64, 176), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteAction_add_request_mirror_policies(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(100, 176), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {30, UPB_SIZE(64, 176), 0, 14, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_internal_redirects(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(104, 184), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {31, UPB_SIZE(68, 184), 10, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction_mutable_max_internal_redirects(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RouteAction_max_internal_redirects(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_max_internal_redirects(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_max_internal_redirects(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_regex_rewrite(envoy_config_route_v3_RouteAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(108, 192), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value; + const upb_MiniTableField field = {32, UPB_SIZE(72, 192), 11, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_mutable_regex_rewrite(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_regex_rewrite(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_regex_rewrite(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_regex_rewrite(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(112, 200), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {33, UPB_SIZE(76, 200), 12, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RouteAction_mutable_retry_policy_typed_config(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RouteAction_retry_policy_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_InternalRedirectPolicy* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(116, 208), envoy_config_route_v3_InternalRedirectPolicy*) = value; + const upb_MiniTableField field = {34, UPB_SIZE(80, 208), 13, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_RouteAction_mutable_internal_redirect_policy(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_InternalRedirectPolicy* sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)envoy_config_route_v3_RouteAction_internal_redirect_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)_upb_Message_New(&envoy_config_route_v3_InternalRedirectPolicy_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_internal_redirect_policy(msg, sub); + sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)_upb_Message_New(&envoy_config_route_v3_InternalRedirectPolicy_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_internal_redirect_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(envoy_config_route_v3_RouteAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 35); + const upb_MiniTableField field = {35, UPB_SIZE(108, 32), UPB_SIZE(-85, -17), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_mutable_host_rewrite_path_regex(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_host_rewrite_path_regex(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_stream_duration(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RouteAction_MaxStreamDuration* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(120, 216), envoy_config_route_v3_RouteAction_MaxStreamDuration*) = value; + const upb_MiniTableField field = {36, UPB_SIZE(88, 216), 14, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_mutable_max_stream_duration(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_MaxStreamDuration* sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)envoy_config_route_v3_RouteAction_max_stream_duration(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_Message_New(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_max_stream_duration(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_Message_New(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_max_stream_duration(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_specifier_plugin(envoy_config_route_v3_RouteAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), value, UPB_SIZE(24, 24), 37); + const upb_MiniTableField field = {37, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_append_x_forwarded_host(envoy_config_route_v3_RouteAction *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; + const upb_MiniTableField field = {38, UPB_SIZE(92, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_set_inline_cluster_specifier_plugin(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_ClusterSpecifierPlugin* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_ClusterSpecifierPlugin*, UPB_SIZE(36, 48), value, UPB_SIZE(24, 24), 39); + const upb_MiniTableField field = {39, UPB_SIZE(116, 48), UPB_SIZE(-97, -25), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_RouteAction_mutable_inline_cluster_specifier_plugin(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_route_v3_ClusterSpecifierPlugin* sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)envoy_config_route_v3_RouteAction_inline_cluster_specifier_plugin(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_inline_cluster_specifier_plugin(msg, sub); + sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_inline_cluster_specifier_plugin(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_early_data_policy(envoy_config_route_v3_RouteAction *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(124, 224), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {40, UPB_SIZE(100, 224), 15, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RouteAction_mutable_early_data_policy(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_RouteAction_early_data_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_early_data_policy(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_early_data_policy(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_set_path_rewrite_policy(envoy_config_route_v3_RouteAction *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(128, 232), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {41, UPB_SIZE(104, 232), 16, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RouteAction_mutable_path_rewrite_policy(envoy_config_route_v3_RouteAction* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_RouteAction_path_rewrite_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_set_path_rewrite_policy(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_set_path_rewrite_policy(msg, sub); } return sub; } @@ -2951,12 +4154,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_ /* envoy.config.route.v3.RouteAction.RequestMirrorPolicy */ UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena); + return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_RequestMirrorPolicy* ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2966,7 +4169,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_r int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_RequestMirrorPolicy* ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2974,88 +4177,110 @@ UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_r } UPB_INLINE char* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_serialize(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_cluster(envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_RequestMirrorPolicy_cluster(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_RuntimeFractionalPercent*); + const struct envoy_config_core_v3_RuntimeFractionalPercent* default_val = NULL; + const struct envoy_config_core_v3_RuntimeFractionalPercent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_cluster_header(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_cluster_header(envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_RequestMirrorPolicy_cluster_header(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_cluster(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_mutable_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_RouteAction_RequestMirrorPolicy_runtime_fraction(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_mutable_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_RequestMirrorPolicy_trace_sampled(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_cluster_header(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteAction.HashPolicy */ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_RouteAction_HashPolicy_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena); + return (envoy_config_route_v3_RouteAction_HashPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_RouteAction_HashPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy* ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3065,7 +4290,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_R int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy* ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3073,13 +4298,13 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_R } UPB_INLINE char* envoy_config_route_v3_RouteAction_HashPolicy_serialize(const envoy_config_route_v3_RouteAction_HashPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -3091,120 +4316,157 @@ typedef enum { envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET = 0 } envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_case(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return (envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_header(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_header(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_header(envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {1, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_header(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, NULL); + const envoy_config_route_v3_RouteAction_HashPolicy_Header* default_val = NULL; + const envoy_config_route_v3_RouteAction_HashPolicy_Header* ret; + const upb_MiniTableField field = {1, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_cookie(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_header(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {1, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_cookie(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_cookie(envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {2, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_cookie(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* default_val = NULL; + const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* ret; + const upb_MiniTableField field = {2, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_cookie(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {2, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {3, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, NULL); + const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* default_val = NULL; + const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* ret; + const upb_MiniTableField field = {3, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_terminal(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {3, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_terminal(envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {4, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_terminal(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; -} -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL); + const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* default_val = NULL; + const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* ret; + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6; +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_filter_state(envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {6, 8, -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 6, NULL); + const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* default_val = NULL; + const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* ret; + const upb_MiniTableField field = {6, 8, -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { + const upb_MiniTableField field = {6, 8, -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_header(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_Header* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_mutable_header(envoy_config_route_v3_RouteAction_HashPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_HashPolicy_Header* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)envoy_config_route_v3_RouteAction_HashPolicy_header(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_set_header(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_set_header(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_mutable_cookie(envoy_config_route_v3_RouteAction_HashPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)envoy_config_route_v3_RouteAction_HashPolicy_cookie(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_mutable_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)envoy_config_route_v3_RouteAction_HashPolicy_connection_properties(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_terminal(envoy_config_route_v3_RouteAction_HashPolicy *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {4, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_mutable_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)envoy_config_route_v3_RouteAction_HashPolicy_query_parameter(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 6); + const upb_MiniTableField field = {6, 8, -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_mutable_filter_state(envoy_config_route_v3_RouteAction_HashPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)envoy_config_route_v3_RouteAction_HashPolicy_filter_state(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(msg, sub); } return sub; } @@ -3212,12 +4474,12 @@ UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envo /* envoy.config.route.v3.RouteAction.HashPolicy.Header */ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_Header_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena); + return (envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_Header_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_Header* ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3227,7 +4489,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_rou int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_Header* ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3235,44 +4497,55 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_rou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_clear_header_name(envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Header_has_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_clear_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_clear_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*); + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Header_has_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_header_name(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_HashPolicy_Header_mutable_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(msg, sub); } return sub; } @@ -3280,12 +4553,12 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_ro /* envoy.config.route.v3.RouteAction.HashPolicy.Cookie */ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena); + return (envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_Cookie* ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3295,7 +4568,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_rou int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_Cookie* ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3303,66 +4576,83 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_rou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_name(envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_Cookie_name(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Cookie_has_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_path(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Cookie_has_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_path(envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_Cookie_path(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_name(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_mutable_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_HashPolicy_Cookie_ttl(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_path(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties */ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena); + return (envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3372,7 +4662,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* en int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3380,35 +4670,41 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* en } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msg_init, 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; +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_clear_source_ip(envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_source_ip(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_set_source_ip(envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter */ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena); + return (envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3418,7 +4714,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_co int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3426,35 +4722,41 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_co } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_clear_name(envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_name(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_set_name(envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteAction.HashPolicy.FilterState */ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena); + return (envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_FilterState* ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3464,7 +4766,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_confi int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_HashPolicy_FilterState* ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3472,35 +4774,41 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_confi } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_FilterState_clear_key(envoy_config_route_v3_RouteAction_HashPolicy_FilterState* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_FilterState_set_key(envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteAction.UpgradeConfig */ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena); + return (envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_UpgradeConfig* ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3510,7 +4818,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_UpgradeConfig* ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3518,66 +4826,82 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v } UPB_INLINE char* envoy_config_route_v3_RouteAction_UpgradeConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_upgrade_type(envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_UpgradeConfig_upgrade_type(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_UpgradeConfig_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*); + const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* default_val = NULL; + const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_upgrade_type(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_UpgradeConfig_mutable_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_UpgradeConfig_enabled(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_mutable_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)envoy_config_route_v3_RouteAction_UpgradeConfig_connect_config(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(msg, sub); + sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(msg, sub); } return sub; } @@ -3585,12 +4909,12 @@ UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* /* envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig */ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena); + return (envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3600,7 +4924,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_ int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3608,57 +4932,68 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_clear_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_clear_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ProxyProtocolConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ProxyProtocolConfig*); + const struct envoy_config_core_v3_ProxyProtocolConfig* default_val = NULL; + const struct envoy_config_core_v3_ProxyProtocolConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_clear_allow_post(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_has_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_clear_allow_post(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_allow_post(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, struct envoy_config_core_v3_ProxyProtocolConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ProxyProtocolConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ProxyProtocolConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_mutable_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_ProxyProtocolConfig* sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_proxy_protocol_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(msg, sub); + sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)_upb_Message_New(&envoy_config_core_v3_ProxyProtocolConfig_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_allow_post(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RouteAction.MaxStreamDuration */ UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_MaxStreamDuration_new(upb_Arena* arena) { - return (envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_Message_New(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena); + return (envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_Message_New(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_MaxStreamDuration_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RouteAction_MaxStreamDuration* ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3668,7 +5003,7 @@ UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_rou int options, upb_Arena* arena) { envoy_config_route_v3_RouteAction_MaxStreamDuration* ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3676,79 +5011,94 @@ UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_rou } UPB_INLINE char* envoy_config_route_v3_RouteAction_MaxStreamDuration_serialize(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_offset(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(msg, sub); } return sub; } @@ -3756,12 +5106,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_Ma /* envoy.config.route.v3.RetryPolicy */ UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_new(upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msginit, arena); + return (envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy* ret = envoy_config_route_v3_RetryPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3771,7 +5121,7 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_ int options, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy* ret = envoy_config_route_v3_RetryPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3779,262 +5129,433 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_ } UPB_INLINE char* envoy_config_route_v3_RetryPolicy_serialize(const envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_on(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(48, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_retry_on(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(48, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_num_retries(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_num_retries(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_num_retries(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy_num_retries(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_timeout(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_num_retries(const envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_per_try_timeout(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_per_try_timeout(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_timeout(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_priority(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_timeout(const envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_priority(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_priority(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_retry_priority(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_RetryPolicy_RetryPriority*); + const envoy_config_route_v3_RetryPolicy_RetryPriority* default_val = NULL; + const envoy_config_route_v3_RetryPolicy_RetryPriority* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_priority(const envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_host_predicate(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const* envoy_config_route_v3_RetryPolicy_retry_host_predicate(const envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_host_predicate(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); + size_t size; + envoy_config_route_v3_RetryPolicy_retry_host_predicate(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_host_predicate(const envoy_config_route_v3_RetryPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); -} -UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const* envoy_config_route_v3_RetryPolicy_retry_host_predicate(const envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_host_selection_retry_max_attempts(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), int64_t) = 0; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_host_selection_retry_max_attempts(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {6, 56, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_config_route_v3_RetryPolicy_host_selection_retry_max_attempts(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {6, 56, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_status_codes(const envoy_config_route_v3_RetryPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_status_codes(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE uint32_t const* envoy_config_route_v3_RetryPolicy_retriable_status_codes(const envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE uint32_t const* envoy_config_route_v3_RetryPolicy_retriable_status_codes(const envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_status_codes(const envoy_config_route_v3_RetryPolicy* msg) { + size_t size; + envoy_config_route_v3_RetryPolicy_retriable_status_codes(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_back_off(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_config_route_v3_RetryPolicy_RetryBackOff*); + const envoy_config_route_v3_RetryPolicy_RetryBackOff* default_val = NULL; + const envoy_config_route_v3_RetryPolicy_RetryBackOff* ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_headers(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_headers(const envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_headers(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); + size_t size; + envoy_config_route_v3_RetryPolicy_retriable_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_headers(const envoy_config_route_v3_RetryPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 72)); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_request_headers(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_headers(const envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_request_headers(const envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_request_headers(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); + size_t size; + envoy_config_route_v3_RetryPolicy_retriable_request_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_request_headers(const envoy_config_route_v3_RetryPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 80)); -} -UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_request_headers(const envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); -} -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 96), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*); + const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* default_val = NULL; + const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* ret; + const upb_MiniTableField field = {11, UPB_SIZE(36, 96), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 96), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(40, 104), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_RetryPolicy_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + const upb_MiniTableField field = {12, UPB_SIZE(40, 104), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); + size_t size; + envoy_config_route_v3_RetryPolicy_retry_options_predicates(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 96)); -} -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_RetryPolicy_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); -} -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) { - return _upb_hasbit(msg, 6); -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_per_try_idle_timeout(envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(44, 112), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {13, UPB_SIZE(44, 112), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(44, 112), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_on(envoy_config_route_v3_RetryPolicy *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(48, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_num_retries(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy_mutable_num_retries(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RetryPolicy_num_retries(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_set_num_retries(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_set_num_retries(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mutable_per_try_timeout(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_per_try_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_set_per_try_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_set_per_try_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_priority(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryPriority* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_RetryPolicy_RetryPriority*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_mutable_retry_priority(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RetryPolicy_RetryPriority* sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)envoy_config_route_v3_RetryPolicy_retry_priority(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_set_retry_priority(msg, sub); + sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_set_retry_priority(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_mutable_retry_host_predicate(envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_mutable_retry_host_predicate(envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_resize_retry_host_predicate(envoy_config_route_v3_RetryPolicy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_resize_retry_host_predicate(envoy_config_route_v3_RetryPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_add_retry_host_predicate(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* sub = (struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* sub = (struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_host_selection_retry_max_attempts(envoy_config_route_v3_RetryPolicy *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), int64_t) = value; + const upb_MiniTableField field = {6, 56, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_mutable_retriable_status_codes(envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_mutable_retriable_status_codes(envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_resize_retriable_status_codes(envoy_config_route_v3_RetryPolicy* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, 2, arena); +UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_resize_retriable_status_codes(envoy_config_route_v3_RetryPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_RetryPolicy_add_retriable_status_codes(envoy_config_route_v3_RetryPolicy* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryBackOff* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_config_route_v3_RetryPolicy_RetryBackOff*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_mutable_retry_back_off(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RetryPolicy_RetryBackOff* sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)envoy_config_route_v3_RetryPolicy_retry_back_off(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_set_retry_back_off(msg, sub); + sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_set_retry_back_off(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_headers(envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_headers(envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(28, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_headers(envoy_config_route_v3_RetryPolicy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_headers(envoy_config_route_v3_RetryPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(28, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_headers(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(28, 80), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_request_headers(envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_request_headers(envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_request_headers(envoy_config_route_v3_RetryPolicy* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_request_headers(envoy_config_route_v3_RetryPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_request_headers(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {10, UPB_SIZE(32, 88), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(36, 96), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_mutable_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(msg, sub); + sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_mutable_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_mutable_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, size_t* size) { + upb_MiniTableField field = {12, UPB_SIZE(40, 104), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_resize_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_resize_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {12, UPB_SIZE(40, 104), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RetryPolicy_add_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {12, UPB_SIZE(40, 104), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(44, 112), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mutable_per_try_idle_timeout(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_per_try_idle_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(msg, sub); } return sub; } @@ -4042,12 +5563,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mu /* envoy.config.route.v3.RetryPolicy.RetryPriority */ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_RetryPriority_new(upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena); + return (envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_RetryPriority_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RetryPriority* ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4057,7 +5578,7 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v int options, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RetryPriority* ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4065,13 +5586,13 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v } UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RetryPriority_serialize(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -4079,36 +5600,49 @@ typedef enum { envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_NOT_SET = 0 } envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases; UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_case(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { - return (envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_clear_name(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_clear_name(envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_RetryPriority_name(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryPriority_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_clear_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_clear_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPriority_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryPriority_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_set_name(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPriority_mutable_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RetryPolicy_RetryPriority_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(msg, sub); } return sub; } @@ -4116,12 +5650,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPr /* envoy.config.route.v3.RetryPolicy.RetryHostPredicate */ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena); + return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RetryHostPredicate* ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4131,7 +5665,7 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_ro int options, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RetryHostPredicate* ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4139,13 +5673,13 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_ro } UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_serialize(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -4153,36 +5687,49 @@ typedef enum { envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_NOT_SET = 0 } envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases; UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_case(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { - return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_clear_name(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_clear_name(envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_RetryHostPredicate_name(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryHostPredicate_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_clear_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_clear_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryHostPredicate_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_name(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_mutable_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RetryPolicy_RetryHostPredicate_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(msg, sub); } return sub; } @@ -4190,12 +5737,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHo /* envoy.config.route.v3.RetryPolicy.RetryBackOff */ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_RetryBackOff_new(upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena); + return (envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_RetryBackOff_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RetryBackOff* ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4205,7 +5752,7 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3 int options, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RetryBackOff* ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4213,57 +5760,67 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3 } UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_clear_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_clear_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_clear_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_clear_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_mutable_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(msg, sub); } return sub; } @@ -4271,12 +5828,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_Re /* envoy.config.route.v3.RetryPolicy.ResetHeader */ UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_RetryPolicy_ResetHeader_new(upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena); + return (envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_RetryPolicy_ResetHeader_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_ResetHeader* ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4286,7 +5843,7 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_ int options, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_ResetHeader* ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4294,44 +5851,56 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_ } UPB_INLINE char* envoy_config_route_v3_RetryPolicy_ResetHeader_serialize(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_clear_name(envoy_config_route_v3_RetryPolicy_ResetHeader* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_ResetHeader_name(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_clear_format(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_clear_format(envoy_config_route_v3_RetryPolicy_ResetHeader* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_RetryPolicy_ResetHeader_format(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_name(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_format(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff */ UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena); + return (envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4341,7 +5910,7 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_conf int options, upb_Arena* arena) { envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4349,56 +5918,86 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_conf } UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_clear_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RetryPolicy_ResetHeader* const* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RetryPolicy_ResetHeader* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_reset_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_clear_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_route_v3_RetryPolicy_ResetHeader* const* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, size_t* len) { - return (const envoy_config_route_v3_RetryPolicy_ResetHeader* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_clear_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_clear_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, size_t* len) { - return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_resize_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_resize_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RetryPolicy_ResetHeader**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_add_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RetryPolicy_ResetHeader* sub = (struct envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RetryPolicy_ResetHeader* sub = (struct envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_ResetHeader_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_max_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(msg, sub); } return sub; } @@ -4406,12 +6005,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_Ra /* envoy.config.route.v3.HedgePolicy */ UPB_INLINE envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_HedgePolicy_new(upb_Arena* arena) { - return (envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msginit, arena); + return (envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msg_init, arena); } UPB_INLINE envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_HedgePolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_HedgePolicy* ret = envoy_config_route_v3_HedgePolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4421,7 +6020,7 @@ UPB_INLINE envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_HedgePolicy_ int options, upb_Arena* arena) { envoy_config_route_v3_HedgePolicy* ret = envoy_config_route_v3_HedgePolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4429,79 +6028,95 @@ UPB_INLINE envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_HedgePolicy_ } UPB_INLINE char* envoy_config_route_v3_HedgePolicy_serialize(const envoy_config_route_v3_HedgePolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_initial_requests(const envoy_config_route_v3_HedgePolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_initial_requests(envoy_config_route_v3_HedgePolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_HedgePolicy_initial_requests(const envoy_config_route_v3_HedgePolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_additional_request_chance(const envoy_config_route_v3_HedgePolicy* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_initial_requests(const envoy_config_route_v3_HedgePolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_additional_request_chance(const envoy_config_route_v3_HedgePolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_additional_request_chance(envoy_config_route_v3_HedgePolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_HedgePolicy_additional_request_chance(const envoy_config_route_v3_HedgePolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_hedge_on_per_try_timeout(const envoy_config_route_v3_HedgePolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_additional_request_chance(const envoy_config_route_v3_HedgePolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_hedge_on_per_try_timeout(envoy_config_route_v3_HedgePolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_HedgePolicy_hedge_on_per_try_timeout(const envoy_config_route_v3_HedgePolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_initial_requests(envoy_config_route_v3_HedgePolicy *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_HedgePolicy_mutable_initial_requests(envoy_config_route_v3_HedgePolicy* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_HedgePolicy_initial_requests(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_HedgePolicy_set_initial_requests(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_HedgePolicy_set_initial_requests(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_additional_request_chance(envoy_config_route_v3_HedgePolicy *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_HedgePolicy_mutable_additional_request_chance(envoy_config_route_v3_HedgePolicy* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_HedgePolicy_additional_request_chance(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_HedgePolicy_set_additional_request_chance(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_HedgePolicy_set_additional_request_chance(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_hedge_on_per_try_timeout(envoy_config_route_v3_HedgePolicy *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RedirectAction */ UPB_INLINE envoy_config_route_v3_RedirectAction* envoy_config_route_v3_RedirectAction_new(upb_Arena* arena) { - return (envoy_config_route_v3_RedirectAction*)_upb_Message_New(&envoy_config_route_v3_RedirectAction_msginit, arena); + return (envoy_config_route_v3_RedirectAction*)_upb_Message_New(&envoy_config_route_v3_RedirectAction_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RedirectAction* envoy_config_route_v3_RedirectAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RedirectAction* ret = envoy_config_route_v3_RedirectAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4511,7 +6126,7 @@ UPB_INLINE envoy_config_route_v3_RedirectAction* envoy_config_route_v3_RedirectA int options, upb_Arena* arena) { envoy_config_route_v3_RedirectAction* ret = envoy_config_route_v3_RedirectAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4519,13 +6134,13 @@ UPB_INLINE envoy_config_route_v3_RedirectAction* envoy_config_route_v3_RedirectA } UPB_INLINE char* envoy_config_route_v3_RedirectAction_serialize(const envoy_config_route_v3_RedirectAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -4534,7 +6149,8 @@ typedef enum { envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET = 0 } envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_case(const envoy_config_route_v3_RedirectAction* msg) { - return (envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), -9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } typedef enum { envoy_config_route_v3_RedirectAction_path_rewrite_specifier_path_redirect = 2, @@ -4543,111 +6159,170 @@ typedef enum { envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET = 0 } envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases envoy_config_route_v3_RedirectAction_path_rewrite_specifier_case(const envoy_config_route_v3_RedirectAction* msg) { - return (envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_host_redirect(const envoy_config_route_v3_RedirectAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_host_redirect(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_host_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_path_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 2; -} -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_path_redirect(const envoy_config_route_v3_RedirectAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_path_redirect(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_path_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), UPB_SIZE(16, 16), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_response_code(const envoy_config_route_v3_RedirectAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_path_redirect(const envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_response_code(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_RedirectAction_response_code(const envoy_config_route_v3_RedirectAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_https_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 4; -} -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_https_redirect(const envoy_config_route_v3_RedirectAction* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(20, 24), 0, UPB_SIZE(8, 8), envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_https_redirect(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), -9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RedirectAction_https_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(20, 24), UPB_SIZE(8, 8), 4, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), -9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_prefix_rewrite(const envoy_config_route_v3_RedirectAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 5; +UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_https_redirect(const envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), -9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_prefix_rewrite(const envoy_config_route_v3_RedirectAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_prefix_rewrite(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_prefix_rewrite(const envoy_config_route_v3_RedirectAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), UPB_SIZE(16, 16), 5, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_strip_query(const envoy_config_route_v3_RedirectAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_prefix_rewrite(const envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_strip_query(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RedirectAction_strip_query(const envoy_config_route_v3_RedirectAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_scheme_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 7; -} -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_scheme_redirect(const envoy_config_route_v3_RedirectAction* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(20, 24), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(8, 8), envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_scheme_redirect(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 24), -9, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_scheme_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(20, 24), UPB_SIZE(8, 8), 7, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 24), -9, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_port_redirect(const envoy_config_route_v3_RedirectAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = 0; +UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_scheme_redirect(const envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 24), -9, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_port_redirect(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {8, 12, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_route_v3_RedirectAction_port_redirect(const envoy_config_route_v3_RedirectAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {8, 12, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 9; -} -UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 40), 0, UPB_SIZE(16, 16), envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_regex_rewrite(envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 40), -17, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RedirectAction_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 40), UPB_SIZE(16, 16), 9, NULL); + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 40), -17, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 40), -17, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_host_redirect(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_path_redirect(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), value, UPB_SIZE(16, 16), 2); + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_response_code(envoy_config_route_v3_RedirectAction *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_https_redirect(envoy_config_route_v3_RedirectAction *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(20, 24), value, UPB_SIZE(8, 8), 4); + const upb_MiniTableField field = {4, UPB_SIZE(20, 24), -9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_prefix_rewrite(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), value, UPB_SIZE(16, 16), 5); + const upb_MiniTableField field = {5, UPB_SIZE(28, 40), -17, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_strip_query(envoy_config_route_v3_RedirectAction *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_scheme_redirect(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(20, 24), value, UPB_SIZE(8, 8), 7); + const upb_MiniTableField field = {7, UPB_SIZE(20, 24), -9, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_port_redirect(envoy_config_route_v3_RedirectAction *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value; + const upb_MiniTableField field = {8, 12, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RedirectAction_set_regex_rewrite(envoy_config_route_v3_RedirectAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 40), value, UPB_SIZE(16, 16), 9); + const upb_MiniTableField field = {9, UPB_SIZE(28, 40), -17, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RedirectAction_mutable_regex_rewrite(envoy_config_route_v3_RedirectAction* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RedirectAction_regex_rewrite(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RedirectAction_set_regex_rewrite(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, arena); + if (sub) envoy_config_route_v3_RedirectAction_set_regex_rewrite(msg, sub); } return sub; } @@ -4655,12 +6330,12 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_ro /* envoy.config.route.v3.DirectResponseAction */ UPB_INLINE envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_DirectResponseAction_new(upb_Arena* arena) { - return (envoy_config_route_v3_DirectResponseAction*)_upb_Message_New(&envoy_config_route_v3_DirectResponseAction_msginit, arena); + return (envoy_config_route_v3_DirectResponseAction*)_upb_Message_New(&envoy_config_route_v3_DirectResponseAction_msg_init, arena); } UPB_INLINE envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_DirectResponseAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_DirectResponseAction* ret = envoy_config_route_v3_DirectResponseAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4670,7 +6345,7 @@ UPB_INLINE envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Dir int options, upb_Arena* arena) { envoy_config_route_v3_DirectResponseAction* ret = envoy_config_route_v3_DirectResponseAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4678,44 +6353,55 @@ UPB_INLINE envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Dir } UPB_INLINE char* envoy_config_route_v3_DirectResponseAction_serialize(const envoy_config_route_v3_DirectResponseAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msg_init, 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; +UPB_INLINE void envoy_config_route_v3_DirectResponseAction_clear_status(envoy_config_route_v3_DirectResponseAction* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_route_v3_DirectResponseAction_status(const envoy_config_route_v3_DirectResponseAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_DirectResponseAction_has_body(const envoy_config_route_v3_DirectResponseAction* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_DirectResponseAction_clear_body(const envoy_config_route_v3_DirectResponseAction* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_DirectResponseAction_clear_body(envoy_config_route_v3_DirectResponseAction* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectResponseAction_body(const envoy_config_route_v3_DirectResponseAction* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_DirectResponseAction_has_body(const envoy_config_route_v3_DirectResponseAction* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_status(envoy_config_route_v3_DirectResponseAction *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_body(envoy_config_route_v3_DirectResponseAction *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectResponseAction_mutable_body(envoy_config_route_v3_DirectResponseAction* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_route_v3_DirectResponseAction_body(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_DirectResponseAction_set_body(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_route_v3_DirectResponseAction_set_body(msg, sub); } return sub; } @@ -4723,12 +6409,12 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectR /* envoy.config.route.v3.NonForwardingAction */ UPB_INLINE envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonForwardingAction_new(upb_Arena* arena) { - return (envoy_config_route_v3_NonForwardingAction*)_upb_Message_New(&envoy_config_route_v3_NonForwardingAction_msginit, arena); + return (envoy_config_route_v3_NonForwardingAction*)_upb_Message_New(&envoy_config_route_v3_NonForwardingAction_msg_init, arena); } UPB_INLINE envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonForwardingAction_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_NonForwardingAction* ret = envoy_config_route_v3_NonForwardingAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4738,7 +6424,7 @@ UPB_INLINE envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonF int options, upb_Arena* arena) { envoy_config_route_v3_NonForwardingAction* ret = envoy_config_route_v3_NonForwardingAction_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4746,13 +6432,13 @@ UPB_INLINE envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonF } UPB_INLINE char* envoy_config_route_v3_NonForwardingAction_serialize(const envoy_config_route_v3_NonForwardingAction* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msg_init, options, arena, &ptr, len); return ptr; } @@ -4760,12 +6446,12 @@ UPB_INLINE char* envoy_config_route_v3_NonForwardingAction_serialize_ex(const en /* envoy.config.route.v3.Decorator */ UPB_INLINE envoy_config_route_v3_Decorator* envoy_config_route_v3_Decorator_new(upb_Arena* arena) { - return (envoy_config_route_v3_Decorator*)_upb_Message_New(&envoy_config_route_v3_Decorator_msginit, arena); + return (envoy_config_route_v3_Decorator*)_upb_Message_New(&envoy_config_route_v3_Decorator_msg_init, arena); } UPB_INLINE envoy_config_route_v3_Decorator* envoy_config_route_v3_Decorator_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_Decorator* ret = envoy_config_route_v3_Decorator_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Decorator_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4775,7 +6461,7 @@ UPB_INLINE envoy_config_route_v3_Decorator* envoy_config_route_v3_Decorator_pars int options, upb_Arena* arena) { envoy_config_route_v3_Decorator* ret = envoy_config_route_v3_Decorator_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Decorator_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4783,44 +6469,55 @@ UPB_INLINE envoy_config_route_v3_Decorator* envoy_config_route_v3_Decorator_pars } UPB_INLINE char* envoy_config_route_v3_Decorator_serialize(const envoy_config_route_v3_Decorator* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Decorator_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Decorator_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Decorator_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Decorator_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_Decorator_clear_operation(envoy_config_route_v3_Decorator* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_Decorator_operation(const envoy_config_route_v3_Decorator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Decorator_has_propagate(const envoy_config_route_v3_Decorator* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_Decorator_clear_propagate(const envoy_config_route_v3_Decorator* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Decorator_clear_propagate(envoy_config_route_v3_Decorator* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_propagate(const envoy_config_route_v3_Decorator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_Decorator_has_propagate(const envoy_config_route_v3_Decorator* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_Decorator_set_operation(envoy_config_route_v3_Decorator *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_Decorator_set_propagate(envoy_config_route_v3_Decorator *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_mutable_propagate(envoy_config_route_v3_Decorator* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_Decorator_propagate(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Decorator_set_propagate(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_Decorator_set_propagate(msg, sub); } return sub; } @@ -4828,12 +6525,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_mut /* envoy.config.route.v3.Tracing */ UPB_INLINE envoy_config_route_v3_Tracing* envoy_config_route_v3_Tracing_new(upb_Arena* arena) { - return (envoy_config_route_v3_Tracing*)_upb_Message_New(&envoy_config_route_v3_Tracing_msginit, arena); + return (envoy_config_route_v3_Tracing*)_upb_Message_New(&envoy_config_route_v3_Tracing_msg_init, arena); } UPB_INLINE envoy_config_route_v3_Tracing* envoy_config_route_v3_Tracing_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_Tracing* ret = envoy_config_route_v3_Tracing_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Tracing_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4843,7 +6540,7 @@ UPB_INLINE envoy_config_route_v3_Tracing* envoy_config_route_v3_Tracing_parse_ex int options, upb_Arena* arena) { envoy_config_route_v3_Tracing* ret = envoy_config_route_v3_Tracing_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Tracing_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4851,113 +6548,153 @@ UPB_INLINE envoy_config_route_v3_Tracing* envoy_config_route_v3_Tracing_parse_ex } UPB_INLINE char* envoy_config_route_v3_Tracing_serialize(const envoy_config_route_v3_Tracing* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Tracing_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Tracing_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_Tracing_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_Tracing_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_Tracing_clear_client_sampling(const envoy_config_route_v3_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Tracing_clear_client_sampling(envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_client_sampling(const envoy_config_route_v3_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Tracing_has_random_sampling(const envoy_config_route_v3_Tracing* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_Tracing_has_client_sampling(const envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Tracing_clear_random_sampling(const envoy_config_route_v3_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Tracing_clear_random_sampling(envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_random_sampling(const envoy_config_route_v3_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_Tracing_has_overall_sampling(const envoy_config_route_v3_Tracing* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_route_v3_Tracing_has_random_sampling(const envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_Tracing_clear_overall_sampling(const envoy_config_route_v3_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_Tracing_clear_overall_sampling(envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_overall_sampling(const envoy_config_route_v3_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_Tracing_has_overall_sampling(const envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_Tracing_clear_custom_tags(envoy_config_route_v3_Tracing* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_config_route_v3_Tracing_custom_tags(const envoy_config_route_v3_Tracing* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_Tracing_has_custom_tags(const envoy_config_route_v3_Tracing* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void envoy_config_route_v3_Tracing_clear_custom_tags(const envoy_config_route_v3_Tracing* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_config_route_v3_Tracing_custom_tags(const envoy_config_route_v3_Tracing* msg, size_t* len) { - return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + envoy_config_route_v3_Tracing_custom_tags(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_route_v3_Tracing_set_client_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_client_sampling(envoy_config_route_v3_Tracing* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_client_sampling(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Tracing_set_client_sampling(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_Tracing_set_client_sampling(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Tracing_set_random_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_random_sampling(envoy_config_route_v3_Tracing* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_random_sampling(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Tracing_set_random_sampling(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_Tracing_set_random_sampling(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_Tracing_set_overall_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_overall_sampling(envoy_config_route_v3_Tracing* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_overall_sampling(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_Tracing_set_overall_sampling(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_config_route_v3_Tracing_set_overall_sampling(msg, sub); } return sub; } -UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_mutable_custom_tags(envoy_config_route_v3_Tracing* msg, size_t* len) { - return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_mutable_custom_tags(envoy_config_route_v3_Tracing* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_resize_custom_tags(envoy_config_route_v3_Tracing* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_tracing_v3_CustomTag**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_resize_custom_tags(envoy_config_route_v3_Tracing* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_tracing_v3_CustomTag**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_tracing_v3_CustomTag* envoy_config_route_v3_Tracing_add_custom_tags(envoy_config_route_v3_Tracing* msg, upb_Arena* arena) { - struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.route.v3.VirtualCluster */ UPB_INLINE envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualCluster_new(upb_Arena* arena) { - return (envoy_config_route_v3_VirtualCluster*)_upb_Message_New(&envoy_config_route_v3_VirtualCluster_msginit, arena); + return (envoy_config_route_v3_VirtualCluster*)_upb_Message_New(&envoy_config_route_v3_VirtualCluster_msg_init, arena); } UPB_INLINE envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualCluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_VirtualCluster* ret = envoy_config_route_v3_VirtualCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -4967,7 +6704,7 @@ UPB_INLINE envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualCl int options, upb_Arena* arena) { envoy_config_route_v3_VirtualCluster* ret = envoy_config_route_v3_VirtualCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -4975,56 +6712,87 @@ UPB_INLINE envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualCl } UPB_INLINE char* envoy_config_route_v3_VirtualCluster_serialize(const envoy_config_route_v3_VirtualCluster* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_VirtualCluster_clear_name(envoy_config_route_v3_VirtualCluster* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_VirtualCluster_name(const envoy_config_route_v3_VirtualCluster* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_route_v3_VirtualCluster_clear_headers(envoy_config_route_v3_VirtualCluster* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_VirtualCluster_headers(const envoy_config_route_v3_VirtualCluster* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_VirtualCluster_has_headers(const envoy_config_route_v3_VirtualCluster* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_config_route_v3_VirtualCluster_clear_headers(const envoy_config_route_v3_VirtualCluster* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_VirtualCluster_headers(const envoy_config_route_v3_VirtualCluster* msg, size_t* len) { - return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_config_route_v3_VirtualCluster_headers(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_route_v3_VirtualCluster_set_name(envoy_config_route_v3_VirtualCluster *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_mutable_headers(envoy_config_route_v3_VirtualCluster* msg, size_t* len) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_mutable_headers(envoy_config_route_v3_VirtualCluster* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_resize_headers(envoy_config_route_v3_VirtualCluster* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_resize_headers(envoy_config_route_v3_VirtualCluster* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_VirtualCluster_add_headers(envoy_config_route_v3_VirtualCluster* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.route.v3.RateLimit */ UPB_INLINE envoy_config_route_v3_RateLimit* envoy_config_route_v3_RateLimit_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit*)_upb_Message_New(&envoy_config_route_v3_RateLimit_msginit, arena); + return (envoy_config_route_v3_RateLimit*)_upb_Message_New(&envoy_config_route_v3_RateLimit_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit* envoy_config_route_v3_RateLimit_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit* ret = envoy_config_route_v3_RateLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5034,7 +6802,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit* envoy_config_route_v3_RateLimit_pars int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit* ret = envoy_config_route_v3_RateLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5042,87 +6810,128 @@ UPB_INLINE envoy_config_route_v3_RateLimit* envoy_config_route_v3_RateLimit_pars } UPB_INLINE char* envoy_config_route_v3_RateLimit_serialize(const envoy_config_route_v3_RateLimit* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_clear_stage(const envoy_config_route_v3_RateLimit* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_clear_stage(envoy_config_route_v3_RateLimit* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_stage(const envoy_config_route_v3_RateLimit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_clear_disable_key(const envoy_config_route_v3_RateLimit* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_RateLimit_has_stage(const envoy_config_route_v3_RateLimit* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RateLimit_clear_disable_key(envoy_config_route_v3_RateLimit* msg) { + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_disable_key(const envoy_config_route_v3_RateLimit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_route_v3_RateLimit_clear_actions(envoy_config_route_v3_RateLimit* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_RateLimit_Action* const* envoy_config_route_v3_RateLimit_actions(const envoy_config_route_v3_RateLimit* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_RateLimit_Action* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RateLimit_has_actions(const envoy_config_route_v3_RateLimit* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + envoy_config_route_v3_RateLimit_actions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RateLimit_clear_actions(const envoy_config_route_v3_RateLimit* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_config_route_v3_RateLimit_Action* const* envoy_config_route_v3_RateLimit_actions(const envoy_config_route_v3_RateLimit* msg, size_t* len) { - return (const envoy_config_route_v3_RateLimit_Action* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); -} -UPB_INLINE bool envoy_config_route_v3_RateLimit_has_limit(const envoy_config_route_v3_RateLimit* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_clear_limit(const envoy_config_route_v3_RateLimit* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_clear_limit(envoy_config_route_v3_RateLimit* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_limit(const envoy_config_route_v3_RateLimit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_RateLimit_Override*); + const envoy_config_route_v3_RateLimit_Override* default_val = NULL; + const envoy_config_route_v3_RateLimit_Override* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_has_limit(const envoy_config_route_v3_RateLimit* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RateLimit_set_stage(envoy_config_route_v3_RateLimit *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_mutable_stage(envoy_config_route_v3_RateLimit* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RateLimit_stage(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_set_stage(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_set_stage(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_set_disable_key(envoy_config_route_v3_RateLimit *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_mutable_actions(envoy_config_route_v3_RateLimit* msg, size_t* len) { - return (envoy_config_route_v3_RateLimit_Action**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_mutable_actions(envoy_config_route_v3_RateLimit* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_RateLimit_Action**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_resize_actions(envoy_config_route_v3_RateLimit* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_resize_actions(envoy_config_route_v3_RateLimit* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RateLimit_Action**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLimit_add_actions(envoy_config_route_v3_RateLimit* msg, upb_Arena* arena) { - struct envoy_config_route_v3_RateLimit_Action* sub = (struct envoy_config_route_v3_RateLimit_Action*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_RateLimit_Action* sub = (struct envoy_config_route_v3_RateLimit_Action*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_set_limit(envoy_config_route_v3_RateLimit *msg, envoy_config_route_v3_RateLimit_Override* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_RateLimit_Override*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_mutable_limit(envoy_config_route_v3_RateLimit* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Override* sub = (struct envoy_config_route_v3_RateLimit_Override*)envoy_config_route_v3_RateLimit_limit(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Override*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_set_limit(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Override*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_set_limit(msg, sub); } return sub; } @@ -5130,12 +6939,12 @@ UPB_INLINE struct envoy_config_route_v3_RateLimit_Override* envoy_config_route_v /* envoy.config.route.v3.RateLimit.Action */ UPB_INLINE envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLimit_Action_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLimit_Action_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action* ret = envoy_config_route_v3_RateLimit_Action_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5145,7 +6954,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLim int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action* ret = envoy_config_route_v3_RateLimit_Action_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5153,13 +6962,13 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLim } UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_serialize(const envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -5177,237 +6986,304 @@ typedef enum { envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET = 0 } envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases envoy_config_route_v3_RateLimit_Action_action_specifier_case(const envoy_config_route_v3_RateLimit_Action* msg) { - return (envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_source_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_source_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_source_cluster(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_source_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_route_v3_RateLimit_Action_SourceCluster* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_SourceCluster* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_destination_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_source_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_destination_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_destination_cluster(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_destination_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_route_v3_RateLimit_Action_DestinationCluster* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_DestinationCluster* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_request_headers(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_destination_cluster(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_request_headers(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_request_headers(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_request_headers(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_route_v3_RateLimit_Action_RequestHeaders* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_RequestHeaders* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_request_headers(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_remote_address(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_config_route_v3_RateLimit_Action_RemoteAddress* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_RemoteAddress* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_generic_key(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_generic_key(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_generic_key(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_generic_key(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const envoy_config_route_v3_RateLimit_Action_GenericKey* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_GenericKey* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_header_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_generic_key(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_header_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_header_value_match(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_header_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_header_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_dynamic_metadata(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_metadata(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const envoy_config_route_v3_RateLimit_Action_MetaData* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_MetaData* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_extension(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_metadata(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_extension(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_extension(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RateLimit_Action_extension(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_masked_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_extension(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_masked_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_masked_remote_address(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* envoy_config_route_v3_RateLimit_Action_masked_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL); + const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_query_parameter_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11; +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_masked_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_query_parameter_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_query_parameter_value_match(envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* envoy_config_route_v3_RateLimit_Action_query_parameter_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 11, NULL); + const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* default_val = NULL; + const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* ret; + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_query_parameter_value_match(const envoy_config_route_v3_RateLimit_Action* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_source_cluster(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_SourceCluster* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_mutable_source_cluster(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_SourceCluster* sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)envoy_config_route_v3_RateLimit_Action_source_cluster(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_source_cluster(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_source_cluster(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_destination_cluster(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_mutable_destination_cluster(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_DestinationCluster* sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)envoy_config_route_v3_RateLimit_Action_destination_cluster(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_destination_cluster(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_destination_cluster(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_request_headers(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_mutable_request_headers(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_RequestHeaders* sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)envoy_config_route_v3_RateLimit_Action_request_headers(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_request_headers(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_request_headers(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_remote_address(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_mutable_remote_address(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_RemoteAddress* sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)envoy_config_route_v3_RateLimit_Action_remote_address(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_remote_address(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_remote_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_generic_key(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_GenericKey* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_mutable_generic_key(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_GenericKey* sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)envoy_config_route_v3_RateLimit_Action_generic_key(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_generic_key(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_generic_key(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_header_value_match(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_mutable_header_value_match(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)envoy_config_route_v3_RateLimit_Action_header_value_match(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_header_value_match(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_header_value_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_mutable_dynamic_metadata(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData* sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)envoy_config_route_v3_RateLimit_Action_dynamic_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_metadata(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_MetaData* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_mutable_metadata(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_MetaData* sub = (struct envoy_config_route_v3_RateLimit_Action_MetaData*)envoy_config_route_v3_RateLimit_Action_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_metadata(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_metadata(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_extension(envoy_config_route_v3_RateLimit_Action *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RateLimit_Action_mutable_extension(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_RateLimit_Action_extension(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_extension(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_extension(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_masked_remote_address(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* envoy_config_route_v3_RateLimit_Action_mutable_masked_remote_address(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* sub = (struct envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*)envoy_config_route_v3_RateLimit_Action_masked_remote_address(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_masked_remote_address(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_masked_remote_address(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_query_parameter_value_match(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 11); + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* envoy_config_route_v3_RateLimit_Action_mutable_query_parameter_value_match(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* sub = (struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*)envoy_config_route_v3_RateLimit_Action_query_parameter_value_match(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_set_query_parameter_value_match(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_set_query_parameter_value_match(msg, sub); } return sub; } @@ -5415,12 +7291,12 @@ UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatc /* envoy.config.route.v3.RateLimit.Action.SourceCluster */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_SourceCluster_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_SourceCluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_SourceCluster* ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5430,7 +7306,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_ro int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_SourceCluster* ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5438,13 +7314,13 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_ro } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msg_init, options, arena, &ptr, len); return ptr; } @@ -5452,12 +7328,12 @@ UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_SourceCluster_serialize_ /* envoy.config.route.v3.RateLimit.Action.DestinationCluster */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_DestinationCluster* ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5467,7 +7343,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_conf int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_DestinationCluster* ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5475,13 +7351,13 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_conf } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msg_init, options, arena, &ptr, len); return ptr; } @@ -5489,12 +7365,12 @@ UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_DestinationCluster_seria /* envoy.config.route.v3.RateLimit.Action.RequestHeaders */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_RequestHeaders* ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5504,7 +7380,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_r int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_RequestHeaders* ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5512,53 +7388,71 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_r } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_header_name(envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_RequestHeaders_header_name(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_descriptor_key(envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_RequestHeaders_descriptor_key(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_skip_if_absent(envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_RequestHeaders_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_header_name(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_skip_if_absent(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {3, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RateLimit.Action.RemoteAddress */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_RemoteAddress* ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5568,7 +7462,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_ro int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_RemoteAddress* ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5576,13 +7470,13 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_ro } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msg_init, options, arena, &ptr, len); return ptr; } @@ -5590,12 +7484,12 @@ UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_RemoteAddress_serialize_ /* envoy.config.route.v3.RateLimit.Action.MaskedRemoteAddress */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* ret = envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5605,7 +7499,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* envoy_con int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* ret = envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5613,57 +7507,67 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* envoy_con } UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_serialize(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_serialize_ex(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_has_v4_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_clear_v4_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_clear_v4_prefix_mask_len(envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_v4_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_has_v6_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_has_v4_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_clear_v6_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_clear_v6_prefix_mask_len(envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_v6_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_has_v6_prefix_mask_len(const envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_set_v4_prefix_mask_len(envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_mutable_v4_prefix_mask_len(envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_v4_prefix_mask_len(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_set_v4_prefix_mask_len(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_set_v4_prefix_mask_len(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_set_v6_prefix_mask_len(envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_mutable_v6_prefix_mask_len(envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_v6_prefix_mask_len(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_set_v6_prefix_mask_len(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_MaskedRemoteAddress_set_v6_prefix_mask_len(msg, sub); } return sub; } @@ -5671,12 +7575,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_A /* envoy.config.route.v3.RateLimit.Action.GenericKey */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_GenericKey_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_GenericKey_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_GenericKey* ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5686,7 +7590,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_GenericKey* ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5694,44 +7598,56 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_clear_descriptor_value(envoy_config_route_v3_RateLimit_Action_GenericKey* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_GenericKey_descriptor_value(const envoy_config_route_v3_RateLimit_Action_GenericKey* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_GenericKey* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_clear_descriptor_key(envoy_config_route_v3_RateLimit_Action_GenericKey* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_GenericKey_descriptor_key(const envoy_config_route_v3_RateLimit_Action_GenericKey* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RateLimit.Action.HeaderValueMatch */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5741,7 +7657,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5749,87 +7665,129 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_descriptor_value(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_descriptor_value(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, size_t* len) { - return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_descriptor_key(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_descriptor_key(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_expect_match(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, size_t* len) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_resize_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_resize_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_add_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RateLimit.Action.DynamicMetaData */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_DynamicMetaData* ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5839,7 +7797,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_ int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_DynamicMetaData* ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5847,66 +7805,83 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_descriptor_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_DynamicMetaData_descriptor_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_DynamicMetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_metadata_v3_MetadataKey*); + const struct envoy_type_metadata_v3_MetadataKey* default_val = NULL; + const struct envoy_type_metadata_v3_MetadataKey* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_default_value(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_DynamicMetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_default_value(envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_DynamicMetaData_default_value(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, struct envoy_type_metadata_v3_MetadataKey* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_metadata_v3_MetadataKey*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Action_DynamicMetaData_metadata_key(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RateLimit.Action.MetaData */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_MetaData_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_MetaData_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_MetaData* ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -5916,7 +7891,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_MetaData* ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -5924,84 +7899,113 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msg_init, 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(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_descriptor_key(envoy_config_route_v3_RateLimit_Action_MetaData* msg) { + const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_MetaData_descriptor_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_metadata_key(envoy_config_route_v3_RateLimit_Action_MetaData* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_MetaData_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_type_metadata_v3_MetadataKey*); + const struct envoy_type_metadata_v3_MetadataKey* default_val = NULL; + const struct envoy_type_metadata_v3_MetadataKey* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_default_value(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_default_value(envoy_config_route_v3_RateLimit_Action_MetaData* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_MetaData_default_value(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_source(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_source(envoy_config_route_v3_RateLimit_Action_MetaData* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_route_v3_RateLimit_Action_MetaData_source(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_skip_if_absent(envoy_config_route_v3_RateLimit_Action_MetaData* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MetaData_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_metadata_key(envoy_config_route_v3_RateLimit_Action_MetaData *msg, struct envoy_type_metadata_v3_MetadataKey* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_type_metadata_v3_MetadataKey*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_MetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_MetaData* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Action_MetaData_metadata_key(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_MetaData_set_metadata_key(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_MetaData_set_metadata_key(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_source(envoy_config_route_v3_RateLimit_Action_MetaData *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_skip_if_absent(envoy_config_route_v3_RateLimit_Action_MetaData *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RateLimit.Action.QueryParameterValueMatch */ UPB_INLINE envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, arena); + return (envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* ret = envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6011,7 +8015,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* envo int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* ret = envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6019,87 +8023,129 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* envo } UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_serialize(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_serialize_ex(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_descriptor_value(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_descriptor_value(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_descriptor_value(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_expect_match(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_expect_match(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_expect_match(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_query_parameters(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_QueryParameterMatcher* const* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_query_parameters(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_QueryParameterMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_has_query_parameters(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_query_parameters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_query_parameters(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const envoy_config_route_v3_QueryParameterMatcher* const* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_query_parameters(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, size_t* len) { - return (const envoy_config_route_v3_QueryParameterMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_clear_descriptor_key(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_descriptor_key(const envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_set_expect_match(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_mutable_expect_match(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_expect_match(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_set_expect_match(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_set_expect_match(msg, sub); } return sub; } -UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_mutable_query_parameters(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, size_t* len) { - return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_mutable_query_parameters(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_resize_query_parameters(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_QueryParameterMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_resize_query_parameters(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_QueryParameterMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_add_query_parameters(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch* msg, upb_Arena* arena) { - struct envoy_config_route_v3_QueryParameterMatcher* sub = (struct envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_QueryParameterMatcher* sub = (struct envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_QueryParameterValueMatch *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(20, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.RateLimit.Override */ UPB_INLINE envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_Override_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Override*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_msginit, arena); + return (envoy_config_route_v3_RateLimit_Override*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_Override_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Override* ret = envoy_config_route_v3_RateLimit_Override_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6109,7 +8155,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateL int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Override* ret = envoy_config_route_v3_RateLimit_Override_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6117,13 +8163,13 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateL } UPB_INLINE char* envoy_config_route_v3_RateLimit_Override_serialize(const envoy_config_route_v3_RateLimit_Override* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -6131,27 +8177,34 @@ typedef enum { envoy_config_route_v3_RateLimit_Override_override_specifier_NOT_SET = 0 } envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases envoy_config_route_v3_RateLimit_Override_override_specifier_case(const envoy_config_route_v3_RateLimit_Override* msg) { - return (envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Override_clear_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Override_override_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_RateLimit_Override_clear_dynamic_metadata(envoy_config_route_v3_RateLimit_Override* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* default_val = NULL; + const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(envoy_config_route_v3_RateLimit_Override *msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata* value) { - UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_mutable_dynamic_metadata(envoy_config_route_v3_RateLimit_Override* msg, upb_Arena* arena) { struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)envoy_config_route_v3_RateLimit_Override_dynamic_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(msg, sub); + sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(msg, sub); } return sub; } @@ -6159,12 +8212,12 @@ UPB_INLINE struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envo /* envoy.config.route.v3.RateLimit.Override.DynamicMetadata */ UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(upb_Arena* arena) { - return (envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena); + return (envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, arena); } UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Override_DynamicMetadata* ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6174,7 +8227,7 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_confi int options, upb_Arena* arena) { envoy_config_route_v3_RateLimit_Override_DynamicMetadata* ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6182,35 +8235,40 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_confi } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_RateLimit_Override_DynamicMetadata_clear_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_RateLimit_Override_DynamicMetadata_clear_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_metadata_v3_MetadataKey*); + const struct envoy_type_metadata_v3_MetadataKey* default_val = NULL; + const struct envoy_type_metadata_v3_MetadataKey* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_DynamicMetadata_has_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, struct envoy_type_metadata_v3_MetadataKey* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_metadata_v3_MetadataKey*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_mutable_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Override_DynamicMetadata_metadata_key(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msg_init, arena); + if (sub) envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(msg, sub); } return sub; } @@ -6218,12 +8276,12 @@ UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_Rate /* envoy.config.route.v3.HeaderMatcher */ UPB_INLINE envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_HeaderMatcher_new(upb_Arena* arena) { - return (envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); + return (envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); } UPB_INLINE envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_HeaderMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_HeaderMatcher* ret = envoy_config_route_v3_HeaderMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6233,7 +8291,7 @@ UPB_INLINE envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_HeaderMatc int options, upb_Arena* arena) { envoy_config_route_v3_HeaderMatcher* ret = envoy_config_route_v3_HeaderMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6241,13 +8299,13 @@ UPB_INLINE envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_HeaderMatc } UPB_INLINE char* envoy_config_route_v3_HeaderMatcher_serialize(const envoy_config_route_v3_HeaderMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -6262,169 +8320,241 @@ typedef enum { envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET = 0 } envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases envoy_config_route_v3_HeaderMatcher_header_match_specifier_case(const envoy_config_route_v3_HeaderMatcher* msg) { - return (envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_name(const envoy_config_route_v3_HeaderMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_name(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_name(const envoy_config_route_v3_HeaderMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; -} -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_exact_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_range_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_range_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_range_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Int64Range* envoy_config_route_v3_HeaderMatcher_range_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 6, NULL); + const struct envoy_type_v3_Int64Range* default_val = NULL; + const struct envoy_type_v3_Int64Range* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_present_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_range_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_present_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_present_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_present_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 7, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_invert_match(const envoy_config_route_v3_HeaderMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_present_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_invert_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {8, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_invert_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_prefix_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 9; -} -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_prefix_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_prefix_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_prefix_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 9, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_prefix_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_suffix_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 10, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_safe_regex_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_safe_regex_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_safe_regex_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 11, NULL); + const struct envoy_type_matcher_v3_RegexMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatcher* ret; + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_contains_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_contains_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_contains_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_contains_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 12, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_string_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_contains_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_string_match(const envoy_config_route_v3_HeaderMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_string_match(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_HeaderMatcher_string_match(const envoy_config_route_v3_HeaderMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 13, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_treat_missing_header_as_empty(const envoy_config_route_v3_HeaderMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_string_match(const envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_treat_missing_header_as_empty(envoy_config_route_v3_HeaderMatcher* msg) { + const upb_MiniTableField field = {14, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_treat_missing_header_as_empty(const envoy_config_route_v3_HeaderMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {14, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_name(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_exact_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_range_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_v3_Int64Range* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 6); + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_route_v3_HeaderMatcher_mutable_range_match(envoy_config_route_v3_HeaderMatcher* msg, upb_Arena* arena) { struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)envoy_config_route_v3_HeaderMatcher_range_match(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_HeaderMatcher_set_range_match(msg, sub); + sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msg_init, arena); + if (sub) envoy_config_route_v3_HeaderMatcher_set_range_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_present_match(envoy_config_route_v3_HeaderMatcher *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_invert_match(envoy_config_route_v3_HeaderMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {8, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_prefix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 9); + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_suffix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 10); + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 11); + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_mutable_safe_regex_match(envoy_config_route_v3_HeaderMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_HeaderMatcher_safe_regex_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msg_init, arena); + if (sub) envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_contains_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 12); + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_string_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 13); + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_HeaderMatcher_mutable_string_match(envoy_config_route_v3_HeaderMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_route_v3_HeaderMatcher_string_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_HeaderMatcher_set_string_match(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_route_v3_HeaderMatcher_set_string_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_treat_missing_header_as_empty(envoy_config_route_v3_HeaderMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {14, 8, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.QueryParameterMatcher */ UPB_INLINE envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_QueryParameterMatcher_new(upb_Arena* arena) { - return (envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena); + return (envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msg_init, arena); } UPB_INLINE envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_QueryParameterMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_QueryParameterMatcher* ret = envoy_config_route_v3_QueryParameterMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6434,7 +8564,7 @@ UPB_INLINE envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_Qu int options, upb_Arena* arena) { envoy_config_route_v3_QueryParameterMatcher* ret = envoy_config_route_v3_QueryParameterMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6442,13 +8572,13 @@ UPB_INLINE envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_Qu } UPB_INLINE char* envoy_config_route_v3_QueryParameterMatcher_serialize(const envoy_config_route_v3_QueryParameterMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -6457,61 +8587,81 @@ typedef enum { envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET = 0 } envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases; UPB_INLINE envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_case(const envoy_config_route_v3_QueryParameterMatcher* msg) { - return (envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_name(const envoy_config_route_v3_QueryParameterMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_name(envoy_config_route_v3_QueryParameterMatcher* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_QueryParameterMatcher_name(const envoy_config_route_v3_QueryParameterMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_string_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; -} -UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_string_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_string_match(envoy_config_route_v3_QueryParameterMatcher* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_QueryParameterMatcher_string_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_present_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_string_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_present_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET); +UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_present_match(envoy_config_route_v3_QueryParameterMatcher* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 24), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_present_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 6, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 24), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_present_match(const envoy_config_route_v3_QueryParameterMatcher* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 24), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_name(envoy_config_route_v3_QueryParameterMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_string_match(envoy_config_route_v3_QueryParameterMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_QueryParameterMatcher_mutable_string_match(envoy_config_route_v3_QueryParameterMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_route_v3_QueryParameterMatcher_string_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_QueryParameterMatcher_set_string_match(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_config_route_v3_QueryParameterMatcher_set_string_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_present_match(envoy_config_route_v3_QueryParameterMatcher *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 24), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.InternalRedirectPolicy */ UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_InternalRedirectPolicy_new(upb_Arena* arena) { - return (envoy_config_route_v3_InternalRedirectPolicy*)_upb_Message_New(&envoy_config_route_v3_InternalRedirectPolicy_msginit, arena); + return (envoy_config_route_v3_InternalRedirectPolicy*)_upb_Message_New(&envoy_config_route_v3_InternalRedirectPolicy_msg_init, arena); } UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_InternalRedirectPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_InternalRedirectPolicy* ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6521,7 +8671,7 @@ UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_I int options, upb_Arena* arena) { envoy_config_route_v3_InternalRedirectPolicy* ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6529,93 +8679,158 @@ UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_I } UPB_INLINE char* envoy_config_route_v3_InternalRedirectPolicy_serialize(const envoy_config_route_v3_InternalRedirectPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_InternalRedirectPolicy_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE uint32_t const* envoy_config_route_v3_InternalRedirectPolicy_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE uint32_t const* envoy_config_route_v3_InternalRedirectPolicy_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy* msg) { + size_t size; + envoy_config_route_v3_InternalRedirectPolicy_redirect_response_codes(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_predicates(envoy_config_route_v3_InternalRedirectPolicy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_InternalRedirectPolicy_predicates(const envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_predicates(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_config_route_v3_InternalRedirectPolicy_predicates(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_predicates(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_InternalRedirectPolicy_predicates(const envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_allow_cross_scheme_redirect(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_allow_cross_scheme_redirect(envoy_config_route_v3_InternalRedirectPolicy* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_allow_cross_scheme_redirect(const envoy_config_route_v3_InternalRedirectPolicy* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_InternalRedirectPolicy_mutable_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_InternalRedirectPolicy_max_internal_redirects(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(msg, sub); } return sub; } -UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_mutable_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_mutable_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_resize_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 2, arena); +UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_resize_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_add_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 2, &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_mutable_predicates(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_mutable_predicates(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_resize_predicates(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_resize_predicates(envoy_config_route_v3_InternalRedirectPolicy* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_InternalRedirectPolicy_add_predicates(envoy_config_route_v3_InternalRedirectPolicy* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_allow_cross_scheme_redirect(envoy_config_route_v3_InternalRedirectPolicy *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.route.v3.FilterConfig */ UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfig_new(upb_Arena* arena) { - return (envoy_config_route_v3_FilterConfig*)_upb_Message_New(&envoy_config_route_v3_FilterConfig_msginit, arena); + return (envoy_config_route_v3_FilterConfig*)_upb_Message_New(&envoy_config_route_v3_FilterConfig_msg_init, arena); } UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_FilterConfig* ret = envoy_config_route_v3_FilterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -6625,7 +8840,7 @@ UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfi int options, upb_Arena* arena) { envoy_config_route_v3_FilterConfig* ret = envoy_config_route_v3_FilterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -6633,63 +8848,80 @@ UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfi } UPB_INLINE char* envoy_config_route_v3_FilterConfig_serialize(const envoy_config_route_v3_FilterConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_config(const envoy_config_route_v3_FilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_config(envoy_config_route_v3_FilterConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_FilterConfig_config(const envoy_config_route_v3_FilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_is_optional(const envoy_config_route_v3_FilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_FilterConfig_has_config(const envoy_config_route_v3_FilterConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_is_optional(envoy_config_route_v3_FilterConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_FilterConfig_is_optional(const envoy_config_route_v3_FilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_disabled(const envoy_config_route_v3_FilterConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_disabled(envoy_config_route_v3_FilterConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_FilterConfig_disabled(const envoy_config_route_v3_FilterConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_route_v3_FilterConfig_set_config(envoy_config_route_v3_FilterConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterConfig_mutable_config(envoy_config_route_v3_FilterConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_FilterConfig_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_FilterConfig_set_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_route_v3_FilterConfig_set_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_FilterConfig_set_is_optional(envoy_config_route_v3_FilterConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_FilterConfig_set_disabled(envoy_config_route_v3_FilterConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_route_v3_route_components_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_route_v3_route_components_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_ */ 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 0daff667317..9d8e4439d60 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/route/v3/scoped_route.upb.h" #include "envoy/config/route/v3/route.upb.h" #include "udpa/annotations/migrate.upb.h" @@ -15,58 +17,77 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_route_v3_ScopedRouteConfiguration_submsgs[2] = { - {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit}, - {.submsg = &envoy_config_route_v3_RouteConfiguration_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_ScopedRouteConfiguration_submsgs[2] = { + {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init}, + {.submsg = &envoy_config_route_v3_RouteConfiguration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_ScopedRouteConfiguration__fields[5] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msginit = { +const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msg_init = { &envoy_config_route_v3_ScopedRouteConfiguration_submsgs[0], &envoy_config_route_v3_ScopedRouteConfiguration__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800000100001a, &upb_psm_1bt_max64b}, + {0x000100003f000020, &upb_psb1_1bt}, + {0x003000000201002a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = { - {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit}, +static const upb_MiniTableSub envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = { + {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init}, }; -static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit = { +const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init = { &envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[0], &envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = { +const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init = { NULL, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[0], - UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_config_route_v3_ScopedRouteConfiguration_msginit, - &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, - &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, + &envoy_config_route_v3_ScopedRouteConfiguration_msg_init, + &envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, + &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, }; -const upb_MiniTable_File envoy_config_route_v3_scoped_route_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_route_v3_scoped_route_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -75,5 +96,5 @@ const upb_MiniTable_File envoy_config_route_v3_scoped_route_proto_upb_file_layou 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 a632f1266ec..0b8bb5c792d 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 @@ -9,40 +9,42 @@ #ifndef ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_ #define ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_route_v3_ScopedRouteConfiguration; -struct envoy_config_route_v3_ScopedRouteConfiguration_Key; -struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment; typedef struct envoy_config_route_v3_ScopedRouteConfiguration envoy_config_route_v3_ScopedRouteConfiguration; typedef struct envoy_config_route_v3_ScopedRouteConfiguration_Key envoy_config_route_v3_ScopedRouteConfiguration_Key; typedef struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment; -extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msginit; -extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit; -extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit; +extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msg_init; +extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init; +extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init; struct envoy_config_route_v3_RouteConfiguration; -extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit; +extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msg_init; /* envoy.config.route.v3.ScopedRouteConfiguration */ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_new(upb_Arena* arena) { - return (envoy_config_route_v3_ScopedRouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena); + return (envoy_config_route_v3_ScopedRouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_msg_init, arena); } UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_ScopedRouteConfiguration* ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -52,7 +54,7 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration* envoy_config_route_v3 int options, upb_Arena* arena) { envoy_config_route_v3_ScopedRouteConfiguration* ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -60,84 +62,112 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration* envoy_config_route_v3 } UPB_INLINE char* envoy_config_route_v3_ScopedRouteConfiguration_serialize(const envoy_config_route_v3_ScopedRouteConfiguration* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msg_init, 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); +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_name(envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_ScopedRouteConfiguration_name(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_route_configuration_name(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_route_configuration_name(envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_ScopedRouteConfiguration_route_configuration_name(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_key(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_key(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_key(envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_key(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_ScopedRouteConfiguration_Key*); + const envoy_config_route_v3_ScopedRouteConfiguration_Key* default_val = NULL; + const envoy_config_route_v3_ScopedRouteConfiguration_Key* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_on_demand(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_key(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_on_demand(envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_on_demand(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_route_configuration(envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_route_v3_RouteConfiguration*); + const struct envoy_config_route_v3_RouteConfiguration* default_val = NULL; + const struct envoy_config_route_v3_RouteConfiguration* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_key(envoy_config_route_v3_ScopedRouteConfiguration *msg, envoy_config_route_v3_ScopedRouteConfiguration_Key* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_ScopedRouteConfiguration_Key*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_mutable_key(envoy_config_route_v3_ScopedRouteConfiguration* msg, upb_Arena* arena) { struct envoy_config_route_v3_ScopedRouteConfiguration_Key* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)envoy_config_route_v3_ScopedRouteConfiguration_key(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_ScopedRouteConfiguration_set_key(msg, sub); + sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, arena); + if (sub) envoy_config_route_v3_ScopedRouteConfiguration_set_key(msg, sub); } return sub; } UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_on_demand(envoy_config_route_v3_ScopedRouteConfiguration *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration(envoy_config_route_v3_ScopedRouteConfiguration *msg, struct envoy_config_route_v3_RouteConfiguration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_route_v3_RouteConfiguration*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_mutable_route_configuration(envoy_config_route_v3_ScopedRouteConfiguration* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteConfiguration* sub = (struct envoy_config_route_v3_RouteConfiguration*)envoy_config_route_v3_ScopedRouteConfiguration_route_configuration(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msginit, arena); - if (!sub) return NULL; - envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration(msg, sub); + sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msg_init, arena); + if (sub) envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration(msg, sub); } return sub; } @@ -145,12 +175,12 @@ UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_config_route_v /* envoy.config.route.v3.ScopedRouteConfiguration.Key */ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_Key_new(upb_Arena* arena) { - return (envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena); + return (envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, arena); } UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_Key_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_ScopedRouteConfiguration_Key* ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -160,7 +190,7 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_rout int options, upb_Arena* arena) { envoy_config_route_v3_ScopedRouteConfiguration_Key* ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -168,47 +198,72 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_rout } UPB_INLINE char* envoy_config_route_v3_ScopedRouteConfiguration_Key_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_clear_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const* envoy_config_route_v3_ScopedRouteConfiguration_Key_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_has_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_clear_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const* envoy_config_route_v3_ScopedRouteConfiguration_Key_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, size_t* len) { - return (const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_route_v3_ScopedRouteConfiguration_Key_fragments(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_mutable_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, size_t* len) { - return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_mutable_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_resize_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, size_t len, upb_Arena* arena) { - return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_resize_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_config_route_v3_ScopedRouteConfiguration_Key_add_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, upb_Arena* arena) { - struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment */ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(upb_Arena* arena) { - return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena); + return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, arena); } UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -218,7 +273,7 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_co int options, upb_Arena* arena) { envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -226,13 +281,13 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_co } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -240,28 +295,36 @@ typedef enum { envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_NOT_SET = 0 } envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases; UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_case(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { - return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_has_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_clear_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_NOT_SET); +UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_clear_string_key(envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_has_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_set_string_key(envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_route_v3_scoped_route_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_route_v3_scoped_route_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_ */ 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 67b0785e38c..0c6ee7132d5 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/tap/v3/common.upb.h" #include "envoy/config/common/matcher/v3/matcher.upb.h" #include "envoy/config/core/v3/base.upb.h" @@ -20,215 +22,300 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_tap_v3_TapConfig_submsgs[4] = { - {.submsg = &envoy_config_tap_v3_MatchPredicate_msginit}, - {.submsg = &envoy_config_tap_v3_OutputConfig_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit}, - {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_TapConfig_submsgs[4] = { + {.submsg = &envoy_config_tap_v3_MatchPredicate_msg_init}, + {.submsg = &envoy_config_tap_v3_OutputConfig_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msg_init}, + {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_TapConfig__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_TapConfig__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_TapConfig_msginit = { +const upb_MiniTable envoy_config_tap_v3_TapConfig_msg_init = { &envoy_config_tap_v3_TapConfig_submsgs[0], &envoy_config_tap_v3_TapConfig__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_MatchPredicate_submsgs[9] = { - {.submsg = &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit}, - {.submsg = &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit}, - {.submsg = &envoy_config_tap_v3_MatchPredicate_msginit}, - {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit}, - {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_msginit}, - {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_MatchPredicate_submsgs[9] = { + {.submsg = &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init}, + {.submsg = &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init}, + {.submsg = &envoy_config_tap_v3_MatchPredicate_msg_init}, + {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msg_init}, + {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init}, + {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_MatchPredicate__fields[10] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_MatchPredicate__fields[10] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_MatchPredicate_msginit = { +const upb_MiniTable envoy_config_tap_v3_MatchPredicate_msg_init = { &envoy_config_tap_v3_MatchPredicate_submsgs[0], &envoy_config_tap_v3_MatchPredicate__fields[0], - UPB_SIZE(8, 16), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(8, 16), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004000020, &upb_pob1_1bt}, + {0x000800000503002a, &upb_pom_1bt_max64b}, + {0x0008000006040032, &upb_pom_1bt_max64b}, + {0x000800000705003a, &upb_pom_1bt_max64b}, + {0x0008000008060042, &upb_pom_1bt_max64b}, + {0x000800000907004a, &upb_pom_1bt_max64b}, + {0x000800000a080052, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_MatchPredicate_MatchSet_submsgs[1] = { - {.submsg = &envoy_config_tap_v3_MatchPredicate_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_MatchPredicate_MatchSet_submsgs[1] = { + {.submsg = &envoy_config_tap_v3_MatchPredicate_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_MatchPredicate_MatchSet__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_MatchPredicate_MatchSet__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_MatchPredicate_MatchSet_msginit = { +const upb_MiniTable envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init = { &envoy_config_tap_v3_MatchPredicate_MatchSet_submsgs[0], &envoy_config_tap_v3_MatchPredicate_MatchSet__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_HttpHeadersMatch_submsgs[1] = { - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_HttpHeadersMatch_submsgs[1] = { + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_HttpHeadersMatch__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_HttpHeadersMatch__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_HttpHeadersMatch_msginit = { +const upb_MiniTable envoy_config_tap_v3_HttpHeadersMatch_msg_init = { &envoy_config_tap_v3_HttpHeadersMatch_submsgs[0], &envoy_config_tap_v3_HttpHeadersMatch__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_HttpGenericBodyMatch_submsgs[1] = { - {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_HttpGenericBodyMatch_submsgs[1] = { + {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_HttpGenericBodyMatch__fields[2] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_msginit = { +const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_msg_init = { &envoy_config_tap_v3_HttpGenericBodyMatch_submsgs[0], &envoy_config_tap_v3_HttpGenericBodyMatch__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit = { +const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init = { NULL, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pob_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_OutputConfig_submsgs[3] = { - {.submsg = &envoy_config_tap_v3_OutputSink_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_OutputConfig_submsgs[3] = { + {.submsg = &envoy_config_tap_v3_OutputSink_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_OutputConfig__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_OutputConfig__fields[4] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_OutputConfig_msginit = { +const upb_MiniTable envoy_config_tap_v3_OutputConfig_msg_init = { &envoy_config_tap_v3_OutputConfig_submsgs[0], &envoy_config_tap_v3_OutputConfig__fields[0], - UPB_SIZE(16, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x001800000202001a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_OutputSink_submsgs[4] = { - {.submsg = &envoy_config_tap_v3_StreamingAdminSink_msginit}, - {.submsg = &envoy_config_tap_v3_FilePerTapSink_msginit}, - {.submsg = &envoy_config_tap_v3_StreamingGrpcSink_msginit}, - {.submsg = &envoy_config_tap_v3_BufferedAdminSink_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_OutputSink_submsgs[4] = { + {.submsg = &envoy_config_tap_v3_StreamingAdminSink_msg_init}, + {.submsg = &envoy_config_tap_v3_FilePerTapSink_msg_init}, + {.submsg = &envoy_config_tap_v3_StreamingGrpcSink_msg_init}, + {.submsg = &envoy_config_tap_v3_BufferedAdminSink_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_OutputSink__fields[5] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_OutputSink__fields[5] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_OutputSink_msginit = { +const upb_MiniTable envoy_config_tap_v3_OutputSink_msg_init = { &envoy_config_tap_v3_OutputSink_submsgs[0], &envoy_config_tap_v3_OutputSink__fields[0], - UPB_SIZE(16, 16), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + 16, 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x0008000402000012, &upb_pom_1bt_max64b}, + {0x000800040301001a, &upb_pom_1bt_max64b}, + {0x0008000404020022, &upb_pom_1bt_max64b}, + {0x000800040503002a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_config_tap_v3_StreamingAdminSink_msginit = { +const upb_MiniTable envoy_config_tap_v3_StreamingAdminSink_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_config_tap_v3_BufferedAdminSink_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_BufferedAdminSink_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_BufferedAdminSink__fields[2] = { - {1, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_BufferedAdminSink__fields[2] = { + {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_BufferedAdminSink_msginit = { +const upb_MiniTable envoy_config_tap_v3_BufferedAdminSink_msg_init = { &envoy_config_tap_v3_BufferedAdminSink_submsgs[0], &envoy_config_tap_v3_BufferedAdminSink__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x0010000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_config_tap_v3_FilePerTapSink__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_FilePerTapSink__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_FilePerTapSink_msginit = { +const upb_MiniTable envoy_config_tap_v3_FilePerTapSink_msg_init = { NULL, &envoy_config_tap_v3_FilePerTapSink__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_config_tap_v3_StreamingGrpcSink_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, +static const upb_MiniTableSub envoy_config_tap_v3_StreamingGrpcSink_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, }; -static const upb_MiniTable_Field envoy_config_tap_v3_StreamingGrpcSink__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_tap_v3_StreamingGrpcSink__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_tap_v3_StreamingGrpcSink_msginit = { +const upb_MiniTable envoy_config_tap_v3_StreamingGrpcSink_msg_init = { &envoy_config_tap_v3_StreamingGrpcSink_submsgs[0], &envoy_config_tap_v3_StreamingGrpcSink__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[12] = { - &envoy_config_tap_v3_TapConfig_msginit, - &envoy_config_tap_v3_MatchPredicate_msginit, - &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, - &envoy_config_tap_v3_HttpHeadersMatch_msginit, - &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, - &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, - &envoy_config_tap_v3_OutputConfig_msginit, - &envoy_config_tap_v3_OutputSink_msginit, - &envoy_config_tap_v3_StreamingAdminSink_msginit, - &envoy_config_tap_v3_BufferedAdminSink_msginit, - &envoy_config_tap_v3_FilePerTapSink_msginit, - &envoy_config_tap_v3_StreamingGrpcSink_msginit, + &envoy_config_tap_v3_TapConfig_msg_init, + &envoy_config_tap_v3_MatchPredicate_msg_init, + &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, + &envoy_config_tap_v3_HttpHeadersMatch_msg_init, + &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, + &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, + &envoy_config_tap_v3_OutputConfig_msg_init, + &envoy_config_tap_v3_OutputSink_msg_init, + &envoy_config_tap_v3_StreamingAdminSink_msg_init, + &envoy_config_tap_v3_BufferedAdminSink_msg_init, + &envoy_config_tap_v3_FilePerTapSink_msg_init, + &envoy_config_tap_v3_StreamingGrpcSink_msg_init, }; -const upb_MiniTable_File envoy_config_tap_v3_common_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_tap_v3_common_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -237,5 +324,5 @@ const upb_MiniTable_File envoy_config_tap_v3_common_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 ff73825a990..9ceefc40c43 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 @@ -9,29 +9,22 @@ #ifndef ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPB_H_ #define ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_tap_v3_TapConfig; -struct envoy_config_tap_v3_MatchPredicate; -struct envoy_config_tap_v3_MatchPredicate_MatchSet; -struct envoy_config_tap_v3_HttpHeadersMatch; -struct envoy_config_tap_v3_HttpGenericBodyMatch; -struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch; -struct envoy_config_tap_v3_OutputConfig; -struct envoy_config_tap_v3_OutputSink; -struct envoy_config_tap_v3_StreamingAdminSink; -struct envoy_config_tap_v3_BufferedAdminSink; -struct envoy_config_tap_v3_FilePerTapSink; -struct envoy_config_tap_v3_StreamingGrpcSink; typedef struct envoy_config_tap_v3_TapConfig envoy_config_tap_v3_TapConfig; typedef struct envoy_config_tap_v3_MatchPredicate envoy_config_tap_v3_MatchPredicate; typedef struct envoy_config_tap_v3_MatchPredicate_MatchSet envoy_config_tap_v3_MatchPredicate_MatchSet; @@ -44,30 +37,30 @@ typedef struct envoy_config_tap_v3_StreamingAdminSink envoy_config_tap_v3_Stream typedef struct envoy_config_tap_v3_BufferedAdminSink envoy_config_tap_v3_BufferedAdminSink; typedef struct envoy_config_tap_v3_FilePerTapSink envoy_config_tap_v3_FilePerTapSink; typedef struct envoy_config_tap_v3_StreamingGrpcSink envoy_config_tap_v3_StreamingGrpcSink; -extern const upb_MiniTable envoy_config_tap_v3_TapConfig_msginit; -extern const upb_MiniTable envoy_config_tap_v3_MatchPredicate_msginit; -extern const upb_MiniTable envoy_config_tap_v3_MatchPredicate_MatchSet_msginit; -extern const upb_MiniTable envoy_config_tap_v3_HttpHeadersMatch_msginit; -extern const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_msginit; -extern const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit; -extern const upb_MiniTable envoy_config_tap_v3_OutputConfig_msginit; -extern const upb_MiniTable envoy_config_tap_v3_OutputSink_msginit; -extern const upb_MiniTable envoy_config_tap_v3_StreamingAdminSink_msginit; -extern const upb_MiniTable envoy_config_tap_v3_BufferedAdminSink_msginit; -extern const upb_MiniTable envoy_config_tap_v3_FilePerTapSink_msginit; -extern const upb_MiniTable envoy_config_tap_v3_StreamingGrpcSink_msginit; +extern const upb_MiniTable envoy_config_tap_v3_TapConfig_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_MatchPredicate_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_HttpHeadersMatch_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_OutputConfig_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_OutputSink_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_StreamingAdminSink_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_BufferedAdminSink_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_FilePerTapSink_msg_init; +extern const upb_MiniTable envoy_config_tap_v3_StreamingGrpcSink_msg_init; struct envoy_config_common_matcher_v3_MatchPredicate; struct envoy_config_core_v3_GrpcService; struct envoy_config_core_v3_RuntimeFractionalPercent; struct envoy_config_route_v3_HeaderMatcher; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msginit; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; -extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit; -extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msg_init; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; +extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msg_init; +extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_config_tap_v3_OutputSink_JSON_BODY_AS_BYTES = 0, @@ -82,12 +75,12 @@ typedef enum { /* envoy.config.tap.v3.TapConfig */ UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_new(upb_Arena* arena) { - return (envoy_config_tap_v3_TapConfig*)_upb_Message_New(&envoy_config_tap_v3_TapConfig_msginit, arena); + return (envoy_config_tap_v3_TapConfig*)_upb_Message_New(&envoy_config_tap_v3_TapConfig_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_TapConfig* ret = envoy_config_tap_v3_TapConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_TapConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_TapConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -97,7 +90,7 @@ UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_parse_ex int options, upb_Arena* arena) { envoy_config_tap_v3_TapConfig* ret = envoy_config_tap_v3_TapConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_TapConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_TapConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -105,101 +98,121 @@ UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_parse_ex } UPB_INLINE char* envoy_config_tap_v3_TapConfig_serialize(const envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_match_config(const envoy_config_tap_v3_TapConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_match_config(envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_match_config(const envoy_config_tap_v3_TapConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_tap_v3_MatchPredicate*); + const envoy_config_tap_v3_MatchPredicate* default_val = NULL; + const envoy_config_tap_v3_MatchPredicate* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_output_config(const envoy_config_tap_v3_TapConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_match_config(const envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_output_config(const envoy_config_tap_v3_TapConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_output_config(envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_TapConfig_output_config(const envoy_config_tap_v3_TapConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_tap_v3_OutputConfig*); + const envoy_config_tap_v3_OutputConfig* default_val = NULL; + const envoy_config_tap_v3_OutputConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_output_config(const envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_tap_enabled(envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_tap_v3_TapConfig_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_RuntimeFractionalPercent*); + const struct envoy_config_core_v3_RuntimeFractionalPercent* default_val = NULL; + const struct envoy_config_core_v3_RuntimeFractionalPercent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_match(const envoy_config_tap_v3_TapConfig* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_match(const envoy_config_tap_v3_TapConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_match(envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_match(const envoy_config_tap_v3_TapConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_common_matcher_v3_MatchPredicate*); + const struct envoy_config_common_matcher_v3_MatchPredicate* default_val = NULL; + const struct envoy_config_common_matcher_v3_MatchPredicate* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_match(const envoy_config_tap_v3_TapConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_tap_v3_TapConfig_set_match_config(envoy_config_tap_v3_TapConfig *msg, envoy_config_tap_v3_MatchPredicate* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_tap_v3_MatchPredicate*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_mutable_match_config(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) { struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)envoy_config_tap_v3_TapConfig_match_config(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_TapConfig_set_match_config(msg, sub); + sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msg_init, arena); + if (sub) envoy_config_tap_v3_TapConfig_set_match_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_TapConfig_set_output_config(envoy_config_tap_v3_TapConfig *msg, envoy_config_tap_v3_OutputConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_tap_v3_OutputConfig*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_TapConfig_mutable_output_config(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) { struct envoy_config_tap_v3_OutputConfig* sub = (struct envoy_config_tap_v3_OutputConfig*)envoy_config_tap_v3_TapConfig_output_config(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_OutputConfig*)_upb_Message_New(&envoy_config_tap_v3_OutputConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_TapConfig_set_output_config(msg, sub); + sub = (struct envoy_config_tap_v3_OutputConfig*)_upb_Message_New(&envoy_config_tap_v3_OutputConfig_msg_init, arena); + if (sub) envoy_config_tap_v3_TapConfig_set_output_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_TapConfig_set_tap_enabled(envoy_config_tap_v3_TapConfig *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_tap_v3_TapConfig_mutable_tap_enabled(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_tap_v3_TapConfig_tap_enabled(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_TapConfig_set_tap_enabled(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msg_init, arena); + if (sub) envoy_config_tap_v3_TapConfig_set_tap_enabled(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_TapConfig_set_match(envoy_config_tap_v3_TapConfig *msg, struct envoy_config_common_matcher_v3_MatchPredicate* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_common_matcher_v3_MatchPredicate*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_mutable_match(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) { struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)envoy_config_tap_v3_TapConfig_match(msg); if (sub == NULL) { - sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_TapConfig_set_match(msg, sub); + sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msg_init, arena); + if (sub) envoy_config_tap_v3_TapConfig_set_match(msg, sub); } return sub; } @@ -207,12 +220,12 @@ UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_ta /* envoy.config.tap.v3.MatchPredicate */ UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_new(upb_Arena* arena) { - return (envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena); + return (envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_MatchPredicate* ret = envoy_config_tap_v3_MatchPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -222,7 +235,7 @@ UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicat int options, upb_Arena* arena) { envoy_config_tap_v3_MatchPredicate* ret = envoy_config_tap_v3_MatchPredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -230,13 +243,13 @@ UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicat } UPB_INLINE char* envoy_config_tap_v3_MatchPredicate_serialize(const envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -253,207 +266,269 @@ typedef enum { envoy_config_tap_v3_MatchPredicate_rule_NOT_SET = 0 } envoy_config_tap_v3_MatchPredicate_rule_oneofcases; UPB_INLINE envoy_config_tap_v3_MatchPredicate_rule_oneofcases envoy_config_tap_v3_MatchPredicate_rule_case(const envoy_config_tap_v3_MatchPredicate* msg) { - return (envoy_config_tap_v3_MatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_tap_v3_MatchPredicate_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_or_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_or_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_or_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_or_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_config_tap_v3_MatchPredicate_MatchSet* default_val = NULL; + const envoy_config_tap_v3_MatchPredicate_MatchSet* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_and_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_or_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_and_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_and_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_and_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_config_tap_v3_MatchPredicate_MatchSet* default_val = NULL; + const envoy_config_tap_v3_MatchPredicate_MatchSet* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_not_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_and_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_not_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_not_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_not_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_MatchPredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_config_tap_v3_MatchPredicate* default_val = NULL; + const envoy_config_tap_v3_MatchPredicate* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_any_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_not_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_any_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_any_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_any_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_any_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_headers_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const envoy_config_tap_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_tap_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_trailers_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const envoy_config_tap_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_tap_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_headers_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const envoy_config_tap_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_tap_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_trailers_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const envoy_config_tap_v3_HttpHeadersMatch* default_val = NULL; + const envoy_config_tap_v3_HttpHeadersMatch* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_generic_body_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const envoy_config_tap_v3_HttpGenericBodyMatch* default_val = NULL; + const envoy_config_tap_v3_HttpGenericBodyMatch* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_generic_body_match(envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL); + const envoy_config_tap_v3_HttpGenericBodyMatch* default_val = NULL; + const envoy_config_tap_v3_HttpGenericBodyMatch* ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_or_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_MatchPredicate_MatchSet* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_mutable_or_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)envoy_config_tap_v3_MatchPredicate_or_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_or_match(msg, sub); + sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_or_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_and_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_MatchPredicate_MatchSet* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_mutable_and_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)envoy_config_tap_v3_MatchPredicate_and_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_and_match(msg, sub); + sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_and_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_not_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_MatchPredicate* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_mutable_not_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)envoy_config_tap_v3_MatchPredicate_not_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_not_match(msg, sub); + sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_not_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_any_match(envoy_config_tap_v3_MatchPredicate *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_request_headers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_request_headers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_request_headers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_http_request_headers_match(msg, sub); + sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_http_request_headers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_request_trailers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_request_trailers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_request_trailers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_http_request_trailers_match(msg, sub); + sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_http_request_trailers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_response_headers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_response_headers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_response_headers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_http_response_headers_match(msg, sub); + sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_http_response_headers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_response_trailers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_response_trailers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_response_trailers_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_http_response_trailers_match(msg, sub); + sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_http_response_trailers_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_request_generic_body_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpGenericBodyMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_request_generic_body_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_HttpGenericBodyMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)envoy_config_tap_v3_MatchPredicate_http_request_generic_body_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_http_request_generic_body_match(msg, sub); + sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_http_request_generic_body_match(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_response_generic_body_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpGenericBodyMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_response_generic_body_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) { struct envoy_config_tap_v3_HttpGenericBodyMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)envoy_config_tap_v3_MatchPredicate_http_response_generic_body_match(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_MatchPredicate_set_http_response_generic_body_match(msg, sub); + sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, arena); + if (sub) envoy_config_tap_v3_MatchPredicate_set_http_response_generic_body_match(msg, sub); } return sub; } @@ -461,12 +536,12 @@ UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_ /* envoy.config.tap.v3.MatchPredicate.MatchSet */ UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_MatchSet_new(upb_Arena* arena) { - return (envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, arena); + return (envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_MatchSet_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_MatchPredicate_MatchSet* ret = envoy_config_tap_v3_MatchPredicate_MatchSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -476,7 +551,7 @@ UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_Matc int options, upb_Arena* arena) { envoy_config_tap_v3_MatchPredicate_MatchSet* ret = envoy_config_tap_v3_MatchPredicate_MatchSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -484,47 +559,72 @@ UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_Matc } UPB_INLINE char* envoy_config_tap_v3_MatchPredicate_MatchSet_serialize(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_tap_v3_MatchPredicate_MatchSet_clear_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_tap_v3_MatchPredicate* const* envoy_config_tap_v3_MatchPredicate_MatchSet_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_tap_v3_MatchPredicate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_MatchSet_has_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_tap_v3_MatchPredicate_MatchSet_clear_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_config_tap_v3_MatchPredicate* const* envoy_config_tap_v3_MatchPredicate_MatchSet_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t* len) { - return (const envoy_config_tap_v3_MatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_tap_v3_MatchPredicate_MatchSet_rules(msg, &size); + return size != 0; } -UPB_INLINE envoy_config_tap_v3_MatchPredicate** envoy_config_tap_v3_MatchPredicate_MatchSet_mutable_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t* len) { - return (envoy_config_tap_v3_MatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_config_tap_v3_MatchPredicate** envoy_config_tap_v3_MatchPredicate_MatchSet_mutable_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_tap_v3_MatchPredicate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_tap_v3_MatchPredicate** envoy_config_tap_v3_MatchPredicate_MatchSet_resize_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t len, upb_Arena* arena) { - return (envoy_config_tap_v3_MatchPredicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_tap_v3_MatchPredicate** envoy_config_tap_v3_MatchPredicate_MatchSet_resize_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_tap_v3_MatchPredicate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_MatchSet_add_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena) { - struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.tap.v3.HttpHeadersMatch */ UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeadersMatch_new(upb_Arena* arena) { - return (envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena); + return (envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeadersMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_HttpHeadersMatch* ret = envoy_config_tap_v3_HttpHeadersMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpHeadersMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpHeadersMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -534,7 +634,7 @@ UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeaders int options, upb_Arena* arena) { envoy_config_tap_v3_HttpHeadersMatch* ret = envoy_config_tap_v3_HttpHeadersMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpHeadersMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpHeadersMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -542,47 +642,72 @@ UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeaders } UPB_INLINE char* envoy_config_tap_v3_HttpHeadersMatch_serialize(const envoy_config_tap_v3_HttpHeadersMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_tap_v3_HttpHeadersMatch_clear_headers(envoy_config_tap_v3_HttpHeadersMatch* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_config_tap_v3_HttpHeadersMatch_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_config_tap_v3_HttpHeadersMatch_has_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_config_tap_v3_HttpHeadersMatch_clear_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_config_tap_v3_HttpHeadersMatch_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg, size_t* len) { - return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_config_tap_v3_HttpHeadersMatch_headers(msg, &size); + return size != 0; } -UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_tap_v3_HttpHeadersMatch_mutable_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, size_t* len) { - return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_tap_v3_HttpHeadersMatch_mutable_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_tap_v3_HttpHeadersMatch_resize_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_tap_v3_HttpHeadersMatch_resize_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_tap_v3_HttpHeadersMatch_add_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.tap.v3.HttpGenericBodyMatch */ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGenericBodyMatch_new(upb_Arena* arena) { - return (envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msginit, arena); + return (envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGenericBodyMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_HttpGenericBodyMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -592,7 +717,7 @@ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGen int options, upb_Arena* arena) { envoy_config_tap_v3_HttpGenericBodyMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -600,56 +725,87 @@ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGen } UPB_INLINE char* envoy_config_tap_v3_HttpGenericBodyMatch_serialize(const envoy_config_tap_v3_HttpGenericBodyMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msg_init, 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; +UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_clear_bytes_limit(envoy_config_tap_v3_HttpGenericBodyMatch* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_config_tap_v3_HttpGenericBodyMatch_bytes_limit(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_clear_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* const* envoy_config_tap_v3_HttpGenericBodyMatch_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_has_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_clear_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* const* envoy_config_tap_v3_HttpGenericBodyMatch_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t* len) { - return (const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_config_tap_v3_HttpGenericBodyMatch_patterns(msg, &size); + return size != 0; } UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_set_bytes_limit(envoy_config_tap_v3_HttpGenericBodyMatch *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_tap_v3_HttpGenericBodyMatch_mutable_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t* len) { - return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_tap_v3_HttpGenericBodyMatch_mutable_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_tap_v3_HttpGenericBodyMatch_resize_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t len, upb_Arena* arena) { - return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_tap_v3_HttpGenericBodyMatch_resize_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_add_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, upb_Arena* arena) { - struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.config.tap.v3.HttpGenericBodyMatch.GenericTextMatch */ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_new(upb_Arena* arena) { - return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena); + return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -659,7 +815,7 @@ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_conf int options, upb_Arena* arena) { envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -667,13 +823,13 @@ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_conf } UPB_INLINE char* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_serialize(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -682,43 +838,58 @@ typedef enum { envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET = 0 } envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases; UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_case(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_has_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_clear_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_clear_string_match(envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_has_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_has_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_clear_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_clear_binary_match(envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_has_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_set_string_match(envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_set_binary_match(envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.tap.v3.OutputConfig */ UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_new(upb_Arena* arena) { - return (envoy_config_tap_v3_OutputConfig*)_upb_Message_New(&envoy_config_tap_v3_OutputConfig_msginit, arena); + return (envoy_config_tap_v3_OutputConfig*)_upb_Message_New(&envoy_config_tap_v3_OutputConfig_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_OutputConfig* ret = envoy_config_tap_v3_OutputConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -728,7 +899,7 @@ UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_pa int options, upb_Arena* arena) { envoy_config_tap_v3_OutputConfig* ret = envoy_config_tap_v3_OutputConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -736,100 +907,141 @@ UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_pa } UPB_INLINE char* envoy_config_tap_v3_OutputConfig_serialize(const envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_sinks(envoy_config_tap_v3_OutputConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_config_tap_v3_OutputSink* const* envoy_config_tap_v3_OutputConfig_sinks(const envoy_config_tap_v3_OutputConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_config_tap_v3_OutputSink* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_config_tap_v3_OutputConfig_sinks(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_sinks(const envoy_config_tap_v3_OutputConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_config_tap_v3_OutputSink* const* envoy_config_tap_v3_OutputConfig_sinks(const envoy_config_tap_v3_OutputConfig* msg, size_t* len) { - return (const envoy_config_tap_v3_OutputSink* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_max_buffered_rx_bytes(envoy_config_tap_v3_OutputConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_max_buffered_tx_bytes(envoy_config_tap_v3_OutputConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_streaming(const envoy_config_tap_v3_OutputConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_streaming(envoy_config_tap_v3_OutputConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_tap_v3_OutputConfig_streaming(const envoy_config_tap_v3_OutputConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE envoy_config_tap_v3_OutputSink** envoy_config_tap_v3_OutputConfig_mutable_sinks(envoy_config_tap_v3_OutputConfig* msg, size_t* len) { - return (envoy_config_tap_v3_OutputSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_config_tap_v3_OutputSink** envoy_config_tap_v3_OutputConfig_mutable_sinks(envoy_config_tap_v3_OutputConfig* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_config_tap_v3_OutputSink**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_config_tap_v3_OutputSink** envoy_config_tap_v3_OutputConfig_resize_sinks(envoy_config_tap_v3_OutputConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_config_tap_v3_OutputSink**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_config_tap_v3_OutputSink** envoy_config_tap_v3_OutputConfig_resize_sinks(envoy_config_tap_v3_OutputConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_tap_v3_OutputSink**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputConfig_add_sinks(envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena) { - struct envoy_config_tap_v3_OutputSink* sub = (struct envoy_config_tap_v3_OutputSink*)_upb_Message_New(&envoy_config_tap_v3_OutputSink_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_tap_v3_OutputSink* sub = (struct envoy_config_tap_v3_OutputSink*)_upb_Message_New(&envoy_config_tap_v3_OutputSink_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_config_tap_v3_OutputConfig_set_max_buffered_rx_bytes(envoy_config_tap_v3_OutputConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_mutable_max_buffered_rx_bytes(envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_tap_v3_OutputConfig_max_buffered_rx_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_OutputConfig_set_max_buffered_rx_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_tap_v3_OutputConfig_set_max_buffered_rx_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_OutputConfig_set_max_buffered_tx_bytes(envoy_config_tap_v3_OutputConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_mutable_max_buffered_tx_bytes(envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_tap_v3_OutputConfig_max_buffered_tx_bytes(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_OutputConfig_set_max_buffered_tx_bytes(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_tap_v3_OutputConfig_set_max_buffered_tx_bytes(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_OutputConfig_set_streaming(envoy_config_tap_v3_OutputConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.tap.v3.OutputSink */ UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_new(upb_Arena* arena) { - return (envoy_config_tap_v3_OutputSink*)_upb_Message_New(&envoy_config_tap_v3_OutputSink_msginit, arena); + return (envoy_config_tap_v3_OutputSink*)_upb_Message_New(&envoy_config_tap_v3_OutputSink_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_OutputSink* ret = envoy_config_tap_v3_OutputSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -839,7 +1051,7 @@ UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_parse_ int options, upb_Arena* arena) { envoy_config_tap_v3_OutputSink* ret = envoy_config_tap_v3_OutputSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -847,13 +1059,13 @@ UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_parse_ } UPB_INLINE char* envoy_config_tap_v3_OutputSink_serialize(const envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -864,99 +1076,130 @@ typedef enum { envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET = 0 } envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases; UPB_INLINE envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases envoy_config_tap_v3_OutputSink_output_sink_type_case(const envoy_config_tap_v3_OutputSink* msg) { - return (envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_format(const envoy_config_tap_v3_OutputSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_format(envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_tap_v3_OutputSink_format(const envoy_config_tap_v3_OutputSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; -} -UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingAdminSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_streaming_admin(envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_OutputSink_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_StreamingAdminSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, NULL); + const envoy_config_tap_v3_StreamingAdminSink* default_val = NULL; + const envoy_config_tap_v3_StreamingAdminSink* ret; + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_FilePerTapSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_file_per_tap(envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_OutputSink_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_FilePerTapSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, NULL); + const envoy_config_tap_v3_FilePerTapSink* default_val = NULL; + const envoy_config_tap_v3_FilePerTapSink* ret; + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingGrpcSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_streaming_grpc(envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {4, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_OutputSink_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_StreamingGrpcSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 4, NULL); + const envoy_config_tap_v3_StreamingGrpcSink* default_val = NULL; + const envoy_config_tap_v3_StreamingGrpcSink* ret; + const upb_MiniTableField field = {4, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_buffered_admin(const envoy_config_tap_v3_OutputSink* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {4, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_buffered_admin(const envoy_config_tap_v3_OutputSink* msg) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_BufferedAdminSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET); +UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_buffered_admin(envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_OutputSink_buffered_admin(const envoy_config_tap_v3_OutputSink* msg) { - return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_BufferedAdminSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL); + const envoy_config_tap_v3_BufferedAdminSink* default_val = NULL; + const envoy_config_tap_v3_BufferedAdminSink* ret; + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_buffered_admin(const envoy_config_tap_v3_OutputSink* msg) { + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_tap_v3_OutputSink_set_format(envoy_config_tap_v3_OutputSink *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_tap_v3_OutputSink_set_streaming_admin(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_StreamingAdminSink* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingAdminSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_OutputSink_mutable_streaming_admin(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) { struct envoy_config_tap_v3_StreamingAdminSink* sub = (struct envoy_config_tap_v3_StreamingAdminSink*)envoy_config_tap_v3_OutputSink_streaming_admin(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_StreamingAdminSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingAdminSink_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_OutputSink_set_streaming_admin(msg, sub); + sub = (struct envoy_config_tap_v3_StreamingAdminSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingAdminSink_msg_init, arena); + if (sub) envoy_config_tap_v3_OutputSink_set_streaming_admin(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_OutputSink_set_file_per_tap(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_FilePerTapSink* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_FilePerTapSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, 8, -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_OutputSink_mutable_file_per_tap(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) { struct envoy_config_tap_v3_FilePerTapSink* sub = (struct envoy_config_tap_v3_FilePerTapSink*)envoy_config_tap_v3_OutputSink_file_per_tap(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_FilePerTapSink*)_upb_Message_New(&envoy_config_tap_v3_FilePerTapSink_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_OutputSink_set_file_per_tap(msg, sub); + sub = (struct envoy_config_tap_v3_FilePerTapSink*)_upb_Message_New(&envoy_config_tap_v3_FilePerTapSink_msg_init, arena); + if (sub) envoy_config_tap_v3_OutputSink_set_file_per_tap(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_OutputSink_set_streaming_grpc(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_StreamingGrpcSink* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingGrpcSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, 8, -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_OutputSink_mutable_streaming_grpc(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) { struct envoy_config_tap_v3_StreamingGrpcSink* sub = (struct envoy_config_tap_v3_StreamingGrpcSink*)envoy_config_tap_v3_OutputSink_streaming_grpc(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_StreamingGrpcSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingGrpcSink_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_OutputSink_set_streaming_grpc(msg, sub); + sub = (struct envoy_config_tap_v3_StreamingGrpcSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingGrpcSink_msg_init, arena); + if (sub) envoy_config_tap_v3_OutputSink_set_streaming_grpc(msg, sub); } return sub; } UPB_INLINE void envoy_config_tap_v3_OutputSink_set_buffered_admin(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_BufferedAdminSink* value) { - UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_BufferedAdminSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, 8, -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_OutputSink_mutable_buffered_admin(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) { struct envoy_config_tap_v3_BufferedAdminSink* sub = (struct envoy_config_tap_v3_BufferedAdminSink*)envoy_config_tap_v3_OutputSink_buffered_admin(msg); if (sub == NULL) { - sub = (struct envoy_config_tap_v3_BufferedAdminSink*)_upb_Message_New(&envoy_config_tap_v3_BufferedAdminSink_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_OutputSink_set_buffered_admin(msg, sub); + sub = (struct envoy_config_tap_v3_BufferedAdminSink*)_upb_Message_New(&envoy_config_tap_v3_BufferedAdminSink_msg_init, arena); + if (sub) envoy_config_tap_v3_OutputSink_set_buffered_admin(msg, sub); } return sub; } @@ -964,12 +1207,12 @@ UPB_INLINE struct envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_Out /* envoy.config.tap.v3.StreamingAdminSink */ UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_StreamingAdminSink_new(upb_Arena* arena) { - return (envoy_config_tap_v3_StreamingAdminSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingAdminSink_msginit, arena); + return (envoy_config_tap_v3_StreamingAdminSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingAdminSink_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_StreamingAdminSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_StreamingAdminSink* ret = envoy_config_tap_v3_StreamingAdminSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingAdminSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingAdminSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -979,7 +1222,7 @@ UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_Streaming int options, upb_Arena* arena) { envoy_config_tap_v3_StreamingAdminSink* ret = envoy_config_tap_v3_StreamingAdminSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingAdminSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingAdminSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -987,13 +1230,13 @@ UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_Streaming } UPB_INLINE char* envoy_config_tap_v3_StreamingAdminSink_serialize(const envoy_config_tap_v3_StreamingAdminSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msg_init, options, arena, &ptr, len); return ptr; } @@ -1001,12 +1244,12 @@ UPB_INLINE char* envoy_config_tap_v3_StreamingAdminSink_serialize_ex(const envoy /* envoy.config.tap.v3.BufferedAdminSink */ UPB_INLINE envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_BufferedAdminSink_new(upb_Arena* arena) { - return (envoy_config_tap_v3_BufferedAdminSink*)_upb_Message_New(&envoy_config_tap_v3_BufferedAdminSink_msginit, arena); + return (envoy_config_tap_v3_BufferedAdminSink*)_upb_Message_New(&envoy_config_tap_v3_BufferedAdminSink_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_BufferedAdminSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_BufferedAdminSink* ret = envoy_config_tap_v3_BufferedAdminSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_BufferedAdminSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_BufferedAdminSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1016,7 +1259,7 @@ UPB_INLINE envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_BufferedAd int options, upb_Arena* arena) { envoy_config_tap_v3_BufferedAdminSink* ret = envoy_config_tap_v3_BufferedAdminSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_BufferedAdminSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_BufferedAdminSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1024,44 +1267,55 @@ UPB_INLINE envoy_config_tap_v3_BufferedAdminSink* envoy_config_tap_v3_BufferedAd } UPB_INLINE char* envoy_config_tap_v3_BufferedAdminSink_serialize(const envoy_config_tap_v3_BufferedAdminSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_BufferedAdminSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_BufferedAdminSink_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_tap_v3_BufferedAdminSink_serialize_ex(const envoy_config_tap_v3_BufferedAdminSink* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_BufferedAdminSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_BufferedAdminSink_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_config_tap_v3_BufferedAdminSink_clear_max_traces(const envoy_config_tap_v3_BufferedAdminSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0; +UPB_INLINE void envoy_config_tap_v3_BufferedAdminSink_clear_max_traces(envoy_config_tap_v3_BufferedAdminSink* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_config_tap_v3_BufferedAdminSink_max_traces(const envoy_config_tap_v3_BufferedAdminSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_BufferedAdminSink_has_timeout(const envoy_config_tap_v3_BufferedAdminSink* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_tap_v3_BufferedAdminSink_clear_timeout(const envoy_config_tap_v3_BufferedAdminSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_BufferedAdminSink_clear_timeout(envoy_config_tap_v3_BufferedAdminSink* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_tap_v3_BufferedAdminSink_timeout(const envoy_config_tap_v3_BufferedAdminSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_tap_v3_BufferedAdminSink_has_timeout(const envoy_config_tap_v3_BufferedAdminSink* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_tap_v3_BufferedAdminSink_set_max_traces(envoy_config_tap_v3_BufferedAdminSink *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_tap_v3_BufferedAdminSink_set_timeout(envoy_config_tap_v3_BufferedAdminSink *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_config_tap_v3_BufferedAdminSink_mutable_timeout(envoy_config_tap_v3_BufferedAdminSink* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_tap_v3_BufferedAdminSink_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_BufferedAdminSink_set_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_config_tap_v3_BufferedAdminSink_set_timeout(msg, sub); } return sub; } @@ -1069,12 +1323,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_tap_v3_BufferedAdminSin /* envoy.config.tap.v3.FilePerTapSink */ UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSink_new(upb_Arena* arena) { - return (envoy_config_tap_v3_FilePerTapSink*)_upb_Message_New(&envoy_config_tap_v3_FilePerTapSink_msginit, arena); + return (envoy_config_tap_v3_FilePerTapSink*)_upb_Message_New(&envoy_config_tap_v3_FilePerTapSink_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_FilePerTapSink* ret = envoy_config_tap_v3_FilePerTapSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_FilePerTapSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_FilePerTapSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1084,7 +1338,7 @@ UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSin int options, upb_Arena* arena) { envoy_config_tap_v3_FilePerTapSink* ret = envoy_config_tap_v3_FilePerTapSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_FilePerTapSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_FilePerTapSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1092,35 +1346,41 @@ UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSin } UPB_INLINE char* envoy_config_tap_v3_FilePerTapSink_serialize(const envoy_config_tap_v3_FilePerTapSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msg_init, 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); +UPB_INLINE void envoy_config_tap_v3_FilePerTapSink_clear_path_prefix(envoy_config_tap_v3_FilePerTapSink* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_tap_v3_FilePerTapSink_path_prefix(const envoy_config_tap_v3_FilePerTapSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_tap_v3_FilePerTapSink_set_path_prefix(envoy_config_tap_v3_FilePerTapSink *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.config.tap.v3.StreamingGrpcSink */ UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingGrpcSink_new(upb_Arena* arena) { - return (envoy_config_tap_v3_StreamingGrpcSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingGrpcSink_msginit, arena); + return (envoy_config_tap_v3_StreamingGrpcSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingGrpcSink_msg_init, arena); } UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingGrpcSink_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_tap_v3_StreamingGrpcSink* ret = envoy_config_tap_v3_StreamingGrpcSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingGrpcSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingGrpcSink_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1130,7 +1390,7 @@ UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingG int options, upb_Arena* arena) { envoy_config_tap_v3_StreamingGrpcSink* ret = envoy_config_tap_v3_StreamingGrpcSink_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingGrpcSink_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingGrpcSink_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1138,54 +1398,65 @@ UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingG } UPB_INLINE char* envoy_config_tap_v3_StreamingGrpcSink_serialize(const envoy_config_tap_v3_StreamingGrpcSink* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msg_init, 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); +UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_clear_tap_id(envoy_config_tap_v3_StreamingGrpcSink* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_tap_v3_StreamingGrpcSink_tap_id(const envoy_config_tap_v3_StreamingGrpcSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_tap_v3_StreamingGrpcSink_has_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_clear_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_clear_grpc_service(envoy_config_tap_v3_StreamingGrpcSink* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_tap_v3_StreamingGrpcSink_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_tap_v3_StreamingGrpcSink_has_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_set_tap_id(envoy_config_tap_v3_StreamingGrpcSink *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_set_grpc_service(envoy_config_tap_v3_StreamingGrpcSink *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_tap_v3_StreamingGrpcSink_mutable_grpc_service(envoy_config_tap_v3_StreamingGrpcSink* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_tap_v3_StreamingGrpcSink_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_tap_v3_StreamingGrpcSink_set_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_tap_v3_StreamingGrpcSink_set_grpc_service(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_tap_v3_common_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_tap_v3_common_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPB_H_ */ 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 00e47d46b2c..7f96dd80cf7 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 @@ -7,32 +7,41 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/datadog.upb.h" #include "udpa/annotations/migrate.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_config_trace_v3_DatadogConfig__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_DatadogConfig__fields[3] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_DatadogConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_DatadogConfig_msg_init = { NULL, &envoy_config_trace_v3_DatadogConfig__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_DatadogConfig_msginit, + &envoy_config_trace_v3_DatadogConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_datadog_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_datadog_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -41,5 +50,5 @@ const upb_MiniTable_File envoy_config_trace_v3_datadog_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b7487627756..9a564460fa4 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 @@ -9,32 +9,36 @@ #ifndef ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_DatadogConfig; typedef struct envoy_config_trace_v3_DatadogConfig envoy_config_trace_v3_DatadogConfig; -extern const upb_MiniTable envoy_config_trace_v3_DatadogConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_DatadogConfig_msg_init; /* envoy.config.trace.v3.DatadogConfig */ UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_DatadogConfig*)_upb_Message_New(&envoy_config_trace_v3_DatadogConfig_msginit, arena); + return (envoy_config_trace_v3_DatadogConfig*)_upb_Message_New(&envoy_config_trace_v3_DatadogConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_DatadogConfig* ret = envoy_config_trace_v3_DatadogConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DatadogConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DatadogConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogCon int options, upb_Arena* arena) { envoy_config_trace_v3_DatadogConfig* ret = envoy_config_trace_v3_DatadogConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DatadogConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DatadogConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,50 +56,68 @@ UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogCon } UPB_INLINE char* envoy_config_trace_v3_DatadogConfig_serialize(const envoy_config_trace_v3_DatadogConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msg_init, 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); +UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_collector_cluster(envoy_config_trace_v3_DatadogConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_DatadogConfig_collector_cluster(const envoy_config_trace_v3_DatadogConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_service_name(const envoy_config_trace_v3_DatadogConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_service_name(envoy_config_trace_v3_DatadogConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_DatadogConfig_service_name(const envoy_config_trace_v3_DatadogConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_collector_hostname(const envoy_config_trace_v3_DatadogConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_collector_hostname(envoy_config_trace_v3_DatadogConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_DatadogConfig_collector_hostname(const envoy_config_trace_v3_DatadogConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_trace_v3_DatadogConfig_set_collector_cluster(envoy_config_trace_v3_DatadogConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_DatadogConfig_set_service_name(envoy_config_trace_v3_DatadogConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_DatadogConfig_set_collector_hostname(envoy_config_trace_v3_DatadogConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_trace_v3_datadog_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_datadog_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPB_H_ */ 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 b42bbdcd7ae..5a9573d57cc 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/dynamic_ot.upb.h" #include "google/protobuf/struct.upb.h" #include "udpa/annotations/migrate.upb.h" @@ -15,28 +17,35 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_DynamicOtConfig_submsgs[1] = { - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_DynamicOtConfig_submsgs[1] = { + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_DynamicOtConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_DynamicOtConfig__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_DynamicOtConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_DynamicOtConfig_msg_init = { &envoy_config_trace_v3_DynamicOtConfig_submsgs[0], &envoy_config_trace_v3_DynamicOtConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_DynamicOtConfig_msginit, + &envoy_config_trace_v3_DynamicOtConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -45,5 +54,5 @@ const upb_MiniTable_File envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 9b8745be264..625c37da5df 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_DynamicOtConfig; typedef struct envoy_config_trace_v3_DynamicOtConfig envoy_config_trace_v3_DynamicOtConfig; -extern const upb_MiniTable envoy_config_trace_v3_DynamicOtConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_DynamicOtConfig_msg_init; struct google_protobuf_Struct; -extern const upb_MiniTable google_protobuf_Struct_msginit; +extern const upb_MiniTable google_protobuf_Struct_msg_init; /* envoy.config.trace.v3.DynamicOtConfig */ UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicOtConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_DynamicOtConfig*)_upb_Message_New(&envoy_config_trace_v3_DynamicOtConfig_msginit, arena); + return (envoy_config_trace_v3_DynamicOtConfig*)_upb_Message_New(&envoy_config_trace_v3_DynamicOtConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicOtConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_DynamicOtConfig* ret = envoy_config_trace_v3_DynamicOtConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DynamicOtConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DynamicOtConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicO int options, upb_Arena* arena) { envoy_config_trace_v3_DynamicOtConfig* ret = envoy_config_trace_v3_DynamicOtConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DynamicOtConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DynamicOtConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicO } UPB_INLINE char* envoy_config_trace_v3_DynamicOtConfig_serialize(const envoy_config_trace_v3_DynamicOtConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msg_init, 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); +UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_clear_library(envoy_config_trace_v3_DynamicOtConfig* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_DynamicOtConfig_library(const envoy_config_trace_v3_DynamicOtConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_DynamicOtConfig_has_config(const envoy_config_trace_v3_DynamicOtConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_clear_config(const envoy_config_trace_v3_DynamicOtConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_clear_config(envoy_config_trace_v3_DynamicOtConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_trace_v3_DynamicOtConfig_config(const envoy_config_trace_v3_DynamicOtConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_DynamicOtConfig_has_config(const envoy_config_trace_v3_DynamicOtConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_set_library(envoy_config_trace_v3_DynamicOtConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_set_config(envoy_config_trace_v3_DynamicOtConfig *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_trace_v3_DynamicOtConfig_mutable_config(envoy_config_trace_v3_DynamicOtConfig* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_trace_v3_DynamicOtConfig_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_DynamicOtConfig_set_config(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_trace_v3_DynamicOtConfig_set_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPB_H_ */ 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 e7ac581c245..c5b3ccb63c7 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 @@ -7,50 +7,63 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/http_tracer.upb.h" #include "google/protobuf/any.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_Tracing_submsgs[1] = { - {.submsg = &envoy_config_trace_v3_Tracing_Http_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_Tracing_submsgs[1] = { + {.submsg = &envoy_config_trace_v3_Tracing_Http_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_Tracing__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_Tracing__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_Tracing_msginit = { +const upb_MiniTable envoy_config_trace_v3_Tracing_msg_init = { &envoy_config_trace_v3_Tracing_submsgs[0], &envoy_config_trace_v3_Tracing__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_config_trace_v3_Tracing_Http_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_Tracing_Http_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_Tracing_Http__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_Tracing_Http__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msginit = { +const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msg_init = { &envoy_config_trace_v3_Tracing_Http_submsgs[0], &envoy_config_trace_v3_Tracing_Http__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_trace_v3_Tracing_msginit, - &envoy_config_trace_v3_Tracing_Http_msginit, + &envoy_config_trace_v3_Tracing_msg_init, + &envoy_config_trace_v3_Tracing_Http_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_http_tracer_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_http_tracer_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -59,5 +72,5 @@ const upb_MiniTable_File envoy_config_trace_v3_http_tracer_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 2a3ec508c09..797a486f4e5 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_Tracing; -struct envoy_config_trace_v3_Tracing_Http; typedef struct envoy_config_trace_v3_Tracing envoy_config_trace_v3_Tracing; typedef struct envoy_config_trace_v3_Tracing_Http envoy_config_trace_v3_Tracing_Http; -extern const upb_MiniTable envoy_config_trace_v3_Tracing_msginit; -extern const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msginit; +extern const upb_MiniTable envoy_config_trace_v3_Tracing_msg_init; +extern const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* envoy.config.trace.v3.Tracing */ UPB_INLINE envoy_config_trace_v3_Tracing* envoy_config_trace_v3_Tracing_new(upb_Arena* arena) { - return (envoy_config_trace_v3_Tracing*)_upb_Message_New(&envoy_config_trace_v3_Tracing_msginit, arena); + return (envoy_config_trace_v3_Tracing*)_upb_Message_New(&envoy_config_trace_v3_Tracing_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_Tracing* envoy_config_trace_v3_Tracing_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_Tracing* ret = envoy_config_trace_v3_Tracing_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_config_trace_v3_Tracing* envoy_config_trace_v3_Tracing_parse_ex int options, upb_Arena* arena) { envoy_config_trace_v3_Tracing* ret = envoy_config_trace_v3_Tracing_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,35 +60,40 @@ UPB_INLINE envoy_config_trace_v3_Tracing* envoy_config_trace_v3_Tracing_parse_ex } UPB_INLINE char* envoy_config_trace_v3_Tracing_serialize(const envoy_config_trace_v3_Tracing* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_msg_init, 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); -} -UPB_INLINE void envoy_config_trace_v3_Tracing_clear_http(const envoy_config_trace_v3_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_Tracing_clear_http(envoy_config_trace_v3_Tracing* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_http(const envoy_config_trace_v3_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_trace_v3_Tracing_Http*); + const envoy_config_trace_v3_Tracing_Http* default_val = NULL; + const envoy_config_trace_v3_Tracing_Http* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_Tracing_has_http(const envoy_config_trace_v3_Tracing* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_Tracing_set_http(envoy_config_trace_v3_Tracing *msg, envoy_config_trace_v3_Tracing_Http* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_trace_v3_Tracing_Http*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_mutable_http(envoy_config_trace_v3_Tracing* msg, upb_Arena* arena) { struct envoy_config_trace_v3_Tracing_Http* sub = (struct envoy_config_trace_v3_Tracing_Http*)envoy_config_trace_v3_Tracing_http(msg); if (sub == NULL) { - sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_Tracing_set_http(msg, sub); + sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msg_init, arena); + if (sub) envoy_config_trace_v3_Tracing_set_http(msg, sub); } return sub; } @@ -93,12 +101,12 @@ UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Trac /* envoy.config.trace.v3.Tracing.Http */ UPB_INLINE envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_Http_new(upb_Arena* arena) { - return (envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msginit, arena); + return (envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_Http_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_Tracing_Http* ret = envoy_config_trace_v3_Tracing_Http_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -108,7 +116,7 @@ UPB_INLINE envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_Htt int options, upb_Arena* arena) { envoy_config_trace_v3_Tracing_Http* ret = envoy_config_trace_v3_Tracing_Http_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -116,13 +124,13 @@ UPB_INLINE envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_Htt } UPB_INLINE char* envoy_config_trace_v3_Tracing_Http_serialize(const envoy_config_trace_v3_Tracing_Http* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -130,46 +138,59 @@ typedef enum { envoy_config_trace_v3_Tracing_Http_config_type_NOT_SET = 0 } envoy_config_trace_v3_Tracing_Http_config_type_oneofcases; UPB_INLINE envoy_config_trace_v3_Tracing_Http_config_type_oneofcases envoy_config_trace_v3_Tracing_Http_config_type_case(const envoy_config_trace_v3_Tracing_Http* msg) { - return (envoy_config_trace_v3_Tracing_Http_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_config_trace_v3_Tracing_Http_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_Tracing_Http_clear_name(const envoy_config_trace_v3_Tracing_Http* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_Tracing_Http_clear_name(envoy_config_trace_v3_Tracing_Http* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_Tracing_Http_name(const envoy_config_trace_v3_Tracing_Http* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_Tracing_Http_has_typed_config(const envoy_config_trace_v3_Tracing_Http* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_config_trace_v3_Tracing_Http_clear_typed_config(const envoy_config_trace_v3_Tracing_Http* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_trace_v3_Tracing_Http_config_type_NOT_SET); +UPB_INLINE void envoy_config_trace_v3_Tracing_Http_clear_typed_config(envoy_config_trace_v3_Tracing_Http* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_typed_config(const envoy_config_trace_v3_Tracing_Http* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_Tracing_Http_has_typed_config(const envoy_config_trace_v3_Tracing_Http* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_Tracing_Http_set_name(envoy_config_trace_v3_Tracing_Http *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_Tracing_Http_set_typed_config(envoy_config_trace_v3_Tracing_Http *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_mutable_typed_config(envoy_config_trace_v3_Tracing_Http* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_trace_v3_Tracing_Http_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_Tracing_Http_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_config_trace_v3_Tracing_Http_set_typed_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_http_tracer_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_http_tracer_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_ */ 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 d7a1d556b80..5dd22e94e42 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/lightstep.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/annotations/deprecation.upb.h" @@ -16,30 +18,41 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_LightstepConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_LightstepConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_LightstepConfig__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_LightstepConfig__fields[4] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_LightstepConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_LightstepConfig_msg_init = { &envoy_config_trace_v3_LightstepConfig_submsgs[0], &envoy_config_trace_v3_LightstepConfig__fields[0], - UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_ppv4_1bt}, + {0x0030000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_LightstepConfig_msginit, + &envoy_config_trace_v3_LightstepConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_lightstep_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_lightstep_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -48,5 +61,5 @@ const upb_MiniTable_File envoy_config_trace_v3_lightstep_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 388ecab1d6e..f678d836ac8 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 @@ -9,22 +9,26 @@ #ifndef ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_LightstepConfig; typedef struct envoy_config_trace_v3_LightstepConfig envoy_config_trace_v3_LightstepConfig; -extern const upb_MiniTable envoy_config_trace_v3_LightstepConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_LightstepConfig_msg_init; struct envoy_config_core_v3_DataSource; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; typedef enum { envoy_config_trace_v3_LightstepConfig_ENVOY = 0, @@ -38,12 +42,12 @@ typedef enum { /* envoy.config.trace.v3.LightstepConfig */ UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_LightstepConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_LightstepConfig*)_upb_Message_New(&envoy_config_trace_v3_LightstepConfig_msginit, arena); + return (envoy_config_trace_v3_LightstepConfig*)_upb_Message_New(&envoy_config_trace_v3_LightstepConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_LightstepConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_LightstepConfig* ret = envoy_config_trace_v3_LightstepConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_LightstepConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_LightstepConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +57,7 @@ UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_Lightste int options, upb_Arena* arena) { envoy_config_trace_v3_LightstepConfig* ret = envoy_config_trace_v3_LightstepConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_LightstepConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_LightstepConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,78 +65,124 @@ UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_Lightste } UPB_INLINE char* envoy_config_trace_v3_LightstepConfig_serialize(const envoy_config_trace_v3_LightstepConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msg_init, 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); +UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_collector_cluster(envoy_config_trace_v3_LightstepConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_LightstepConfig_collector_cluster(const envoy_config_trace_v3_LightstepConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_access_token_file(const envoy_config_trace_v3_LightstepConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_access_token_file(envoy_config_trace_v3_LightstepConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_LightstepConfig_access_token_file(const envoy_config_trace_v3_LightstepConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_propagation_modes(const envoy_config_trace_v3_LightstepConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* envoy_config_trace_v3_LightstepConfig_propagation_modes(const envoy_config_trace_v3_LightstepConfig* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE int32_t const* envoy_config_trace_v3_LightstepConfig_propagation_modes(const envoy_config_trace_v3_LightstepConfig* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool envoy_config_trace_v3_LightstepConfig_has_access_token(const envoy_config_trace_v3_LightstepConfig* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_trace_v3_LightstepConfig_has_propagation_modes(const envoy_config_trace_v3_LightstepConfig* msg) { + size_t size; + envoy_config_trace_v3_LightstepConfig_propagation_modes(msg, &size); + return size != 0; } -UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_access_token(const envoy_config_trace_v3_LightstepConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_access_token(envoy_config_trace_v3_LightstepConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_LightstepConfig_access_token(const envoy_config_trace_v3_LightstepConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_LightstepConfig_has_access_token(const envoy_config_trace_v3_LightstepConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_LightstepConfig_set_collector_cluster(envoy_config_trace_v3_LightstepConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_LightstepConfig_set_access_token_file(envoy_config_trace_v3_LightstepConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* envoy_config_trace_v3_LightstepConfig_mutable_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE int32_t* envoy_config_trace_v3_LightstepConfig_mutable_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* envoy_config_trace_v3_LightstepConfig_resize_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, 2, arena); +UPB_INLINE int32_t* envoy_config_trace_v3_LightstepConfig_resize_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_trace_v3_LightstepConfig_add_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), 2, &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_trace_v3_LightstepConfig_set_access_token(envoy_config_trace_v3_LightstepConfig *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_LightstepConfig_mutable_access_token(envoy_config_trace_v3_LightstepConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_trace_v3_LightstepConfig_access_token(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_LightstepConfig_set_access_token(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_trace_v3_LightstepConfig_set_access_token(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_lightstep_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_lightstep_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPB_H_ */ 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 9fc1f8cfae7..661ff157b72 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/opencensus.upb.h" #include "envoy/config/core/v3/grpc_service.upb.h" #include "opencensus/proto/trace/v1/trace_config.upb.h" @@ -16,41 +18,60 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_OpenCensusConfig_submsgs[3] = { - {.submsg = &opencensus_proto_trace_v1_TraceConfig_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_OpenCensusConfig_submsgs[3] = { + {.submsg = &opencensus_proto_trace_v1_TraceConfig_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_OpenCensusConfig__fields[13] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(44, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(52, 96), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(56, 104), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_OpenCensusConfig__fields[13] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(40, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 48), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(16, 56), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(20, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(56, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(24, 96), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(28, 104), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_OpenCensusConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_OpenCensusConfig_msg_init = { &envoy_config_trace_v3_OpenCensusConfig_submsgs[0], &envoy_config_trace_v3_OpenCensusConfig__fields[0], - UPB_SIZE(64, 112), 13, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(64, 112), 13, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x000200003f000018, &upb_psb1_1bt}, + {0x001000003f000022, &upb_pss_1bt}, + {0x000300003f000028, &upb_psb1_1bt}, + {0x002000003f000032, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003000003f000042, &upb_ppv4_1bt}, + {0x003800003f00004a, &upb_ppv4_1bt}, + {0x004000003f000052, &upb_pss_1bt}, + {0x000400003f000058, &upb_psb1_1bt}, + {0x005000003f000062, &upb_pss_1bt}, + {0x006000000201006a, &upb_psm_1bt_maxmaxb}, + {0x0068000003020072, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_OpenCensusConfig_msginit, + &envoy_config_trace_v3_OpenCensusConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_opencensus_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_opencensus_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -59,5 +80,5 @@ const upb_MiniTable_File envoy_config_trace_v3_opencensus_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 4c8e8670398..1d3070abd40 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 @@ -9,24 +9,28 @@ #ifndef ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_OpenCensusConfig; typedef struct envoy_config_trace_v3_OpenCensusConfig envoy_config_trace_v3_OpenCensusConfig; -extern const upb_MiniTable envoy_config_trace_v3_OpenCensusConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_OpenCensusConfig_msg_init; struct envoy_config_core_v3_GrpcService; struct opencensus_proto_trace_v1_TraceConfig; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; -extern const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; +extern const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msg_init; typedef enum { envoy_config_trace_v3_OpenCensusConfig_NONE = 0, @@ -41,12 +45,12 @@ typedef enum { /* envoy.config.trace.v3.OpenCensusConfig */ UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCensusConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_OpenCensusConfig*)_upb_Message_New(&envoy_config_trace_v3_OpenCensusConfig_msginit, arena); + return (envoy_config_trace_v3_OpenCensusConfig*)_upb_Message_New(&envoy_config_trace_v3_OpenCensusConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCensusConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_OpenCensusConfig* ret = envoy_config_trace_v3_OpenCensusConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenCensusConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenCensusConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -56,7 +60,7 @@ UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCen int options, upb_Arena* arena) { envoy_config_trace_v3_OpenCensusConfig* ret = envoy_config_trace_v3_OpenCensusConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenCensusConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenCensusConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -64,191 +68,312 @@ UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCen } UPB_INLINE char* envoy_config_trace_v3_OpenCensusConfig_serialize(const envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_trace_config(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct opencensus_proto_trace_v1_TraceConfig* envoy_config_trace_v3_OpenCensusConfig_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct opencensus_proto_trace_v1_TraceConfig*); + const struct opencensus_proto_trace_v1_TraceConfig* default_val = NULL; + const struct opencensus_proto_trace_v1_TraceConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stdout_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stdout_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_stdout_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_stackdriver_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_project_id(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_project_id(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_stackdriver_project_id(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_zipkin_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_zipkin_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_zipkin_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_zipkin_url(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_zipkin_url(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(40, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_zipkin_url(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(40, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_incoming_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 48)); +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 48), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* envoy_config_trace_v3_OpenCensusConfig_incoming_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE int32_t const* envoy_config_trace_v3_OpenCensusConfig_incoming_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 48), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_outgoing_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); +UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_incoming_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg) { + size_t size; + envoy_config_trace_v3_OpenCensusConfig_incoming_trace_context(msg, &size); + return size != 0; } -UPB_INLINE int32_t const* envoy_config_trace_v3_OpenCensusConfig_outgoing_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(16, 56), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_address(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE int32_t const* envoy_config_trace_v3_OpenCensusConfig_outgoing_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(16, 56), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_outgoing_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg) { + size_t size; + envoy_config_trace_v3_OpenCensusConfig_outgoing_trace_context(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_address(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_stackdriver_address(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(20, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_ocagent_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {11, UPB_SIZE(20, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_address(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_address(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(56, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_ocagent_address(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(56, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_grpc_service(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(24, 96), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {13, UPB_SIZE(24, 96), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(24, 96), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_grpc_service(envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(28, 104), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {14, UPB_SIZE(28, 104), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(28, 104), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_trace_config(envoy_config_trace_v3_OpenCensusConfig *msg, struct opencensus_proto_trace_v1_TraceConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct opencensus_proto_trace_v1_TraceConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct opencensus_proto_trace_v1_TraceConfig* envoy_config_trace_v3_OpenCensusConfig_mutable_trace_config(envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena) { struct opencensus_proto_trace_v1_TraceConfig* sub = (struct opencensus_proto_trace_v1_TraceConfig*)envoy_config_trace_v3_OpenCensusConfig_trace_config(msg); if (sub == NULL) { - sub = (struct opencensus_proto_trace_v1_TraceConfig*)_upb_Message_New(&opencensus_proto_trace_v1_TraceConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_OpenCensusConfig_set_trace_config(msg, sub); + sub = (struct opencensus_proto_trace_v1_TraceConfig*)_upb_Message_New(&opencensus_proto_trace_v1_TraceConfig_msg_init, arena); + if (sub) envoy_config_trace_v3_OpenCensusConfig_set_trace_config(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stdout_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_project_id(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_zipkin_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_zipkin_url(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(40, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_mutable_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len); +UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_mutable_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(12, 48), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_resize_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 48), len, 2, arena); +UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_resize_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(12, 48), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_add_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), 2, &val, arena); + upb_MiniTableField field = {8, UPB_SIZE(12, 48), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_mutable_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_mutable_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(16, 56), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_resize_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, 2, arena); +UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_resize_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(16, 56), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_add_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), 2, &val, arena); + upb_MiniTableField field = {9, UPB_SIZE(16, 56), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_address(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value; + const upb_MiniTableField field = {10, UPB_SIZE(48, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_ocagent_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {11, UPB_SIZE(20, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_ocagent_address(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = value; + const upb_MiniTableField field = {12, UPB_SIZE(56, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_grpc_service(envoy_config_trace_v3_OpenCensusConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(24, 96), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_mutable_stackdriver_grpc_service(envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_OpenCensusConfig_stackdriver_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_grpc_service(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_ocagent_grpc_service(envoy_config_trace_v3_OpenCensusConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(28, 104), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_mutable_ocagent_grpc_service(envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_OpenCensusConfig_ocagent_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_OpenCensusConfig_set_ocagent_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_trace_v3_OpenCensusConfig_set_ocagent_grpc_service(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_opencensus_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_opencensus_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c index 813e3dc16ec..a9a38111603 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c @@ -7,33 +7,42 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/opentelemetry.upb.h" #include "envoy/config/core/v3/grpc_service.upb.h" #include "udpa/annotations/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_OpenTelemetryConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_OpenTelemetryConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_OpenTelemetryConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_OpenTelemetryConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_OpenTelemetryConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_OpenTelemetryConfig_msg_init = { &envoy_config_trace_v3_OpenTelemetryConfig_submsgs[0], &envoy_config_trace_v3_OpenTelemetryConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_OpenTelemetryConfig_msginit, + &envoy_config_trace_v3_OpenTelemetryConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_opentelemetry_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_opentelemetry_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +51,5 @@ const upb_MiniTable_File envoy_config_trace_v3_opentelemetry_proto_upb_file_layo 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h index 4ac3700f312..6f3e5265c5a 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_TRACE_V3_OPENTELEMETRY_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_OPENTELEMETRY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_OpenTelemetryConfig; typedef struct envoy_config_trace_v3_OpenTelemetryConfig envoy_config_trace_v3_OpenTelemetryConfig; -extern const upb_MiniTable envoy_config_trace_v3_OpenTelemetryConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_OpenTelemetryConfig_msg_init; struct envoy_config_core_v3_GrpcService; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; /* envoy.config.trace.v3.OpenTelemetryConfig */ UPB_INLINE envoy_config_trace_v3_OpenTelemetryConfig* envoy_config_trace_v3_OpenTelemetryConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_OpenTelemetryConfig*)_upb_Message_New(&envoy_config_trace_v3_OpenTelemetryConfig_msginit, arena); + return (envoy_config_trace_v3_OpenTelemetryConfig*)_upb_Message_New(&envoy_config_trace_v3_OpenTelemetryConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_OpenTelemetryConfig* envoy_config_trace_v3_OpenTelemetryConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_OpenTelemetryConfig* ret = envoy_config_trace_v3_OpenTelemetryConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenTelemetryConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenTelemetryConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_trace_v3_OpenTelemetryConfig* envoy_config_trace_v3_Open int options, upb_Arena* arena) { envoy_config_trace_v3_OpenTelemetryConfig* ret = envoy_config_trace_v3_OpenTelemetryConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenTelemetryConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenTelemetryConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE envoy_config_trace_v3_OpenTelemetryConfig* envoy_config_trace_v3_Open } UPB_INLINE char* envoy_config_trace_v3_OpenTelemetryConfig_serialize(const envoy_config_trace_v3_OpenTelemetryConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_OpenTelemetryConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_OpenTelemetryConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_config_trace_v3_OpenTelemetryConfig_serialize_ex(const envoy_config_trace_v3_OpenTelemetryConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_OpenTelemetryConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_OpenTelemetryConfig_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_config_trace_v3_OpenTelemetryConfig_has_grpc_service(const envoy_config_trace_v3_OpenTelemetryConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_trace_v3_OpenTelemetryConfig_clear_grpc_service(const envoy_config_trace_v3_OpenTelemetryConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_OpenTelemetryConfig_clear_grpc_service(envoy_config_trace_v3_OpenTelemetryConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenTelemetryConfig_grpc_service(const envoy_config_trace_v3_OpenTelemetryConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_OpenTelemetryConfig_clear_service_name(const envoy_config_trace_v3_OpenTelemetryConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_trace_v3_OpenTelemetryConfig_has_grpc_service(const envoy_config_trace_v3_OpenTelemetryConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_trace_v3_OpenTelemetryConfig_clear_service_name(envoy_config_trace_v3_OpenTelemetryConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_OpenTelemetryConfig_service_name(const envoy_config_trace_v3_OpenTelemetryConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_trace_v3_OpenTelemetryConfig_set_grpc_service(envoy_config_trace_v3_OpenTelemetryConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenTelemetryConfig_mutable_grpc_service(envoy_config_trace_v3_OpenTelemetryConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_OpenTelemetryConfig_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_OpenTelemetryConfig_set_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_trace_v3_OpenTelemetryConfig_set_grpc_service(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_OpenTelemetryConfig_set_service_name(envoy_config_trace_v3_OpenTelemetryConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_trace_v3_opentelemetry_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_opentelemetry_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_OPENTELEMETRY_PROTO_UPB_H_ */ 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 f8dcbea6b61..7bb457be9d9 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 @@ -7,34 +7,41 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/service.upb.h" #include "envoy/config/core/v3/grpc_service.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_TraceServiceConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_TraceServiceConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_TraceServiceConfig__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_TraceServiceConfig__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_TraceServiceConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_TraceServiceConfig_msg_init = { &envoy_config_trace_v3_TraceServiceConfig_submsgs[0], &envoy_config_trace_v3_TraceServiceConfig__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_TraceServiceConfig_msginit, + &envoy_config_trace_v3_TraceServiceConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_service_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_service_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -43,5 +50,5 @@ const upb_MiniTable_File envoy_config_trace_v3_service_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 a1ff88de4d8..5729817bf8e 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_TraceServiceConfig; typedef struct envoy_config_trace_v3_TraceServiceConfig envoy_config_trace_v3_TraceServiceConfig; -extern const upb_MiniTable envoy_config_trace_v3_TraceServiceConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_TraceServiceConfig_msg_init; struct envoy_config_core_v3_GrpcService; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; /* envoy.config.trace.v3.TraceServiceConfig */ UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_TraceServiceConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_TraceServiceConfig*)_upb_Message_New(&envoy_config_trace_v3_TraceServiceConfig_msginit, arena); + return (envoy_config_trace_v3_TraceServiceConfig*)_upb_Message_New(&envoy_config_trace_v3_TraceServiceConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_TraceServiceConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_TraceServiceConfig* ret = envoy_config_trace_v3_TraceServiceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_TraceServiceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_TraceServiceConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_Trace int options, upb_Arena* arena) { envoy_config_trace_v3_TraceServiceConfig* ret = envoy_config_trace_v3_TraceServiceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_TraceServiceConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_TraceServiceConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,45 +58,50 @@ UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_Trace } UPB_INLINE char* envoy_config_trace_v3_TraceServiceConfig_serialize(const envoy_config_trace_v3_TraceServiceConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_trace_v3_TraceServiceConfig_clear_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_TraceServiceConfig_clear_grpc_service(envoy_config_trace_v3_TraceServiceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_TraceServiceConfig_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_TraceServiceConfig_has_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_TraceServiceConfig_set_grpc_service(envoy_config_trace_v3_TraceServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_TraceServiceConfig_mutable_grpc_service(envoy_config_trace_v3_TraceServiceConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_TraceServiceConfig_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_TraceServiceConfig_set_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_trace_v3_TraceServiceConfig_set_grpc_service(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_service_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_service_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPB_H_ */ 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 6fd29d151f6..4818fb68db3 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/skywalking.upb.h" #include "envoy/config/core/v3/grpc_service.upb.h" #include "google/protobuf/wrappers.upb.h" @@ -16,47 +18,64 @@ #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_SkyWalkingConfig_submsgs[2] = { - {.submsg = &envoy_config_core_v3_GrpcService_msginit}, - {.submsg = &envoy_config_trace_v3_ClientConfig_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_SkyWalkingConfig_submsgs[2] = { + {.submsg = &envoy_config_core_v3_GrpcService_msg_init}, + {.submsg = &envoy_config_trace_v3_ClientConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_SkyWalkingConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_SkyWalkingConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_SkyWalkingConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_SkyWalkingConfig_msg_init = { &envoy_config_trace_v3_SkyWalkingConfig_submsgs[0], &envoy_config_trace_v3_SkyWalkingConfig__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_trace_v3_ClientConfig_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_ClientConfig_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_ClientConfig__fields[4] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_ClientConfig__fields[4] = { + {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_ClientConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_ClientConfig_msg_init = { &envoy_config_trace_v3_ClientConfig_submsgs[0], &envoy_config_trace_v3_ClientConfig__fields[0], - UPB_SIZE(40, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(40, 64), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x002800003f000012, &upb_pss_1bt}, + {0x000800040300001a, &upb_pos_1bt}, + {0x0038000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_trace_v3_SkyWalkingConfig_msginit, - &envoy_config_trace_v3_ClientConfig_msginit, + &envoy_config_trace_v3_SkyWalkingConfig_msg_init, + &envoy_config_trace_v3_ClientConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_skywalking_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_skywalking_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -65,5 +84,5 @@ const upb_MiniTable_File envoy_config_trace_v3_skywalking_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 6eba4aa85b5..c3b58e796c0 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 @@ -9,39 +9,42 @@ #ifndef ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_SkyWalkingConfig; -struct envoy_config_trace_v3_ClientConfig; typedef struct envoy_config_trace_v3_SkyWalkingConfig envoy_config_trace_v3_SkyWalkingConfig; typedef struct envoy_config_trace_v3_ClientConfig envoy_config_trace_v3_ClientConfig; -extern const upb_MiniTable envoy_config_trace_v3_SkyWalkingConfig_msginit; -extern const upb_MiniTable envoy_config_trace_v3_ClientConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_SkyWalkingConfig_msg_init; +extern const upb_MiniTable envoy_config_trace_v3_ClientConfig_msg_init; struct envoy_config_core_v3_GrpcService; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_GrpcService_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.config.trace.v3.SkyWalkingConfig */ UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalkingConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_SkyWalkingConfig*)_upb_Message_New(&envoy_config_trace_v3_SkyWalkingConfig_msginit, arena); + return (envoy_config_trace_v3_SkyWalkingConfig*)_upb_Message_New(&envoy_config_trace_v3_SkyWalkingConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalkingConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_SkyWalkingConfig* ret = envoy_config_trace_v3_SkyWalkingConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_SkyWalkingConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_SkyWalkingConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -51,7 +54,7 @@ UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalk int options, upb_Arena* arena) { envoy_config_trace_v3_SkyWalkingConfig* ret = envoy_config_trace_v3_SkyWalkingConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_SkyWalkingConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_SkyWalkingConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -59,57 +62,67 @@ UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalk } UPB_INLINE char* envoy_config_trace_v3_SkyWalkingConfig_serialize(const envoy_config_trace_v3_SkyWalkingConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_clear_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_clear_grpc_service(envoy_config_trace_v3_SkyWalkingConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_SkyWalkingConfig_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_GrpcService*); + const struct envoy_config_core_v3_GrpcService* default_val = NULL; + const struct envoy_config_core_v3_GrpcService* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_SkyWalkingConfig_has_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_config_trace_v3_SkyWalkingConfig_has_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_clear_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_clear_client_config(envoy_config_trace_v3_SkyWalkingConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_SkyWalkingConfig_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_trace_v3_ClientConfig*); + const envoy_config_trace_v3_ClientConfig* default_val = NULL; + const envoy_config_trace_v3_ClientConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_SkyWalkingConfig_has_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_set_grpc_service(envoy_config_trace_v3_SkyWalkingConfig *msg, struct envoy_config_core_v3_GrpcService* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_GrpcService*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_SkyWalkingConfig_mutable_grpc_service(envoy_config_trace_v3_SkyWalkingConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_SkyWalkingConfig_grpc_service(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_SkyWalkingConfig_set_grpc_service(msg, sub); + sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msg_init, arena); + if (sub) envoy_config_trace_v3_SkyWalkingConfig_set_grpc_service(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_set_client_config(envoy_config_trace_v3_SkyWalkingConfig *msg, envoy_config_trace_v3_ClientConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_trace_v3_ClientConfig*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_SkyWalkingConfig_mutable_client_config(envoy_config_trace_v3_SkyWalkingConfig* msg, upb_Arena* arena) { struct envoy_config_trace_v3_ClientConfig* sub = (struct envoy_config_trace_v3_ClientConfig*)envoy_config_trace_v3_SkyWalkingConfig_client_config(msg); if (sub == NULL) { - sub = (struct envoy_config_trace_v3_ClientConfig*)_upb_Message_New(&envoy_config_trace_v3_ClientConfig_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_SkyWalkingConfig_set_client_config(msg, sub); + sub = (struct envoy_config_trace_v3_ClientConfig*)_upb_Message_New(&envoy_config_trace_v3_ClientConfig_msg_init, arena); + if (sub) envoy_config_trace_v3_SkyWalkingConfig_set_client_config(msg, sub); } return sub; } @@ -117,12 +130,12 @@ UPB_INLINE struct envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_SkyW /* envoy.config.trace.v3.ClientConfig */ UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_ClientConfig*)_upb_Message_New(&envoy_config_trace_v3_ClientConfig_msginit, arena); + return (envoy_config_trace_v3_ClientConfig*)_upb_Message_New(&envoy_config_trace_v3_ClientConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_ClientConfig* ret = envoy_config_trace_v3_ClientConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ClientConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ClientConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -132,7 +145,7 @@ UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfi int options, upb_Arena* arena) { envoy_config_trace_v3_ClientConfig* ret = envoy_config_trace_v3_ClientConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ClientConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ClientConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -140,13 +153,13 @@ UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfi } UPB_INLINE char* envoy_config_trace_v3_ClientConfig_serialize(const envoy_config_trace_v3_ClientConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -154,68 +167,93 @@ typedef enum { envoy_config_trace_v3_ClientConfig_backend_token_specifier_NOT_SET = 0 } envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases; UPB_INLINE envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases envoy_config_trace_v3_ClientConfig_backend_token_specifier_case(const envoy_config_trace_v3_ClientConfig* msg) { - return (envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_service_name(const envoy_config_trace_v3_ClientConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_service_name(envoy_config_trace_v3_ClientConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_ClientConfig_service_name(const envoy_config_trace_v3_ClientConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_instance_name(const envoy_config_trace_v3_ClientConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_instance_name(envoy_config_trace_v3_ClientConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_ClientConfig_instance_name(const envoy_config_trace_v3_ClientConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_ClientConfig_has_backend_token(const envoy_config_trace_v3_ClientConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; -} -UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_backend_token(const envoy_config_trace_v3_ClientConfig* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_trace_v3_ClientConfig_backend_token_specifier_NOT_SET); +UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_backend_token(envoy_config_trace_v3_ClientConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_ClientConfig_backend_token(const envoy_config_trace_v3_ClientConfig* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_ClientConfig_has_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_config_trace_v3_ClientConfig_has_backend_token(const envoy_config_trace_v3_ClientConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_max_cache_size(envoy_config_trace_v3_ClientConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_trace_v3_ClientConfig_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_ClientConfig_has_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_service_name(envoy_config_trace_v3_ClientConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_instance_name(envoy_config_trace_v3_ClientConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_backend_token(envoy_config_trace_v3_ClientConfig *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_max_cache_size(envoy_config_trace_v3_ClientConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_trace_v3_ClientConfig_mutable_max_cache_size(envoy_config_trace_v3_ClientConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_trace_v3_ClientConfig_max_cache_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_ClientConfig_set_max_cache_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_config_trace_v3_ClientConfig_set_max_cache_size(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_skywalking_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_skywalking_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c index df33447bb59..b38da47a9f7 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/trace.upb.h" #include "envoy/config/trace/v3/datadog.upb.h" #include "envoy/config/trace/v3/dynamic_ot.upb.h" @@ -18,9 +20,10 @@ #include "envoy/config/trace/v3/service.upb.h" #include "envoy/config/trace/v3/zipkin.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable_File envoy_config_trace_v3_trace_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_trace_proto_upb_file_layout = { NULL, NULL, NULL, @@ -29,5 +32,5 @@ const upb_MiniTable_File envoy_config_trace_v3_trace_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h index 58a30906248..e2e25e20a24 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h @@ -9,22 +9,27 @@ #ifndef ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" /* Public Imports. */ -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" -#include "envoy/config/trace/v3/trace.upb.h" +#include "envoy/config/trace/v3/datadog.upb.h" +#include "envoy/config/trace/v3/dynamic_ot.upb.h" +#include "envoy/config/trace/v3/http_tracer.upb.h" +#include "envoy/config/trace/v3/lightstep.upb.h" +#include "envoy/config/trace/v3/opencensus.upb.h" +#include "envoy/config/trace/v3/opentelemetry.upb.h" +#include "envoy/config/trace/v3/service.upb.h" +#include "envoy/config/trace/v3/zipkin.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -32,12 +37,12 @@ extern "C" { -extern const upb_MiniTable_File envoy_config_trace_v3_trace_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_trace_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPB_H_ */ 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 db068743219..0e8ffdc3d7e 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/xray.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/base.upb.h" @@ -17,48 +19,65 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_XRayConfig_submsgs[3] = { - {.submsg = &envoy_config_core_v3_SocketAddress_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_XRayConfig_submsgs[3] = { + {.submsg = &envoy_config_core_v3_SocketAddress_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_XRayConfig__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_XRayConfig__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_XRayConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_XRayConfig_msg_init = { &envoy_config_trace_v3_XRayConfig_submsgs[0], &envoy_config_trace_v3_XRayConfig__fields[0], - UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000003020022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_config_trace_v3_XRayConfig_SegmentFields_submsgs[1] = { - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_XRayConfig_SegmentFields_submsgs[1] = { + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_XRayConfig_SegmentFields__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_XRayConfig_SegmentFields__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_XRayConfig_SegmentFields_msginit = { +const upb_MiniTable envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init = { &envoy_config_trace_v3_XRayConfig_SegmentFields_submsgs[0], &envoy_config_trace_v3_XRayConfig_SegmentFields__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_config_trace_v3_XRayConfig_msginit, - &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, + &envoy_config_trace_v3_XRayConfig_msg_init, + &envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_xray_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_xray_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -67,5 +86,5 @@ const upb_MiniTable_File envoy_config_trace_v3_xray_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 fb00760b9c1..eb9bc2aa42e 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 @@ -9,41 +9,44 @@ #ifndef ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_XRayConfig; -struct envoy_config_trace_v3_XRayConfig_SegmentFields; typedef struct envoy_config_trace_v3_XRayConfig envoy_config_trace_v3_XRayConfig; typedef struct envoy_config_trace_v3_XRayConfig_SegmentFields envoy_config_trace_v3_XRayConfig_SegmentFields; -extern const upb_MiniTable envoy_config_trace_v3_XRayConfig_msginit; -extern const upb_MiniTable envoy_config_trace_v3_XRayConfig_SegmentFields_msginit; +extern const upb_MiniTable envoy_config_trace_v3_XRayConfig_msg_init; +extern const upb_MiniTable envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init; struct envoy_config_core_v3_DataSource; struct envoy_config_core_v3_SocketAddress; struct google_protobuf_Struct; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit; -extern const upb_MiniTable google_protobuf_Struct_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SocketAddress_msg_init; +extern const upb_MiniTable google_protobuf_Struct_msg_init; /* envoy.config.trace.v3.XRayConfig */ UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_XRayConfig*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_msginit, arena); + return (envoy_config_trace_v3_XRayConfig*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_XRayConfig* ret = envoy_config_trace_v3_XRayConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_pa int options, upb_Arena* arena) { envoy_config_trace_v3_XRayConfig* ret = envoy_config_trace_v3_XRayConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,88 +64,109 @@ UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_pa } UPB_INLINE char* envoy_config_trace_v3_XRayConfig_serialize(const envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msg_init, 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); -} -UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_daemon_endpoint(envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_SocketAddress* envoy_config_trace_v3_XRayConfig_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_SocketAddress*); + const struct envoy_config_core_v3_SocketAddress* default_val = NULL; + const struct envoy_config_core_v3_SocketAddress* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_segment_name(const envoy_config_trace_v3_XRayConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_segment_name(envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_XRayConfig_segment_name(const envoy_config_trace_v3_XRayConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_sampling_rule_manifest(envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_XRayConfig_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_segment_fields(envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_trace_v3_XRayConfig_SegmentFields*); + const envoy_config_trace_v3_XRayConfig_SegmentFields* default_val = NULL; + const envoy_config_trace_v3_XRayConfig_SegmentFields* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_daemon_endpoint(envoy_config_trace_v3_XRayConfig *msg, struct envoy_config_core_v3_SocketAddress* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_SocketAddress*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_trace_v3_XRayConfig_mutable_daemon_endpoint(envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_trace_v3_XRayConfig_daemon_endpoint(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_XRayConfig_set_daemon_endpoint(msg, sub); + sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msg_init, arena); + if (sub) envoy_config_trace_v3_XRayConfig_set_daemon_endpoint(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_segment_name(envoy_config_trace_v3_XRayConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_sampling_rule_manifest(envoy_config_trace_v3_XRayConfig *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_XRayConfig_mutable_sampling_rule_manifest(envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_trace_v3_XRayConfig_sampling_rule_manifest(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_XRayConfig_set_sampling_rule_manifest(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_config_trace_v3_XRayConfig_set_sampling_rule_manifest(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_segment_fields(envoy_config_trace_v3_XRayConfig *msg, envoy_config_trace_v3_XRayConfig_SegmentFields* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_trace_v3_XRayConfig_SegmentFields*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_mutable_segment_fields(envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena) { struct envoy_config_trace_v3_XRayConfig_SegmentFields* sub = (struct envoy_config_trace_v3_XRayConfig_SegmentFields*)envoy_config_trace_v3_XRayConfig_segment_fields(msg); if (sub == NULL) { - sub = (struct envoy_config_trace_v3_XRayConfig_SegmentFields*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_XRayConfig_set_segment_fields(msg, sub); + sub = (struct envoy_config_trace_v3_XRayConfig_SegmentFields*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, arena); + if (sub) envoy_config_trace_v3_XRayConfig_set_segment_fields(msg, sub); } return sub; } @@ -150,12 +174,12 @@ UPB_INLINE struct envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_t /* envoy.config.trace.v3.XRayConfig.SegmentFields */ UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_SegmentFields_new(upb_Arena* arena) { - return (envoy_config_trace_v3_XRayConfig_SegmentFields*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, arena); + return (envoy_config_trace_v3_XRayConfig_SegmentFields*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_SegmentFields_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_XRayConfig_SegmentFields* ret = envoy_config_trace_v3_XRayConfig_SegmentFields_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -165,7 +189,7 @@ UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3 int options, upb_Arena* arena) { envoy_config_trace_v3_XRayConfig_SegmentFields* ret = envoy_config_trace_v3_XRayConfig_SegmentFields_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -173,54 +197,65 @@ UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3 } UPB_INLINE char* envoy_config_trace_v3_XRayConfig_SegmentFields_serialize(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msg_init, 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); +UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_clear_origin(envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_XRayConfig_SegmentFields_origin(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_XRayConfig_SegmentFields_has_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_clear_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_clear_aws(envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* envoy_config_trace_v3_XRayConfig_SegmentFields_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_config_trace_v3_XRayConfig_SegmentFields_has_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_set_origin(envoy_config_trace_v3_XRayConfig_SegmentFields *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_set_aws(envoy_config_trace_v3_XRayConfig_SegmentFields *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* envoy_config_trace_v3_XRayConfig_SegmentFields_mutable_aws(envoy_config_trace_v3_XRayConfig_SegmentFields* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_trace_v3_XRayConfig_SegmentFields_aws(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_XRayConfig_SegmentFields_set_aws(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) envoy_config_trace_v3_XRayConfig_SegmentFields_set_aws(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_config_trace_v3_xray_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_xray_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPB_H_ */ 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 52212206294..f83f0ddc3ce 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/config/trace/v3/zipkin.upb.h" #include "google/protobuf/wrappers.upb.h" #include "envoy/annotations/deprecation.upb.h" @@ -16,33 +18,44 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_config_trace_v3_ZipkinConfig_submsgs[1] = { - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_config_trace_v3_ZipkinConfig_submsgs[1] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_config_trace_v3_ZipkinConfig__fields[7] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 48), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_config_trace_v3_ZipkinConfig__fields[7] = { + {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_config_trace_v3_ZipkinConfig_msginit = { +const upb_MiniTable envoy_config_trace_v3_ZipkinConfig_msg_init = { &envoy_config_trace_v3_ZipkinConfig_submsgs[0], &envoy_config_trace_v3_ZipkinConfig__fields[0], - UPB_SIZE(40, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 72), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_pss_1bt}, + {0x002000003f000012, &upb_pss_1bt}, + {0x000100003f000018, &upb_psb1_1bt}, + {0x0030000001000022, &upb_psm_1bt_maxmaxb}, + {0x000400003f000028, &upb_psv4_1bt}, + {0x003800003f000032, &upb_pss_1bt}, + {0x000800003f000038, &upb_psb1_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_config_trace_v3_ZipkinConfig_msginit, + &envoy_config_trace_v3_ZipkinConfig_msg_init, }; -const upb_MiniTable_File envoy_config_trace_v3_zipkin_proto_upb_file_layout = { +const upb_MiniTableFile envoy_config_trace_v3_zipkin_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -51,5 +64,5 @@ const upb_MiniTable_File envoy_config_trace_v3_zipkin_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 439b3e9bea1..3577ba7924f 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 @@ -9,22 +9,26 @@ #ifndef ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPB_H_ #define ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_config_trace_v3_ZipkinConfig; typedef struct envoy_config_trace_v3_ZipkinConfig envoy_config_trace_v3_ZipkinConfig; -extern const upb_MiniTable envoy_config_trace_v3_ZipkinConfig_msginit; +extern const upb_MiniTable envoy_config_trace_v3_ZipkinConfig_msg_init; struct google_protobuf_BoolValue; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; typedef enum { envoy_config_trace_v3_ZipkinConfig_DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0, @@ -38,12 +42,12 @@ typedef enum { /* envoy.config.trace.v3.ZipkinConfig */ UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfig_new(upb_Arena* arena) { - return (envoy_config_trace_v3_ZipkinConfig*)_upb_Message_New(&envoy_config_trace_v3_ZipkinConfig_msginit, arena); + return (envoy_config_trace_v3_ZipkinConfig*)_upb_Message_New(&envoy_config_trace_v3_ZipkinConfig_msg_init, arena); } UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_config_trace_v3_ZipkinConfig* ret = envoy_config_trace_v3_ZipkinConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ZipkinConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ZipkinConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +57,7 @@ UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfi int options, upb_Arena* arena) { envoy_config_trace_v3_ZipkinConfig* ret = envoy_config_trace_v3_ZipkinConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ZipkinConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ZipkinConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,99 +65,140 @@ UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfi } UPB_INLINE char* envoy_config_trace_v3_ZipkinConfig_serialize(const envoy_config_trace_v3_ZipkinConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msg_init, 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(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_cluster(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_ZipkinConfig_collector_cluster(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_endpoint(const envoy_config_trace_v3_ZipkinConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_endpoint(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_ZipkinConfig_collector_endpoint(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_trace_id_128bit(const envoy_config_trace_v3_ZipkinConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_trace_id_128bit(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {3, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_trace_v3_ZipkinConfig_trace_id_128bit(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_config_trace_v3_ZipkinConfig_has_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_shared_span_context(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_trace_v3_ZipkinConfig_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_endpoint_version(const envoy_config_trace_v3_ZipkinConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_config_trace_v3_ZipkinConfig_has_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_endpoint_version(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_config_trace_v3_ZipkinConfig_collector_endpoint_version(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_hostname(const envoy_config_trace_v3_ZipkinConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_hostname(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_config_trace_v3_ZipkinConfig_collector_hostname(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_split_spans_for_request(const envoy_config_trace_v3_ZipkinConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_split_spans_for_request(envoy_config_trace_v3_ZipkinConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_config_trace_v3_ZipkinConfig_split_spans_for_request(const envoy_config_trace_v3_ZipkinConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_cluster(envoy_config_trace_v3_ZipkinConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_endpoint(envoy_config_trace_v3_ZipkinConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_trace_id_128bit(envoy_config_trace_v3_ZipkinConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_shared_span_context(envoy_config_trace_v3_ZipkinConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 48), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_config_trace_v3_ZipkinConfig_mutable_shared_span_context(envoy_config_trace_v3_ZipkinConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_trace_v3_ZipkinConfig_shared_span_context(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_config_trace_v3_ZipkinConfig_set_shared_span_context(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_config_trace_v3_ZipkinConfig_set_shared_span_context(msg, sub); } return sub; } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_endpoint_version(envoy_config_trace_v3_ZipkinConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_hostname(envoy_config_trace_v3_ZipkinConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(32, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_split_spans_for_request(envoy_config_trace_v3_ZipkinConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {7, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_config_trace_v3_zipkin_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_config_trace_v3_zipkin_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPB_H_ */ 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 61c5bf44060..9c3bbd6121b 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 @@ -7,29 +7,36 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = { +const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init = { NULL, &envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prs_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, + &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init, }; -const upb_MiniTable_File envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -38,5 +45,5 @@ const upb_MiniTable_File envoy_extensions_clusters_aggregate_v3_cluster_proto_up 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 f69e6f35386..1f093960fd1 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 @@ -9,32 +9,36 @@ #ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_clusters_aggregate_v3_ClusterConfig; typedef struct envoy_extensions_clusters_aggregate_v3_ClusterConfig envoy_extensions_clusters_aggregate_v3_ClusterConfig; -extern const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit; +extern const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init; /* envoy.extensions.clusters.aggregate.v3.ClusterConfig */ UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(upb_Arena* arena) { - return (envoy_extensions_clusters_aggregate_v3_ClusterConfig*)_upb_Message_New(&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena); + return (envoy_extensions_clusters_aggregate_v3_ClusterConfig*)_upb_Message_New(&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init, arena); } UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_clusters_aggregate_v3_ClusterConfig* ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extension int options, upb_Arena* arena) { envoy_extensions_clusters_aggregate_v3_ClusterConfig* ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,38 +56,67 @@ UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extension } UPB_INLINE char* envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msg_init, 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)); +UPB_INLINE void envoy_extensions_clusters_aggregate_v3_ClusterConfig_clear_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView const* envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_has_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg) { + size_t size; + envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_mutable_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_mutable_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_resize_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_resize_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_add_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_ */ 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 cba03ac0276..6da48de1e85 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/filters/common/fault/v3/fault.upb.h" #include "envoy/type/v3/percent.upb.h" #include "google/protobuf/duration.upb.h" @@ -15,75 +17,96 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[3] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, - {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[3] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, + {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_common_fault_v3_FaultDelay__fields[3] = { - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_common_fault_v3_FaultDelay__fields[3] = { + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit = { +const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init = { &envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[0], &envoy_extensions_filters_common_fault_v3_FaultDelay__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000040300001a, &upb_pom_1bt_maxmaxb}, + {0x0008000001010022, &upb_psm_1bt_maxmaxb}, + {0x001000040502002a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit = { +const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = { - {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit}, - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, - {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = { + {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init}, + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, + {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[3] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[3] = { + {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit = { +const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init = { &envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[0], &envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000040100000a, &upb_pom_1bt_max64b}, + {0x0008000001010012, &upb_psm_1bt_maxmaxb}, + {0x001000040302001a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Field envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[1] = { + {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit = { +const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init = { NULL, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + }) }; -const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit = { +const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[5] = { - &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, - &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, - &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, - &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, - &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, + &envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, + &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, + &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, + &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, + &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, }; -const upb_MiniTable_File envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -92,5 +115,5 @@ const upb_MiniTable_File envoy_extensions_filters_common_fault_v3_fault_proto_up 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 e9d461d5921..305154080a3 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 @@ -9,36 +9,36 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_filters_common_fault_v3_FaultDelay; -struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay; -struct envoy_extensions_filters_common_fault_v3_FaultRateLimit; -struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit; -struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit; typedef struct envoy_extensions_filters_common_fault_v3_FaultDelay envoy_extensions_filters_common_fault_v3_FaultDelay; typedef struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay; typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit; typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit; typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init; struct envoy_type_v3_FractionalPercent; struct google_protobuf_Duration; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; typedef enum { envoy_extensions_filters_common_fault_v3_FaultDelay_FIXED = 0 @@ -49,12 +49,12 @@ typedef enum { /* envoy.extensions.filters.common.fault.v3.FaultDelay */ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_new(upb_Arena* arena) { - return (envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena); + return (envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, arena); } UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -64,7 +64,7 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions int options, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -72,13 +72,13 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -87,70 +87,88 @@ typedef enum { envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET = 0 } envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases; UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_case(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return (envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; -} -UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL); + const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* default_val = NULL; + const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, struct google_protobuf_Duration* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) { struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(msg, sub); + sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, arena); + if (sub) envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(msg, sub); } return sub; } @@ -158,12 +176,12 @@ UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDela /* envoy.extensions.filters.common.fault.v3.FaultDelay.HeaderDelay */ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(upb_Arena* arena) { - return (envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena); + return (envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, arena); } UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -173,7 +191,7 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envo int options, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -181,13 +199,13 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envo } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msg_init, options, arena, &ptr, len); return ptr; } @@ -195,12 +213,12 @@ UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay /* envoy.extensions.filters.common.fault.v3.FaultRateLimit */ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(upb_Arena* arena) { - return (envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena); + return (envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, arena); } UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -210,7 +228,7 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extens int options, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -218,13 +236,13 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extens } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -233,70 +251,88 @@ typedef enum { envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET = 0 } envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases; UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_case(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL); + const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* default_val = NULL; + const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* default_val = NULL; + const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) { struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(msg, sub); + sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, arena); + if (sub) envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) { struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(msg, sub); + sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, arena); + if (sub) envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(msg, sub); } return sub; } @@ -304,12 +340,12 @@ UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_Header /* envoy.extensions.filters.common.fault.v3.FaultRateLimit.FixedLimit */ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(upb_Arena* arena) { - return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena); + return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, arena); } UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -319,7 +355,7 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* e int options, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -327,35 +363,41 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* e } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msg_init, 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; +UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_clear_limit_kbps(envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_limit_kbps(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_set_limit_kbps(envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.common.fault.v3.FaultRateLimit.HeaderLimit */ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(upb_Arena* arena) { - return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena); + return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, arena); } UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -365,7 +407,7 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* int options, upb_Arena* arena) { envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -373,23 +415,23 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_ */ 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 c8bb2b5dbb1..a1d7046e34b 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/filters/http/fault/v3/fault.upb.h" #include "envoy/config/route/v3/route_components.upb.h" #include "envoy/extensions/filters/common/fault/v3/fault.upb.h" @@ -17,71 +19,100 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[2] = { - {.submsg = &envoy_type_v3_FractionalPercent_msginit}, - {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[2] = { + {.submsg = &envoy_type_v3_FractionalPercent_msg_init}, + {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_fault_v3_FaultAbort__fields[4] = { - {2, UPB_SIZE(8, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_fault_v3_FaultAbort__fields[4] = { + {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msginit = { +const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init = { &envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[0], &envoy_extensions_filters_http_fault_v3_FaultAbort__fields[0], - UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000402000010, &upb_pov4_1bt}, + {0x000800000100001a, &upb_psm_1bt_maxmaxb}, + {0x0010000404010022, &upb_pom_1bt_max64b}, + {0x0010000405000028, &upb_pov4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit = { +const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = { - {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit}, - {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit}, - {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = { + {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init}, + {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init}, + {.submsg = &envoy_config_route_v3_HeaderMatcher_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_fault_v3_HTTPFault__fields[15] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(44, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(52, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(60, 120), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(68, 136), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(76, 152), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(84, 168), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_fault_v3_HTTPFault__fields[15] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(48, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(56, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(64, 120), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(72, 136), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(80, 152), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(88, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(28, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msginit = { +const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init = { &envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[0], &envoy_extensions_filters_http_fault_v3_HTTPFault__fields[0], - UPB_SIZE(96, 184), 15, kUpb_ExtMode_NonExtendable, 15, 255, 0, + UPB_SIZE(96, 184), 15, kUpb_ExtMode_NonExtendable, 15, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x002800003f020022, &upb_prm_1bt_maxmaxb}, + {0x003000003f00002a, &upb_prs_1bt}, + {0x0038000003030032, &upb_psm_1bt_maxmaxb}, + {0x004000000404003a, &upb_psm_1bt_maxmaxb}, + {0x004800003f000042, &upb_pss_1bt}, + {0x005800003f00004a, &upb_pss_1bt}, + {0x006800003f000052, &upb_pss_1bt}, + {0x007800003f00005a, &upb_pss_1bt}, + {0x008800003f000062, &upb_pss_1bt}, + {0x009800003f00006a, &upb_pss_1bt}, + {0x00a800003f000072, &upb_pss_1bt}, + {0x000100003f000078, &upb_psb1_1bt}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, - &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, - &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, + &envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, + &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, + &envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init, }; -const upb_MiniTable_File envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -90,5 +121,5 @@ const upb_MiniTable_File envoy_extensions_filters_http_fault_v3_fault_proto_upb_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 4a106be1ded..02b93fd2f3a 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 @@ -9,48 +9,50 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_filters_http_fault_v3_FaultAbort; -struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort; -struct envoy_extensions_filters_http_fault_v3_HTTPFault; typedef struct envoy_extensions_filters_http_fault_v3_FaultAbort envoy_extensions_filters_http_fault_v3_FaultAbort; typedef struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort; typedef struct envoy_extensions_filters_http_fault_v3_HTTPFault envoy_extensions_filters_http_fault_v3_HTTPFault; -extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msginit; -extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit; -extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msginit; +extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init; +extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init; +extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init; struct envoy_config_route_v3_HeaderMatcher; struct envoy_extensions_filters_common_fault_v3_FaultDelay; struct envoy_extensions_filters_common_fault_v3_FaultRateLimit; struct envoy_type_v3_FractionalPercent; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit; -extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msg_init; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init; +extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.extensions.filters.http.fault.v3.FaultAbort */ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena); + return (envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_fault_v3_FaultAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -60,7 +62,7 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_f int options, upb_Arena* arena) { envoy_extensions_filters_http_fault_v3_FaultAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -68,13 +70,13 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_f } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -84,86 +86,112 @@ typedef enum { envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET = 0 } envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases; UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_case(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return (envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; -} -UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_http_status(envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_extensions_filters_http_fault_v3_FaultAbort_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), UPB_SIZE(4, 4), 2, _upb_UInt32_FromU(0u)); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_percentage(envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_http_fault_v3_FaultAbort_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 8), const struct envoy_type_v3_FractionalPercent*); + const struct envoy_type_v3_FractionalPercent* default_val = NULL; + const struct envoy_type_v3_FractionalPercent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_header_abort(envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), UPB_SIZE(4, 4), 4, NULL); + const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* default_val = NULL; + const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_grpc_status(envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_extensions_filters_http_fault_v3_FaultAbort_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { - return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), UPB_SIZE(4, 4), 5, _upb_UInt32_FromU(0u)); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_http_status(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, uint32_t value) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_percentage(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, struct envoy_type_v3_FractionalPercent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 8), struct envoy_type_v3_FractionalPercent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_http_fault_v3_FaultAbort_mutable_percentage(envoy_extensions_filters_http_fault_v3_FaultAbort* msg, upb_Arena* arena) { struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_http_fault_v3_FaultAbort_percentage(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_fault_v3_FaultAbort_set_percentage(msg, sub); + sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); + if (sub) envoy_extensions_filters_http_fault_v3_FaultAbort_set_percentage(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_header_abort(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_mutable_header_abort(envoy_extensions_filters_http_fault_v3_FaultAbort* msg, upb_Arena* arena) { struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)envoy_extensions_filters_http_fault_v3_FaultAbort_header_abort(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_fault_v3_FaultAbort_set_header_abort(msg, sub); + sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, arena); + if (sub) envoy_extensions_filters_http_fault_v3_FaultAbort_set_header_abort(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_grpc_status(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, uint32_t value) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.http.fault.v3.FaultAbort.HeaderAbort */ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena); + return (envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -173,7 +201,7 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_ int options, upb_Arena* arena) { envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -181,13 +209,13 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msg_init, options, arena, &ptr, len); return ptr; } @@ -195,12 +223,12 @@ UPB_INLINE char* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_s /* envoy.extensions.filters.http.fault.v3.HTTPFault */ UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_filters_http_fault_v3_HTTPFault_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_fault_v3_HTTPFault*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena); + return (envoy_extensions_filters_http_fault_v3_HTTPFault*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_filters_http_fault_v3_HTTPFault_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_fault_v3_HTTPFault* ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -210,7 +238,7 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_fi int options, upb_Arena* arena) { envoy_extensions_filters_http_fault_v3_HTTPFault* ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -218,228 +246,356 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_fi } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_http_fault_v3_HTTPFault_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_extensions_filters_common_fault_v3_FaultDelay*); + const struct envoy_extensions_filters_common_fault_v3_FaultDelay* default_val = NULL; + const struct envoy_extensions_filters_common_fault_v3_FaultDelay* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_HTTPFault_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_filters_http_fault_v3_FaultAbort*); + const envoy_extensions_filters_http_fault_v3_FaultAbort* default_val = NULL; + const envoy_extensions_filters_http_fault_v3_FaultAbort* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_upstream_cluster(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_upstream_cluster(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_upstream_cluster(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_extensions_filters_http_fault_v3_HTTPFault_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_extensions_filters_http_fault_v3_HTTPFault_headers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_extensions_filters_http_fault_v3_HTTPFault_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) { - return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE upb_StringView const* envoy_extensions_filters_http_fault_v3_HTTPFault_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + size_t size; + envoy_extensions_filters_http_fault_v3_HTTPFault_downstream_nodes(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_extensions_filters_http_fault_v3_HTTPFault_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); -} -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_max_active_faults(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_response_rate_limit(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*); + const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* default_val = NULL; + const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_delay_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(48, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_abort_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(48, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay_duration_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay_duration_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(56, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_delay_duration_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(56, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_http_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_http_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(64, 120), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_abort_http_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {11, UPB_SIZE(64, 120), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_max_active_faults_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_max_active_faults_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(72, 136), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(72, 136), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_response_rate_limit_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_response_rate_limit_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(80, 152), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {13, UPB_SIZE(80, 152), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_grpc_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_grpc_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(88, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_abort_grpc_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 168), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {14, UPB_SIZE(88, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_disable_downstream_cluster_stats(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_disable_downstream_cluster_stats(envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(28, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_disable_downstream_cluster_stats(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {15, UPB_SIZE(28, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct envoy_extensions_filters_common_fault_v3_FaultDelay* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_extensions_filters_common_fault_v3_FaultDelay*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_delay(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) { struct envoy_extensions_filters_common_fault_v3_FaultDelay* sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay*)envoy_extensions_filters_http_fault_v3_HTTPFault_delay(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay(msg, sub); + sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msg_init, arena); + if (sub) envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, envoy_extensions_filters_http_fault_v3_FaultAbort* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_filters_http_fault_v3_FaultAbort*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_abort(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) { struct envoy_extensions_filters_http_fault_v3_FaultAbort* sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort*)envoy_extensions_filters_http_fault_v3_HTTPFault_abort(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort(msg, sub); + sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_msg_init, arena); + if (sub) envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_upstream_cluster(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) { - return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_resize_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_resize_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_HeaderMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_extensions_filters_http_fault_v3_HTTPFault_add_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) { - struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE upb_StringView* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_filters_http_fault_v3_HTTPFault_resize_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_filters_http_fault_v3_HTTPFault_resize_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_add_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_max_active_faults(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_response_rate_limit(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) { struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*)envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit(msg, sub); + sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msg_init, arena); + if (sub) envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_StringView) = value; + const upb_MiniTableField field = {9, UPB_SIZE(48, 88), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay_duration_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_StringView) = value; + const upb_MiniTableField field = {10, UPB_SIZE(56, 104), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_http_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_StringView) = value; + const upb_MiniTableField field = {11, UPB_SIZE(64, 120), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 136), upb_StringView) = value; + const upb_MiniTableField field = {12, UPB_SIZE(72, 136), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 152), upb_StringView) = value; + const upb_MiniTableField field = {13, UPB_SIZE(80, 152), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_grpc_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 168), upb_StringView) = value; + const upb_MiniTableField field = {14, UPB_SIZE(88, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_disable_downstream_cluster_stats(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {15, UPB_SIZE(28, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_ */ 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 767e2f03d21..c555d6c41db 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/filters/http/rbac/v3/rbac.upb.h" #include "envoy/config/rbac/v3/rbac.upb.h" #include "xds/annotations/v3/status.upb.h" @@ -16,49 +18,66 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[4] = { - {.submsg = &envoy_config_rbac_v3_RBAC_msginit}, - {.submsg = &envoy_config_rbac_v3_RBAC_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[4] = { + {.submsg = &envoy_config_rbac_v3_RBAC_msg_init}, + {.submsg = &envoy_config_rbac_v3_RBAC_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_rbac_v3_RBAC__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_rbac_v3_RBAC__fields[5] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msginit = { +const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msg_init = { &envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[0], &envoy_extensions_filters_http_rbac_v3_RBAC__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x0028000003020022, &upb_psm_1bt_maxmaxb}, + {0x003000000403002a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[1] = { - {.submsg = &envoy_extensions_filters_http_rbac_v3_RBAC_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[1] = { + {.submsg = &envoy_extensions_filters_http_rbac_v3_RBAC_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[1] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[1] = { + {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit = { +const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init = { &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[0], &envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, - &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, + &envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, + &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init, }; -const upb_MiniTable_File envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -67,5 +86,5 @@ const upb_MiniTable_File envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_fi 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 ad8061cc5df..c8896cb37ff 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 @@ -9,39 +9,42 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_filters_http_rbac_v3_RBAC; -struct envoy_extensions_filters_http_rbac_v3_RBACPerRoute; typedef struct envoy_extensions_filters_http_rbac_v3_RBAC envoy_extensions_filters_http_rbac_v3_RBAC; typedef struct envoy_extensions_filters_http_rbac_v3_RBACPerRoute envoy_extensions_filters_http_rbac_v3_RBACPerRoute; -extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msginit; -extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit; +extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msg_init; +extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init; struct envoy_config_rbac_v3_RBAC; struct xds_type_matcher_v3_Matcher; -extern const upb_MiniTable envoy_config_rbac_v3_RBAC_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_msginit; +extern const upb_MiniTable envoy_config_rbac_v3_RBAC_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_msg_init; /* envoy.extensions.filters.http.rbac.v3.RBAC */ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena); + return (envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_rbac_v3_RBAC* ret = envoy_extensions_filters_http_rbac_v3_RBAC_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -51,7 +54,7 @@ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_ int options, upb_Arena* arena) { envoy_extensions_filters_http_rbac_v3_RBAC* ret = envoy_extensions_filters_http_rbac_v3_RBAC_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -59,110 +62,136 @@ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_rules(envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_rbac_v3_RBAC*); + const struct envoy_config_rbac_v3_RBAC* default_val = NULL; + const struct envoy_config_rbac_v3_RBAC* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_rbac_v3_RBAC*); + const struct envoy_config_rbac_v3_RBAC* default_val = NULL; + const struct envoy_config_rbac_v3_RBAC* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_rules_stat_prefix(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_rules_stat_prefix(envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules_stat_prefix(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_matcher(envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher* envoy_extensions_filters_http_rbac_v3_RBAC_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct xds_type_matcher_v3_Matcher*); + const struct xds_type_matcher_v3_Matcher* default_val = NULL; + const struct xds_type_matcher_v3_Matcher* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_shadow_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_matcher(envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher* envoy_extensions_filters_http_rbac_v3_RBAC_shadow_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct xds_type_matcher_v3_Matcher*); + const struct xds_type_matcher_v3_Matcher* default_val = NULL; + const struct xds_type_matcher_v3_Matcher* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_shadow_matcher(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct envoy_config_rbac_v3_RBAC* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_rbac_v3_RBAC*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_rules(envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_RBAC* sub = (struct envoy_config_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBAC_rules(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(msg, sub); + sub = (struct envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msg_init, arena); + if (sub) envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct envoy_config_rbac_v3_RBAC* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_rbac_v3_RBAC*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena) { struct envoy_config_rbac_v3_RBAC* sub = (struct envoy_config_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules(msg); if (sub == NULL) { - sub = (struct envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(msg, sub); + sub = (struct envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msg_init, arena); + if (sub) envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules_stat_prefix(envoy_extensions_filters_http_rbac_v3_RBAC *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_matcher(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct xds_type_matcher_v3_Matcher* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct xds_type_matcher_v3_Matcher*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_matcher(envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)envoy_extensions_filters_http_rbac_v3_RBAC_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_rbac_v3_RBAC_set_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msg_init, arena); + if (sub) envoy_extensions_filters_http_rbac_v3_RBAC_set_matcher(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_matcher(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct xds_type_matcher_v3_Matcher* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct xds_type_matcher_v3_Matcher*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_shadow_matcher(envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)envoy_extensions_filters_http_rbac_v3_RBAC_shadow_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msg_init, arena); + if (sub) envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_matcher(msg, sub); } return sub; } @@ -170,12 +199,12 @@ UPB_INLINE struct xds_type_matcher_v3_Matcher* envoy_extensions_filters_http_rba /* envoy.extensions.filters.http.rbac.v3.RBACPerRoute */ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_rbac_v3_RBACPerRoute*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, arena); + return (envoy_extensions_filters_http_rbac_v3_RBACPerRoute*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_rbac_v3_RBACPerRoute* ret = envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -185,7 +214,7 @@ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_ int options, upb_Arena* arena) { envoy_extensions_filters_http_rbac_v3_RBACPerRoute* ret = envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -193,45 +222,50 @@ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_ } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBACPerRoute_clear_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBACPerRoute_clear_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_filters_http_rbac_v3_RBAC*); + const envoy_extensions_filters_http_rbac_v3_RBAC* default_val = NULL; + const envoy_extensions_filters_http_rbac_v3_RBAC* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBACPerRoute_has_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg, envoy_extensions_filters_http_rbac_v3_RBAC* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_filters_http_rbac_v3_RBAC*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_mutable_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg, upb_Arena* arena) { struct envoy_extensions_filters_http_rbac_v3_RBAC* sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(msg, sub); + sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBAC_msg_init, arena); + if (sub) envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_ */ 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 caf754277de..07a33cf0acc 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/filters/http/router/v3/router.upb.h" #include "envoy/config/accesslog/v3/accesslog.upb.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h" @@ -16,36 +18,55 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_filters_http_router_v3_Router_submsgs[3] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_router_v3_Router_submsgs[3] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_accesslog_v3_AccessLog_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_router_v3_Router__fields[8] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_router_v3_Router__fields[8] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(25, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msginit = { +const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msg_init = { &envoy_extensions_filters_http_router_v3_Router_submsgs[0], &envoy_extensions_filters_http_router_v3_Router__fields[0], - UPB_SIZE(24, 40), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(32, 40), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x001000003f01001a, &upb_prm_1bt_maxmaxb}, + {0x000200003f000020, &upb_psb1_1bt}, + {0x001800003f00002a, &upb_prs_1bt}, + {0x000300003f000030, &upb_psb1_1bt}, + {0x000400003f000038, &upb_psb1_1bt}, + {0x002000003f020042, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_extensions_filters_http_router_v3_Router_msginit, + &envoy_extensions_filters_http_router_v3_Router_msg_init, }; -const upb_MiniTable_File envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -54,5 +75,5 @@ const upb_MiniTable_File envoy_extensions_filters_http_router_v3_router_proto_up 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 0e6bc543fb6..1ee0ef1ef2d 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 @@ -9,38 +9,42 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_filters_http_router_v3_Router; typedef struct envoy_extensions_filters_http_router_v3_Router envoy_extensions_filters_http_router_v3_Router; -extern const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msginit; +extern const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msg_init; struct envoy_config_accesslog_v3_AccessLog; struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter; struct google_protobuf_BoolValue; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; /* envoy.extensions.filters.http.router.v3.Router */ UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filters_http_router_v3_Router_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_router_v3_Router*)_upb_Message_New(&envoy_extensions_filters_http_router_v3_Router_msginit, arena); + return (envoy_extensions_filters_http_router_v3_Router*)_upb_Message_New(&envoy_extensions_filters_http_router_v3_Router_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filters_http_router_v3_Router_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_router_v3_Router* ret = envoy_extensions_filters_http_router_v3_Router_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +54,7 @@ UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filt int options, upb_Arena* arena) { envoy_extensions_filters_http_router_v3_Router* ret = envoy_extensions_filters_http_router_v3_Router_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,138 +62,246 @@ UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filt } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_dynamic_stats(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_start_child_span(const envoy_extensions_filters_http_router_v3_Router* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_start_child_span(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_start_child_span(const envoy_extensions_filters_http_router_v3_Router* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); + size_t size; + envoy_extensions_filters_http_router_v3_Router_upstream_log(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); -} -UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) { - return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); -} -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_suppress_envoy_headers(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE upb_StringView const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router* msg) { + size_t size; + envoy_extensions_filters_http_router_v3_Router_strict_check_headers(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_respect_expected_rq_timeout(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_suppress_grpc_request_failure_code_stats(const envoy_extensions_filters_http_router_v3_Router* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_suppress_grpc_request_failure_code_stats(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(25, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_grpc_request_failure_code_stats(const envoy_extensions_filters_http_router_v3_Router* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(25, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_upstream_http_filters(envoy_extensions_filters_http_router_v3_Router* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_http_router_v3_Router_upstream_http_filters(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_http_filters(const envoy_extensions_filters_http_router_v3_Router* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); -} -UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_upstream_http_filters(const envoy_extensions_filters_http_router_v3_Router* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); -} -UPB_INLINE const struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_http_router_v3_Router_upstream_http_filters(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) { - return (const struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); + size_t size; + envoy_extensions_filters_http_router_v3_Router_upstream_http_filters(msg, &size); + return size != 0; } UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_mutable_dynamic_stats(envoy_extensions_filters_http_router_v3_Router* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_http_router_v3_Router_dynamic_stats(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_start_child_span(envoy_extensions_filters_http_router_v3_Router *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_resize_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_resize_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_accesslog_v3_AccessLog**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_http_router_v3_Router_add_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, upb_Arena* arena) { - struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_envoy_headers(envoy_extensions_filters_http_router_v3_Router *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_extensions_filters_http_router_v3_Router_mutable_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE upb_StringView* envoy_extensions_filters_http_router_v3_Router_mutable_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_filters_http_router_v3_Router_resize_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_filters_http_router_v3_Router_resize_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_add_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {5, UPB_SIZE(20, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_respect_expected_rq_timeout(envoy_extensions_filters_http_router_v3_Router *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_grpc_request_failure_code_stats(envoy_extensions_filters_http_router_v3_Router *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {7, UPB_SIZE(25, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_http_filters(envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) { - return (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_http_filters(envoy_extensions_filters_http_router_v3_Router* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(28, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_http_router_v3_Router_resize_upstream_http_filters(envoy_extensions_filters_http_router_v3_Router* msg, size_t len, upb_Arena* arena) { - return (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_http_router_v3_Router_resize_upstream_http_filters(envoy_extensions_filters_http_router_v3_Router* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(28, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_http_router_v3_Router_add_upstream_http_filters(envoy_extensions_filters_http_router_v3_Router* msg, upb_Arena* arena) { - struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(28, 32), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c b/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c index ad2079ab164..68e0caf299e 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c @@ -7,49 +7,62 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h" #include "envoy/config/core/v3/extension.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_filters_http_stateful_session_v3_StatefulSession_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_stateful_session_v3_StatefulSession_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_stateful_session_v3_StatefulSession__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_stateful_session_v3_StatefulSession__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit = { +const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init = { &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_submsgs[0], &envoy_extensions_filters_http_stateful_session_v3_StatefulSession__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_submsgs[1] = { - {.submsg = &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_submsgs[1] = { + {.submsg = &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute__fields[2] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit = { +const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init = { &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_submsgs[0], &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_pob1_1bt}, + {0x0008000002000012, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, - &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit, + &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, + &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init, }; -const upb_MiniTable_File envoy_extensions_filters_http_stateful_session_v3_stateful_session_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_filters_http_stateful_session_v3_stateful_session_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -58,5 +71,5 @@ const upb_MiniTable_File envoy_extensions_filters_http_stateful_session_v3_state 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h b/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h index d93a0593580..3887236c400 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h @@ -9,37 +9,40 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_STATEFUL_SESSION_V3_STATEFUL_SESSION_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_STATEFUL_SESSION_V3_STATEFUL_SESSION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession; -struct envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute; typedef struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession envoy_extensions_filters_http_stateful_session_v3_StatefulSession; typedef struct envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute; -extern const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit; -extern const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit; +extern const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init; +extern const upb_MiniTable envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init; struct envoy_config_core_v3_TypedExtensionConfig; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; /* envoy.extensions.filters.http.stateful_session.v3.StatefulSession */ UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSession* envoy_extensions_filters_http_stateful_session_v3_StatefulSession_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_stateful_session_v3_StatefulSession*)_upb_Message_New(&envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, arena); + return (envoy_extensions_filters_http_stateful_session_v3_StatefulSession*)_upb_Message_New(&envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSession* envoy_extensions_filters_http_stateful_session_v3_StatefulSession_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_stateful_session_v3_StatefulSession* ret = envoy_extensions_filters_http_stateful_session_v3_StatefulSession_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSession* en int options, upb_Arena* arena) { envoy_extensions_filters_http_stateful_session_v3_StatefulSession* ret = envoy_extensions_filters_http_stateful_session_v3_StatefulSession_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,35 +60,40 @@ UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSession* en } UPB_INLINE char* envoy_extensions_filters_http_stateful_session_v3_StatefulSession_serialize(const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_filters_http_stateful_session_v3_StatefulSession_serialize_ex(const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSession_has_session_state(const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSession_clear_session_state(const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSession_clear_session_state(envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_http_stateful_session_v3_StatefulSession_session_state(const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSession_has_session_state(const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSession_set_session_state(envoy_extensions_filters_http_stateful_session_v3_StatefulSession *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_http_stateful_session_v3_StatefulSession_mutable_session_state(envoy_extensions_filters_http_stateful_session_v3_StatefulSession* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_filters_http_stateful_session_v3_StatefulSession_session_state(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_stateful_session_v3_StatefulSession_set_session_state(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_extensions_filters_http_stateful_session_v3_StatefulSession_set_session_state(msg, sub); } return sub; } @@ -93,12 +101,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_fi /* envoy.extensions.filters.http.stateful_session.v3.StatefulSessionPerRoute */ UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_new(upb_Arena* arena) { - return (envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute*)_upb_Message_New(&envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit, arena); + return (envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute*)_upb_Message_New(&envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init, arena); } UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* ret = envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -108,7 +116,7 @@ UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerR int options, upb_Arena* arena) { envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* ret = envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -116,13 +124,13 @@ UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerR } UPB_INLINE char* envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_serialize(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_serialize_ex(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -131,49 +139,63 @@ typedef enum { envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_NOT_SET = 0 } envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_oneofcases; UPB_INLINE envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_oneofcases envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_case(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - return (envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_has_disabled(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_clear_disabled(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_NOT_SET); +UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_clear_disabled(envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_disabled(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_has_stateful_session(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_has_disabled(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_clear_stateful_session(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_stateful_session_v3_StatefulSession*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_override_NOT_SET); +UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_clear_stateful_session(envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_stateful_session(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_http_stateful_session_v3_StatefulSession*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* default_val = NULL; + const envoy_extensions_filters_http_stateful_session_v3_StatefulSession* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_has_stateful_session(const envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_set_disabled(envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_set_stateful_session(envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute *msg, envoy_extensions_filters_http_stateful_session_v3_StatefulSession* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_stateful_session_v3_StatefulSession*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession* envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_mutable_stateful_session(envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute* msg, upb_Arena* arena) { struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession* sub = (struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession*)envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_stateful_session(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession*)_upb_Message_New(&envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_set_stateful_session(msg, sub); + sub = (struct envoy_extensions_filters_http_stateful_session_v3_StatefulSession*)_upb_Message_New(&envoy_extensions_filters_http_stateful_session_v3_StatefulSession_msg_init, arena); + if (sub) envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_set_stateful_session(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_filters_http_stateful_session_v3_stateful_session_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_filters_http_stateful_session_v3_stateful_session_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_STATEFUL_SESSION_V3_STATEFUL_SESSION_PROTO_UPB_H_ */ 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 0054574339a..490d93d2756 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h" #include "envoy/config/accesslog/v3/accesslog.upb.h" #include "envoy/config/core/v3/address.upb.h" @@ -31,442 +33,617 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[34] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit}, - {.submsg = &envoy_config_route_v3_RouteConfiguration_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit}, - {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msginit}, - {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit}, - {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit}, - {.submsg = &envoy_config_core_v3_Http3ProtocolOptions_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_SchemeHeaderTransformation_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[34] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init}, + {.submsg = &envoy_config_route_v3_RouteConfiguration_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init}, + {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msg_init}, + {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_accesslog_v3_AccessLog_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init}, + {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init}, + {.submsg = &envoy_config_core_v3_Http3ProtocolOptions_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_SchemeHeaderTransformation_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[53] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(52, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(200, 352), UPB_SIZE(-25, -25), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(200, 352), UPB_SIZE(-25, -25), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(60, 72), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(64, 80), UPB_SIZE(1, 1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(68, 88), UPB_SIZE(2, 2), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(72, 96), UPB_SIZE(3, 3), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(76, 104), UPB_SIZE(4, 4), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(80, 112), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(88, 128), UPB_SIZE(5, 5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(92, 136), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(96, 144), UPB_SIZE(6, 6), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(100, 152), UPB_SIZE(7, 7), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(104, 160), UPB_SIZE(8, 8), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(21, 21), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(108, 168), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(116, 184), UPB_SIZE(0, 0), 12, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(120, 192), UPB_SIZE(9, 9), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(124, 200), UPB_SIZE(10, 10), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(128, 208), UPB_SIZE(11, 11), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {28, UPB_SIZE(132, 216), UPB_SIZE(12, 12), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {29, UPB_SIZE(136, 224), UPB_SIZE(13, 13), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {30, UPB_SIZE(140, 232), UPB_SIZE(14, 14), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(200, 352), UPB_SIZE(-25, -25), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {32, UPB_SIZE(28, 28), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {33, UPB_SIZE(29, 29), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {34, UPB_SIZE(32, 32), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {35, UPB_SIZE(144, 240), UPB_SIZE(15, 15), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(148, 248), UPB_SIZE(16, 16), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(36, 36), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {38, UPB_SIZE(152, 256), UPB_SIZE(17, 17), 22, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {39, UPB_SIZE(37, 37), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {40, UPB_SIZE(156, 264), UPB_SIZE(18, 18), 23, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {41, UPB_SIZE(160, 272), UPB_SIZE(19, 19), 24, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {42, UPB_SIZE(204, 360), UPB_SIZE(-41, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {43, UPB_SIZE(164, 280), UPB_SIZE(20, 20), 25, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {44, UPB_SIZE(168, 288), UPB_SIZE(21, 21), 26, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {45, UPB_SIZE(44, 44), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {46, UPB_SIZE(172, 296), UPB_SIZE(0, 0), 27, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {47, UPB_SIZE(48, 48), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {48, UPB_SIZE(176, 304), UPB_SIZE(22, 22), 28, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {49, UPB_SIZE(180, 312), UPB_SIZE(23, 23), 29, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {50, UPB_SIZE(184, 320), UPB_SIZE(24, 24), 30, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {51, UPB_SIZE(49, 49), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {52, UPB_SIZE(188, 328), UPB_SIZE(0, 0), 31, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {53, UPB_SIZE(192, 336), UPB_SIZE(25, 25), 32, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {54, UPB_SIZE(196, 344), UPB_SIZE(26, 26), 33, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {55, UPB_SIZE(50, 50), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[53] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(196, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 72), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 80), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 96), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(24, 104), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(204, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(28, 128), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(32, 136), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(36, 144), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(40, 152), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(48, 160), 8, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(52, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(56, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(60, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(61, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(212, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(64, 184), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(68, 192), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(72, 200), 10, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(76, 208), 11, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {28, UPB_SIZE(80, 216), 12, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {29, UPB_SIZE(84, 224), 13, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {30, UPB_SIZE(88, 232), 14, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {31, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {32, UPB_SIZE(96, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {33, UPB_SIZE(97, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(100, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {35, UPB_SIZE(104, 240), 15, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(108, 248), 16, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(112, 36), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {38, UPB_SIZE(116, 256), 17, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(120, 37), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(124, 264), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(128, 272), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {42, UPB_SIZE(192, 360), UPB_SIZE(-133, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {43, UPB_SIZE(136, 280), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {44, UPB_SIZE(140, 288), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {45, UPB_SIZE(144, 44), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {46, UPB_SIZE(148, 296), 0, 27, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {47, UPB_SIZE(152, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {48, UPB_SIZE(156, 304), 22, 28, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {49, UPB_SIZE(160, 312), 23, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {50, UPB_SIZE(164, 320), 24, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {51, UPB_SIZE(168, 49), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {52, UPB_SIZE(172, 328), 0, 31, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {53, UPB_SIZE(176, 336), 25, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {54, UPB_SIZE(180, 344), 26, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {55, UPB_SIZE(184, 50), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[0], - UPB_SIZE(208, 368), 53, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(224, 368), 53, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x003800003f000012, &upb_pss_1bt}, + {0x016000180300001a, &upb_pom_1bt_max64b}, + {0x0160001804010022, &upb_pom_1bt_maxmaxb}, + {0x004800003f02002a, &upb_prm_1bt_max64b}, + {0x0050000001030032, &upb_psm_1bt_maxmaxb}, + {0x005800000204003a, &upb_psm_1bt_max64b}, + {0x0060000003050042, &upb_psm_1bt_maxmaxb}, + {0x006800000406004a, &upb_psm_1bt_maxmaxb}, + {0x007000003f000052, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0080000005070062, &upb_psm_1bt_maxmaxb}, + {0x008800003f08006a, &upb_prm_1bt_maxmaxb}, + {0x0090000006090072, &upb_psm_1bt_maxmaxb}, + {0x00980000070a007a, &upb_psm_1bt_maxmaxb}, + {0x000800003f000180, &upb_psv4_2bt}, + {0x00a00000080b018a, &upb_psm_2bt_max64b}, + {0x000c00003f000190, &upb_psb1_2bt}, + {0x001000003f000198, &upb_psv4_2bt}, + {0x001400003f0001a0, &upb_psb1_2bt}, + {0x001500003f0001a8, &upb_psb1_2bt}, + {0x00a800003f0001b2, &upb_pss_2bt}, + {0x00b800003f0c01ba, &upb_prm_2bt_max64b}, + {0x00c00000090d01c2, &upb_psm_2bt_maxmaxb}, + {0x00c800000a0e01ca, &upb_psm_2bt_max64b}, + {0x00d000000b0f01d2, &upb_psm_2bt_maxmaxb}, + {0x01180000141902da, &upb_psm_2bt_max64b}, + {0x00d800000c1001e2, &upb_psm_2bt_maxmaxb}, + {0x00e000000d1101ea, &upb_psm_2bt_maxmaxb}, + {0x00e800000e1201f2, &upb_psm_2bt_maxmaxb}, + {0x016000181f1301fa, &upb_pom_2bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[6] = { - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_type_tracing_v3_CustomTag_msginit}, - {.submsg = &envoy_config_trace_v3_Tracing_Http_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[6] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_type_tracing_v3_CustomTag_msg_init}, + {.submsg = &envoy_config_trace_v3_Tracing_Http_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = { - {3, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(24, 48), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = { + {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[0], - UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100001a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010022, &upb_psm_1bt_maxmaxb}, + {0x001800000302002a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000030, &upb_psb1_1bt}, + {0x002000000403003a, &upb_psm_1bt_maxmaxb}, + {0x002800003f040042, &upb_prm_1bt_maxmaxb}, + {0x003000000505004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000800003f000012, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = { - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(11, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[0], - UPB_SIZE(16, 16), 5, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 16, 5, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000100003f000018, &upb_psb1_1bt}, + {0x000200003f000020, &upb_psb1_1bt}, + {0x000300003f000028, &upb_psb1_1bt}, + {0x000400003f000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000101001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[2] = { - {.submsg = &envoy_type_http_v3_PathTransformation_msginit}, - {.submsg = &envoy_type_http_v3_PathTransformation_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[2] = { + {.submsg = &envoy_type_http_v3_PathTransformation_msg_init}, + {.submsg = &envoy_type_http_v3_PathTransformation_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init = { &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(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig__fields[6] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig__fields[6] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 2, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, 3, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, 8, -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init = { NULL, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig__fields[0], - UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x000200003f000018, &upb_psb1_1bt}, + {0x000300003f000020, &upb_psb1_1bt}, + {0x0008000405000028, &upb_pob1_1bt}, + {0x0008000406000032, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit}, - {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init}, + {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = { - {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msginit}, - {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = { + {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msg_init}, + {.submsg = &envoy_config_core_v3_HeaderValueOption_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[0], - UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800003f04002a, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = { - {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = { + {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit}, - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit}, - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init}, + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init}, + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 40), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[0], - UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + {0x0028000404020022, &upb_pom_1bt_max64b}, + {0x002800040503002a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[1] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 40), UPB_SIZE(-1, -1), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 40), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[4] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[0], - UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x0028000003000018, &upb_pov4_1bt}, + {0x0028000004000022, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init = { NULL, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init = { &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, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[4] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[0], - UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0018000004000022, &upb_pom_1bt_maxmaxb}, + {0x001800000501002a, &upb_pom_1bt_maxmaxb}, + {0x000400003f000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init = { &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[0], &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[1] = { - {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit}, +static const upb_MiniTableSub envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[1] = { + {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit = { +const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init = { &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, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[20] = { - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, - &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, + &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init, }; -const upb_MiniTable_File envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -475,5 +652,5 @@ const upb_MiniTable_File envoy_extensions_filters_network_http_connection_manage 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 54a90f924ee..b1f1f19a2a4 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 @@ -9,37 +9,22 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig; -struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig; -struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper; -struct envoy_extensions_filters_network_http_connection_manager_v3_Rds; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement; -struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds; -struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter; -struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension; -struct envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager; typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager; typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing; typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig; @@ -60,26 +45,26 @@ typedef struct envoy_extensions_filters_network_http_connection_manager_v3_Scope typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter; typedef struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension; typedef struct envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit; -extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init; +extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init; struct envoy_config_accesslog_v3_AccessLog; struct envoy_config_accesslog_v3_AccessLogFilter; struct envoy_config_core_v3_CidrRange; @@ -104,30 +89,30 @@ struct google_protobuf_Any; struct google_protobuf_BoolValue; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit; -extern const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msginit; -extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit; -extern const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msginit; -extern const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit; -extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msginit; -extern const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msginit; -extern const upb_MiniTable envoy_type_http_v3_PathTransformation_msginit; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msg_init; +extern const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msg_init; +extern const upb_MiniTable envoy_config_core_v3_CidrRange_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msg_init; +extern const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msg_init; +extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msg_init; +extern const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msg_init; +extern const upb_MiniTable envoy_type_http_v3_PathTransformation_msg_init; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_AUTO = 0, @@ -168,12 +153,12 @@ typedef enum { /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -183,7 +168,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -191,13 +176,13 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -207,940 +192,1330 @@ typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_strip_any_host_port = 42, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 40), int32_t); + const upb_MiniTableField field = {42, UPB_SIZE(192, 360), UPB_SIZE(-133, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_codec_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_codec_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_codec_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stat_prefix(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(196, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(196, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 3; -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(200, 352), 0, UPB_SIZE(24, 24), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(200, 352), UPB_SIZE(24, 24), 3, NULL); + const envoy_extensions_filters_network_http_connection_manager_v3_Rds* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_Rds* ret; + const upb_MiniTableField field = {3, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 4; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(200, 352), 0, UPB_SIZE(24, 24), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(200, 352), UPB_SIZE(24, 24), 4, NULL); + const struct envoy_config_route_v3_RouteConfiguration* default_val = NULL; + const struct envoy_config_route_v3_RouteConfiguration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 72), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 72), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 72)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - _upb_array_detach(msg, UPB_SIZE(60, 72)); -} -UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(60, 72), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 80), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 80), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 80), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 80), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 88), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 88), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*); + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* ret; + const upb_MiniTableField field = {7, UPB_SIZE(16, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 96), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 96), const struct envoy_config_core_v3_Http1ProtocolOptions*); + const struct envoy_config_core_v3_Http1ProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_Http1ProtocolOptions* ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 96), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 96), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 104), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 104), const struct envoy_config_core_v3_Http2ProtocolOptions*); + const struct envoy_config_core_v3_Http2ProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_Http2ProtocolOptions* ret; + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_server_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(204, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 112), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(204, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(88, 128), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(28, 128), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(88, 128), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {12, UPB_SIZE(28, 128), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(28, 128), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 136), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 136), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 136)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - _upb_array_detach(msg, UPB_SIZE(92, 136)); -} -UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(92, 136), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 6); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 144), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 144), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(96, 144), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {14, UPB_SIZE(36, 144), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 144), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(100, 152), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(40, 152), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(100, 152), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {15, UPB_SIZE(40, 152), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_forward_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(40, 152), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_forward_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_forward_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {16, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 8); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(104, 160), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(48, 160), 8, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(104, 160), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*); + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* ret; + const upb_MiniTableField field = {17, UPB_SIZE(48, 160), 8, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(48, 160), 8, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_proxy_100_continue(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(52, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {18, UPB_SIZE(52, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_xff_num_trusted_hops(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(56, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {19, UPB_SIZE(56, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(60, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {20, UPB_SIZE(60, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_skip_xff_append(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(61, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {21, UPB_SIZE(61, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_via(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(212, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {22, UPB_SIZE(212, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(64, 184), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + const upb_MiniTableField field = {23, UPB_SIZE(64, 184), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 184)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - _upb_array_detach(msg, UPB_SIZE(116, 184)); -} -UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(116, 184), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 9); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(120, 192), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(68, 192), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(120, 192), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {24, UPB_SIZE(68, 192), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(68, 192), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(124, 200), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(72, 200), 10, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(124, 200), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*); + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* ret; + const upb_MiniTableField field = {25, UPB_SIZE(72, 200), 10, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(72, 200), 10, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(128, 208), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(76, 208), 11, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(128, 208), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {26, UPB_SIZE(76, 208), 11, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 12); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(76, 208), 11, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(80, 216), 12, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {28, UPB_SIZE(80, 216), 12, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {28, UPB_SIZE(80, 216), 12, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(84, 224), 13, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {29, UPB_SIZE(84, 224), 13, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {29, UPB_SIZE(84, 224), 13, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(88, 232), 14, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {30, UPB_SIZE(88, 232), 14, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(24, 24)) == 31; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {30, UPB_SIZE(88, 232), 14, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(200, 352), 0, UPB_SIZE(24, 24), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(200, 352), UPB_SIZE(24, 24), 31, NULL); + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* ret; + const upb_MiniTableField field = {31, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {31, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_preserve_external_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {32, UPB_SIZE(96, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {32, UPB_SIZE(96, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_merge_slashes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {33, UPB_SIZE(97, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {33, UPB_SIZE(97, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_server_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int32_t) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_server_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(100, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {34, UPB_SIZE(100, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 15); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(144, 240), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(104, 240), 15, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(144, 240), const struct envoy_config_core_v3_HttpProtocolOptions*); + const struct envoy_config_core_v3_HttpProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_HttpProtocolOptions* ret; + const upb_MiniTableField field = {35, UPB_SIZE(104, 240), 15, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 16); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {35, UPB_SIZE(104, 240), 15, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(148, 248), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(108, 248), 16, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(148, 248), const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*); + const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* ret; + const upb_MiniTableField field = {36, UPB_SIZE(108, 248), 16, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 36), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(108, 248), 16, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_always_set_request_id_in_response(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(112, 36), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 36), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {37, UPB_SIZE(112, 36), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 17); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(152, 256), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {38, UPB_SIZE(116, 256), 17, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(152, 256), const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*); + const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* ret; + const upb_MiniTableField field = {38, UPB_SIZE(116, 256), 17, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(37, 37), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {38, UPB_SIZE(116, 256), 17, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_matching_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(120, 37), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(37, 37), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {39, UPB_SIZE(120, 37), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 18); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(156, 264), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(124, 264), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(156, 264), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {40, UPB_SIZE(124, 264), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 19); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(124, 264), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(128, 272), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {41, UPB_SIZE(128, 272), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(40, 40)) == 42; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(128, 272), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(204, 360), 0, UPB_SIZE(40, 40), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_any_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {42, UPB_SIZE(192, 360), UPB_SIZE(-133, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(204, 360), UPB_SIZE(40, 40), 42, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {42, UPB_SIZE(192, 360), UPB_SIZE(-133, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 20); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {42, UPB_SIZE(192, 360), UPB_SIZE(-133, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {43, UPB_SIZE(136, 280), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*); + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* ret; + const upb_MiniTableField field = {43, UPB_SIZE(136, 280), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 21); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {43, UPB_SIZE(136, 280), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(140, 288), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Http3ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const struct envoy_config_core_v3_Http3ProtocolOptions*); + const struct envoy_config_core_v3_Http3ProtocolOptions* default_val = NULL; + const struct envoy_config_core_v3_Http3ProtocolOptions* ret; + const upb_MiniTableField field = {44, UPB_SIZE(140, 288), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_path_with_escaped_slashes_action(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 44), int32_t) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(140, 288), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_path_with_escaped_slashes_action(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {45, UPB_SIZE(144, 44), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_with_escaped_slashes_action(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 44), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {45, UPB_SIZE(144, 44), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {46, UPB_SIZE(148, 296), 0, 27, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + const upb_MiniTableField field = {46, UPB_SIZE(148, 296), 0, 27, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(172, 296)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_original_ip_detection_extensions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - _upb_array_detach(msg, UPB_SIZE(172, 296)); -} -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(172, 296), len); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_trailing_host_dot(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_trailing_host_dot(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {47, UPB_SIZE(152, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_trailing_host_dot(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {47, UPB_SIZE(152, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 22); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {48, UPB_SIZE(156, 304), 22, 28, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_SchemeHeaderTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const struct envoy_config_core_v3_SchemeHeaderTransformation*); + const struct envoy_config_core_v3_SchemeHeaderTransformation* default_val = NULL; + const struct envoy_config_core_v3_SchemeHeaderTransformation* ret; + const upb_MiniTableField field = {48, UPB_SIZE(156, 304), 22, 28, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 23); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {48, UPB_SIZE(156, 304), 22, 28, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_proxy_status_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {49, UPB_SIZE(160, 312), 23, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*); + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* ret; + const upb_MiniTableField field = {49, UPB_SIZE(160, 312), 23, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_typed_header_validation_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 24); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {49, UPB_SIZE(160, 312), 23, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_typed_header_validation_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(184, 320), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_typed_header_validation_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(164, 320), 24, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_typed_header_validation_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(184, 320), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {50, UPB_SIZE(164, 320), 24, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_append_x_forwarded_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(49, 49), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_typed_header_validation_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(164, 320), 24, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_append_x_forwarded_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {51, UPB_SIZE(168, 49), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_append_x_forwarded_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(49, 49), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {51, UPB_SIZE(168, 49), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_early_header_mutation_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {52, UPB_SIZE(172, 328), 0, 31, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_early_header_mutation_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + const upb_MiniTableField field = {52, UPB_SIZE(172, 328), 0, 31, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_early_header_mutation_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(188, 328)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_early_header_mutation_extensions(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_early_header_mutation_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - _upb_array_detach(msg, UPB_SIZE(188, 328)); -} -UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_early_header_mutation_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(188, 328), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_proxy_protocol_connection_state(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 25); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_add_proxy_protocol_connection_state(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(192, 336), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_add_proxy_protocol_connection_state(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {53, UPB_SIZE(176, 336), 25, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_proxy_protocol_connection_state(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(192, 336), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {53, UPB_SIZE(176, 336), 25, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log_flush_interval(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return _upb_hasbit(msg, 26); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_proxy_protocol_connection_state(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {53, UPB_SIZE(176, 336), 25, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_access_log_flush_interval(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(196, 344), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_access_log_flush_interval(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {54, UPB_SIZE(180, 344), 26, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log_flush_interval(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(196, 344), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {54, UPB_SIZE(180, 344), 26, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_flush_access_log_on_new_request(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(50, 50), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log_flush_interval(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {54, UPB_SIZE(180, 344), 26, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_flush_access_log_on_new_request(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { + const upb_MiniTableField field = {55, UPB_SIZE(184, 50), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_flush_access_log_on_new_request(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(50, 50), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {55, UPB_SIZE(184, 50), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_codec_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stat_prefix(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(196, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(200, 352), value, UPB_SIZE(24, 24), 3); + const upb_MiniTableField field = {3, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_route_v3_RouteConfiguration* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(200, 352), value, UPB_SIZE(24, 24), 4); + const upb_MiniTableField field = {4, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_route_v3_RouteConfiguration* sub = (struct envoy_config_route_v3_RouteConfiguration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(msg); if (sub == NULL) { - sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(msg, sub); + sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(msg, sub); } return sub; } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 72), len); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(8, 72), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(60, 72), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(8, 72), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { - struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 72), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(8, 72), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(64, 80), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 80), 1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(68, 88), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(16, 88), 2, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(72, 96), struct envoy_config_core_v3_Http1ProtocolOptions*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 96), 3, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(76, 104), struct envoy_config_core_v3_Http2ProtocolOptions*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(24, 104), 4, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 112), upb_StringView) = value; + const upb_MiniTableField field = {10, UPB_SIZE(204, 112), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(88, 128), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {12, UPB_SIZE(28, 128), 5, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 136), len); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + upb_MiniTableField field = {13, UPB_SIZE(32, 136), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_accesslog_v3_AccessLog**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(92, 136), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {13, UPB_SIZE(32, 136), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_accesslog_v3_AccessLog**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { - struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(92, 136), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {13, UPB_SIZE(32, 136), 0, 8, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(96, 144), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(36, 144), 6, 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(100, 152), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(40, 152), 7, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_forward_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {16, UPB_SIZE(44, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(104, 160), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(48, 160), 8, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_100_continue(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; + const upb_MiniTableField field = {18, UPB_SIZE(52, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_xff_num_trusted_hops(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value; + const upb_MiniTableField field = {19, UPB_SIZE(56, 16), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; + const upb_MiniTableField field = {20, UPB_SIZE(60, 20), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_skip_xff_append(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value; + const upb_MiniTableField field = {21, UPB_SIZE(61, 21), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_via(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = value; + const upb_MiniTableField field = {22, UPB_SIZE(212, 168), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(116, 184), len); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + upb_MiniTableField field = {23, UPB_SIZE(64, 184), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(116, 184), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {23, UPB_SIZE(64, 184), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { - struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(116, 184), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {23, UPB_SIZE(64, 184), 0, 12, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(120, 192), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {24, UPB_SIZE(68, 192), 9, 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(124, 200), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*) = value; + const upb_MiniTableField field = {25, UPB_SIZE(72, 200), 10, 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(128, 208), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {26, UPB_SIZE(76, 208), 11, 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(132, 216), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {28, UPB_SIZE(80, 216), 12, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(136, 224), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {29, UPB_SIZE(84, 224), 13, 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(140, 232), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {30, UPB_SIZE(88, 232), 14, 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(200, 352), value, UPB_SIZE(24, 24), 31); + const upb_MiniTableField field = {31, UPB_SIZE(188, 352), UPB_SIZE(-93, -25), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_preserve_external_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value; + const upb_MiniTableField field = {32, UPB_SIZE(96, 28), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_merge_slashes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value; + const upb_MiniTableField field = {33, UPB_SIZE(97, 29), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int32_t) = value; + const upb_MiniTableField field = {34, UPB_SIZE(100, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(144, 240), struct envoy_config_core_v3_HttpProtocolOptions*) = value; + const upb_MiniTableField field = {35, UPB_SIZE(104, 240), 15, 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(148, 248), envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*) = value; + const upb_MiniTableField field = {36, UPB_SIZE(108, 248), 16, 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_always_set_request_id_in_response(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 36), bool) = value; + const upb_MiniTableField field = {37, UPB_SIZE(112, 36), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* value) { - _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(152, 256), envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*) = value; + const upb_MiniTableField field = {38, UPB_SIZE(116, 256), 17, 22, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_matching_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(37, 37), bool) = value; + const upb_MiniTableField field = {39, UPB_SIZE(120, 37), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 18); - *UPB_PTR_AT(msg, UPB_SIZE(156, 264), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {40, UPB_SIZE(124, 264), 18, 23, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 19); - *UPB_PTR_AT(msg, UPB_SIZE(160, 272), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {41, UPB_SIZE(128, 272), 19, 24, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_headers_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_headers_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_any_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(204, 360), value, UPB_SIZE(40, 40), 42); + const upb_MiniTableField field = {42, UPB_SIZE(192, 360), UPB_SIZE(-133, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* value) { - _upb_sethas(msg, 20); - *UPB_PTR_AT(msg, UPB_SIZE(164, 280), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*) = value; + const upb_MiniTableField field = {43, UPB_SIZE(136, 280), 20, 25, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_normalization_options(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http3ProtocolOptions* value) { - _upb_sethas(msg, 21); - *UPB_PTR_AT(msg, UPB_SIZE(168, 288), struct envoy_config_core_v3_Http3ProtocolOptions*) = value; + const upb_MiniTableField field = {44, UPB_SIZE(140, 288), 21, 26, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Http3ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_Http3ProtocolOptions* sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http3_protocol_options(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http3ProtocolOptions_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(msg, sub); + sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http3ProtocolOptions_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_with_escaped_slashes_action(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 44), int32_t) = value; + const upb_MiniTableField field = {45, UPB_SIZE(144, 44), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(172, 296), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + upb_MiniTableField field = {46, UPB_SIZE(148, 296), 0, 27, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(172, 296), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {46, UPB_SIZE(148, 296), 0, 27, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(172, 296), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {46, UPB_SIZE(148, 296), 0, 27, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_trailing_host_dot(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value; + const upb_MiniTableField field = {47, UPB_SIZE(152, 48), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_SchemeHeaderTransformation* value) { - _upb_sethas(msg, 22); - *UPB_PTR_AT(msg, UPB_SIZE(176, 304), struct envoy_config_core_v3_SchemeHeaderTransformation*) = value; + const upb_MiniTableField field = {48, UPB_SIZE(156, 304), 22, 28, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SchemeHeaderTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_SchemeHeaderTransformation* sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scheme_header_transformation(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)_upb_Message_New(&envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(msg, sub); + sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)_upb_Message_New(&envoy_config_core_v3_SchemeHeaderTransformation_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_status_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* value) { - _upb_sethas(msg, 23); - *UPB_PTR_AT(msg, UPB_SIZE(180, 312), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*) = value; + const upb_MiniTableField field = {49, UPB_SIZE(160, 312), 23, 29, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_proxy_status_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_status_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_status_config(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_status_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_typed_header_validation_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 24); - *UPB_PTR_AT(msg, UPB_SIZE(184, 320), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {50, UPB_SIZE(164, 320), 24, 30, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_typed_header_validation_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_typed_header_validation_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_typed_header_validation_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_typed_header_validation_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_append_x_forwarded_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(49, 49), bool) = value; + const upb_MiniTableField field = {51, UPB_SIZE(168, 49), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_early_header_mutation_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(188, 328), len); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_early_header_mutation_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* size) { + upb_MiniTableField field = {52, UPB_SIZE(172, 328), 0, 31, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_early_header_mutation_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(188, 328), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_early_header_mutation_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {52, UPB_SIZE(172, 328), 0, 31, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_TypedExtensionConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_early_header_mutation_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { - struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(188, 328), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {52, UPB_SIZE(172, 328), 0, 31, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_proxy_protocol_connection_state(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 25); - *UPB_PTR_AT(msg, UPB_SIZE(192, 336), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {53, UPB_SIZE(176, 336), 25, 32, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_add_proxy_protocol_connection_state(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_proxy_protocol_connection_state(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_proxy_protocol_connection_state(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_proxy_protocol_connection_state(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_access_log_flush_interval(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 26); - *UPB_PTR_AT(msg, UPB_SIZE(196, 344), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {54, UPB_SIZE(180, 344), 26, 33, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_access_log_flush_interval(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log_flush_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_access_log_flush_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_access_log_flush_interval(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_flush_access_log_on_new_request(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(50, 50), bool) = value; + const upb_MiniTableField field = {55, UPB_SIZE(184, 50), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1150,7 +1525,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1158,153 +1533,209 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE 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) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_verbose(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_verbose(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_verbose(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_custom_tags(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, size_t* len) { - return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_trace_v3_Tracing_Http*); + const struct envoy_config_trace_v3_Tracing_Http* default_val = NULL; + const struct envoy_config_trace_v3_Tracing_Http* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_client_sampling(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_random_sampling(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_overall_sampling(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_verbose(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_max_path_tag_length(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(msg, sub); } return sub; } -UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, size_t* len) { - return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(24, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_resize_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_tracing_v3_CustomTag**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_resize_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(24, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_tracing_v3_CustomTag**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_tracing_v3_CustomTag* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_add_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, upb_Arena* arena) { - struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(24, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_config_trace_v3_Tracing_Http* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_trace_v3_Tracing_Http*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, upb_Arena* arena) { struct envoy_config_trace_v3_Tracing_Http* sub = (struct envoy_config_trace_v3_Tracing_Http*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_provider(msg); if (sub == NULL) { - sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(msg, sub); + sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(msg, sub); } return sub; } @@ -1312,12 +1743,12 @@ UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_n /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.InternalAddressConfig */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1327,7 +1758,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1335,56 +1766,87 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msg_init, 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; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_clear_unix_sockets(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_unix_sockets(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_clear_cidr_ranges(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_cidr_ranges(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_has_cidr_ranges(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_clear_cidr_ranges(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_cidr_ranges(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, size_t* len) { - return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_cidr_ranges(msg, &size); + return size != 0; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_set_unix_sockets(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_mutable_cidr_ranges(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, size_t* len) { - return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_mutable_cidr_ranges(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_resize_cidr_ranges(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_resize_cidr_ranges(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_add_cidr_ranges(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, upb_Arena* arena) { - struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1394,7 +1856,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1402,84 +1864,113 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_cert(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_has_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_cert(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_cert(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_dns(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_dns(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_dns(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_uri(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_uri(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_uri(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_chain(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_chain(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(11, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_chain(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(11, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_mutable_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_subject(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_cert(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_dns(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(9, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_uri(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(10, 3), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_chain(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(11, 4), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1489,7 +1980,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1497,65 +1988,101 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msg_init, 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); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_upgrade_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_upgrade_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_filters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, size_t* len) { - return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_upgrade_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, size_t* len) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_resize_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_resize_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_add_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, upb_Arena* arena) { - struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_enabled(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(msg, sub); } return sub; } @@ -1563,12 +2090,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1578,7 +2105,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1586,57 +2113,67 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_clear_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_clear_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_http_v3_PathTransformation*); + const struct envoy_type_http_v3_PathTransformation* default_val = NULL; + const struct envoy_type_http_v3_PathTransformation* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_has_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE 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) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_clear_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_clear_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_http_v3_PathTransformation*); + const struct envoy_type_http_v3_PathTransformation* default_val = NULL; + const struct envoy_type_http_v3_PathTransformation* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_has_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, struct envoy_type_http_v3_PathTransformation* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_http_v3_PathTransformation*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_mutable_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg, upb_Arena* arena) { struct envoy_type_http_v3_PathTransformation* sub = (struct envoy_type_http_v3_PathTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_forwarding_transformation(msg); if (sub == NULL) { - sub = (struct envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(msg, sub); + sub = (struct envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, struct envoy_type_http_v3_PathTransformation* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_http_v3_PathTransformation*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_mutable_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg, upb_Arena* arena) { struct envoy_type_http_v3_PathTransformation* sub = (struct envoy_type_http_v3_PathTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_http_filter_transformation(msg); if (sub == NULL) { - sub = (struct envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(msg, sub); + sub = (struct envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(msg, sub); } return sub; } @@ -1644,12 +2181,12 @@ UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filter /* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.ProxyStatusConfig */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1659,7 +2196,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1667,13 +2204,13 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1682,79 +2219,118 @@ typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {5, 8, -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_remove_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_connection_termination_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_connection_termination_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_remove_connection_termination_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_response_flags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_response_flags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {3, 2, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_remove_response_flags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 2, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_set_recommended_response_code(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_set_recommended_response_code(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {4, 3, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_recommended_response_code(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, 3, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_has_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_use_node_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {5, 8, -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, 8, -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_has_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_has_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {5, 8, -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_literal_proxy_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {6, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 6, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_has_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) { + const upb_MiniTableField field = {6, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_remove_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_remove_connection_termination_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_remove_response_flags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {3, 2, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_set_recommended_response_code(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {4, 3, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_use_node_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, 8, -5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_literal_proxy_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 6); + const upb_MiniTableField field = {6, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1764,7 +2340,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalRepl int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1772,56 +2348,86 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalRepl } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_clear_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mappers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_clear_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, size_t* len) { - return (const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_has_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_clear_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_clear_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_SubstitutionFormatString*); + const struct envoy_config_core_v3_SubstitutionFormatString* default_val = NULL; + const struct envoy_config_core_v3_SubstitutionFormatString* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_has_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, size_t* len) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_resize_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_resize_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_add_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, upb_Arena* arena) { - struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, struct envoy_config_core_v3_SubstitutionFormatString* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_SubstitutionFormatString*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_SubstitutionFormatString* sub = (struct envoy_config_core_v3_SubstitutionFormatString*)envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_body_format(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_New(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(msg, sub); + sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_New(&envoy_config_core_v3_SubstitutionFormatString_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(msg, sub); } return sub; } @@ -1829,12 +2435,12 @@ UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extension /* envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1844,7 +2450,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseM int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1852,135 +2458,180 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseM } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_accesslog_v3_AccessLogFilter* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_accesslog_v3_AccessLogFilter*); + const struct envoy_config_accesslog_v3_AccessLogFilter* default_val = NULL; + const struct envoy_config_accesslog_v3_AccessLogFilter* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_SubstitutionFormatString*); + const struct envoy_config_core_v3_SubstitutionFormatString* default_val = NULL; + const struct envoy_config_core_v3_SubstitutionFormatString* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, size_t* len) { - return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_headers_to_add(msg, &size); + return size != 0; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_accesslog_v3_AccessLogFilter* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_accesslog_v3_AccessLogFilter*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, upb_Arena* arena) { struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_filter(msg); if (sub == NULL) { - sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(msg, sub); + sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_status_code(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_core_v3_SubstitutionFormatString* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_SubstitutionFormatString*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, upb_Arena* arena) { struct envoy_config_core_v3_SubstitutionFormatString* sub = (struct envoy_config_core_v3_SubstitutionFormatString*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body_format_override(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_New(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(msg, sub); + sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_New(&envoy_config_core_v3_SubstitutionFormatString_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, size_t* len) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_resize_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_resize_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_HeaderValueOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_add_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, upb_Arena* arena) { - struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.filters.network.http_connection_manager.v3.Rds */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_Rds* ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1990,7 +2641,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds* envo int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_Rds* ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1998,57 +2649,68 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds* envo } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_clear_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_clear_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_clear_route_config_name(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_Rds_has_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_clear_route_config_name(envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_Rds_mutable_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_route_config_name(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2058,7 +2720,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2066,47 +2728,72 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_clear_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_route_v3_ScopedRouteConfiguration* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_route_v3_ScopedRouteConfiguration* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_has_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_clear_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const struct envoy_config_route_v3_ScopedRouteConfiguration* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, size_t* len) { - return (const struct envoy_config_route_v3_ScopedRouteConfiguration* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_scoped_route_configurations(msg, &size); + return size != 0; } -UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_mutable_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, size_t* len) { - return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_mutable_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_resize_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_resize_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_route_v3_ScopedRouteConfiguration**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_add_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, upb_Arena* arena) { - struct envoy_config_route_v3_ScopedRouteConfiguration* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_route_v3_ScopedRouteConfiguration* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2116,7 +2803,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2124,13 +2811,13 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2139,101 +2826,130 @@ typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*); + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(24, 40), 0, UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 4, NULL); + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(24, 40), 0, UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 5, NULL); + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scope_key_builder(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_rds_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(24, 40), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_route_configurations_list(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(24, 40), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(16, 40), UPB_SIZE(-13, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_rds(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(msg, sub); } return sub; } @@ -2241,12 +2957,12 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2256,7 +2972,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2264,47 +2980,72 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_clear_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_has_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_clear_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, size_t* len) { - return (const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_fragments(msg, &size); + return size != 0; } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_mutable_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, size_t* len) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_mutable_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_resize_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_resize_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_add_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, upb_Arena* arena) { - struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2314,7 +3055,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2322,13 +3063,13 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2336,27 +3077,34 @@ typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_has_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_clear_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_clear_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_has_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_mutable_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_header_value_extractor(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(msg, sub); } return sub; } @@ -2364,12 +3112,12 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2379,7 +3127,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2387,13 +3135,13 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2402,57 +3150,83 @@ typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_element_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_element_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 40), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_index(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(4, 40), UPB_SIZE(0, 0), 3, _upb_UInt32_FromU(0u)); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(4, 40), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(4, 40), UPB_SIZE(0, 0), 4, NULL); + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_index(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, uint32_t value) { - UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 40), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(4, 40), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_mutable_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(msg, sub); } return sub; } @@ -2460,12 +3234,12 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2475,7 +3249,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2483,44 +3257,56 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msg_init, 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); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_clear_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_clear_key(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_clear_key(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_key(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_set_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_set_key(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2530,7 +3316,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2538,57 +3324,68 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_clear_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_clear_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_clear_srds_resources_locator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE 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) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_clear_srds_resources_locator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_srds_resources_locator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_mutable_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_srds_resources_locator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2598,7 +3395,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilte int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2606,13 +3403,13 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilte } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2621,79 +3418,104 @@ typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET = 0 } envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases; UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(16, 24), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 4, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(16, 24), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET); +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 5, NULL); + const struct envoy_config_core_v3_ExtensionConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ExtensionConfigSource* ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_is_optional(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_is_optional(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(16, 24), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(8, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_mutable_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, struct envoy_config_core_v3_ExtensionConfigSource* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(8, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_mutable_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg, upb_Arena* arena) { struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_discovery(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(msg, sub); + sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_is_optional(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {6, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2703,7 +3525,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestID int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2711,35 +3533,40 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestID } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_clear_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_clear_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +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) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_mutable_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(msg, sub); } return sub; } @@ -2747,12 +3574,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_con /* envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager */ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(upb_Arena* arena) { - return (envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, arena); + return (envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init, arena); } UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2762,7 +3589,7 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobi int options, upb_Arena* arena) { envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2770,45 +3597,50 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobi } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msg_init, 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); -} -UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_clear_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_clear_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*); + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* default_val = NULL; + const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +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) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_mutable_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg, upb_Arena* arena) { struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena); - if (!sub) return NULL; - envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(msg, sub); + sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msg_init, arena); + if (sub) envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c b/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c index 08c4a4a2765..5299e605d27 100644 --- a/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c @@ -7,33 +7,40 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h" #include "envoy/type/http/v3/cookie.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_submsgs[1] = { - {.submsg = &envoy_type_http_v3_Cookie_msginit}, +static const upb_MiniTableSub envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_submsgs[1] = { + {.submsg = &envoy_type_http_v3_Cookie_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit = { +const upb_MiniTable envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init = { &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_submsgs[0], &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit, + &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init, }; -const upb_MiniTable_File envoy_extensions_http_stateful_session_cookie_v3_cookie_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_http_stateful_session_cookie_v3_cookie_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +49,5 @@ const upb_MiniTable_File envoy_extensions_http_stateful_session_cookie_v3_cookie 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h b/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h index 84010d82e2c..e66bfb5335a 100644 --- a/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h @@ -9,34 +9,38 @@ #ifndef ENVOY_EXTENSIONS_HTTP_STATEFUL_SESSION_COOKIE_V3_COOKIE_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_HTTP_STATEFUL_SESSION_COOKIE_V3_COOKIE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState; typedef struct envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState; -extern const upb_MiniTable envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit; +extern const upb_MiniTable envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init; struct envoy_type_http_v3_Cookie; -extern const upb_MiniTable envoy_type_http_v3_Cookie_msginit; +extern const upb_MiniTable envoy_type_http_v3_Cookie_msg_init; /* envoy.extensions.http.stateful_session.cookie.v3.CookieBasedSessionState */ UPB_INLINE envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_new(upb_Arena* arena) { - return (envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState*)_upb_Message_New(&envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit, arena); + return (envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState*)_upb_Message_New(&envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init, arena); } UPB_INLINE envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* ret = envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionSt int options, upb_Arena* arena) { envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* ret = envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,45 +58,50 @@ UPB_INLINE envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionSt } UPB_INLINE char* envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_serialize(const envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_serialize_ex(const envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_has_cookie(const envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_clear_cookie(const envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_clear_cookie(envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_http_v3_Cookie* envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_cookie(const envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_http_v3_Cookie*); + const struct envoy_type_http_v3_Cookie* default_val = NULL; + const struct envoy_type_http_v3_Cookie* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_has_cookie(const envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_set_cookie(envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState *msg, struct envoy_type_http_v3_Cookie* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_http_v3_Cookie*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_http_v3_Cookie* envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_mutable_cookie(envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState* msg, upb_Arena* arena) { struct envoy_type_http_v3_Cookie* sub = (struct envoy_type_http_v3_Cookie*)envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_cookie(msg); if (sub == NULL) { - sub = (struct envoy_type_http_v3_Cookie*)_upb_Message_New(&envoy_type_http_v3_Cookie_msginit, arena); - if (!sub) return NULL; - envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_set_cookie(msg, sub); + sub = (struct envoy_type_http_v3_Cookie*)_upb_Message_New(&envoy_type_http_v3_Cookie_msg_init, arena); + if (sub) envoy_extensions_http_stateful_session_cookie_v3_CookieBasedSessionState_set_cookie(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_http_stateful_session_cookie_v3_cookie_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_http_stateful_session_cookie_v3_cookie_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_HTTP_STATEFUL_SESSION_COOKIE_V3_COOKIE_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c index e53fccd4e5e..23fb4216a93 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c @@ -7,43 +7,56 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" #include "udpa/annotations/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_submsgs[6] = { - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_FloatValue_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_submsgs[6] = { + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_FloatValue_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin__fields[6] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init = { &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_submsgs[0], &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin__fields[0], - UPB_SIZE(32, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 56), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800000504002a, &upb_psm_1bt_maxmaxb}, + {0x0030000006050032, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit, + &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init, }; -const upb_MiniTable_File envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_client_side_weighted_round_robin_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_client_side_weighted_round_robin_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -52,5 +65,5 @@ const upb_MiniTable_File envoy_extensions_load_balancing_policies_client_side_we 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h index 506bd29c5af..1a03f0bab22 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h @@ -9,38 +9,42 @@ #ifndef ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_CLIENT_SIDE_WEIGHTED_ROUND_ROBIN_V3_CLIENT_SIDE_WEIGHTED_ROUND_ROBIN_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_CLIENT_SIDE_WEIGHTED_ROUND_ROBIN_V3_CLIENT_SIDE_WEIGHTED_ROUND_ROBIN_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin; typedef struct envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init; struct google_protobuf_BoolValue; struct google_protobuf_Duration; struct google_protobuf_FloatValue; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_FloatValue_msginit; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_FloatValue_msg_init; /* envoy.extensions.load_balancing_policies.client_side_weighted_round_robin.v3.ClientSideWeightedRoundRobin */ UPB_INLINE envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin*)_upb_Message_New(&envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit, arena); + return (envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin*)_upb_Message_New(&envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* ret = envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +54,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_client_side_weighted_round_r int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* ret = envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,155 +62,185 @@ UPB_INLINE envoy_extensions_load_balancing_policies_client_side_weighted_round_r } UPB_INLINE char* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_serialize(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_serialize_ex(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_enable_oob_load_report(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_enable_oob_load_report(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_enable_oob_load_report(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_enable_oob_load_report(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_oob_reporting_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_enable_oob_load_report(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_oob_reporting_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_oob_reporting_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_oob_reporting_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_blackout_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_oob_reporting_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_blackout_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_blackout_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_blackout_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_weight_expiration_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_blackout_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_weight_expiration_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_weight_expiration_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_weight_expiration_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_weight_update_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_weight_expiration_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_weight_update_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_weight_update_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_weight_update_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_error_utilization_penalty(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_weight_update_period(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_error_utilization_penalty(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_clear_error_utilization_penalty(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_FloatValue* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_error_utilization_penalty(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_FloatValue*); + const struct google_protobuf_FloatValue* default_val = NULL; + const struct google_protobuf_FloatValue* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_has_error_utilization_penalty(const envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_enable_oob_load_report(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_mutable_enable_oob_load_report(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_enable_oob_load_report(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_enable_oob_load_report(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_enable_oob_load_report(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_oob_reporting_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_mutable_oob_reporting_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_oob_reporting_period(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_oob_reporting_period(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_oob_reporting_period(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_blackout_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_mutable_blackout_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_blackout_period(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_blackout_period(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_blackout_period(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_weight_expiration_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_mutable_weight_expiration_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_weight_expiration_period(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_weight_expiration_period(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_weight_expiration_period(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_weight_update_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_mutable_weight_update_period(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_weight_update_period(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_weight_update_period(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_weight_update_period(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_error_utilization_penalty(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin *msg, struct google_protobuf_FloatValue* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_FloatValue*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 6, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_FloatValue* envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_mutable_error_utilization_penalty(envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin* msg, upb_Arena* arena) { struct google_protobuf_FloatValue* sub = (struct google_protobuf_FloatValue*)envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_error_utilization_penalty(msg); if (sub == NULL) { - sub = (struct google_protobuf_FloatValue*)_upb_Message_New(&google_protobuf_FloatValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_error_utilization_penalty(msg, sub); + sub = (struct google_protobuf_FloatValue*)_upb_Message_New(&google_protobuf_FloatValue_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_ClientSideWeightedRoundRobin_set_error_utilization_penalty(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_client_side_weighted_round_robin_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_v3_client_side_weighted_round_robin_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_CLIENT_SIDE_WEIGHTED_ROUND_ROBIN_V3_CLIENT_SIDE_WEIGHTED_ROUND_ROBIN_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c index e273862fb1f..ca58b47b280 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/load_balancing_policies/common/v3/common.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/type/v3/percent.upb.h" @@ -16,89 +18,114 @@ #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_submsgs[2] = { - {.submsg = &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit}, - {.submsg = &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_submsgs[2] = { + {.submsg = &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init}, + {.submsg = &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init = { &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_submsgs[0], &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_submsgs[2] = { - {.submsg = &envoy_type_v3_Percent_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_submsgs[2] = { + {.submsg = &envoy_type_v3_Percent_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init = { &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_submsgs[0], &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + }) }; -const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_submsgs[3] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit}, - {.submsg = &envoy_type_v3_Percent_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_submsgs[3] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_config_core_v3_RuntimeDouble_msg_init}, + {.submsg = &envoy_type_v3_Percent_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init = { &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_submsgs[0], &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig__fields[2] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig__fields[2] = { + {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init = { &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_submsgs[0], &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000100003f000008, &upb_psb1_1bt}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit, - &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, - &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, - &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit, - &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, + &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init, + &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, + &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, + &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init, + &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, }; -const upb_MiniTable_File envoy_extensions_load_balancing_policies_common_v3_common_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_load_balancing_policies_common_v3_common_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -107,5 +134,5 @@ const upb_MiniTable_File envoy_extensions_load_balancing_policies_common_v3_comm 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h index 6587ef88096..f2c8041a593 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h @@ -9,54 +9,54 @@ #ifndef ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_COMMON_V3_COMMON_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_COMMON_V3_COMMON_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig; -struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig; -struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig; -struct envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig; -struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig; typedef struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig; typedef struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig; typedef struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig; typedef struct envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig; typedef struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init; struct envoy_config_core_v3_RuntimeDouble; struct envoy_type_v3_Percent; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; struct google_protobuf_UInt64Value; -extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msg_init; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; /* envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig */ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit, arena); + return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -66,7 +66,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -74,13 +74,13 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_serialize(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_serialize_ex(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -89,48 +89,61 @@ typedef enum { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_NOT_SET = 0 } envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_oneofcases; UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_oneofcases envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_case(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_has_zone_aware_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_clear_zone_aware_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_clear_zone_aware_lb_config(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_zone_aware_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* default_val = NULL; + const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_has_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_has_zone_aware_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_clear_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_config_specifier_NOT_SET); +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_clear_locality_weighted_lb_config(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* default_val = NULL; + const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_has_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_set_zone_aware_lb_config(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig *msg, envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_mutable_zone_aware_lb_config(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg, upb_Arena* arena) { struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*)envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_zone_aware_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_set_zone_aware_lb_config(msg, sub); + sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_set_zone_aware_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_set_locality_weighted_lb_config(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig *msg, envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_mutable_locality_weighted_lb_config(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig* msg, upb_Arena* arena) { struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_locality_weighted_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_set_locality_weighted_lb_config(msg, sub); + sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_set_locality_weighted_lb_config(msg, sub); } return sub; } @@ -138,12 +151,12 @@ UPB_INLINE struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbC /* envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfig */ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, arena); + return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -153,7 +166,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_Z int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -161,79 +174,95 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_Z } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_serialize(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_serialize_ex(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_has_routing_enabled(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_clear_routing_enabled(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_clear_routing_enabled(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_routing_enabled(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_has_min_cluster_size(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_has_routing_enabled(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_clear_min_cluster_size(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_clear_min_cluster_size(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_min_cluster_size(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_clear_fail_traffic_on_panic(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_has_min_cluster_size(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_clear_fail_traffic_on_panic(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_fail_traffic_on_panic(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_routing_enabled(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_mutable_routing_enabled(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_routing_enabled(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_min_cluster_size(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_mutable_min_cluster_size(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_min_cluster_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig_set_fail_traffic_on_panic(envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_ZoneAwareLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.LocalityWeightedLbConfig */ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, arena); + return (envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -243,7 +272,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_L int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -251,13 +280,13 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_L } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_serialize(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_serialize_ex(const envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, options, arena, &ptr, len); return ptr; } @@ -265,12 +294,12 @@ UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_LocalityLbCo /* envoy.extensions.load_balancing_policies.common.v3.SlowStartConfig */ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit, arena); + return (envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* ret = envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -280,7 +309,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* e int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* ret = envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -288,79 +317,94 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* e } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_serialize(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_serialize_ex(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_has_slow_start_window(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_clear_slow_start_window(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_clear_slow_start_window(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_slow_start_window(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_has_aggression(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_has_slow_start_window(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_clear_aggression(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_clear_aggression(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_aggression(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeDouble*); + const struct envoy_config_core_v3_RuntimeDouble* default_val = NULL; + const struct envoy_config_core_v3_RuntimeDouble* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_has_min_weight_percent(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_has_aggression(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_clear_min_weight_percent(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_clear_min_weight_percent(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_min_weight_percent(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); + const struct envoy_type_v3_Percent* default_val = NULL; + const struct envoy_type_v3_Percent* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_has_min_weight_percent(const envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_slow_start_window(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_mutable_slow_start_window(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_slow_start_window(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_slow_start_window(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_slow_start_window(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_aggression(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeDouble*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_mutable_aggression(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_aggression(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_aggression(msg, sub); + sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_aggression(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_min_weight_percent(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig *msg, struct envoy_type_v3_Percent* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_mutable_min_weight_percent(envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig* msg, upb_Arena* arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_min_weight_percent(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_min_weight_percent(msg, sub); + sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_SlowStartConfig_set_min_weight_percent(msg, sub); } return sub; } @@ -368,12 +412,12 @@ UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_load_balancing_policie /* envoy.extensions.load_balancing_policies.common.v3.ConsistentHashingLbConfig */ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, arena); + return (envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -383,7 +427,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingL int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* ret = envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -391,54 +435,65 @@ UPB_INLINE envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingL } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_serialize(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_serialize_ex(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_clear_use_hostname_for_hashing(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_clear_use_hostname_for_hashing(envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_use_hostname_for_hashing(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_has_hash_balance_factor(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_clear_hash_balance_factor(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_clear_hash_balance_factor(envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_hash_balance_factor(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_has_hash_balance_factor(const envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_set_use_hostname_for_hashing(envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_set_hash_balance_factor(envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_mutable_hash_balance_factor(envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_hash_balance_factor(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_load_balancing_policies_common_v3_common_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_load_balancing_policies_common_v3_common_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_COMMON_V3_COMMON_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c index 44e93fcb220..d3a6d1e3e51 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h" #include "envoy/extensions/load_balancing_policies/common/v3/common.upb.h" #include "google/protobuf/wrappers.upb.h" @@ -15,37 +17,48 @@ #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_submsgs[5] = { - {.submsg = &google_protobuf_UInt64Value_msginit}, - {.submsg = &google_protobuf_UInt64Value_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit}, - {.submsg = &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_submsgs[5] = { + {.submsg = &google_protobuf_UInt64Value_msg_init}, + {.submsg = &google_protobuf_UInt64Value_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init}, + {.submsg = &envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash__fields[7] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 48), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash__fields[7] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init = { &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_submsgs[0], &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash__fields[0], - UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0010000001000012, &upb_psm_1bt_maxmaxb}, + {0x001800000201001a, &upb_psm_1bt_maxmaxb}, + {0x000800003f000020, &upb_psb1_1bt}, + {0x002000000302002a, &upb_psm_1bt_maxmaxb}, + {0x0028000004030032, &upb_psm_1bt_maxmaxb}, + {0x003000000504003a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, + &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init, }; -const upb_MiniTable_File envoy_extensions_load_balancing_policies_ring_hash_v3_ring_hash_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_load_balancing_policies_ring_hash_v3_ring_hash_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -54,5 +67,5 @@ const upb_MiniTable_File envoy_extensions_load_balancing_policies_ring_hash_v3_r 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 a84e5d00da7..668ebf9ade4 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 @@ -9,28 +9,32 @@ #ifndef ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_RING_HASH_V3_RING_HASH_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_RING_HASH_V3_RING_HASH_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash; typedef struct envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init; struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig; struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig; struct google_protobuf_UInt32Value; struct google_protobuf_UInt64Value; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; typedef enum { envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_DEFAULT_HASH = 0, @@ -43,12 +47,12 @@ typedef enum { /* envoy.extensions.load_balancing_policies.ring_hash.v3.RingHash */ UPB_INLINE envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash*)_upb_Message_New(&envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, arena); + return (envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash*)_upb_Message_New(&envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* ret = envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -58,7 +62,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* envoy int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* ret = envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -66,151 +70,188 @@ UPB_INLINE envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* envoy } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msg_init, 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; +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_hash_function(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_hash_function(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_minimum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_minimum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_minimum_ring_size(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_minimum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_maximum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_minimum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_maximum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_maximum_ring_size(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt64Value* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_maximum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt64Value*); + const struct google_protobuf_UInt64Value* default_val = NULL; + const struct google_protobuf_UInt64Value* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_use_hostname_for_hashing(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_maximum_ring_size(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_use_hostname_for_hashing(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_use_hostname_for_hashing(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_hash_balance_factor(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_hash_balance_factor(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_hash_balance_factor(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_hash_balance_factor(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_consistent_hashing_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_hash_balance_factor(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_consistent_hashing_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_consistent_hashing_lb_config(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_consistent_hashing_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*); + const struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* default_val = NULL; + const struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_consistent_hashing_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_locality_weighted_lb_config(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*); + const struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* default_val = NULL; + const struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_has_locality_weighted_lb_config(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_hash_function(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_minimum_ring_size(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_mutable_minimum_ring_size(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_minimum_ring_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_minimum_ring_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_minimum_ring_size(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_maximum_ring_size(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, struct google_protobuf_UInt64Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt64Value*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt64Value* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_mutable_maximum_ring_size(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, upb_Arena* arena) { struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_maximum_ring_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_maximum_ring_size(msg, sub); + sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_maximum_ring_size(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_use_hostname_for_hashing(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_hash_balance_factor(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_mutable_hash_balance_factor(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_hash_balance_factor(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_hash_balance_factor(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_hash_balance_factor(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_consistent_hashing_lb_config(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_mutable_consistent_hashing_lb_config(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, upb_Arena* arena) { struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig* sub = (struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*)envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_consistent_hashing_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_consistent_hashing_lb_config(msg, sub); + sub = (struct envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_ConsistentHashingLbConfig_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_consistent_hashing_lb_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_locality_weighted_lb_config(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash *msg, struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 48), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_mutable_locality_weighted_lb_config(envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, upb_Arena* arena) { struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig* sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_locality_weighted_lb_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_locality_weighted_lb_config(msg, sub); + sub = (struct envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig*)_upb_Message_New(&envoy_extensions_load_balancing_policies_common_v3_LocalityLbConfig_LocalityWeightedLbConfig_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_set_locality_weighted_lb_config(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_load_balancing_policies_ring_hash_v3_ring_hash_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_load_balancing_policies_ring_hash_v3_ring_hash_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_RING_HASH_V3_RING_HASH_PROTO_UPB_H_ */ 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 0544401d58a..26fe04e8f95 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 @@ -7,33 +7,40 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h" #include "envoy/config/cluster/v3/cluster.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_submsgs[1] = { - {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_msginit}, +static const upb_MiniTableSub envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_submsgs[1] = { + {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit = { +const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init = { &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, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, + &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init, }; -const upb_MiniTable_File envoy_extensions_load_balancing_policies_wrr_locality_v3_wrr_locality_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_load_balancing_policies_wrr_locality_v3_wrr_locality_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +49,5 @@ const upb_MiniTable_File envoy_extensions_load_balancing_policies_wrr_locality_v 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 407af554d9d..76a06be1047 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_WRR_LOCALITY_V3_WRR_LOCALITY_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_WRR_LOCALITY_V3_WRR_LOCALITY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality; typedef struct envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality; -extern const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit; +extern const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init; struct envoy_config_cluster_v3_LoadBalancingPolicy; -extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msginit; +extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msg_init; /* envoy.extensions.load_balancing_policies.wrr_locality.v3.WrrLocality */ UPB_INLINE envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_new(upb_Arena* arena) { - return (envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality*)_upb_Message_New(&envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, arena); + return (envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality*)_upb_Message_New(&envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init, arena); } UPB_INLINE envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* ret = envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* int options, upb_Arena* arena) { envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* ret = envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,45 +58,50 @@ UPB_INLINE envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msg_init, 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); -} -UPB_INLINE void envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_clear_endpoint_picking_policy(const envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_clear_endpoint_picking_policy(envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_cluster_v3_LoadBalancingPolicy* envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_endpoint_picking_policy(const envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_cluster_v3_LoadBalancingPolicy*); + const struct envoy_config_cluster_v3_LoadBalancingPolicy* default_val = NULL; + const struct envoy_config_cluster_v3_LoadBalancingPolicy* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +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) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_set_endpoint_picking_policy(envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality *msg, struct envoy_config_cluster_v3_LoadBalancingPolicy* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_cluster_v3_LoadBalancingPolicy*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy* envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_mutable_endpoint_picking_policy(envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg, upb_Arena* arena) { struct envoy_config_cluster_v3_LoadBalancingPolicy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_endpoint_picking_policy(msg); if (sub == NULL) { - sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena); - if (!sub) return NULL; - envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_set_endpoint_picking_policy(msg, sub); + sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msg_init, arena); + if (sub) envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_set_endpoint_picking_policy(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_load_balancing_policies_wrr_locality_v3_wrr_locality_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_load_balancing_policies_wrr_locality_v3_wrr_locality_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_LOAD_BALANCING_POLICIES_WRR_LOCALITY_V3_WRR_LOCALITY_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c index ee06e884076..d8ba145c65c 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c @@ -7,15 +7,18 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h" #include "envoy/extensions/transport_sockets/tls/v3/common.upb.h" #include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h" #include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout = { NULL, NULL, NULL, @@ -24,5 +27,5 @@ const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_cert_proto_up 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h index aa472be6487..23927fc1122 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h @@ -9,17 +9,22 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" /* Public Imports. */ -#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h" -#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h" -#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h" +#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h" +#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h" +#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -27,12 +32,12 @@ extern "C" { -extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_ */ 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 e7c61d3215d..dc586a354e3 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/transport_sockets/tls/v3/common.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -21,151 +23,236 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[5] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[5] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init = { NULL, &envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[0], - UPB_SIZE(24, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 32), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x000800003f00001a, &upb_prs_1bt}, + {0x001000003f000022, &upb_prs_1bt}, + {0x001800003f00002a, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init = { &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000300001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[8] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit}, - {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[8] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init}, + {.submsg = &envoy_config_core_v3_WatchedDirectory_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[8] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 56), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 64), UPB_SIZE(7, 7), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[8] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 56), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 64), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init = { &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[0], - UPB_SIZE(40, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 72), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_maxmaxb}, + {0x0020000004030022, &upb_psm_1bt_maxmaxb}, + {0x002800003f04002a, &upb_prm_1bt_maxmaxb}, + {0x0030000005050032, &upb_psm_1bt_max64b}, + {0x003800000606003a, &upb_psm_1bt_maxmaxb}, + {0x0040000007070042, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init = { &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init = { NULL, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher__fields[2] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher__fields[2] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init = { &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[9] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_config_core_v3_DataSource_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[9] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &envoy_config_core_v3_WatchedDirectory_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[14] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(28, 48), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(40, 72), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(44, 80), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(52, 96), UPB_SIZE(7, 7), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[14] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 40), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 48), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 56), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(36, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(40, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(44, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(48, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(52, 88), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(56, 96), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init = { &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[0], - UPB_SIZE(56, 104), 14, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(64, 104), 14, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_maxmaxb}, + {0x001800003f000012, &upb_prs_1bt}, + {0x002000003f00001a, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0028000002010032, &upb_psm_1bt_maxmaxb}, + {0x003000000302003a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000040, &upb_psb1_1bt}, + {0x003800003f03004a, &upb_prm_1bt_maxmaxb}, + {0x000400003f000050, &upb_psv4_1bt}, + {0x004000000404005a, &upb_psm_1bt_maxmaxb}, + {0x0048000005050062, &upb_psm_1bt_maxmaxb}, + {0x005000000606006a, &upb_psm_1bt_max64b}, + {0x000800003f000070, &upb_psb1_1bt}, + {0x005800003f07007a, &upb_prm_1bt_max64b}, + {0x0060000007080182, &upb_psm_2bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[7] = { - &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, - &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, - &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, - &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, - &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, - &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, - &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, + &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, + &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, + &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, + &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, + &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, + &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, + &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, }; -const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -174,5 +261,5 @@ const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_common_proto_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 7c3e60a9886..d9d4f195f62 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 @@ -9,24 +9,22 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_transport_sockets_tls_v3_TlsParameters; -struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider; -struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate; -struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys; -struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance; -struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher; -struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext; typedef struct envoy_extensions_transport_sockets_tls_v3_TlsParameters envoy_extensions_transport_sockets_tls_v3_TlsParameters; typedef struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider; typedef struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate envoy_extensions_transport_sockets_tls_v3_TlsCertificate; @@ -34,13 +32,13 @@ typedef struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys en typedef struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance; typedef struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher; typedef struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init; struct envoy_config_core_v3_DataSource; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_config_core_v3_WatchedDirectory; @@ -48,13 +46,13 @@ struct envoy_type_matcher_v3_StringMatcher; struct google_protobuf_Any; struct google_protobuf_BoolValue; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_VERIFY_TRUST_CHAIN = 0, @@ -82,12 +80,12 @@ typedef enum { /* envoy.extensions.transport_sockets.tls.v3.TlsParameters */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsParameters* ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -97,7 +95,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extens int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsParameters* ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -105,89 +103,188 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extens } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, 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; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_tls_minimum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_TlsParameters_tls_minimum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_tls_maximum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_tls_maximum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_TlsParameters_tls_maximum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 8)); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* size) { + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_has_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsParameters_cipher_suites(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_signature_algorithms(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); +UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_signature_algorithms(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_has_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsParameters_ecdh_curves(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_signature_algorithms(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_signature_algorithms(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_has_signature_algorithms(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) { + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsParameters_signature_algorithms(msg, &size); + return size != 0; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_minimum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_maximum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* size) { + upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {4, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_signature_algorithms(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_signature_algorithms(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_signature_algorithms(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_signature_algorithms(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_signature_algorithms(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {5, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* envoy.extensions.transport_sockets.tls.v3.PrivateKeyProvider */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -197,7 +294,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_e int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -205,13 +302,13 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_e } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -219,36 +316,49 @@ typedef enum { envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_NOT_SET = 0 } envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases; UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_case(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { - return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_clear_provider_name(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_clear_provider_name(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_provider_name(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_clear_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_clear_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_provider_name(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, struct google_protobuf_Any* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_mutable_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(msg, sub); } return sub; } @@ -256,12 +366,12 @@ UPB_INLINE struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3 /* envoy.extensions.transport_sockets.tls.v3.TlsCertificate */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsCertificate* ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -271,7 +381,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_exten int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsCertificate* ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -279,188 +389,248 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_exten } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, 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); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsCertificate_signed_certificate_timestamp(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); -} -UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, size_t* len) { - return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); -} -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*); + const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_watched_directory(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_WatchedDirectory*); + const struct envoy_config_core_v3_WatchedDirectory* default_val = NULL; + const struct envoy_config_core_v3_WatchedDirectory* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_pkcs12(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_certificate_chain(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_password(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_ocsp_staple(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, size_t* len) { - return (struct envoy_config_core_v3_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_DataSource**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_resize_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_DataSource**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_resize_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_DataSource**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_add_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { - struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(20, 40), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key_provider(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_watched_directory(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_WatchedDirectory* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_WatchedDirectory*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_watched_directory(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_config_core_v3_WatchedDirectory* sub = (struct envoy_config_core_v3_WatchedDirectory*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_watched_directory(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_watched_directory(msg, sub); + sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_watched_directory(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pkcs12(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 64), 7, 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_pkcs12(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_pkcs12(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pkcs12(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pkcs12(msg, sub); } return sub; } @@ -468,12 +638,12 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_so /* envoy.extensions.transport_sockets.tls.v3.TlsSessionTicketKeys */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -483,7 +653,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -491,47 +661,72 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_clear_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_has_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_clear_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, size_t* len) { - return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_keys(msg, &size); + return size != 0; } -UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_mutable_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, size_t* len) { - return (struct envoy_config_core_v3_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_mutable_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_DataSource**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_resize_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_DataSource**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_resize_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_DataSource**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_add_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, upb_Arena* arena) { - struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.transport_sockets.tls.v3.CertificateProviderPluginInstance */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* ret = envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -541,7 +736,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginIn int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* ret = envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -549,44 +744,56 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginIn } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, 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); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_clear_instance_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_instance_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_clear_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_clear_certificate_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_set_instance_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.transport_sockets.tls.v3.SubjectAltNameMatcher */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* ret = envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -596,7 +803,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envo int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* ret = envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -604,44 +811,55 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envo } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, 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; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_clear_san_type(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_san_type(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_has_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_clear_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_clear_matcher(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_matcher_v3_StringMatcher*); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_has_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_san_type(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_matcher(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_matcher_v3_StringMatcher*) = value; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_mutable_matcher(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_matcher(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_matcher(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_matcher(msg, sub); } return sub; } @@ -649,12 +867,12 @@ UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transpor /* envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -664,7 +882,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContex int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -672,276 +890,437 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContex } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, 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); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); +UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + size_t size; + envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(msg, &size); + return size != 0; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + size_t size; + envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 48), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 48), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_allow_expired_certificate(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 48), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_allow_expired_certificate(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_allow_expired_certificate(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 56), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 56), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); + size_t size; + envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); -} -UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_trust_chain_verification(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_trust_chain_verification(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trust_chain_verification(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {10, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_watched_directory(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_config_core_v3_WatchedDirectory*); + const struct envoy_config_core_v3_WatchedDirectory* default_val = NULL; + const struct envoy_config_core_v3_WatchedDirectory* ret; + const upb_MiniTableField field = {11, UPB_SIZE(36, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(44, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*); + const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* ret; + const upb_MiniTableField field = {13, UPB_SIZE(44, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_only_verify_leaf_cert_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(44, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_only_verify_leaf_cert_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(48, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_only_verify_leaf_cert_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {14, UPB_SIZE(48, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(52, 88), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + const upb_MiniTableField field = {15, UPB_SIZE(52, 88), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_match_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); + size_t size; + envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_typed_subject_alt_names(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_match_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 88)); -} -UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); -} -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_max_verify_depth(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return _upb_hasbit(msg, 7); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_max_verify_depth(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_max_verify_depth(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(56, 96), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_max_verify_depth(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {16, UPB_SIZE(56, 96), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_max_verify_depth(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(56, 96), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(msg, sub); } return sub; } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(12, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 48), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_allow_expired_certificate(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(28, 56), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_matcher_v3_StringMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(28, 56), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_matcher_v3_StringMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(28, 56), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trust_chain_verification(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {10, UPB_SIZE(32, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_watched_directory(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_WatchedDirectory* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_config_core_v3_WatchedDirectory*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(36, 64), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_watched_directory(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct envoy_config_core_v3_WatchedDirectory* sub = (struct envoy_config_core_v3_WatchedDirectory*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_watched_directory(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_watched_directory(msg, sub); + sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_watched_directory(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 5, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_custom_validator_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(44, 80), 6, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_only_verify_leaf_cert_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {14, UPB_SIZE(48, 8), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) { - return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len); +UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* size) { + upb_MiniTableField field = {15, UPB_SIZE(52, 88), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {15, UPB_SIZE(52, 88), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { - struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* sub = (struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {15, UPB_SIZE(52, 88), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* sub = (struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_max_verify_depth(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {16, UPB_SIZE(56, 96), 7, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_max_verify_depth(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_max_verify_depth(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_max_verify_depth(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_max_verify_depth(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_ */ 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 8fefcb2cc2a..d52e121d24b 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/config_source.upb.h" @@ -17,65 +19,86 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init = { &envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = { - {.submsg = &envoy_config_core_v3_ConfigSource_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = { + {.submsg = &envoy_config_core_v3_ConfigSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init = { &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = { - {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = { + {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Secret__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_Secret__fields[5] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msg_init = { &envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_Secret__fields[0], - UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_maxmaxb}, + {0x001800000301001a, &upb_pom_1bt_maxmaxb}, + {0x0018000004020022, &upb_pom_1bt_maxmaxb}, + {0x001800000503002a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, - &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, - &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, + &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, + &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, + &envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, }; -const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -84,5 +107,5 @@ const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_secret_proto_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 9937d7b8894..adde2ca4823 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 @@ -9,48 +9,50 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_transport_sockets_tls_v3_GenericSecret; -struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig; -struct envoy_extensions_transport_sockets_tls_v3_Secret; typedef struct envoy_extensions_transport_sockets_tls_v3_GenericSecret envoy_extensions_transport_sockets_tls_v3_GenericSecret; typedef struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig; typedef struct envoy_extensions_transport_sockets_tls_v3_Secret envoy_extensions_transport_sockets_tls_v3_Secret; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msginit; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msg_init; struct envoy_config_core_v3_ConfigSource; struct envoy_config_core_v3_DataSource; struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext; struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate; struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys; -extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit; +extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msg_init; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init; /* envoy.extensions.transport_sockets.tls.v3.GenericSecret */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_GenericSecret* ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -60,7 +62,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extens int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_GenericSecret* ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -68,35 +70,40 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extens } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, 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); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_GenericSecret_clear_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_GenericSecret_clear_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_GenericSecret_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_GenericSecret_has_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_GenericSecret_mutable_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_GenericSecret_secret(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(msg, sub); } return sub; } @@ -104,12 +111,12 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_so /* envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -119,7 +126,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_exte int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -127,44 +134,55 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_exte } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, 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); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_clear_name(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_name(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_clear_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_clear_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); + const struct envoy_config_core_v3_ConfigSource* default_val = NULL; + const struct envoy_config_core_v3_ConfigSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_name(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, struct envoy_config_core_v3_ConfigSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_mutable_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(msg, sub); + sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(msg, sub); } return sub; } @@ -172,12 +190,12 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_ /* envoy.extensions.transport_sockets.tls.v3.Secret */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret* envoy_extensions_transport_sockets_tls_v3_Secret_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret* envoy_extensions_transport_sockets_tls_v3_Secret_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_Secret* ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -187,7 +205,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret* envoy_extensions_tr int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_Secret* ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -195,13 +213,13 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret* envoy_extensions_tr } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -212,109 +230,140 @@ typedef enum { envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET = 0 } envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases; UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases envoy_extensions_transport_sockets_tls_v3_Secret_type_case(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return (envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_name(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_name(envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_Secret_name(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_Secret_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_Secret_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_Secret_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 4, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_Secret_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, NULL); + const envoy_extensions_transport_sockets_tls_v3_GenericSecret* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_GenericSecret* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_name(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)envoy_extensions_transport_sockets_tls_v3_Secret_tls_certificate(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)envoy_extensions_transport_sockets_tls_v3_Secret_session_ticket_keys(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_Secret_validation_context(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret *msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)envoy_extensions_transport_sockets_tls_v3_Secret_generic_secret(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_ */ 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 bcfbbb39105..ed37abae971 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h" #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/extension.upb.h" @@ -20,167 +22,242 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = { - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit}, - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = { + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init}, + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init = { &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + {0x001000003f000012, &upb_pss_1bt}, + {0x000100003f000018, &upb_psb1_1bt}, + {0x0020000002010022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[7] = { - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_BoolValue_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[7] = { + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_BoolValue_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[9] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 56), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 56), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 56), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(28, 48), UPB_SIZE(5, 5), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[9] = { + {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 48), 5, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init = { &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[0], - UPB_SIZE(40, 64), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(40, 64), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psm_1bt_max128b}, + {0x0018000002010012, &upb_psm_1bt_maxmaxb}, + {0x002000000302001a, &upb_psm_1bt_maxmaxb}, + {0x0038000404030022, &upb_pom_1bt_maxmaxb}, + {0x003800040504002a, &upb_pom_1bt_maxmaxb}, + {0x0028000004050032, &upb_psm_1bt_maxmaxb}, + {0x0038000407000038, &upb_pob1_1bt}, + {0x000800003f000040, &upb_psv4_1bt}, + {0x003000000506004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_submsgs[2] = { - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, - {.submsg = &envoy_config_core_v3_CidrRange_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_submsgs[2] = { + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, + {.submsg = &envoy_config_core_v3_CidrRange_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsKeyLog__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_TlsKeyLog__fields[3] = { + {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init = { &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prm_1bt_maxmaxb}, + {0x001800003f01001a, &upb_prm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[13] = { - {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit}, - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[13] = { + {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init}, + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[14] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(24, 40), UPB_SIZE(2, 2), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(28, 48), UPB_SIZE(3, 3), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(32, 56), UPB_SIZE(4, 4), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(36, 64), UPB_SIZE(5, 5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(40, 72), UPB_SIZE(6, 6), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[14] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(20, 40), 2, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(24, 48), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(32, 56), 4, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(36, 64), 5, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(40, 72), 6, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init = { &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[0], - UPB_SIZE(48, 88), 14, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(48, 88), 14, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f010012, &upb_prm_1bt_maxmaxb}, + {0x005000040302001a, &upb_pom_1bt_maxmaxb}, + {0x001800003f000022, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f030032, &upb_prm_1bt_maxmaxb}, + {0x005000040704003a, &upb_pom_1bt_maxmaxb}, + {0x0050000408050042, &upb_pom_1bt_max64b}, + {0x002800000206004a, &upb_psm_1bt_max64b}, + {0x005000040a070052, &upb_pom_1bt_max64b}, + {0x003000000308005a, &upb_psm_1bt_max64b}, + {0x005000040c090062, &upb_pom_1bt_max64b}, + {0x00380000040a006a, &upb_psm_1bt_maxmaxb}, + {0x00400000050b0072, &upb_psm_1bt_maxmaxb}, + {0x00480000060c007a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = { - {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = { + {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init = { &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init = { NULL, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = { - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit}, - {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = { + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init}, + {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init = { &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800000302001a, &upb_psm_1bt_max64b}, + {0x0020000004030022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[7] = { - &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, - &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, - &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, - &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, - &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, - &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, - &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, + &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init, + &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init, + &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, + &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, + &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, + &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, + &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, }; -const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -189,5 +266,5 @@ const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_proto_upb 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 7f464468a21..20a891e2f82 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 @@ -9,24 +9,22 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext; -struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext; -struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog; -struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext; -struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider; -struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance; -struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext; typedef struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext; typedef struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext; typedef struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog envoy_extensions_transport_sockets_tls_v3_TlsKeyLog; @@ -34,13 +32,13 @@ typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext envoy_ typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider; typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance; typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init; struct envoy_config_core_v3_CidrRange; struct envoy_config_core_v3_TypedExtensionConfig; struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance; @@ -52,17 +50,17 @@ struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys; struct google_protobuf_BoolValue; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit; -extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable envoy_config_core_v3_CidrRange_msg_init; +extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; typedef enum { envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_LENIENT_STAPLING = 0, @@ -75,12 +73,12 @@ typedef enum { /* envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -90,7 +88,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* envoy_e int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -98,75 +96,97 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* envoy_e } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msg_init, 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); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_sni(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_sni(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_sni(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_allow_renegotiation(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_allow_renegotiation(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_allow_renegotiation(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_sni(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_allow_renegotiation(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_mutable_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_max_session_keys(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(msg, sub); } return sub; } @@ -174,12 +194,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_transport_socket /* envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -189,7 +209,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* envoy int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -197,13 +217,13 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* envoy } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -213,179 +233,230 @@ typedef enum { envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET = 0 } envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases; UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_case(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {4, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(32, 56), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(32, 56), UPB_SIZE(4, 4), 4, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* ret; + const upb_MiniTableField field = {4, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(32, 56), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(32, 56), UPB_SIZE(4, 4), 5, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* ret; + const upb_MiniTableField field = {5, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(32, 56), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_disable_stateless_session_resumption(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(32, 56), UPB_SIZE(4, 4), 7, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_ocsp_staple_policy(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_ocsp_staple_policy(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_ocsp_staple_policy(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_full_scan_certs_on_sni_mismatch(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return _upb_hasbit(msg, 5); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_full_scan_certs_on_sni_mismatch(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_full_scan_certs_on_sni_mismatch(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_full_scan_certs_on_sni_mismatch(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_BoolValue*); + const struct google_protobuf_BoolValue* default_val = NULL; + const struct google_protobuf_BoolValue* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_full_scan_certs_on_sni_mismatch(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 32), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(32, 56), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(32, 56), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_sds_secret_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 40), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_disable_stateless_session_resumption(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(32, 56), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, UPB_SIZE(32, 56), UPB_SIZE(-21, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_ocsp_staple_policy(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_full_scan_certs_on_sni_mismatch(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_BoolValue*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 5, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_full_scan_certs_on_sni_mismatch(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, upb_Arena* arena) { struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_full_scan_certs_on_sni_mismatch(msg); if (sub == NULL) { - sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_full_scan_certs_on_sni_mismatch(msg, sub); + sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_full_scan_certs_on_sni_mismatch(msg, sub); } return sub; } @@ -393,12 +464,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_ /* envoy.extensions.transport_sockets.tls.v3.TlsKeyLog */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* ret = envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -408,7 +479,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* ret = envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -416,77 +487,133 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, 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); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_path(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_path(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_has_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_local_address_range(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) { - return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_has_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) { - return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); + size_t size; + envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_remote_address_range(msg, &size); + return size != 0; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_set_path(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(8, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_mutable_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) { - return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_mutable_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_resize_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_resize_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_add_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, upb_Arena* arena) { - struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_mutable_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) { - return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_mutable_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_resize_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_resize_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_add_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, upb_Arena* arena) { - struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -496,7 +623,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_ext int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -504,13 +631,13 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_ext } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -522,300 +649,440 @@ typedef enum { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET = 0 } envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases; UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*); + const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); + size_t size; + envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); -} -UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) { - return (const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); -} -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 3, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* ret; + const upb_MiniTableField field = {3, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + size_t size; + envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); + size_t size; + envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(msg, &size); + return size != 0; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); -} -UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) { - return (const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); -} -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 7, NULL); + const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* ret; + const upb_MiniTableField field = {7, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 8, NULL); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* ret; + const upb_MiniTableField field = {8, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 40), 2, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* ret; + const upb_MiniTableField field = {9, UPB_SIZE(20, 40), 2, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 40), 2, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 10, NULL); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* ret; + const upb_MiniTableField field = {10, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 48), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* ret; + const upb_MiniTableField field = {11, UPB_SIZE(24, 48), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12; +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(24, 48), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 12, NULL); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* ret; + const upb_MiniTableField field = {12, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 56), 4, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_config_core_v3_TypedExtensionConfig*); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {13, UPB_SIZE(32, 56), 4, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(32, 56), 4, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 64), 5, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*); + const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* ret; + const upb_MiniTableField field = {14, UPB_SIZE(36, 64), 5, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(36, 64), 5, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_key_log(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(40, 72), 6, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*); + const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* ret; + const upb_MiniTableField field = {15, UPB_SIZE(40, 72), 6, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(40, 72), 6, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(msg, sub); } return sub; } -UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) { - return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t len, upb_Arena* arena) { - return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { - struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(msg, sub); } return sub; } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) { - return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t len, upb_Arena* arena) { - return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { - struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 8); + const upb_MiniTableField field = {8, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(20, 40), 2, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 10); + const upb_MiniTableField field = {10, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value; + const upb_MiniTableField field = {11, UPB_SIZE(24, 48), 3, 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) { - UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 12); + const upb_MiniTableField field = {12, UPB_SIZE(44, 80), UPB_SIZE(-29, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_config_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {13, UPB_SIZE(32, 56), 4, 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*) = value; + const upb_MiniTableField field = {14, UPB_SIZE(36, 64), 5, 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_key_log(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*) = value; + const upb_MiniTableField field = {15, UPB_SIZE(40, 72), 6, 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_key_log(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_key_log(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_key_log(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_key_log(msg, sub); } return sub; } @@ -823,12 +1090,12 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_ext /* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProvider */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -838,7 +1105,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -846,13 +1113,13 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -860,36 +1127,49 @@ typedef enum { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_NOT_SET = 0 } envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases; UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { - return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_clear_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_clear_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_clear_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_NOT_SET); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_clear_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_config_core_v3_TypedExtensionConfig* default_val = NULL; + const struct envoy_config_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_mutable_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg, upb_Arena* arena) { struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_typed_config(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(msg, sub); + sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(msg, sub); } return sub; } @@ -897,12 +1177,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_tr /* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProviderInstance */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -912,7 +1192,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -920,44 +1200,56 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, 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); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_clear_instance_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_clear_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_clear_certificate_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_instance_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CombinedCertificateValidationContext */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -967,7 +1259,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCe int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -975,111 +1267,131 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCe } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msg_init, 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); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*); + const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*); + const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* default_val = NULL; + const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* default_val = NULL; + const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_sds_secret_config(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(msg, sub); } return sub; } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg, upb_Arena* arena) { struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(msg); if (sub == NULL) { - sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(msg, sub); + sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_ */ 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 32386615b8a..87ce172d60f 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 @@ -7,49 +7,62 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_submsgs[1] = { - {.submsg = &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_submsgs[1] = { + {.submsg = &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init = { &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_submsgs[1] = { - {.submsg = &envoy_config_core_v3_DataSource_msginit}, +static const upb_MiniTableSub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_submsgs[1] = { + {.submsg = &envoy_config_core_v3_DataSource_msg_init}, }; -static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit = { +const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init = { &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_submsgs[0], &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, - &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, + &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init, + &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, }; -const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout = { +const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -58,5 +71,5 @@ const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_spiffe_va 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1cb9437bbc2..7a88cc5d4fa 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPB_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig; -struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain; typedef struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig; typedef struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit; -extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init; +extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init; struct envoy_config_core_v3_DataSource; -extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit; +extern const upb_MiniTable envoy_config_core_v3_DataSource_msg_init; /* envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,47 +60,72 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_clear_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* const* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_has_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_clear_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* const* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t* len) { - return (const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_trust_domains(msg, &size); + return size != 0; } -UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain** envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_mutable_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t* len) { - return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain** envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_mutable_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain** envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_resize_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain** envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_resize_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_add_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, upb_Arena* arena) { - struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* sub = (struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* sub = (struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig.TrustDomain */ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_new(upb_Arena* arena) { - return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, arena); + return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, arena); } UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -107,7 +135,7 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_T int options, upb_Arena* arena) { envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -115,54 +143,65 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_T } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msg_init, 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); +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_clear_name(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_name(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_has_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_clear_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_clear_trust_bundle(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*); + const struct envoy_config_core_v3_DataSource* default_val = NULL; + const struct envoy_config_core_v3_DataSource* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_has_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_name(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_trust_bundle(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain *msg, struct envoy_config_core_v3_DataSource* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_DataSource*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_mutable_trust_bundle(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg, upb_Arena* arena) { struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_trust_bundle(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena); - if (!sub) return NULL; - envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_trust_bundle(msg, sub); + sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msg_init, arena); + if (sub) envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_trust_bundle(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPB_H_ */ 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 612a2c3f88b..766aa306b39 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 @@ -7,25 +7,28 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/service/discovery/v3/ads.upb.h" #include "envoy/service/discovery/v3/discovery.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable envoy_service_discovery_v3_AdsDummy_msginit = { +const upb_MiniTable envoy_service_discovery_v3_AdsDummy_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[1] = { - &envoy_service_discovery_v3_AdsDummy_msginit, + &envoy_service_discovery_v3_AdsDummy_msg_init, }; -const upb_MiniTable_File envoy_service_discovery_v3_ads_proto_upb_file_layout = { +const upb_MiniTableFile envoy_service_discovery_v3_ads_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -34,5 +37,5 @@ const upb_MiniTable_File envoy_service_discovery_v3_ads_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 5c8864686c8..280d1d9d1d3 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 @@ -9,32 +9,36 @@ #ifndef ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_ #define ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_service_discovery_v3_AdsDummy; typedef struct envoy_service_discovery_v3_AdsDummy envoy_service_discovery_v3_AdsDummy; -extern const upb_MiniTable envoy_service_discovery_v3_AdsDummy_msginit; +extern const upb_MiniTable envoy_service_discovery_v3_AdsDummy_msg_init; /* envoy.service.discovery.v3.AdsDummy */ UPB_INLINE envoy_service_discovery_v3_AdsDummy* envoy_service_discovery_v3_AdsDummy_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_AdsDummy*)_upb_Message_New(&envoy_service_discovery_v3_AdsDummy_msginit, arena); + return (envoy_service_discovery_v3_AdsDummy*)_upb_Message_New(&envoy_service_discovery_v3_AdsDummy_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_AdsDummy* envoy_service_discovery_v3_AdsDummy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_AdsDummy* ret = envoy_service_discovery_v3_AdsDummy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE envoy_service_discovery_v3_AdsDummy* envoy_service_discovery_v3_AdsDu int options, upb_Arena* arena) { envoy_service_discovery_v3_AdsDummy* ret = envoy_service_discovery_v3_AdsDummy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,23 +56,23 @@ UPB_INLINE envoy_service_discovery_v3_AdsDummy* envoy_service_discovery_v3_AdsDu } UPB_INLINE char* envoy_service_discovery_v3_AdsDummy_serialize(const envoy_service_discovery_v3_AdsDummy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_service_discovery_v3_ads_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_service_discovery_v3_ads_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_ */ 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 b4bad06df27..df244a279c2 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/service/discovery/v3/discovery.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "google/protobuf/any.upb.h" @@ -17,259 +19,380 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_service_discovery_v3_ResourceLocator_submsgs[1] = { - {.submsg = &envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_ResourceLocator_submsgs[1] = { + {.submsg = &envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_ResourceLocator__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_ResourceLocator__fields[2] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_msginit = { +const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_msg_init = { &envoy_service_discovery_v3_ResourceLocator_submsgs[0], &envoy_service_discovery_v3_ResourceLocator__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msginit = { +const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msg_init = { NULL, &envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_ResourceName_submsgs[1] = { - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_ResourceName_submsgs[1] = { + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_ResourceName__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_ResourceName__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_ResourceName_msginit = { +const upb_MiniTable envoy_service_discovery_v3_ResourceName_msg_init = { &envoy_service_discovery_v3_ResourceName_submsgs[0], &envoy_service_discovery_v3_ResourceName__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DiscoveryRequest_submsgs[3] = { - {.submsg = &envoy_config_core_v3_Node_msginit}, - {.submsg = &google_rpc_Status_msginit}, - {.submsg = &envoy_service_discovery_v3_ResourceLocator_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DiscoveryRequest_submsgs[3] = { + {.submsg = &envoy_config_core_v3_Node_msg_init}, + {.submsg = &google_rpc_Status_msg_init}, + {.submsg = &envoy_service_discovery_v3_ResourceLocator_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DiscoveryRequest__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(36, 72), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DiscoveryRequest__fields[7] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msg_init = { &envoy_service_discovery_v3_DiscoveryRequest_submsgs[0], &envoy_service_discovery_v3_DiscoveryRequest__fields[0], - UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f00001a, &upb_prs_1bt}, + {0x002800003f000022, &upb_pss_1bt}, + {0x003800003f00002a, &upb_pss_1bt}, + {0x0048000002010032, &upb_psm_1bt_maxmaxb}, + {0x005000003f02003a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &envoy_config_core_v3_ControlPlane_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &envoy_config_core_v3_ControlPlane_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DiscoveryResponse__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 64), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DiscoveryResponse__fields[6] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msg_init = { &envoy_service_discovery_v3_DiscoveryResponse_submsgs[0], &envoy_service_discovery_v3_DiscoveryResponse__fields[0], - UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + {0x002000003f000022, &upb_pss_1bt}, + {0x003000003f00002a, &upb_pss_1bt}, + {0x0040000001010032, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[5] = { - {.submsg = &envoy_config_core_v3_Node_msginit}, - {.submsg = &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit}, - {.submsg = &google_rpc_Status_msginit}, - {.submsg = &envoy_service_discovery_v3_ResourceLocator_msginit}, - {.submsg = &envoy_service_discovery_v3_ResourceLocator_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[5] = { + {.submsg = &envoy_config_core_v3_Node_msg_init}, + {.submsg = &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msg_init}, + {.submsg = &google_rpc_Status_msg_init}, + {.submsg = &envoy_service_discovery_v3_ResourceLocator_msg_init}, + {.submsg = &envoy_service_discovery_v3_ResourceLocator_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[9] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(36, 72), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(44, 88), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[9] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init = { &envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[0], &envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[0], - UPB_SIZE(48, 96), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(48, 96), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_prs_1bt}, + {0x002800003f000022, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f000032, &upb_pss_1bt}, + {0x004800000202003a, &upb_psm_1bt_maxmaxb}, + {0x005000003f030042, &upb_prm_1bt_max64b}, + {0x005800003f04004a, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msg_init = { NULL, &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[3] = { - {.submsg = &envoy_service_discovery_v3_Resource_msginit}, - {.submsg = &envoy_config_core_v3_ControlPlane_msginit}, - {.submsg = &envoy_service_discovery_v3_ResourceName_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[3] = { + {.submsg = &envoy_service_discovery_v3_Resource_msg_init}, + {.submsg = &envoy_config_core_v3_ControlPlane_msg_init}, + {.submsg = &envoy_service_discovery_v3_ResourceName_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(36, 72), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[7] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(28, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(8, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(12, 72), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init = { &envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[0], &envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[0], - UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f000022, &upb_pss_1bt}, + {0x003000003f00002a, &upb_pss_1bt}, + {0x004000003f000032, &upb_prs_1bt}, + {0x004800000101003a, &upb_psm_1bt_maxmaxb}, + {0x005000003f020042, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DynamicParameterConstraints_submsgs[4] = { - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit}, - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit}, - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit}, - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DynamicParameterConstraints_submsgs[4] = { + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init}, + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init}, + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init}, + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DynamicParameterConstraints__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DynamicParameterConstraints__fields[4] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_msg_init = { &envoy_service_discovery_v3_DynamicParameterConstraints_submsgs[0], &envoy_service_discovery_v3_DynamicParameterConstraints__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004030022, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_submsgs[1] = { - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_submsgs[1] = { + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint__fields[3] = { - {1, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint__fields[3] = { + {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init = { &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_submsgs[0], &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x0008000002000012, &upb_pos_1bt}, + {0x000800000300001a, &upb_pom_1bt_max64b}, + }) }; -const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_submsgs[1] = { - {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_submsgs[1] = { + {.submsg = &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit = { +const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init = { &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_submsgs[0], &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_service_discovery_v3_Resource_submsgs[5] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &envoy_service_discovery_v3_Resource_CacheControl_msginit}, - {.submsg = &envoy_service_discovery_v3_ResourceName_msginit}, - {.submsg = &envoy_config_core_v3_Metadata_msginit}, +static const upb_MiniTableSub envoy_service_discovery_v3_Resource_submsgs[5] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &envoy_service_discovery_v3_Resource_CacheControl_msg_init}, + {.submsg = &envoy_service_discovery_v3_ResourceName_msg_init}, + {.submsg = &envoy_config_core_v3_Metadata_msg_init}, }; -static const upb_MiniTable_Field envoy_service_discovery_v3_Resource__fields[8] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 64), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 72), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(40, 80), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_Resource__fields[8] = { + {1, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 72), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(24, 80), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_Resource_msginit = { +const upb_MiniTable envoy_service_discovery_v3_Resource_msg_init = { &envoy_service_discovery_v3_Resource_submsgs[0], &envoy_service_discovery_v3_Resource__fields[0], - UPB_SIZE(48, 88), 8, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(48, 88), 8, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f00001a, &upb_pss_1bt}, + {0x003000003f000022, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0038000002010032, &upb_psm_1bt_maxmaxb}, + {0x004000000302003a, &upb_psm_1bt_max64b}, + {0x0048000004030042, &upb_psm_1bt_max64b}, + {0x005000000504004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_service_discovery_v3_Resource_CacheControl__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_discovery_v3_Resource_CacheControl__fields[1] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msginit = { +const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msg_init = { NULL, &envoy_service_discovery_v3_Resource_CacheControl__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + }) }; static const upb_MiniTable *messages_layout[14] = { - &envoy_service_discovery_v3_ResourceLocator_msginit, - &envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msginit, - &envoy_service_discovery_v3_ResourceName_msginit, - &envoy_service_discovery_v3_DiscoveryRequest_msginit, - &envoy_service_discovery_v3_DiscoveryResponse_msginit, - &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, - &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit, - &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, - &envoy_service_discovery_v3_DynamicParameterConstraints_msginit, - &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, - &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, - &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, - &envoy_service_discovery_v3_Resource_msginit, - &envoy_service_discovery_v3_Resource_CacheControl_msginit, + &envoy_service_discovery_v3_ResourceLocator_msg_init, + &envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msg_init, + &envoy_service_discovery_v3_ResourceName_msg_init, + &envoy_service_discovery_v3_DiscoveryRequest_msg_init, + &envoy_service_discovery_v3_DiscoveryResponse_msg_init, + &envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init, + &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msg_init, + &envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init, + &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, + &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, + &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, + &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, + &envoy_service_discovery_v3_Resource_msg_init, + &envoy_service_discovery_v3_Resource_CacheControl_msg_init, }; -const upb_MiniTable_File envoy_service_discovery_v3_discovery_proto_upb_file_layout = { +const upb_MiniTableFile envoy_service_discovery_v3_discovery_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -278,5 +401,5 @@ const upb_MiniTable_File envoy_service_discovery_v3_discovery_proto_upb_file_lay 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 224f6bd4301..7a257d987d1 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 @@ -9,31 +9,22 @@ #ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_ #define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_service_discovery_v3_ResourceLocator; -struct envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry; -struct envoy_service_discovery_v3_ResourceName; -struct envoy_service_discovery_v3_DiscoveryRequest; -struct envoy_service_discovery_v3_DiscoveryResponse; -struct envoy_service_discovery_v3_DeltaDiscoveryRequest; -struct envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry; -struct envoy_service_discovery_v3_DeltaDiscoveryResponse; -struct envoy_service_discovery_v3_DynamicParameterConstraints; -struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint; -struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists; -struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList; -struct envoy_service_discovery_v3_Resource; -struct envoy_service_discovery_v3_Resource_CacheControl; typedef struct envoy_service_discovery_v3_ResourceLocator envoy_service_discovery_v3_ResourceLocator; typedef struct envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry; typedef struct envoy_service_discovery_v3_ResourceName envoy_service_discovery_v3_ResourceName; @@ -48,44 +39,44 @@ typedef struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleCons typedef struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList; typedef struct envoy_service_discovery_v3_Resource envoy_service_discovery_v3_Resource; typedef struct envoy_service_discovery_v3_Resource_CacheControl envoy_service_discovery_v3_Resource_CacheControl; -extern const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_ResourceName_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_Resource_msginit; -extern const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msginit; +extern const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_ResourceName_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_Resource_msg_init; +extern const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msg_init; struct envoy_config_core_v3_ControlPlane; struct envoy_config_core_v3_Metadata; struct envoy_config_core_v3_Node; struct google_protobuf_Any; struct google_protobuf_Duration; struct google_rpc_Status; -extern const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit; -extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit; -extern const upb_MiniTable envoy_config_core_v3_Node_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_rpc_Status_msginit; +extern const upb_MiniTable envoy_config_core_v3_ControlPlane_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Metadata_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Node_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_rpc_Status_msg_init; /* envoy.service.discovery.v3.ResourceLocator */ UPB_INLINE envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v3_ResourceLocator_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msginit, arena); + return (envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v3_ResourceLocator_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_ResourceLocator* ret = envoy_service_discovery_v3_ResourceLocator_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceLocator_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceLocator_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -95,7 +86,7 @@ UPB_INLINE envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v int options, upb_Arena* arena) { envoy_service_discovery_v3_ResourceLocator* ret = envoy_service_discovery_v3_ResourceLocator_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceLocator_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceLocator_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -103,49 +94,78 @@ UPB_INLINE envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v } UPB_INLINE char* envoy_service_discovery_v3_ResourceLocator_serialize(const envoy_service_discovery_v3_ResourceLocator* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceLocator_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceLocator_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_service_discovery_v3_ResourceLocator_serialize_ex(const envoy_service_discovery_v3_ResourceLocator* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceLocator_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceLocator_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_clear_name(const envoy_service_discovery_v3_ResourceLocator* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_clear_name(envoy_service_discovery_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_ResourceLocator_name(const envoy_service_discovery_v3_ResourceLocator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_ResourceLocator_has_dynamic_parameters(const envoy_service_discovery_v3_ResourceLocator* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_clear_dynamic_parameters(const envoy_service_discovery_v3_ResourceLocator* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_clear_dynamic_parameters(envoy_service_discovery_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_size(const envoy_service_discovery_v3_ResourceLocator* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(8, 16)); + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_get(const envoy_service_discovery_v3_ResourceLocator* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(8, 16), &key, 0, val, 0); + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry* envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_next(const envoy_service_discovery_v3_ResourceLocator* msg, size_t* iter) { - return (const envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool envoy_service_discovery_v3_ResourceLocator_has_dynamic_parameters(const envoy_service_discovery_v3_ResourceLocator* msg) { + return envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_size(msg) != 0; } UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_set_name(envoy_service_discovery_v3_ResourceLocator *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_clear(envoy_service_discovery_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_clear(envoy_service_discovery_v3_ResourceLocator* msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 16)); } UPB_INLINE bool envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_set(envoy_service_discovery_v3_ResourceLocator* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(8, 16), &key, 0, &val, 0, a); + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_delete(envoy_service_discovery_v3_ResourceLocator* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(8, 16), &key, 0); + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry* envoy_service_discovery_v3_ResourceLocator_dynamic_parameters_nextmutable(envoy_service_discovery_v3_ResourceLocator* msg, size_t* iter) { - return (envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntry*)_upb_map_next(map, iter); } /* envoy.service.discovery.v3.ResourceLocator.DynamicParametersEntry */ @@ -168,12 +188,12 @@ UPB_INLINE void envoy_service_discovery_v3_ResourceLocator_DynamicParametersEntr /* envoy.service.discovery.v3.ResourceName */ UPB_INLINE envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_ResourceName_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_ResourceName*)_upb_Message_New(&envoy_service_discovery_v3_ResourceName_msginit, arena); + return (envoy_service_discovery_v3_ResourceName*)_upb_Message_New(&envoy_service_discovery_v3_ResourceName_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_ResourceName_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_ResourceName* ret = envoy_service_discovery_v3_ResourceName_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceName_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceName_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -183,7 +203,7 @@ UPB_INLINE envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_R int options, upb_Arena* arena) { envoy_service_discovery_v3_ResourceName* ret = envoy_service_discovery_v3_ResourceName_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceName_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_ResourceName_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -191,44 +211,55 @@ UPB_INLINE envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_R } UPB_INLINE char* envoy_service_discovery_v3_ResourceName_serialize(const envoy_service_discovery_v3_ResourceName* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceName_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceName_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_service_discovery_v3_ResourceName_serialize_ex(const envoy_service_discovery_v3_ResourceName* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceName_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_ResourceName_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_service_discovery_v3_ResourceName_clear_name(const envoy_service_discovery_v3_ResourceName* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_ResourceName_clear_name(envoy_service_discovery_v3_ResourceName* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_ResourceName_name(const envoy_service_discovery_v3_ResourceName* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_ResourceName_has_dynamic_parameter_constraints(const envoy_service_discovery_v3_ResourceName* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_service_discovery_v3_ResourceName_clear_dynamic_parameter_constraints(const envoy_service_discovery_v3_ResourceName* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_ResourceName_clear_dynamic_parameter_constraints(envoy_service_discovery_v3_ResourceName* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_ResourceName_dynamic_parameter_constraints(const envoy_service_discovery_v3_ResourceName* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_service_discovery_v3_DynamicParameterConstraints*); + const envoy_service_discovery_v3_DynamicParameterConstraints* default_val = NULL; + const envoy_service_discovery_v3_DynamicParameterConstraints* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_ResourceName_has_dynamic_parameter_constraints(const envoy_service_discovery_v3_ResourceName* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_service_discovery_v3_ResourceName_set_name(envoy_service_discovery_v3_ResourceName *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_ResourceName_set_dynamic_parameter_constraints(envoy_service_discovery_v3_ResourceName *msg, envoy_service_discovery_v3_DynamicParameterConstraints* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_service_discovery_v3_DynamicParameterConstraints*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_ResourceName_mutable_dynamic_parameter_constraints(envoy_service_discovery_v3_ResourceName* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_DynamicParameterConstraints* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)envoy_service_discovery_v3_ResourceName_dynamic_parameter_constraints(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_ResourceName_set_dynamic_parameter_constraints(msg, sub); + sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, arena); + if (sub) envoy_service_discovery_v3_ResourceName_set_dynamic_parameter_constraints(msg, sub); } return sub; } @@ -236,12 +267,12 @@ UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints* envoy_ /* envoy.service.discovery.v3.DiscoveryRequest */ UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest* envoy_service_discovery_v3_DiscoveryRequest_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DiscoveryRequest*)_upb_Message_New(&envoy_service_discovery_v3_DiscoveryRequest_msginit, arena); + return (envoy_service_discovery_v3_DiscoveryRequest*)_upb_Message_New(&envoy_service_discovery_v3_DiscoveryRequest_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest* envoy_service_discovery_v3_DiscoveryRequest_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DiscoveryRequest* ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -251,7 +282,7 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest* envoy_service_discovery_ int options, upb_Arena* arena) { envoy_service_discovery_v3_DiscoveryRequest* ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -259,133 +290,215 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest* envoy_service_discovery_ } UPB_INLINE char* envoy_service_discovery_v3_DiscoveryRequest_serialize(const envoy_service_discovery_v3_DiscoveryRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msg_init, 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); +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_version_info(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryRequest_version_info(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_node(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_node(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_node(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DiscoveryRequest_node(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_resource_names(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_node(const envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DiscoveryRequest_resource_names(const envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_type_url(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DiscoveryRequest_resource_names(const envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_resource_names(const envoy_service_discovery_v3_DiscoveryRequest* msg) { + size_t size; + envoy_service_discovery_v3_DiscoveryRequest_resource_names(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_type_url(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryRequest_type_url(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_response_nonce(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_response_nonce(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_error_detail(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_error_detail(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest_error_detail(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_rpc_Status*); + const struct google_rpc_Status* default_val = NULL; + const struct google_rpc_Status* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_resource_locators(envoy_service_discovery_v3_DiscoveryRequest* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_discovery_v3_ResourceLocator* const* envoy_service_discovery_v3_DiscoveryRequest_resource_locators(const envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_discovery_v3_ResourceLocator* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_resource_locators(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); -} -UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_resource_locators(const envoy_service_discovery_v3_DiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 80)); -} -UPB_INLINE const envoy_service_discovery_v3_ResourceLocator* const* envoy_service_discovery_v3_DiscoveryRequest_resource_locators(const envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* len) { - return (const envoy_service_discovery_v3_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); + size_t size; + envoy_service_discovery_v3_DiscoveryRequest_resource_locators(msg, &size); + return size != 0; } UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_version_info(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_node(envoy_service_discovery_v3_DiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DiscoveryRequest_mutable_node(envoy_service_discovery_v3_DiscoveryRequest* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_discovery_v3_DiscoveryRequest_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DiscoveryRequest_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_service_discovery_v3_DiscoveryRequest_set_node(msg, sub); } return sub; } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DiscoveryRequest_resize_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DiscoveryRequest_resize_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_type_url(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(28, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(36, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DiscoveryRequest *msg, struct google_rpc_Status* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_rpc_Status*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(envoy_service_discovery_v3_DiscoveryRequest* msg, upb_Arena* arena) { struct google_rpc_Status* sub = (struct google_rpc_Status*)envoy_service_discovery_v3_DiscoveryRequest_error_detail(msg); if (sub == NULL) { - sub = (struct google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(msg, sub); + sub = (struct google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msg_init, arena); + if (sub) envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(msg, sub); } return sub; } -UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_locators(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* len) { - return (envoy_service_discovery_v3_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_locators(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_discovery_v3_ResourceLocator**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DiscoveryRequest_resize_resource_locators(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t len, upb_Arena* arena) { - return (envoy_service_discovery_v3_ResourceLocator**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DiscoveryRequest_resize_resource_locators(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_ResourceLocator**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v3_DiscoveryRequest_add_resource_locators(envoy_service_discovery_v3_DiscoveryRequest* msg, upb_Arena* arena) { - struct envoy_service_discovery_v3_ResourceLocator* sub = (struct envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_discovery_v3_ResourceLocator* sub = (struct envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.service.discovery.v3.DiscoveryResponse */ UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse* envoy_service_discovery_v3_DiscoveryResponse_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DiscoveryResponse*)_upb_Message_New(&envoy_service_discovery_v3_DiscoveryResponse_msginit, arena); + return (envoy_service_discovery_v3_DiscoveryResponse*)_upb_Message_New(&envoy_service_discovery_v3_DiscoveryResponse_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse* envoy_service_discovery_v3_DiscoveryResponse_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DiscoveryResponse* ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -395,7 +508,7 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse* envoy_service_discovery int options, upb_Arena* arena) { envoy_service_discovery_v3_DiscoveryResponse* ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -403,92 +516,146 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse* envoy_service_discovery } UPB_INLINE char* envoy_service_discovery_v3_DiscoveryResponse_serialize(const envoy_service_discovery_v3_DiscoveryResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msg_init, 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); +UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_version_info(envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryResponse_version_info(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_resources(envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Any* const* envoy_service_discovery_v3_DiscoveryResponse_resources(const envoy_service_discovery_v3_DiscoveryResponse* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_resources(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_service_discovery_v3_DiscoveryResponse_resources(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_resources(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const struct google_protobuf_Any* const* envoy_service_discovery_v3_DiscoveryResponse_resources(const envoy_service_discovery_v3_DiscoveryResponse* msg, size_t* len) { - return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_canary(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_canary(envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_canary(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_type_url(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_type_url(envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryResponse_type_url(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_nonce(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_nonce(envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryResponse_nonce(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_control_plane(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_control_plane(envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DiscoveryResponse_control_plane(const envoy_service_discovery_v3_DiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct envoy_config_core_v3_ControlPlane*); + const struct envoy_config_core_v3_ControlPlane* default_val = NULL; + const struct envoy_config_core_v3_ControlPlane* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DiscoveryResponse* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_version_info(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DiscoveryResponse* msg, size_t* len) { - return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DiscoveryResponse* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Any**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_resize_resources(envoy_service_discovery_v3_DiscoveryResponse* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_resize_resources(envoy_service_discovery_v3_DiscoveryResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Any* envoy_service_discovery_v3_DiscoveryResponse_add_resources(envoy_service_discovery_v3_DiscoveryResponse* msg, upb_Arena* arena) { - struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_canary(envoy_service_discovery_v3_DiscoveryResponse *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_type_url(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_nonce(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(envoy_service_discovery_v3_DiscoveryResponse *msg, struct envoy_config_core_v3_ControlPlane* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct envoy_config_core_v3_ControlPlane*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 64), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DiscoveryResponse_mutable_control_plane(envoy_service_discovery_v3_DiscoveryResponse* msg, upb_Arena* arena) { struct envoy_config_core_v3_ControlPlane* sub = (struct envoy_config_core_v3_ControlPlane*)envoy_service_discovery_v3_DiscoveryResponse_control_plane(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(msg, sub); + sub = (struct envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msg_init, arena); + if (sub) envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(msg, sub); } return sub; } @@ -496,12 +663,12 @@ UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_ /* envoy.service.discovery.v3.DeltaDiscoveryRequest */ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_discovery_v3_DeltaDiscoveryRequest_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DeltaDiscoveryRequest*)_upb_Message_New(&envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena); + return (envoy_service_discovery_v3_DeltaDiscoveryRequest*)_upb_Message_New(&envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_discovery_v3_DeltaDiscoveryRequest_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DeltaDiscoveryRequest* ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -511,7 +678,7 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_disco int options, upb_Arena* arena) { envoy_service_discovery_v3_DeltaDiscoveryRequest* ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -519,173 +686,326 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_disco } UPB_INLINE char* envoy_service_discovery_v3_DeltaDiscoveryRequest_serialize(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msg_init, 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); -} -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_node(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DeltaDiscoveryRequest_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_type_url(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_type_url(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryRequest_type_url(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_subscribe(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_initial_resource_versions(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); +UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_initial_resource_versions(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_unsubscribe(msg, &size); + return size != 0; +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_initial_resource_versions(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_size(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(24, 48)); + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_get(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(24, 48), &key, 0, val, 0); + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_next(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* iter) { - return (const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), iter); + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_map_next(map, iter); } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_response_nonce(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_initial_resource_versions(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + return envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_size(msg) != 0; +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_response_nonce(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRequest_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_rpc_Status*); + const struct google_rpc_Status* default_val = NULL; + const struct google_rpc_Status* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_locators_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_discovery_v3_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_locators_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_discovery_v3_ResourceLocator* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_resource_locators_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_locators_subscribe(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_locators_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 80)); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_locators_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_service_discovery_v3_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_locators_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (const envoy_service_discovery_v3_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE const envoy_service_discovery_v3_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_locators_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_discovery_v3_ResourceLocator* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_resource_locators_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); -} -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_locators_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 88)); -} -UPB_INLINE const envoy_service_discovery_v3_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_locators_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (const envoy_service_discovery_v3_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_locators_unsubscribe(msg, &size); + return size != 0; } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_node(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_discovery_v3_DeltaDiscoveryRequest_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(32, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_clear(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_clear(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 48)); } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_set(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(24, 48), &key, 0, &val, 0, a); + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_delete(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(24, 48), &key, 0); + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_nextmutable(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* iter) { - return (envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), iter); + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_map_next(map, iter); } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct google_rpc_Status* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_rpc_Status*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_Arena* arena) { struct google_rpc_Status* sub = (struct google_rpc_Status*)envoy_service_discovery_v3_DeltaDiscoveryRequest_error_detail(msg); if (sub == NULL) { - sub = (struct google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(msg, sub); + sub = (struct google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msg_init, arena); + if (sub) envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(msg, sub); } return sub; } -UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_locators_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (envoy_service_discovery_v3_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_locators_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(24, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_discovery_v3_ResourceLocator**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_locators_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t len, upb_Arena* arena) { - return (envoy_service_discovery_v3_ResourceLocator**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_locators_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(24, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_ResourceLocator**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_locators_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_Arena* arena) { - struct envoy_service_discovery_v3_ResourceLocator* sub = (struct envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(24, 80), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_discovery_v3_ResourceLocator* sub = (struct envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_locators_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) { - return (envoy_service_discovery_v3_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len); +UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_locators_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_discovery_v3_ResourceLocator**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_locators_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t len, upb_Arena* arena) { - return (envoy_service_discovery_v3_ResourceLocator**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_discovery_v3_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_locators_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_ResourceLocator**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_discovery_v3_ResourceLocator* envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_locators_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_Arena* arena) { - struct envoy_service_discovery_v3_ResourceLocator* sub = (struct envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(28, 88), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_discovery_v3_ResourceLocator* sub = (struct envoy_service_discovery_v3_ResourceLocator*)_upb_Message_New(&envoy_service_discovery_v3_ResourceLocator_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } @@ -709,12 +1029,12 @@ UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResource /* envoy.service.discovery.v3.DeltaDiscoveryResponse */ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse* envoy_service_discovery_v3_DeltaDiscoveryResponse_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DeltaDiscoveryResponse*)_upb_Message_New(&envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena); + return (envoy_service_discovery_v3_DeltaDiscoveryResponse*)_upb_Message_New(&envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse* envoy_service_discovery_v3_DeltaDiscoveryResponse_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DeltaDiscoveryResponse* ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -724,7 +1044,7 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse* envoy_service_disc int options, upb_Arena* arena) { envoy_service_discovery_v3_DeltaDiscoveryResponse* ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -732,132 +1052,234 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse* envoy_service_disc } UPB_INLINE char* envoy_service_discovery_v3_DeltaDiscoveryResponse_serialize(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msg_init, 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); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_system_version_info(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryResponse_system_version_info(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_discovery_v3_Resource* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_discovery_v3_Resource* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryResponse_resources(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_service_discovery_v3_Resource* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) { - return (const envoy_service_discovery_v3_Resource* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_type_url(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_type_url(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(28, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryResponse_type_url(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(28, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_nonce(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_nonce(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryResponse_nonce(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 64)); +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resources(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_control_plane(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 72), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DeltaDiscoveryResponse_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct envoy_config_core_v3_ControlPlane*); + const struct envoy_config_core_v3_ControlPlane* default_val = NULL; + const struct envoy_config_core_v3_ControlPlane* ret; + const upb_MiniTableField field = {7, UPB_SIZE(12, 72), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 72), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_removed_resource_names(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_discovery_v3_ResourceName* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resource_names(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_discovery_v3_ResourceName* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_removed_resource_names(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); -} -UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_removed_resource_names(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 80)); -} -UPB_INLINE const envoy_service_discovery_v3_ResourceName* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resource_names(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) { - return (const envoy_service_discovery_v3_ResourceName* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); + size_t size; + envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resource_names(msg, &size); + return size != 0; } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_system_version_info(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) { - return (envoy_service_discovery_v3_Resource**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_discovery_v3_Resource**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t len, upb_Arena* arena) { - return (envoy_service_discovery_v3_Resource**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_Resource**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_DeltaDiscoveryResponse_add_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_Arena* arena) { - struct envoy_service_discovery_v3_Resource* sub = (struct envoy_service_discovery_v3_Resource*)_upb_Message_New(&envoy_service_discovery_v3_Resource_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_discovery_v3_Resource* sub = (struct envoy_service_discovery_v3_Resource*)_upb_Message_New(&envoy_service_discovery_v3_Resource_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(28, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_nonce(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(36, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(8, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(8, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_add_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(8, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_control_plane(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, struct envoy_config_core_v3_ControlPlane* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct envoy_config_core_v3_ControlPlane*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(12, 72), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_control_plane(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_Arena* arena) { struct envoy_config_core_v3_ControlPlane* sub = (struct envoy_config_core_v3_ControlPlane*)envoy_service_discovery_v3_DeltaDiscoveryResponse_control_plane(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DeltaDiscoveryResponse_set_control_plane(msg, sub); + sub = (struct envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msg_init, arena); + if (sub) envoy_service_discovery_v3_DeltaDiscoveryResponse_set_control_plane(msg, sub); } return sub; } -UPB_INLINE envoy_service_discovery_v3_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resource_names(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) { - return (envoy_service_discovery_v3_ResourceName**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE envoy_service_discovery_v3_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resource_names(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_discovery_v3_ResourceName**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_discovery_v3_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resource_names(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t len, upb_Arena* arena) { - return (envoy_service_discovery_v3_ResourceName**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_discovery_v3_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resource_names(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_ResourceName**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_DeltaDiscoveryResponse_add_removed_resource_names(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_Arena* arena) { - struct envoy_service_discovery_v3_ResourceName* sub = (struct envoy_service_discovery_v3_ResourceName*)_upb_Message_New(&envoy_service_discovery_v3_ResourceName_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(16, 80), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_discovery_v3_ResourceName* sub = (struct envoy_service_discovery_v3_ResourceName*)_upb_Message_New(&envoy_service_discovery_v3_ResourceName_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.service.discovery.v3.DynamicParameterConstraints */ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_DynamicParameterConstraints_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msginit, arena); + return (envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_DynamicParameterConstraints_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints* ret = envoy_service_discovery_v3_DynamicParameterConstraints_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -867,7 +1289,7 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service int options, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints* ret = envoy_service_discovery_v3_DynamicParameterConstraints_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -875,13 +1297,13 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_serialize(const envoy_service_discovery_v3_DynamicParameterConstraints* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_serialize_ex(const envoy_service_discovery_v3_DynamicParameterConstraints* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -892,90 +1314,115 @@ typedef enum { envoy_service_discovery_v3_DynamicParameterConstraints_type_NOT_SET = 0 } envoy_service_discovery_v3_DynamicParameterConstraints_type_oneofcases; UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_type_oneofcases envoy_service_discovery_v3_DynamicParameterConstraints_type_case(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return (envoy_service_discovery_v3_DynamicParameterConstraints_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_DynamicParameterConstraints_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_constraint(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_constraint(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_service_discovery_v3_DynamicParameterConstraints_type_NOT_SET); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_constraint(envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* envoy_service_discovery_v3_DynamicParameterConstraints_constraint(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return UPB_READ_ONEOF(msg, const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* default_val = NULL; + const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_or_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_constraint(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_or_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_service_discovery_v3_DynamicParameterConstraints_type_NOT_SET); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_or_constraints(envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* envoy_service_discovery_v3_DynamicParameterConstraints_or_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return UPB_READ_ONEOF(msg, const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* default_val = NULL; + const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_and_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_or_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_and_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_service_discovery_v3_DynamicParameterConstraints_type_NOT_SET); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_and_constraints(envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* envoy_service_discovery_v3_DynamicParameterConstraints_and_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return UPB_READ_ONEOF(msg, const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* default_val = NULL; + const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_not_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_and_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_not_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_service_discovery_v3_DynamicParameterConstraints_type_NOT_SET); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_clear_not_constraints(envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_DynamicParameterConstraints_not_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { - return UPB_READ_ONEOF(msg, const envoy_service_discovery_v3_DynamicParameterConstraints*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_service_discovery_v3_DynamicParameterConstraints* default_val = NULL; + const envoy_service_discovery_v3_DynamicParameterConstraints* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_has_not_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_set_constraint(envoy_service_discovery_v3_DynamicParameterConstraints *msg, envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* value) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* envoy_service_discovery_v3_DynamicParameterConstraints_mutable_constraint(envoy_service_discovery_v3_DynamicParameterConstraints* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*)envoy_service_discovery_v3_DynamicParameterConstraints_constraint(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DynamicParameterConstraints_set_constraint(msg, sub); + sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, arena); + if (sub) envoy_service_discovery_v3_DynamicParameterConstraints_set_constraint(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_set_or_constraints(envoy_service_discovery_v3_DynamicParameterConstraints *msg, envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* value) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* envoy_service_discovery_v3_DynamicParameterConstraints_mutable_or_constraints(envoy_service_discovery_v3_DynamicParameterConstraints* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)envoy_service_discovery_v3_DynamicParameterConstraints_or_constraints(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DynamicParameterConstraints_set_or_constraints(msg, sub); + sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, arena); + if (sub) envoy_service_discovery_v3_DynamicParameterConstraints_set_or_constraints(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_set_and_constraints(envoy_service_discovery_v3_DynamicParameterConstraints *msg, envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* value) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* envoy_service_discovery_v3_DynamicParameterConstraints_mutable_and_constraints(envoy_service_discovery_v3_DynamicParameterConstraints* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)envoy_service_discovery_v3_DynamicParameterConstraints_and_constraints(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DynamicParameterConstraints_set_and_constraints(msg, sub); + sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, arena); + if (sub) envoy_service_discovery_v3_DynamicParameterConstraints_set_and_constraints(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_set_not_constraints(envoy_service_discovery_v3_DynamicParameterConstraints *msg, envoy_service_discovery_v3_DynamicParameterConstraints* value) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_DynamicParameterConstraints_mutable_not_constraints(envoy_service_discovery_v3_DynamicParameterConstraints* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_DynamicParameterConstraints* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)envoy_service_discovery_v3_DynamicParameterConstraints_not_constraints(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DynamicParameterConstraints_set_not_constraints(msg, sub); + sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, arena); + if (sub) envoy_service_discovery_v3_DynamicParameterConstraints_set_not_constraints(msg, sub); } return sub; } @@ -983,12 +1430,12 @@ UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints* envoy_ /* envoy.service.discovery.v3.DynamicParameterConstraints.SingleConstraint */ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, arena); + return (envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* ret = envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -998,7 +1445,7 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstrai int options, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* ret = envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1006,13 +1453,13 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstrai } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_serialize(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_serialize_ex(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1021,48 +1468,68 @@ typedef enum { envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_NOT_SET = 0 } envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_oneofcases; UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_oneofcases envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_case(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - return (envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_clear_key(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_clear_key(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_key(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_has_value(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_clear_value(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_NOT_SET); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_clear_value(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_value(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_has_exists(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_has_value(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_clear_exists(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_constraint_type_NOT_SET); +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_clear_exists(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_exists(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { - return UPB_READ_ONEOF(msg, const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* default_val = NULL; + const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_has_exists(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_set_key(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_set_value(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_set_exists(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint *msg, envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* value) { - UPB_WRITE_ONEOF(msg, envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_mutable_exists(envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*)envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_exists(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_set_exists(msg, sub); + sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, arena); + if (sub) envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_set_exists(msg, sub); } return sub; } @@ -1070,12 +1537,12 @@ UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints_SingleC /* envoy.service.discovery.v3.DynamicParameterConstraints.SingleConstraint.Exists */ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, arena); + return (envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* ret = envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1085,7 +1552,7 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstrai int options, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* ret = envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1093,13 +1560,13 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstrai } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_serialize(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_serialize_ex(const envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_SingleConstraint_Exists_msg_init, options, arena, &ptr, len); return ptr; } @@ -1107,12 +1574,12 @@ UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_SingleCo /* envoy.service.discovery.v3.DynamicParameterConstraints.ConstraintList */ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, arena); + return (envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* ret = envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1122,7 +1589,7 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList int options, upb_Arena* arena) { envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* ret = envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1130,47 +1597,72 @@ UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_serialize(const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_serialize_ex(const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_clear_constraints(envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints* const* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_discovery_v3_DynamicParameterConstraints* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_has_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_clear_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_service_discovery_v3_DynamicParameterConstraints* const* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_constraints(const envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, size_t* len) { - return (const envoy_service_discovery_v3_DynamicParameterConstraints* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_constraints(msg, &size); + return size != 0; } -UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints** envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_mutable_constraints(envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, size_t* len) { - return (envoy_service_discovery_v3_DynamicParameterConstraints**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints** envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_mutable_constraints(envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_discovery_v3_DynamicParameterConstraints**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints** envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_resize_constraints(envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, size_t len, upb_Arena* arena) { - return (envoy_service_discovery_v3_DynamicParameterConstraints**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_discovery_v3_DynamicParameterConstraints** envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_resize_constraints(envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_discovery_v3_DynamicParameterConstraints**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_discovery_v3_DynamicParameterConstraints* envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList_add_constraints(envoy_service_discovery_v3_DynamicParameterConstraints_ConstraintList* msg, upb_Arena* arena) { - struct envoy_service_discovery_v3_DynamicParameterConstraints* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_discovery_v3_DynamicParameterConstraints* sub = (struct envoy_service_discovery_v3_DynamicParameterConstraints*)_upb_Message_New(&envoy_service_discovery_v3_DynamicParameterConstraints_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.service.discovery.v3.Resource */ UPB_INLINE envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_Resource_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_Resource*)_upb_Message_New(&envoy_service_discovery_v3_Resource_msginit, arena); + return (envoy_service_discovery_v3_Resource*)_upb_Message_New(&envoy_service_discovery_v3_Resource_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_Resource_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_Resource* ret = envoy_service_discovery_v3_Resource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1180,7 +1672,7 @@ UPB_INLINE envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_Resou int options, upb_Arena* arena) { envoy_service_discovery_v3_Resource* ret = envoy_service_discovery_v3_Resource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1188,156 +1680,222 @@ UPB_INLINE envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_Resou } UPB_INLINE char* envoy_service_discovery_v3_Resource_serialize(const envoy_service_discovery_v3_Resource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_msg_init, 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); +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_version(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_Resource_version(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource(const envoy_service_discovery_v3_Resource* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_resource(const envoy_service_discovery_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_resource(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_service_discovery_v3_Resource_resource(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_name(const envoy_service_discovery_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource(const envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_name(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_discovery_v3_Resource_name(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_aliases(const envoy_service_discovery_v3_Resource* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_aliases(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_service_discovery_v3_Resource_aliases(const envoy_service_discovery_v3_Resource* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE upb_StringView const* envoy_service_discovery_v3_Resource_aliases(const envoy_service_discovery_v3_Resource* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool envoy_service_discovery_v3_Resource_has_ttl(const envoy_service_discovery_v3_Resource* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_service_discovery_v3_Resource_has_aliases(const envoy_service_discovery_v3_Resource* msg) { + size_t size; + envoy_service_discovery_v3_Resource_aliases(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_ttl(const envoy_service_discovery_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_ttl(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_ttl(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_Resource_has_cache_control(const envoy_service_discovery_v3_Resource* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool envoy_service_discovery_v3_Resource_has_ttl(const envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_cache_control(const envoy_service_discovery_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_cache_control(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_cache_control(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_service_discovery_v3_Resource_CacheControl*); + const envoy_service_discovery_v3_Resource_CacheControl* default_val = NULL; + const envoy_service_discovery_v3_Resource_CacheControl* ret; + const upb_MiniTableField field = {7, UPB_SIZE(16, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource_name(const envoy_service_discovery_v3_Resource* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool envoy_service_discovery_v3_Resource_has_cache_control(const envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_resource_name(const envoy_service_discovery_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_resource_name(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 72), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_Resource_resource_name(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const envoy_service_discovery_v3_ResourceName*); + const envoy_service_discovery_v3_ResourceName* default_val = NULL; + const envoy_service_discovery_v3_ResourceName* ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 72), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_discovery_v3_Resource_has_metadata(const envoy_service_discovery_v3_Resource* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource_name(const envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 72), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_discovery_v3_Resource_clear_metadata(const envoy_service_discovery_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_discovery_v3_Resource_clear_metadata(envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_service_discovery_v3_Resource_metadata(const envoy_service_discovery_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct envoy_config_core_v3_Metadata*); + const struct envoy_config_core_v3_Metadata* default_val = NULL; + const struct envoy_config_core_v3_Metadata* ret; + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_discovery_v3_Resource_has_metadata(const envoy_service_discovery_v3_Resource* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_service_discovery_v3_Resource_set_version(envoy_service_discovery_v3_Resource *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(28, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_discovery_v3_Resource_set_resource(envoy_service_discovery_v3_Resource *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_service_discovery_v3_Resource_mutable_resource(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_service_discovery_v3_Resource_resource(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_Resource_set_resource(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_service_discovery_v3_Resource_set_resource(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_Resource_set_name(envoy_service_discovery_v3_Resource *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_Resource_mutable_aliases(envoy_service_discovery_v3_Resource* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_Resource_mutable_aliases(envoy_service_discovery_v3_Resource* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_service_discovery_v3_Resource_resize_aliases(envoy_service_discovery_v3_Resource* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_service_discovery_v3_Resource_resize_aliases(envoy_service_discovery_v3_Resource* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_service_discovery_v3_Resource_add_aliases(envoy_service_discovery_v3_Resource* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_service_discovery_v3_Resource_set_ttl(envoy_service_discovery_v3_Resource *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_mutable_ttl(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_service_discovery_v3_Resource_ttl(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_Resource_set_ttl(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_service_discovery_v3_Resource_set_ttl(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_Resource_set_cache_control(envoy_service_discovery_v3_Resource *msg, envoy_service_discovery_v3_Resource_CacheControl* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_service_discovery_v3_Resource_CacheControl*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(16, 64), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_mutable_cache_control(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_Resource_CacheControl* sub = (struct envoy_service_discovery_v3_Resource_CacheControl*)envoy_service_discovery_v3_Resource_cache_control(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_Resource_CacheControl*)_upb_Message_New(&envoy_service_discovery_v3_Resource_CacheControl_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_Resource_set_cache_control(msg, sub); + sub = (struct envoy_service_discovery_v3_Resource_CacheControl*)_upb_Message_New(&envoy_service_discovery_v3_Resource_CacheControl_msg_init, arena); + if (sub) envoy_service_discovery_v3_Resource_set_cache_control(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_Resource_set_resource_name(envoy_service_discovery_v3_Resource *msg, envoy_service_discovery_v3_ResourceName* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), envoy_service_discovery_v3_ResourceName*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 72), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_service_discovery_v3_ResourceName* envoy_service_discovery_v3_Resource_mutable_resource_name(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) { struct envoy_service_discovery_v3_ResourceName* sub = (struct envoy_service_discovery_v3_ResourceName*)envoy_service_discovery_v3_Resource_resource_name(msg); if (sub == NULL) { - sub = (struct envoy_service_discovery_v3_ResourceName*)_upb_Message_New(&envoy_service_discovery_v3_ResourceName_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_Resource_set_resource_name(msg, sub); + sub = (struct envoy_service_discovery_v3_ResourceName*)_upb_Message_New(&envoy_service_discovery_v3_ResourceName_msg_init, arena); + if (sub) envoy_service_discovery_v3_Resource_set_resource_name(msg, sub); } return sub; } UPB_INLINE void envoy_service_discovery_v3_Resource_set_metadata(envoy_service_discovery_v3_Resource *msg, struct envoy_config_core_v3_Metadata* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct envoy_config_core_v3_Metadata*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(24, 80), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_service_discovery_v3_Resource_mutable_metadata(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) { struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_service_discovery_v3_Resource_metadata(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_service_discovery_v3_Resource_set_metadata(msg, sub); + sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msg_init, arena); + if (sub) envoy_service_discovery_v3_Resource_set_metadata(msg, sub); } return sub; } @@ -1345,12 +1903,12 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_service_discovery_v3_Reso /* envoy.service.discovery.v3.Resource.CacheControl */ UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_CacheControl_new(upb_Arena* arena) { - return (envoy_service_discovery_v3_Resource_CacheControl*)_upb_Message_New(&envoy_service_discovery_v3_Resource_CacheControl_msginit, arena); + return (envoy_service_discovery_v3_Resource_CacheControl*)_upb_Message_New(&envoy_service_discovery_v3_Resource_CacheControl_msg_init, arena); } UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_CacheControl_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_discovery_v3_Resource_CacheControl* ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1360,7 +1918,7 @@ UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_disco int options, upb_Arena* arena) { envoy_service_discovery_v3_Resource_CacheControl* ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1368,32 +1926,38 @@ UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_disco } UPB_INLINE char* envoy_service_discovery_v3_Resource_CacheControl_serialize(const envoy_service_discovery_v3_Resource_CacheControl* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msg_init, 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; +UPB_INLINE void envoy_service_discovery_v3_Resource_CacheControl_clear_do_not_cache(envoy_service_discovery_v3_Resource_CacheControl* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_service_discovery_v3_Resource_CacheControl_do_not_cache(const envoy_service_discovery_v3_Resource_CacheControl* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_service_discovery_v3_Resource_CacheControl_set_do_not_cache(envoy_service_discovery_v3_Resource_CacheControl *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_service_discovery_v3_discovery_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_service_discovery_v3_discovery_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_ */ 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 539f7ccb8eb..2fe1b4801ce 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/service/load_stats/v3/lrs.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/endpoint/v3/load_report.upb.h" @@ -15,47 +17,64 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = { - {.submsg = &envoy_config_core_v3_Node_msginit}, - {.submsg = &envoy_config_endpoint_v3_ClusterStats_msginit}, +static const upb_MiniTableSub envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = { + {.submsg = &envoy_config_core_v3_Node_msg_init}, + {.submsg = &envoy_config_endpoint_v3_ClusterStats_msg_init}, }; -static const upb_MiniTable_Field envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msginit = { +const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msg_init = { &envoy_service_load_stats_v3_LoadStatsRequest_submsgs[0], &envoy_service_load_stats_v3_LoadStatsRequest__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f010012, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_service_load_stats_v3_LoadStatsResponse__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_load_stats_v3_LoadStatsResponse__fields[4] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(13, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_load_stats_v3_LoadStatsResponse_msginit = { +const upb_MiniTable envoy_service_load_stats_v3_LoadStatsResponse_msg_init = { &envoy_service_load_stats_v3_LoadStatsResponse_submsgs[0], &envoy_service_load_stats_v3_LoadStatsResponse__fields[0], - UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prs_1bt}, + {0x0010000001000012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + {0x000200003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_service_load_stats_v3_LoadStatsRequest_msginit, - &envoy_service_load_stats_v3_LoadStatsResponse_msginit, + &envoy_service_load_stats_v3_LoadStatsRequest_msg_init, + &envoy_service_load_stats_v3_LoadStatsResponse_msg_init, }; -const upb_MiniTable_File envoy_service_load_stats_v3_lrs_proto_upb_file_layout = { +const upb_MiniTableFile envoy_service_load_stats_v3_lrs_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -64,5 +83,5 @@ const upb_MiniTable_File envoy_service_load_stats_v3_lrs_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 86c0e872ad3..7430799531e 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 @@ -9,41 +9,44 @@ #ifndef ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_ #define ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_service_load_stats_v3_LoadStatsRequest; -struct envoy_service_load_stats_v3_LoadStatsResponse; typedef struct envoy_service_load_stats_v3_LoadStatsRequest envoy_service_load_stats_v3_LoadStatsRequest; typedef struct envoy_service_load_stats_v3_LoadStatsResponse envoy_service_load_stats_v3_LoadStatsResponse; -extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msginit; -extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsResponse_msginit; +extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msg_init; +extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsResponse_msg_init; struct envoy_config_core_v3_Node; struct envoy_config_endpoint_v3_ClusterStats; struct google_protobuf_Duration; -extern const upb_MiniTable envoy_config_core_v3_Node_msginit; -extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable envoy_config_core_v3_Node_msg_init; +extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msg_init; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* envoy.service.load_stats.v3.LoadStatsRequest */ UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest* envoy_service_load_stats_v3_LoadStatsRequest_new(upb_Arena* arena) { - return (envoy_service_load_stats_v3_LoadStatsRequest*)_upb_Message_New(&envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena); + return (envoy_service_load_stats_v3_LoadStatsRequest*)_upb_Message_New(&envoy_service_load_stats_v3_LoadStatsRequest_msg_init, arena); } UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest* envoy_service_load_stats_v3_LoadStatsRequest_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_load_stats_v3_LoadStatsRequest* ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest* envoy_service_load_stat int options, upb_Arena* arena) { envoy_service_load_stats_v3_LoadStatsRequest* ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,69 +64,99 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest* envoy_service_load_stat } UPB_INLINE char* envoy_service_load_stats_v3_LoadStatsRequest_serialize(const envoy_service_load_stats_v3_LoadStatsRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msg_init, 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); -} -UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_clear_node(const envoy_service_load_stats_v3_LoadStatsRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_clear_node(envoy_service_load_stats_v3_LoadStatsRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_load_stats_v3_LoadStatsRequest_node(const envoy_service_load_stats_v3_LoadStatsRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_node(const envoy_service_load_stats_v3_LoadStatsRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_clear_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_config_endpoint_v3_ClusterStats* const* envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_config_endpoint_v3_ClusterStats* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_clear_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const struct envoy_config_endpoint_v3_ClusterStats* const* envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest* msg, size_t* len) { - return (const struct envoy_config_endpoint_v3_ClusterStats* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(msg, &size); + return size != 0; } UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_set_node(envoy_service_load_stats_v3_LoadStatsRequest *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(envoy_service_load_stats_v3_LoadStatsRequest* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_load_stats_v3_LoadStatsRequest_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_service_load_stats_v3_LoadStatsRequest_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_service_load_stats_v3_LoadStatsRequest_set_node(msg, sub); } return sub; } -UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_mutable_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest* msg, size_t* len) { - return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_mutable_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_resize_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest* msg, size_t len, upb_Arena* arena) { - return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_resize_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_config_endpoint_v3_ClusterStats**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats* envoy_service_load_stats_v3_LoadStatsRequest_add_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest* msg, upb_Arena* arena) { - struct envoy_config_endpoint_v3_ClusterStats* sub = (struct envoy_config_endpoint_v3_ClusterStats*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_config_endpoint_v3_ClusterStats* sub = (struct envoy_config_endpoint_v3_ClusterStats*)_upb_Message_New(&envoy_config_endpoint_v3_ClusterStats_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.service.load_stats.v3.LoadStatsResponse */ UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse* envoy_service_load_stats_v3_LoadStatsResponse_new(upb_Arena* arena) { - return (envoy_service_load_stats_v3_LoadStatsResponse*)_upb_Message_New(&envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena); + return (envoy_service_load_stats_v3_LoadStatsResponse*)_upb_Message_New(&envoy_service_load_stats_v3_LoadStatsResponse_msg_init, arena); } UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse* envoy_service_load_stats_v3_LoadStatsResponse_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_load_stats_v3_LoadStatsResponse* ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -133,7 +166,7 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse* envoy_service_load_sta int options, upb_Arena* arena) { envoy_service_load_stats_v3_LoadStatsResponse* ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -141,78 +174,124 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse* envoy_service_load_sta } UPB_INLINE char* envoy_service_load_stats_v3_LoadStatsResponse_serialize(const envoy_service_load_stats_v3_LoadStatsResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msg_init, 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)); +UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* envoy_service_load_stats_v3_LoadStatsResponse_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE upb_StringView const* envoy_service_load_stats_v3_LoadStatsResponse_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_has_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_has_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { + size_t size; + envoy_service_load_stats_v3_LoadStatsResponse_clusters(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_report_endpoint_granularity(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_has_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_report_endpoint_granularity(envoy_service_load_stats_v3_LoadStatsResponse* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_report_endpoint_granularity(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_send_all_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; +UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_send_all_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(13, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_send_all_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(13, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE upb_StringView* envoy_service_load_stats_v3_LoadStatsResponse_mutable_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE upb_StringView* envoy_service_load_stats_v3_LoadStatsResponse_mutable_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* envoy_service_load_stats_v3_LoadStatsResponse_resize_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* envoy_service_load_stats_v3_LoadStatsResponse_resize_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_add_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_service_load_stats_v3_LoadStatsResponse_mutable_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(msg, sub); } return sub; } UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_report_endpoint_granularity(envoy_service_load_stats_v3_LoadStatsResponse *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_send_all_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(13, 2), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_service_load_stats_v3_lrs_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_service_load_stats_v3_lrs_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_ */ 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 ccfddce780f..ff648c7be22 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/service/status/v3/csds.upb.h" #include "envoy/admin/v3/config_dump_shared.upb.h" #include "envoy/config/core/v3/base.upb.h" @@ -19,113 +21,158 @@ #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_service_status_v3_ClientStatusRequest_submsgs[2] = { - {.submsg = &envoy_type_matcher_v3_NodeMatcher_msginit}, - {.submsg = &envoy_config_core_v3_Node_msginit}, +static const upb_MiniTableSub envoy_service_status_v3_ClientStatusRequest_submsgs[2] = { + {.submsg = &envoy_type_matcher_v3_NodeMatcher_msg_init}, + {.submsg = &envoy_config_core_v3_Node_msg_init}, }; -static const upb_MiniTable_Field envoy_service_status_v3_ClientStatusRequest__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_status_v3_ClientStatusRequest__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_status_v3_ClientStatusRequest_msginit = { +const upb_MiniTable envoy_service_status_v3_ClientStatusRequest_msg_init = { &envoy_service_status_v3_ClientStatusRequest_submsgs[0], &envoy_service_status_v3_ClientStatusRequest__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_maxmaxb}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_status_v3_PerXdsConfig_submsgs[5] = { - {.submsg = &envoy_admin_v3_ListenersConfigDump_msginit}, - {.submsg = &envoy_admin_v3_ClustersConfigDump_msginit}, - {.submsg = &envoy_admin_v3_RoutesConfigDump_msginit}, - {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_msginit}, - {.submsg = &envoy_admin_v3_EndpointsConfigDump_msginit}, +static const upb_MiniTableSub envoy_service_status_v3_PerXdsConfig_submsgs[5] = { + {.submsg = &envoy_admin_v3_ListenersConfigDump_msg_init}, + {.submsg = &envoy_admin_v3_ClustersConfigDump_msg_init}, + {.submsg = &envoy_admin_v3_RoutesConfigDump_msg_init}, + {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_msg_init}, + {.submsg = &envoy_admin_v3_EndpointsConfigDump_msg_init}, }; -static const upb_MiniTable_Field envoy_service_status_v3_PerXdsConfig__fields[7] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_status_v3_PerXdsConfig__fields[7] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 16), -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 16), -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_status_v3_PerXdsConfig_msginit = { +const upb_MiniTable envoy_service_status_v3_PerXdsConfig_msg_init = { &envoy_service_status_v3_PerXdsConfig_submsgs[0], &envoy_service_status_v3_PerXdsConfig__fields[0], - UPB_SIZE(16, 24), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(16, 24), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x0010000402000012, &upb_pom_1bt_maxmaxb}, + {0x001000040301001a, &upb_pom_1bt_maxmaxb}, + {0x0010000404020022, &upb_pom_1bt_maxmaxb}, + {0x001000040503002a, &upb_pom_1bt_maxmaxb}, + {0x0010000406040032, &upb_pom_1bt_maxmaxb}, + {0x000800003f000038, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_service_status_v3_ClientConfig_submsgs[3] = { - {.submsg = &envoy_config_core_v3_Node_msginit}, - {.submsg = &envoy_service_status_v3_PerXdsConfig_msginit}, - {.submsg = &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit}, +static const upb_MiniTableSub envoy_service_status_v3_ClientConfig_submsgs[3] = { + {.submsg = &envoy_config_core_v3_Node_msg_init}, + {.submsg = &envoy_service_status_v3_PerXdsConfig_msg_init}, + {.submsg = &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_service_status_v3_ClientConfig__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_status_v3_ClientConfig__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_status_v3_ClientConfig_msginit = { +const upb_MiniTable envoy_service_status_v3_ClientConfig_msg_init = { &envoy_service_status_v3_ClientConfig_submsgs[0], &envoy_service_status_v3_ClientConfig__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x001800003f02001a, &upb_prm_1bt_max128b}, + }) }; -static const upb_MiniTable_Sub envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[3] = { - {.submsg = &google_protobuf_Any_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &envoy_admin_v3_UpdateFailureState_msginit}, +static const upb_MiniTableSub envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[3] = { + {.submsg = &google_protobuf_Any_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &envoy_admin_v3_UpdateFailureState_msg_init}, }; -static const upb_MiniTable_Field envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[9] = { - {1, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 64), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(44, 72), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(48, 80), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[9] = { + {1, UPB_SIZE(28, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(44, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 64), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 80), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(24, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit = { +const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init = { &envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[0], &envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[0], - UPB_SIZE(56, 88), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(56, 88), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_pss_1bt}, + {0x002000003f000012, &upb_pss_1bt}, + {0x003000003f00001a, &upb_pss_1bt}, + {0x0040000001000022, &upb_psm_1bt_maxmaxb}, + {0x004800000201002a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000030, &upb_psv4_1bt}, + {0x000800003f000038, &upb_psv4_1bt}, + {0x0050000003020042, &upb_psm_1bt_maxmaxb}, + {0x000c00003f000048, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_service_status_v3_ClientStatusResponse_submsgs[1] = { - {.submsg = &envoy_service_status_v3_ClientConfig_msginit}, +static const upb_MiniTableSub envoy_service_status_v3_ClientStatusResponse_submsgs[1] = { + {.submsg = &envoy_service_status_v3_ClientConfig_msg_init}, }; -static const upb_MiniTable_Field envoy_service_status_v3_ClientStatusResponse__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_service_status_v3_ClientStatusResponse__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_service_status_v3_ClientStatusResponse_msginit = { +const upb_MiniTable envoy_service_status_v3_ClientStatusResponse_msg_init = { &envoy_service_status_v3_ClientStatusResponse_submsgs[0], &envoy_service_status_v3_ClientStatusResponse__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_service_status_v3_ClientStatusRequest_msginit, - &envoy_service_status_v3_PerXdsConfig_msginit, - &envoy_service_status_v3_ClientConfig_msginit, - &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, - &envoy_service_status_v3_ClientStatusResponse_msginit, + &envoy_service_status_v3_ClientStatusRequest_msg_init, + &envoy_service_status_v3_PerXdsConfig_msg_init, + &envoy_service_status_v3_ClientConfig_msg_init, + &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, + &envoy_service_status_v3_ClientStatusResponse_msg_init, }; -const upb_MiniTable_File envoy_service_status_v3_csds_proto_upb_file_layout = { +const upb_MiniTableFile envoy_service_status_v3_csds_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -134,5 +181,5 @@ const upb_MiniTable_File envoy_service_status_v3_csds_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 864215d2877..cedfebe4729 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 @@ -9,32 +9,32 @@ #ifndef ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_ #define ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_service_status_v3_ClientStatusRequest; -struct envoy_service_status_v3_PerXdsConfig; -struct envoy_service_status_v3_ClientConfig; -struct envoy_service_status_v3_ClientConfig_GenericXdsConfig; -struct envoy_service_status_v3_ClientStatusResponse; typedef struct envoy_service_status_v3_ClientStatusRequest envoy_service_status_v3_ClientStatusRequest; typedef struct envoy_service_status_v3_PerXdsConfig envoy_service_status_v3_PerXdsConfig; typedef struct envoy_service_status_v3_ClientConfig envoy_service_status_v3_ClientConfig; typedef struct envoy_service_status_v3_ClientConfig_GenericXdsConfig envoy_service_status_v3_ClientConfig_GenericXdsConfig; typedef struct envoy_service_status_v3_ClientStatusResponse envoy_service_status_v3_ClientStatusResponse; -extern const upb_MiniTable envoy_service_status_v3_ClientStatusRequest_msginit; -extern const upb_MiniTable envoy_service_status_v3_PerXdsConfig_msginit; -extern const upb_MiniTable envoy_service_status_v3_ClientConfig_msginit; -extern const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit; -extern const upb_MiniTable envoy_service_status_v3_ClientStatusResponse_msginit; +extern const upb_MiniTable envoy_service_status_v3_ClientStatusRequest_msg_init; +extern const upb_MiniTable envoy_service_status_v3_PerXdsConfig_msg_init; +extern const upb_MiniTable envoy_service_status_v3_ClientConfig_msg_init; +extern const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init; +extern const upb_MiniTable envoy_service_status_v3_ClientStatusResponse_msg_init; struct envoy_admin_v3_ClustersConfigDump; struct envoy_admin_v3_EndpointsConfigDump; struct envoy_admin_v3_ListenersConfigDump; @@ -45,16 +45,16 @@ struct envoy_config_core_v3_Node; struct envoy_type_matcher_v3_NodeMatcher; struct google_protobuf_Any; struct google_protobuf_Timestamp; -extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit; -extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit; -extern const upb_MiniTable envoy_config_core_v3_Node_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msginit; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msg_init; +extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msg_init; +extern const upb_MiniTable envoy_config_core_v3_Node_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msg_init; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; typedef enum { envoy_service_status_v3_CLIENT_UNKNOWN = 0, @@ -76,12 +76,12 @@ typedef enum { /* envoy.service.status.v3.ClientStatusRequest */ UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ClientStatusRequest_new(upb_Arena* arena) { - return (envoy_service_status_v3_ClientStatusRequest*)_upb_Message_New(&envoy_service_status_v3_ClientStatusRequest_msginit, arena); + return (envoy_service_status_v3_ClientStatusRequest*)_upb_Message_New(&envoy_service_status_v3_ClientStatusRequest_msg_init, arena); } UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ClientStatusRequest_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_status_v3_ClientStatusRequest* ret = envoy_service_status_v3_ClientStatusRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -91,7 +91,7 @@ UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ int options, upb_Arena* arena) { envoy_service_status_v3_ClientStatusRequest* ret = envoy_service_status_v3_ClientStatusRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -99,56 +99,86 @@ UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ } UPB_INLINE char* envoy_service_status_v3_ClientStatusRequest_serialize(const envoy_service_status_v3_ClientStatusRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_clear_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_matcher_v3_NodeMatcher* const* envoy_service_status_v3_ClientStatusRequest_node_matchers(const envoy_service_status_v3_ClientStatusRequest* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_matcher_v3_NodeMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_service_status_v3_ClientStatusRequest_node_matchers(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_clear_node_matchers(const envoy_service_status_v3_ClientStatusRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct envoy_type_matcher_v3_NodeMatcher* const* envoy_service_status_v3_ClientStatusRequest_node_matchers(const envoy_service_status_v3_ClientStatusRequest* msg, size_t* len) { - return (const struct envoy_type_matcher_v3_NodeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_service_status_v3_ClientStatusRequest_has_node(const envoy_service_status_v3_ClientStatusRequest* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_clear_node(const envoy_service_status_v3_ClientStatusRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_clear_node(envoy_service_status_v3_ClientStatusRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatusRequest_node(const envoy_service_status_v3_ClientStatusRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_status_v3_ClientStatusRequest_has_node(const envoy_service_status_v3_ClientStatusRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_mutable_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, size_t* len) { - return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_mutable_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_resize_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_resize_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_matcher_v3_NodeMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher* envoy_service_status_v3_ClientStatusRequest_add_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_NodeMatcher* sub = (struct envoy_type_matcher_v3_NodeMatcher*)_upb_Message_New(&envoy_type_matcher_v3_NodeMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_NodeMatcher* sub = (struct envoy_type_matcher_v3_NodeMatcher*)_upb_Message_New(&envoy_type_matcher_v3_NodeMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_set_node(envoy_service_status_v3_ClientStatusRequest *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatusRequest_mutable_node(envoy_service_status_v3_ClientStatusRequest* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_status_v3_ClientStatusRequest_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_ClientStatusRequest_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_service_status_v3_ClientStatusRequest_set_node(msg, sub); } return sub; } @@ -156,12 +186,12 @@ UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatu /* envoy.service.status.v3.PerXdsConfig */ UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsConfig_new(upb_Arena* arena) { - return (envoy_service_status_v3_PerXdsConfig*)_upb_Message_New(&envoy_service_status_v3_PerXdsConfig_msginit, arena); + return (envoy_service_status_v3_PerXdsConfig*)_upb_Message_New(&envoy_service_status_v3_PerXdsConfig_msg_init, arena); } UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_status_v3_PerXdsConfig* ret = envoy_service_status_v3_PerXdsConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -171,7 +201,7 @@ UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsC int options, upb_Arena* arena) { envoy_service_status_v3_PerXdsConfig* ret = envoy_service_status_v3_PerXdsConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -179,13 +209,13 @@ UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsC } UPB_INLINE char* envoy_service_status_v3_PerXdsConfig_serialize(const envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -197,142 +227,185 @@ typedef enum { envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET = 0 } envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases; UPB_INLINE envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases envoy_service_status_v3_PerXdsConfig_per_xds_config_case(const envoy_service_status_v3_PerXdsConfig* msg) { - return (envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_status(const envoy_service_status_v3_PerXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_status(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_service_status_v3_PerXdsConfig_status(const envoy_service_status_v3_PerXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; -} -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET); +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_listener_config(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_ListenersConfigDump* envoy_service_status_v3_PerXdsConfig_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const struct envoy_admin_v3_ListenersConfigDump* default_val = NULL; + const struct envoy_admin_v3_ListenersConfigDump* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET); +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_cluster_config(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_ClustersConfigDump* envoy_service_status_v3_PerXdsConfig_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const struct envoy_admin_v3_ClustersConfigDump* default_val = NULL; + const struct envoy_admin_v3_ClustersConfigDump* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET); +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_route_config(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_RoutesConfigDump* envoy_service_status_v3_PerXdsConfig_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL); + const struct envoy_admin_v3_RoutesConfigDump* default_val = NULL; + const struct envoy_admin_v3_RoutesConfigDump* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET); +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_scoped_route_config(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_ScopedRoutesConfigDump* envoy_service_status_v3_PerXdsConfig_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL); + const struct envoy_admin_v3_ScopedRoutesConfigDump* default_val = NULL; + const struct envoy_admin_v3_ScopedRoutesConfigDump* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6; +UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET); +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_endpoint_config(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_EndpointsConfigDump* envoy_service_status_v3_PerXdsConfig_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 6, NULL); + const struct envoy_admin_v3_EndpointsConfigDump* default_val = NULL; + const struct envoy_admin_v3_EndpointsConfigDump* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_client_status(const envoy_service_status_v3_PerXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_client_status(envoy_service_status_v3_PerXdsConfig* msg) { + const upb_MiniTableField field = {7, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_service_status_v3_PerXdsConfig_client_status(const envoy_service_status_v3_PerXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {7, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_status(envoy_service_status_v3_PerXdsConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_listener_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_ListenersConfigDump* value) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_ListenersConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_listener_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_ListenersConfigDump* sub = (struct envoy_admin_v3_ListenersConfigDump*)envoy_service_status_v3_PerXdsConfig_listener_config(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_ListenersConfigDump*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_PerXdsConfig_set_listener_config(msg, sub); + sub = (struct envoy_admin_v3_ListenersConfigDump*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_msg_init, arena); + if (sub) envoy_service_status_v3_PerXdsConfig_set_listener_config(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_cluster_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_ClustersConfigDump* value) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_ClustersConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_cluster_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_ClustersConfigDump* sub = (struct envoy_admin_v3_ClustersConfigDump*)envoy_service_status_v3_PerXdsConfig_cluster_config(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_ClustersConfigDump*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_PerXdsConfig_set_cluster_config(msg, sub); + sub = (struct envoy_admin_v3_ClustersConfigDump*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_msg_init, arena); + if (sub) envoy_service_status_v3_PerXdsConfig_set_cluster_config(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_route_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_RoutesConfigDump* value) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), -5, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_RoutesConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_route_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_RoutesConfigDump* sub = (struct envoy_admin_v3_RoutesConfigDump*)envoy_service_status_v3_PerXdsConfig_route_config(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_RoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_PerXdsConfig_set_route_config(msg, sub); + sub = (struct envoy_admin_v3_RoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_msg_init, arena); + if (sub) envoy_service_status_v3_PerXdsConfig_set_route_config(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_scoped_route_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_ScopedRoutesConfigDump* value) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), -5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_scoped_route_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_ScopedRoutesConfigDump* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump*)envoy_service_status_v3_PerXdsConfig_scoped_route_config(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_ScopedRoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_PerXdsConfig_set_scoped_route_config(msg, sub); + sub = (struct envoy_admin_v3_ScopedRoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_msg_init, arena); + if (sub) envoy_service_status_v3_PerXdsConfig_set_scoped_route_config(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_endpoint_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_EndpointsConfigDump* value) { - UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 6); + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), -5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_endpoint_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_EndpointsConfigDump* sub = (struct envoy_admin_v3_EndpointsConfigDump*)envoy_service_status_v3_PerXdsConfig_endpoint_config(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_EndpointsConfigDump*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_PerXdsConfig_set_endpoint_config(msg, sub); + sub = (struct envoy_admin_v3_EndpointsConfigDump*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_msg_init, arena); + if (sub) envoy_service_status_v3_PerXdsConfig_set_endpoint_config(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_client_status(envoy_service_status_v3_PerXdsConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {7, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.service.status.v3.ClientConfig */ UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientConfig_new(upb_Arena* arena) { - return (envoy_service_status_v3_ClientConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_msginit, arena); + return (envoy_service_status_v3_ClientConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_msg_init, arena); } UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_status_v3_ClientConfig* ret = envoy_service_status_v3_ClientConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -342,7 +415,7 @@ UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientC int options, upb_Arena* arena) { envoy_service_status_v3_ClientConfig* ret = envoy_service_status_v3_ClientConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -350,90 +423,145 @@ UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientC } UPB_INLINE char* envoy_service_status_v3_ClientConfig_serialize(const envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msg_init, 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); -} -UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_node(const envoy_service_status_v3_ClientConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_node(envoy_service_status_v3_ClientConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_node(const envoy_service_status_v3_ClientConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*); + const struct envoy_config_core_v3_Node* default_val = NULL; + const struct envoy_config_core_v3_Node* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_node(const envoy_service_status_v3_ClientConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_xds_config(envoy_service_status_v3_ClientConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_status_v3_PerXdsConfig* const* envoy_service_status_v3_ClientConfig_xds_config(const envoy_service_status_v3_ClientConfig* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_status_v3_PerXdsConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_xds_config(const envoy_service_status_v3_ClientConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + envoy_service_status_v3_ClientConfig_xds_config(msg, &size); + return size != 0; } -UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_xds_config(const envoy_service_status_v3_ClientConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const envoy_service_status_v3_PerXdsConfig* const* envoy_service_status_v3_ClientConfig_xds_config(const envoy_service_status_v3_ClientConfig* msg, size_t* len) { - return (const envoy_service_status_v3_PerXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const* envoy_service_status_v3_ClientConfig_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const* envoy_service_status_v3_ClientConfig_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg, size_t* len) { - return (const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); + size_t size; + envoy_service_status_v3_ClientConfig_generic_xds_configs(msg, &size); + return size != 0; } UPB_INLINE void envoy_service_status_v3_ClientConfig_set_node(envoy_service_status_v3_ClientConfig *msg, struct envoy_config_core_v3_Node* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Node*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_mutable_node(envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena) { struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_status_v3_ClientConfig_node(msg); if (sub == NULL) { - sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_ClientConfig_set_node(msg, sub); + sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msg_init, arena); + if (sub) envoy_service_status_v3_ClientConfig_set_node(msg, sub); } return sub; } -UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig* msg, size_t* len) { - return (envoy_service_status_v3_PerXdsConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_status_v3_PerXdsConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_resize_xds_config(envoy_service_status_v3_ClientConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_service_status_v3_PerXdsConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_resize_xds_config(envoy_service_status_v3_ClientConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_status_v3_PerXdsConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_ClientConfig_add_xds_config(envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena) { - struct envoy_service_status_v3_PerXdsConfig* sub = (struct envoy_service_status_v3_PerXdsConfig*)_upb_Message_New(&envoy_service_status_v3_PerXdsConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_status_v3_PerXdsConfig* sub = (struct envoy_service_status_v3_PerXdsConfig*)_upb_Message_New(&envoy_service_status_v3_PerXdsConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_mutable_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, size_t* len) { - return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_mutable_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_resize_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, size_t len, upb_Arena* arena) { - return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_resize_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_add_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena) { - struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* sub = (struct envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* sub = (struct envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.service.status.v3.ClientConfig.GenericXdsConfig */ UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(upb_Arena* arena) { - return (envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena); + return (envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, arena); } UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_GenericXdsConfig_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_status_v3_ClientConfig_GenericXdsConfig* ret = envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -443,7 +571,7 @@ UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_ int options, upb_Arena* arena) { envoy_service_status_v3_ClientConfig_GenericXdsConfig* ret = envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -451,146 +579,197 @@ UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_ } UPB_INLINE char* envoy_service_status_v3_ClientConfig_GenericXdsConfig_serialize(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msg_init, 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); +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_type_url(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_status_v3_ClientConfig_GenericXdsConfig_type_url(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_name(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_name(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_status_v3_ClientConfig_GenericXdsConfig_name(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_version_info(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_version_info(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(44, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_service_status_v3_ClientConfig_GenericXdsConfig_version_info(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(44, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* envoy_service_status_v3_ClientConfig_GenericXdsConfig_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* envoy_service_status_v3_ClientConfig_GenericXdsConfig_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_config_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_config_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_service_status_v3_ClientConfig_GenericXdsConfig_config_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_client_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_client_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_service_status_v3_ClientConfig_GenericXdsConfig_client_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {7, UPB_SIZE(16, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const upb_Message*) = NULL; +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 80), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_admin_v3_UpdateFailureState* envoy_service_status_v3_ClientConfig_GenericXdsConfig_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct envoy_admin_v3_UpdateFailureState*); + const struct envoy_admin_v3_UpdateFailureState* default_val = NULL; + const struct envoy_admin_v3_UpdateFailureState* ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 80), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_is_static_resource(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0; +UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 80), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_is_static_resource(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(24, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_is_static_resource(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {9, UPB_SIZE(24, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_type_url(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_name(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_version_info(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(44, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(40, 64), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 64), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_xds_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 72), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_last_updated(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_config_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 4), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_client_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {7, UPB_SIZE(16, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct envoy_admin_v3_UpdateFailureState* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct envoy_admin_v3_UpdateFailureState*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 80), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena) { struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_error_state(msg); if (sub == NULL) { - sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena); - if (!sub) return NULL; - envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(msg, sub); + sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msg_init, arena); + if (sub) envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(msg, sub); } return sub; } UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_is_static_resource(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; + const upb_MiniTableField field = {9, UPB_SIZE(24, 12), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.service.status.v3.ClientStatusResponse */ UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3_ClientStatusResponse_new(upb_Arena* arena) { - return (envoy_service_status_v3_ClientStatusResponse*)_upb_Message_New(&envoy_service_status_v3_ClientStatusResponse_msginit, arena); + return (envoy_service_status_v3_ClientStatusResponse*)_upb_Message_New(&envoy_service_status_v3_ClientStatusResponse_msg_init, arena); } UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3_ClientStatusResponse_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_service_status_v3_ClientStatusResponse* ret = envoy_service_status_v3_ClientStatusResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -600,7 +779,7 @@ UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3 int options, upb_Arena* arena) { envoy_service_status_v3_ClientStatusResponse* ret = envoy_service_status_v3_ClientStatusResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -608,44 +787,69 @@ UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3 } UPB_INLINE char* envoy_service_status_v3_ClientStatusResponse_serialize(const envoy_service_status_v3_ClientStatusResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_service_status_v3_ClientStatusResponse_clear_config(envoy_service_status_v3_ClientStatusResponse* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_service_status_v3_ClientConfig* const* envoy_service_status_v3_ClientStatusResponse_config(const envoy_service_status_v3_ClientStatusResponse* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_service_status_v3_ClientConfig* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_service_status_v3_ClientStatusResponse_has_config(const envoy_service_status_v3_ClientStatusResponse* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_service_status_v3_ClientStatusResponse_clear_config(const envoy_service_status_v3_ClientStatusResponse* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_service_status_v3_ClientConfig* const* envoy_service_status_v3_ClientStatusResponse_config(const envoy_service_status_v3_ClientStatusResponse* msg, size_t* len) { - return (const envoy_service_status_v3_ClientConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_service_status_v3_ClientStatusResponse_config(msg, &size); + return size != 0; } -UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_mutable_config(envoy_service_status_v3_ClientStatusResponse* msg, size_t* len) { - return (envoy_service_status_v3_ClientConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_mutable_config(envoy_service_status_v3_ClientStatusResponse* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_service_status_v3_ClientConfig**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_resize_config(envoy_service_status_v3_ClientStatusResponse* msg, size_t len, upb_Arena* arena) { - return (envoy_service_status_v3_ClientConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_resize_config(envoy_service_status_v3_ClientStatusResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_service_status_v3_ClientConfig**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientStatusResponse_add_config(envoy_service_status_v3_ClientStatusResponse* msg, upb_Arena* arena) { - struct envoy_service_status_v3_ClientConfig* sub = (struct envoy_service_status_v3_ClientConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_service_status_v3_ClientConfig* sub = (struct envoy_service_status_v3_ClientConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_service_status_v3_csds_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_service_status_v3_csds_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_ */ 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 7fb008c9455..30c140db33a 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 @@ -7,35 +7,44 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/http/v3/cookie.upb.h" #include "google/protobuf/duration.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_http_v3_Cookie_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_type_http_v3_Cookie_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_type_http_v3_Cookie__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_http_v3_Cookie__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_http_v3_Cookie_msginit = { +const upb_MiniTable envoy_type_http_v3_Cookie_msg_init = { &envoy_type_http_v3_Cookie_submsgs[0], &envoy_type_http_v3_Cookie__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x002000003f00001a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_http_v3_Cookie_msginit, + &envoy_type_http_v3_Cookie_msg_init, }; -const upb_MiniTable_File envoy_type_http_v3_cookie_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_http_v3_cookie_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -44,5 +53,5 @@ const upb_MiniTable_File envoy_type_http_v3_cookie_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 0fcd828d07c..28dfec18694 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPB_H_ #define ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_http_v3_Cookie; typedef struct envoy_type_http_v3_Cookie envoy_type_http_v3_Cookie; -extern const upb_MiniTable envoy_type_http_v3_Cookie_msginit; +extern const upb_MiniTable envoy_type_http_v3_Cookie_msg_init; struct google_protobuf_Duration; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* envoy.type.http.v3.Cookie */ UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_new(upb_Arena* arena) { - return (envoy_type_http_v3_Cookie*)_upb_Message_New(&envoy_type_http_v3_Cookie_msginit, arena); + return (envoy_type_http_v3_Cookie*)_upb_Message_New(&envoy_type_http_v3_Cookie_msg_init, arena); } UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_http_v3_Cookie* ret = envoy_type_http_v3_Cookie_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_Cookie_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_Cookie_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_parse_ex(const c int options, upb_Arena* arena) { envoy_type_http_v3_Cookie* ret = envoy_type_http_v3_Cookie_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_Cookie_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_Cookie_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,63 +58,80 @@ UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_parse_ex(const c } UPB_INLINE char* envoy_type_http_v3_Cookie_serialize(const envoy_type_http_v3_Cookie* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_Cookie_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_Cookie_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_Cookie_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_Cookie_msg_init, 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); +UPB_INLINE void envoy_type_http_v3_Cookie_clear_name(envoy_type_http_v3_Cookie* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_http_v3_Cookie_name(const envoy_type_http_v3_Cookie* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_http_v3_Cookie_has_ttl(const envoy_type_http_v3_Cookie* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_type_http_v3_Cookie_clear_ttl(const envoy_type_http_v3_Cookie* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_http_v3_Cookie_clear_ttl(envoy_type_http_v3_Cookie* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_type_http_v3_Cookie_ttl(const envoy_type_http_v3_Cookie* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_http_v3_Cookie_clear_path(const envoy_type_http_v3_Cookie* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_type_http_v3_Cookie_has_ttl(const envoy_type_http_v3_Cookie* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_http_v3_Cookie_clear_path(envoy_type_http_v3_Cookie* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_http_v3_Cookie_path(const envoy_type_http_v3_Cookie* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_http_v3_Cookie_set_name(envoy_type_http_v3_Cookie *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_http_v3_Cookie_set_ttl(envoy_type_http_v3_Cookie *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_type_http_v3_Cookie_mutable_ttl(envoy_type_http_v3_Cookie* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_type_http_v3_Cookie_ttl(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_type_http_v3_Cookie_set_ttl(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_type_http_v3_Cookie_set_ttl(msg, sub); } return sub; } UPB_INLINE void envoy_type_http_v3_Cookie_set_path(envoy_type_http_v3_Cookie *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_http_v3_cookie_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_http_v3_cookie_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPB_H_ */ 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 8f0d5e99af0..c828344127a 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 @@ -7,63 +7,76 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/http/v3/path_transformation.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_http_v3_PathTransformation_submsgs[1] = { - {.submsg = &envoy_type_http_v3_PathTransformation_Operation_msginit}, +static const upb_MiniTableSub envoy_type_http_v3_PathTransformation_submsgs[1] = { + {.submsg = &envoy_type_http_v3_PathTransformation_Operation_msg_init}, }; -static const upb_MiniTable_Field envoy_type_http_v3_PathTransformation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_http_v3_PathTransformation__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_http_v3_PathTransformation_msginit = { +const upb_MiniTable envoy_type_http_v3_PathTransformation_msg_init = { &envoy_type_http_v3_PathTransformation_submsgs[0], &envoy_type_http_v3_PathTransformation__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub envoy_type_http_v3_PathTransformation_Operation_submsgs[2] = { - {.submsg = &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit}, - {.submsg = &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit}, +static const upb_MiniTableSub envoy_type_http_v3_PathTransformation_Operation_submsgs[2] = { + {.submsg = &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init}, + {.submsg = &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init}, }; -static const upb_MiniTable_Field envoy_type_http_v3_PathTransformation_Operation__fields[2] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_http_v3_PathTransformation_Operation__fields[2] = { + {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_msginit = { +const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_msg_init = { &envoy_type_http_v3_PathTransformation_Operation_submsgs[0], &envoy_type_http_v3_PathTransformation_Operation__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000002000012, &upb_pom_1bt_max64b}, + {0x000800000301001a, &upb_pom_1bt_max64b}, + }) }; -const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit = { +const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit = { +const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[4] = { - &envoy_type_http_v3_PathTransformation_msginit, - &envoy_type_http_v3_PathTransformation_Operation_msginit, - &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, - &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, + &envoy_type_http_v3_PathTransformation_msg_init, + &envoy_type_http_v3_PathTransformation_Operation_msg_init, + &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, + &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, }; -const upb_MiniTable_File envoy_type_http_v3_path_transformation_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_http_v3_path_transformation_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -72,5 +85,5 @@ const upb_MiniTable_File envoy_type_http_v3_path_transformation_proto_upb_file_l 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 cd32ab126cb..59b2a0265e5 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 @@ -9,41 +9,42 @@ #ifndef ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_ #define ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_http_v3_PathTransformation; -struct envoy_type_http_v3_PathTransformation_Operation; -struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986; -struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes; typedef struct envoy_type_http_v3_PathTransformation envoy_type_http_v3_PathTransformation; typedef struct envoy_type_http_v3_PathTransformation_Operation envoy_type_http_v3_PathTransformation_Operation; typedef struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986; typedef struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes envoy_type_http_v3_PathTransformation_Operation_MergeSlashes; -extern const upb_MiniTable envoy_type_http_v3_PathTransformation_msginit; -extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_msginit; -extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit; -extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit; +extern const upb_MiniTable envoy_type_http_v3_PathTransformation_msg_init; +extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_msg_init; +extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init; +extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init; /* envoy.type.http.v3.PathTransformation */ UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransformation_new(upb_Arena* arena) { - return (envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msginit, arena); + return (envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msg_init, arena); } UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransformation_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_http_v3_PathTransformation* ret = envoy_type_http_v3_PathTransformation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +54,7 @@ UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransfo int options, upb_Arena* arena) { envoy_type_http_v3_PathTransformation* ret = envoy_type_http_v3_PathTransformation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,47 +62,72 @@ UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransfo } UPB_INLINE char* envoy_type_http_v3_PathTransformation_serialize(const envoy_type_http_v3_PathTransformation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_type_http_v3_PathTransformation_clear_operations(envoy_type_http_v3_PathTransformation* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation* const* envoy_type_http_v3_PathTransformation_operations(const envoy_type_http_v3_PathTransformation* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_type_http_v3_PathTransformation_Operation* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_type_http_v3_PathTransformation_has_operations(const envoy_type_http_v3_PathTransformation* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_type_http_v3_PathTransformation_clear_operations(const envoy_type_http_v3_PathTransformation* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation* const* envoy_type_http_v3_PathTransformation_operations(const envoy_type_http_v3_PathTransformation* msg, size_t* len) { - return (const envoy_type_http_v3_PathTransformation_Operation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_type_http_v3_PathTransformation_operations(msg, &size); + return size != 0; } -UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_mutable_operations(envoy_type_http_v3_PathTransformation* msg, size_t* len) { - return (envoy_type_http_v3_PathTransformation_Operation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_mutable_operations(envoy_type_http_v3_PathTransformation* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_type_http_v3_PathTransformation_Operation**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_resize_operations(envoy_type_http_v3_PathTransformation* msg, size_t len, upb_Arena* arena) { - return (envoy_type_http_v3_PathTransformation_Operation**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_resize_operations(envoy_type_http_v3_PathTransformation* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_http_v3_PathTransformation_Operation**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_add_operations(envoy_type_http_v3_PathTransformation* msg, upb_Arena* arena) { - struct envoy_type_http_v3_PathTransformation_Operation* sub = (struct envoy_type_http_v3_PathTransformation_Operation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_http_v3_PathTransformation_Operation* sub = (struct envoy_type_http_v3_PathTransformation_Operation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.type.http.v3.PathTransformation.Operation */ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_Operation_new(upb_Arena* arena) { - return (envoy_type_http_v3_PathTransformation_Operation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_msginit, arena); + return (envoy_type_http_v3_PathTransformation_Operation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_msg_init, arena); } UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_Operation_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_http_v3_PathTransformation_Operation* ret = envoy_type_http_v3_PathTransformation_Operation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -111,7 +137,7 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_P int options, upb_Arena* arena) { envoy_type_http_v3_PathTransformation_Operation* ret = envoy_type_http_v3_PathTransformation_Operation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -119,13 +145,13 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_P } UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_serialize(const envoy_type_http_v3_PathTransformation_Operation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -134,48 +160,61 @@ typedef enum { envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET = 0 } envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases; UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases envoy_type_http_v3_PathTransformation_Operation_operation_specifier_case(const envoy_type_http_v3_PathTransformation_Operation* msg) { - return (envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_clear_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET); +UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_clear_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* default_val = NULL; + const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_clear_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET); +UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_clear_merge_slashes(envoy_type_http_v3_PathTransformation_Operation* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* default_val = NULL; + const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation *msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* value) { - UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_mutable_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation* msg, upb_Arena* arena) { struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)envoy_type_http_v3_PathTransformation_Operation_normalize_path_rfc_3986(msg); if (sub == NULL) { - sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena); - if (!sub) return NULL; - envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(msg, sub); + sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, arena); + if (sub) envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(msg, sub); } return sub; } UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(envoy_type_http_v3_PathTransformation_Operation *msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* value) { - UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_mutable_merge_slashes(envoy_type_http_v3_PathTransformation_Operation* msg, upb_Arena* arena) { struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)envoy_type_http_v3_PathTransformation_Operation_merge_slashes(msg); if (sub == NULL) { - sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena); - if (!sub) return NULL; - envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(msg, sub); + sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, arena); + if (sub) envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(msg, sub); } return sub; } @@ -183,12 +222,12 @@ UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* /* envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986 */ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(upb_Arena* arena) { - return (envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena); + return (envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, arena); } UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* ret = envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -198,7 +237,7 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* int options, upb_Arena* arena) { envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* ret = envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -206,13 +245,13 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msg_init, options, arena, &ptr, len); return ptr; } @@ -220,12 +259,12 @@ UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRF /* envoy.type.http.v3.PathTransformation.Operation.MergeSlashes */ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(upb_Arena* arena) { - return (envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena); + return (envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, arena); } UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* ret = envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -235,7 +274,7 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_t int options, upb_Arena* arena) { envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* ret = envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -243,23 +282,23 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_t } 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_type_http_v3_path_transformation_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_http_v3_path_transformation_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c index ba2ca49252a..03d0fa81dd4 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c @@ -7,34 +7,43 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/filter_state.upb.h" #include "envoy/type/matcher/v3/string.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_FilterStateMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_FilterStateMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_FilterStateMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_FilterStateMatcher__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_FilterStateMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_FilterStateMatcher_msg_init = { &envoy_type_matcher_v3_FilterStateMatcher_submsgs[0], &envoy_type_matcher_v3_FilterStateMatcher__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_matcher_v3_FilterStateMatcher_msginit, + &envoy_type_matcher_v3_FilterStateMatcher_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_filter_state_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_filter_state_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -43,5 +52,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_filter_state_proto_upb_file_layou 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h index 44015d418bd..e30e99af59c 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h @@ -9,34 +9,38 @@ #ifndef ENVOY_TYPE_MATCHER_V3_FILTER_STATE_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_FILTER_STATE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_FilterStateMatcher; typedef struct envoy_type_matcher_v3_FilterStateMatcher envoy_type_matcher_v3_FilterStateMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_FilterStateMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_FilterStateMatcher_msg_init; struct envoy_type_matcher_v3_StringMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; /* envoy.type.matcher.v3.FilterStateMatcher */ UPB_INLINE envoy_type_matcher_v3_FilterStateMatcher* envoy_type_matcher_v3_FilterStateMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_FilterStateMatcher*)_upb_Message_New(&envoy_type_matcher_v3_FilterStateMatcher_msginit, arena); + return (envoy_type_matcher_v3_FilterStateMatcher*)_upb_Message_New(&envoy_type_matcher_v3_FilterStateMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_FilterStateMatcher* envoy_type_matcher_v3_FilterStateMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_FilterStateMatcher* ret = envoy_type_matcher_v3_FilterStateMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_FilterStateMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_FilterStateMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_type_matcher_v3_FilterStateMatcher* envoy_type_matcher_v3_Filte int options, upb_Arena* arena) { envoy_type_matcher_v3_FilterStateMatcher* ret = envoy_type_matcher_v3_FilterStateMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_FilterStateMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_FilterStateMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,13 +58,13 @@ UPB_INLINE envoy_type_matcher_v3_FilterStateMatcher* envoy_type_matcher_v3_Filte } UPB_INLINE char* envoy_type_matcher_v3_FilterStateMatcher_serialize(const envoy_type_matcher_v3_FilterStateMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_FilterStateMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_FilterStateMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_type_matcher_v3_FilterStateMatcher_serialize_ex(const envoy_type_matcher_v3_FilterStateMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_FilterStateMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_FilterStateMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -68,46 +72,59 @@ typedef enum { envoy_type_matcher_v3_FilterStateMatcher_matcher_NOT_SET = 0 } envoy_type_matcher_v3_FilterStateMatcher_matcher_oneofcases; UPB_INLINE envoy_type_matcher_v3_FilterStateMatcher_matcher_oneofcases envoy_type_matcher_v3_FilterStateMatcher_matcher_case(const envoy_type_matcher_v3_FilterStateMatcher* msg) { - return (envoy_type_matcher_v3_FilterStateMatcher_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_FilterStateMatcher_matcher_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_FilterStateMatcher_clear_key(const envoy_type_matcher_v3_FilterStateMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_type_matcher_v3_FilterStateMatcher_clear_key(envoy_type_matcher_v3_FilterStateMatcher* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_FilterStateMatcher_key(const envoy_type_matcher_v3_FilterStateMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_FilterStateMatcher_has_string_match(const envoy_type_matcher_v3_FilterStateMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_type_matcher_v3_FilterStateMatcher_clear_string_match(const envoy_type_matcher_v3_FilterStateMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_FilterStateMatcher_matcher_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_FilterStateMatcher_clear_string_match(envoy_type_matcher_v3_FilterStateMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_FilterStateMatcher_string_match(const envoy_type_matcher_v3_FilterStateMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_FilterStateMatcher_has_string_match(const envoy_type_matcher_v3_FilterStateMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_FilterStateMatcher_set_key(envoy_type_matcher_v3_FilterStateMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_FilterStateMatcher_set_string_match(envoy_type_matcher_v3_FilterStateMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_FilterStateMatcher_mutable_string_match(envoy_type_matcher_v3_FilterStateMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_FilterStateMatcher_string_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_FilterStateMatcher_set_string_match(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_FilterStateMatcher_set_string_match(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_type_matcher_v3_filter_state_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_filter_state_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_FILTER_STATE_PROTO_UPB_H_ */ 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 29a3a16fd20..75bf14085c6 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 @@ -7,72 +7,95 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/http_inputs.upb.h" #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestHeaderMatchInput__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_HttpRequestHeaderMatchInput__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init = { NULL, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestTrailerMatchInput__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_HttpRequestTrailerMatchInput__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init = { NULL, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseHeaderMatchInput__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_HttpResponseHeaderMatchInput__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init = { NULL, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseTrailerMatchInput__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_HttpResponseTrailerMatchInput__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init = { NULL, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestQueryParamMatchInput__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_HttpRequestQueryParamMatchInput__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init = { NULL, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, - &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, - &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, - &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, - &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit, + &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init, + &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init, + &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init, + &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init, + &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_http_inputs_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_http_inputs_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -81,5 +104,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_http_inputs_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1e23a824d3e..cc5733ed7ff 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 @@ -9,44 +9,44 @@ #ifndef ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_HttpRequestHeaderMatchInput; -struct envoy_type_matcher_v3_HttpRequestTrailerMatchInput; -struct envoy_type_matcher_v3_HttpResponseHeaderMatchInput; -struct envoy_type_matcher_v3_HttpResponseTrailerMatchInput; -struct envoy_type_matcher_v3_HttpRequestQueryParamMatchInput; typedef struct envoy_type_matcher_v3_HttpRequestHeaderMatchInput envoy_type_matcher_v3_HttpRequestHeaderMatchInput; typedef struct envoy_type_matcher_v3_HttpRequestTrailerMatchInput envoy_type_matcher_v3_HttpRequestTrailerMatchInput; typedef struct envoy_type_matcher_v3_HttpResponseHeaderMatchInput envoy_type_matcher_v3_HttpResponseHeaderMatchInput; typedef struct envoy_type_matcher_v3_HttpResponseTrailerMatchInput envoy_type_matcher_v3_HttpResponseTrailerMatchInput; typedef struct envoy_type_matcher_v3_HttpRequestQueryParamMatchInput envoy_type_matcher_v3_HttpRequestQueryParamMatchInput; -extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init; /* envoy.type.matcher.v3.HttpRequestHeaderMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpRequestHeaderMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpRequestHeaderMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpRequestHeaderMatchInput* ret = envoy_type_matcher_v3_HttpRequestHeaderMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -56,7 +56,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpRequestHeaderMatchInput* ret = envoy_type_matcher_v3_HttpRequestHeaderMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -64,35 +64,41 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher } UPB_INLINE char* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_serialize(const envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msg_init, 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); +UPB_INLINE void envoy_type_matcher_v3_HttpRequestHeaderMatchInput_clear_header_name(envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpRequestHeaderMatchInput_header_name(const envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_HttpRequestHeaderMatchInput_set_header_name(envoy_type_matcher_v3_HttpRequestHeaderMatchInput *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.HttpRequestTrailerMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpRequestTrailerMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpRequestTrailerMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpRequestTrailerMatchInput* ret = envoy_type_matcher_v3_HttpRequestTrailerMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -102,7 +108,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matche int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpRequestTrailerMatchInput* ret = envoy_type_matcher_v3_HttpRequestTrailerMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -110,35 +116,41 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matche } UPB_INLINE char* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_serialize(const envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msg_init, 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); +UPB_INLINE void envoy_type_matcher_v3_HttpRequestTrailerMatchInput_clear_header_name(envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpRequestTrailerMatchInput_header_name(const envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_HttpRequestTrailerMatchInput_set_header_name(envoy_type_matcher_v3_HttpRequestTrailerMatchInput *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.HttpResponseHeaderMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpResponseHeaderMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpResponseHeaderMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseHeaderMatchInput* ret = envoy_type_matcher_v3_HttpResponseHeaderMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -148,7 +160,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matche int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseHeaderMatchInput* ret = envoy_type_matcher_v3_HttpResponseHeaderMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -156,35 +168,41 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matche } UPB_INLINE char* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_serialize(const envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msg_init, 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); +UPB_INLINE void envoy_type_matcher_v3_HttpResponseHeaderMatchInput_clear_header_name(envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpResponseHeaderMatchInput_header_name(const envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_HttpResponseHeaderMatchInput_set_header_name(envoy_type_matcher_v3_HttpResponseHeaderMatchInput *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.HttpResponseTrailerMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpResponseTrailerMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpResponseTrailerMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseTrailerMatchInput* ret = envoy_type_matcher_v3_HttpResponseTrailerMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -194,7 +212,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_match int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseTrailerMatchInput* ret = envoy_type_matcher_v3_HttpResponseTrailerMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -202,35 +220,41 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_match } UPB_INLINE char* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_serialize(const envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msg_init, 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); +UPB_INLINE void envoy_type_matcher_v3_HttpResponseTrailerMatchInput_clear_header_name(envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpResponseTrailerMatchInput_header_name(const envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_HttpResponseTrailerMatchInput_set_header_name(envoy_type_matcher_v3_HttpResponseTrailerMatchInput *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.HttpRequestQueryParamMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpRequestQueryParamMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpRequestQueryParamMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* ret = envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -240,7 +264,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* envoy_type_mat int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* ret = envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -248,32 +272,38 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* envoy_type_mat } UPB_INLINE char* envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_serialize(const envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_clear_query_param(const envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_clear_query_param(envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_query_param(const envoy_type_matcher_v3_HttpRequestQueryParamMatchInput* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_HttpRequestQueryParamMatchInput_set_query_param(envoy_type_matcher_v3_HttpRequestQueryParamMatchInput *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_matcher_v3_http_inputs_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_http_inputs_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ */ 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 bdf6825ad96..15712fbb84e 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 @@ -7,49 +7,66 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/metadata.upb.h" #include "envoy/type/matcher/v3/value.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = { - {.submsg = &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit}, - {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = { + {.submsg = &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init}, + {.submsg = &envoy_type_matcher_v3_ValueMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_MetadataMatcher__fields[4] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msg_init = { &envoy_type_matcher_v3_MetadataMatcher_submsgs[0], &envoy_type_matcher_v3_MetadataMatcher__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000101001a, &upb_psm_1bt_maxmaxb}, + {0x000100003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = { +const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init = { NULL, &envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[0], - UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_type_matcher_v3_MetadataMatcher_msginit, - &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, + &envoy_type_matcher_v3_MetadataMatcher_msg_init, + &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_metadata_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_metadata_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -58,5 +75,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_metadata_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 52808c79520..a793f70cddd 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_MetadataMatcher; -struct envoy_type_matcher_v3_MetadataMatcher_PathSegment; typedef struct envoy_type_matcher_v3_MetadataMatcher envoy_type_matcher_v3_MetadataMatcher; typedef struct envoy_type_matcher_v3_MetadataMatcher_PathSegment envoy_type_matcher_v3_MetadataMatcher_PathSegment; -extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init; struct envoy_type_matcher_v3_ValueMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msg_init; /* envoy.type.matcher.v3.MetadataMatcher */ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher* envoy_type_matcher_v3_MetadataMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena); + return (envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_MetadataMatcher* envoy_type_matcher_v3_MetadataMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_MetadataMatcher* ret = envoy_type_matcher_v3_MetadataMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher* envoy_type_matcher_v3_Metadata int options, upb_Arena* arena) { envoy_type_matcher_v3_MetadataMatcher* ret = envoy_type_matcher_v3_MetadataMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,87 +60,129 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher* envoy_type_matcher_v3_Metadata } UPB_INLINE char* envoy_type_matcher_v3_MetadataMatcher_serialize(const envoy_type_matcher_v3_MetadataMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msg_init, 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); +UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_filter(envoy_type_matcher_v3_MetadataMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_path(envoy_type_matcher_v3_MetadataMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const* envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_path(const envoy_type_matcher_v3_MetadataMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + envoy_type_matcher_v3_MetadataMatcher_path(msg, &size); + return size != 0; } -UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_path(const envoy_type_matcher_v3_MetadataMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const* envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher* msg, size_t* len) { - return (const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_value(const envoy_type_matcher_v3_MetadataMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_value(envoy_type_matcher_v3_MetadataMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_value(const envoy_type_matcher_v3_MetadataMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_type_matcher_v3_ValueMatcher*); + const struct envoy_type_matcher_v3_ValueMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_ValueMatcher* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_invert(const envoy_type_matcher_v3_MetadataMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_invert(envoy_type_matcher_v3_MetadataMatcher* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_invert(const envoy_type_matcher_v3_MetadataMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_filter(envoy_type_matcher_v3_MetadataMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_mutable_path(envoy_type_matcher_v3_MetadataMatcher* msg, size_t* len) { - return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_mutable_path(envoy_type_matcher_v3_MetadataMatcher* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_resize_path(envoy_type_matcher_v3_MetadataMatcher* msg, size_t len, upb_Arena* arena) { - return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_resize_path(envoy_type_matcher_v3_MetadataMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher_v3_MetadataMatcher_add_path(envoy_type_matcher_v3_MetadataMatcher* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_value(envoy_type_matcher_v3_MetadataMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_type_matcher_v3_ValueMatcher*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_mutable_value(envoy_type_matcher_v3_MetadataMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_MetadataMatcher_value(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_MetadataMatcher_set_value(msg, sub); + sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_MetadataMatcher_set_value(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_invert(envoy_type_matcher_v3_MetadataMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.MetadataMatcher.PathSegment */ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena); + return (envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_MetadataMatcher_PathSegment* ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -147,7 +192,7 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher int options, upb_Arena* arena) { envoy_type_matcher_v3_MetadataMatcher_PathSegment* ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -155,13 +200,13 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher } UPB_INLINE char* envoy_type_matcher_v3_MetadataMatcher_PathSegment_serialize(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -169,28 +214,36 @@ typedef enum { envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_NOT_SET = 0 } envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases; UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { - return (envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_PathSegment_has_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_clear_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_clear_key(envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_MetadataMatcher_PathSegment_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_PathSegment_has_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_set_key(envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_matcher_v3_metadata_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_metadata_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_ */ 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 003b9293f3f..6f9e47b3006 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 @@ -7,36 +7,45 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/node.upb.h" #include "envoy/type/matcher/v3/string.upb.h" #include "envoy/type/matcher/v3/struct.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_NodeMatcher_submsgs[2] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_StructMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_NodeMatcher_submsgs[2] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_StructMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_NodeMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_NodeMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msg_init = { &envoy_type_matcher_v3_NodeMatcher_submsgs[0], &envoy_type_matcher_v3_NodeMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f010012, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_matcher_v3_NodeMatcher_msginit, + &envoy_type_matcher_v3_NodeMatcher_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_node_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_node_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -45,5 +54,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_node_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 c0a41ff889e..7b4334ce7e7 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 @@ -9,36 +9,40 @@ #ifndef ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_NodeMatcher; typedef struct envoy_type_matcher_v3_NodeMatcher envoy_type_matcher_v3_NodeMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msg_init; struct envoy_type_matcher_v3_StringMatcher; struct envoy_type_matcher_v3_StructMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msg_init; /* envoy.type.matcher.v3.NodeMatcher */ UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_NodeMatcher*)_upb_Message_New(&envoy_type_matcher_v3_NodeMatcher_msginit, arena); + return (envoy_type_matcher_v3_NodeMatcher*)_upb_Message_New(&envoy_type_matcher_v3_NodeMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_NodeMatcher* ret = envoy_type_matcher_v3_NodeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -48,7 +52,7 @@ UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_ int options, upb_Arena* arena) { envoy_type_matcher_v3_NodeMatcher* ret = envoy_type_matcher_v3_NodeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -56,66 +60,96 @@ UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_ } UPB_INLINE char* envoy_type_matcher_v3_NodeMatcher_serialize(const envoy_type_matcher_v3_NodeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msg_init, 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); -} -UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_clear_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_clear_node_id(envoy_type_matcher_v3_NodeMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_NodeMatcher_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_clear_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct envoy_type_matcher_v3_StructMatcher* const* envoy_type_matcher_v3_NodeMatcher_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct envoy_type_matcher_v3_StructMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_clear_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const struct envoy_type_matcher_v3_StructMatcher* const* envoy_type_matcher_v3_NodeMatcher_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg, size_t* len) { - return (const struct envoy_type_matcher_v3_StructMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_type_matcher_v3_NodeMatcher_node_metadatas(msg, &size); + return size != 0; } UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_set_node_id(envoy_type_matcher_v3_NodeMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_StringMatcher*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_NodeMatcher_mutable_node_id(envoy_type_matcher_v3_NodeMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_NodeMatcher_node_id(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_NodeMatcher_set_node_id(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_NodeMatcher_set_node_id(msg, sub); } return sub; } -UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_mutable_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, size_t* len) { - return (struct envoy_type_matcher_v3_StructMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_mutable_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct envoy_type_matcher_v3_StructMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_resize_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, size_t len, upb_Arena* arena) { - return (struct envoy_type_matcher_v3_StructMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_resize_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct envoy_type_matcher_v3_StructMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_NodeMatcher_add_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_StructMatcher* sub = (struct envoy_type_matcher_v3_StructMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_StructMatcher* sub = (struct envoy_type_matcher_v3_StructMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_type_matcher_v3_node_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_node_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_ */ 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 a59aa8d1dd9..be7c3679e79 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 @@ -7,35 +7,44 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/number.upb.h" #include "envoy/type/v3/range.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = { - {.submsg = &envoy_type_v3_DoubleRange_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = { + {.submsg = &envoy_type_v3_DoubleRange_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_DoubleMatcher__fields[2] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_DoubleMatcher__fields[2] = { + {1, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msg_init = { &envoy_type_matcher_v3_DoubleMatcher_submsgs[0], &envoy_type_matcher_v3_DoubleMatcher__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + {0x0008000002000011, &upb_pof8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_matcher_v3_DoubleMatcher_msginit, + &envoy_type_matcher_v3_DoubleMatcher_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_number_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_number_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -44,5 +53,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_number_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 bb17b247d56..bb5813a0951 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_DoubleMatcher; typedef struct envoy_type_matcher_v3_DoubleMatcher envoy_type_matcher_v3_DoubleMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msg_init; struct envoy_type_v3_DoubleRange; -extern const upb_MiniTable envoy_type_v3_DoubleRange_msginit; +extern const upb_MiniTable envoy_type_v3_DoubleRange_msg_init; /* envoy.type.matcher.v3.DoubleMatcher */ UPB_INLINE envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_DoubleMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_DoubleMatcher*)_upb_Message_New(&envoy_type_matcher_v3_DoubleMatcher_msginit, arena); + return (envoy_type_matcher_v3_DoubleMatcher*)_upb_Message_New(&envoy_type_matcher_v3_DoubleMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_DoubleMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_DoubleMatcher* ret = envoy_type_matcher_v3_DoubleMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_DoubleMatc int options, upb_Arena* arena) { envoy_type_matcher_v3_DoubleMatcher* ret = envoy_type_matcher_v3_DoubleMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,13 +58,13 @@ UPB_INLINE envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_DoubleMatc } UPB_INLINE char* envoy_type_matcher_v3_DoubleMatcher_serialize(const envoy_type_matcher_v3_DoubleMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -69,49 +73,63 @@ typedef enum { envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET = 0 } envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases; UPB_INLINE envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases envoy_type_matcher_v3_DoubleMatcher_match_pattern_case(const envoy_type_matcher_v3_DoubleMatcher* msg) { - return (envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_range(const envoy_type_matcher_v3_DoubleMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_clear_range(const envoy_type_matcher_v3_DoubleMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_DoubleRange*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_clear_range(envoy_type_matcher_v3_DoubleMatcher* msg) { + const upb_MiniTableField field = {1, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_range(const envoy_type_matcher_v3_DoubleMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_v3_DoubleRange*, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 1, NULL); + const struct envoy_type_v3_DoubleRange* default_val = NULL; + const struct envoy_type_v3_DoubleRange* ret; + const upb_MiniTableField field = {1, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_exact(const envoy_type_matcher_v3_DoubleMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_range(const envoy_type_matcher_v3_DoubleMatcher* msg) { + const upb_MiniTableField field = {1, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_clear_exact(const envoy_type_matcher_v3_DoubleMatcher* msg) { - UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_clear_exact(envoy_type_matcher_v3_DoubleMatcher* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_type_matcher_v3_DoubleMatcher_exact(const envoy_type_matcher_v3_DoubleMatcher* msg) { - return UPB_READ_ONEOF(msg, double, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 2, 0); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_exact(const envoy_type_matcher_v3_DoubleMatcher* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_range(envoy_type_matcher_v3_DoubleMatcher *msg, struct envoy_type_v3_DoubleRange* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_DoubleRange*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_mutable_range(envoy_type_matcher_v3_DoubleMatcher* msg, upb_Arena* arena) { struct envoy_type_v3_DoubleRange* sub = (struct envoy_type_v3_DoubleRange*)envoy_type_matcher_v3_DoubleMatcher_range(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_DoubleRange*)_upb_Message_New(&envoy_type_v3_DoubleRange_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_DoubleMatcher_set_range(msg, sub); + sub = (struct envoy_type_v3_DoubleRange*)_upb_Message_New(&envoy_type_v3_DoubleRange_msg_init, arena); + if (sub) envoy_type_matcher_v3_DoubleMatcher_set_range(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_exact(envoy_type_matcher_v3_DoubleMatcher *msg, double value) { - UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_matcher_v3_number_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_number_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_ */ 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 31ce5dbb251..0d5dae659f0 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 @@ -7,34 +7,41 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/path.upb.h" #include "envoy/type/matcher/v3/string.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_PathMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_PathMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_PathMatcher__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_PathMatcher__fields[1] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msg_init = { &envoy_type_matcher_v3_PathMatcher_submsgs[0], &envoy_type_matcher_v3_PathMatcher__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_matcher_v3_PathMatcher_msginit, + &envoy_type_matcher_v3_PathMatcher_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_path_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_path_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -43,5 +50,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_path_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 21deddcd8b5..a280f307a25 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 @@ -9,34 +9,38 @@ #ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_PathMatcher; typedef struct envoy_type_matcher_v3_PathMatcher envoy_type_matcher_v3_PathMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msg_init; struct envoy_type_matcher_v3_StringMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; /* envoy.type.matcher.v3.PathMatcher */ UPB_INLINE envoy_type_matcher_v3_PathMatcher* envoy_type_matcher_v3_PathMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msginit, arena); + return (envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_PathMatcher* envoy_type_matcher_v3_PathMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_PathMatcher* ret = envoy_type_matcher_v3_PathMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE envoy_type_matcher_v3_PathMatcher* envoy_type_matcher_v3_PathMatcher_ int options, upb_Arena* arena) { envoy_type_matcher_v3_PathMatcher* ret = envoy_type_matcher_v3_PathMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,13 +58,13 @@ UPB_INLINE envoy_type_matcher_v3_PathMatcher* envoy_type_matcher_v3_PathMatcher_ } UPB_INLINE char* envoy_type_matcher_v3_PathMatcher_serialize(const envoy_type_matcher_v3_PathMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -68,37 +72,44 @@ typedef enum { envoy_type_matcher_v3_PathMatcher_rule_NOT_SET = 0 } envoy_type_matcher_v3_PathMatcher_rule_oneofcases; UPB_INLINE envoy_type_matcher_v3_PathMatcher_rule_oneofcases envoy_type_matcher_v3_PathMatcher_rule_case(const envoy_type_matcher_v3_PathMatcher* msg) { - return (envoy_type_matcher_v3_PathMatcher_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_PathMatcher_rule_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_PathMatcher_has_path(const envoy_type_matcher_v3_PathMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_PathMatcher_clear_path(const envoy_type_matcher_v3_PathMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_PathMatcher_rule_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_PathMatcher_clear_path(envoy_type_matcher_v3_PathMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_path(const envoy_type_matcher_v3_PathMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_PathMatcher_has_path(const envoy_type_matcher_v3_PathMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_PathMatcher_set_path(envoy_type_matcher_v3_PathMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_mutable_path(envoy_type_matcher_v3_PathMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_PathMatcher_path(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_PathMatcher_set_path(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_PathMatcher_set_path(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_type_matcher_v3_path_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_path_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_ */ 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 f1468732e35..98c4fd58503 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/regex.upb.h" #include "google/protobuf/wrappers.upb.h" #include "envoy/annotations/deprecation.upb.h" @@ -15,59 +17,76 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_RegexMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatcher__fields[2] = { - {1, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_RegexMatcher__fields[2] = { + {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msg_init = { &envoy_type_matcher_v3_RegexMatcher_submsgs[0], &envoy_type_matcher_v3_RegexMatcher__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_pom_1bt_max64b}, + {0x000800003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = { +const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init = { &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[0], &envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_RegexMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit = { +const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init = { &envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[0], &envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_type_matcher_v3_RegexMatcher_msginit, - &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, - &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, + &envoy_type_matcher_v3_RegexMatcher_msg_init, + &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, + &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_regex_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_regex_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -76,5 +95,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_regex_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b7c12bf4a4c..93d254a3a05 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 @@ -9,40 +9,42 @@ #ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_RegexMatcher; -struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2; -struct envoy_type_matcher_v3_RegexMatchAndSubstitute; typedef struct envoy_type_matcher_v3_RegexMatcher envoy_type_matcher_v3_RegexMatcher; typedef struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2 envoy_type_matcher_v3_RegexMatcher_GoogleRE2; typedef struct envoy_type_matcher_v3_RegexMatchAndSubstitute envoy_type_matcher_v3_RegexMatchAndSubstitute; -extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init; struct google_protobuf_UInt32Value; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.type.matcher.v3.RegexMatcher */ UPB_INLINE envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena); + return (envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_RegexMatcher* ret = envoy_type_matcher_v3_RegexMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -52,7 +54,7 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatche int options, upb_Arena* arena) { envoy_type_matcher_v3_RegexMatcher* ret = envoy_type_matcher_v3_RegexMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -60,13 +62,13 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatche } UPB_INLINE char* envoy_type_matcher_v3_RegexMatcher_serialize(const envoy_type_matcher_v3_RegexMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -74,49 +76,62 @@ typedef enum { envoy_type_matcher_v3_RegexMatcher_engine_type_NOT_SET = 0 } envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases; UPB_INLINE envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases envoy_type_matcher_v3_RegexMatcher_engine_type_case(const envoy_type_matcher_v3_RegexMatcher* msg) { - return (envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_has_google_re2(const envoy_type_matcher_v3_RegexMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_clear_google_re2(const envoy_type_matcher_v3_RegexMatcher* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_RegexMatcher_engine_type_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_clear_google_re2(envoy_type_matcher_v3_RegexMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_google_re2(const envoy_type_matcher_v3_RegexMatcher* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, NULL); + const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* default_val = NULL; + const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_clear_regex(const envoy_type_matcher_v3_RegexMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_has_google_re2(const envoy_type_matcher_v3_RegexMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_clear_regex(envoy_type_matcher_v3_RegexMatcher* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_RegexMatcher_regex(const envoy_type_matcher_v3_RegexMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2* value) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_mutable_google_re2(envoy_type_matcher_v3_RegexMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)envoy_type_matcher_v3_RegexMatcher_google_re2(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, arena); + if (sub) envoy_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_regex(envoy_type_matcher_v3_RegexMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.RegexMatcher.GoogleRE2 */ UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena); + return (envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_RegexMatcher_GoogleRE2* ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -126,7 +141,7 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_R int options, upb_Arena* arena) { envoy_type_matcher_v3_RegexMatcher_GoogleRE2* ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -134,35 +149,40 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_R } UPB_INLINE char* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, 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); -} -UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_clear_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_clear_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_GoogleRE2_has_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_mutable_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(msg, sub); } return sub; } @@ -170,12 +190,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatche /* envoy.type.matcher.v3.RegexMatchAndSubstitute */ UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_type_matcher_v3_RegexMatchAndSubstitute_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena); + return (envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_type_matcher_v3_RegexMatchAndSubstitute_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_RegexMatchAndSubstitute* ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -185,7 +205,7 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_type_matcher_v3_ int options, upb_Arena* arena) { envoy_type_matcher_v3_RegexMatchAndSubstitute* ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -193,54 +213,65 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_type_matcher_v3_ } UPB_INLINE char* envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msg_init, 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); -} -UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_clear_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_clear_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_type_matcher_v3_RegexMatcher*); + const envoy_type_matcher_v3_RegexMatcher* default_val = NULL; + const envoy_type_matcher_v3_RegexMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_clear_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_clear_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, envoy_type_matcher_v3_RegexMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_type_matcher_v3_RegexMatcher*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_mutable_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_matcher_v3_regex_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_regex_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c index 0962639eca2..04fc11aa9ce 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c @@ -7,30 +7,33 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/status_code_input.upb.h" #include "udpa/annotations/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit = { +const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[2] = { - &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit, - &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit, + &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init, + &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_status_code_input_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_status_code_input_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -39,5 +42,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_status_code_input_proto_upb_file_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h index 508026b8394..2a662603b88 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h @@ -9,35 +9,38 @@ #ifndef ENVOY_TYPE_MATCHER_V3_STATUS_CODE_INPUT_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_STATUS_CODE_INPUT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput; -struct envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput; typedef struct envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput; typedef struct envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput; -extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init; /* envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* ret = envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +50,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* envoy_type_ma int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* ret = envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,13 +58,13 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* envoy_type_ma } UPB_INLINE char* envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_serialize(const envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_msg_init, options, arena, &ptr, len); return ptr; } @@ -69,12 +72,12 @@ UPB_INLINE char* envoy_type_matcher_v3_HttpResponseStatusCodeMatchInput_serializ /* envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput */ UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit, arena); + return (envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* ret = envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -84,7 +87,7 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* envoy_ty int options, upb_Arena* arena) { envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* ret = envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -92,23 +95,23 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* envoy_ty } UPB_INLINE char* envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_serialize(const envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseStatusCodeClassMatchInput_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_type_matcher_v3_status_code_input_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_status_code_input_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_STATUS_CODE_INPUT_PROTO_UPB_H_ */ 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 8b702c4508f..d0e39581921 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 @@ -7,54 +7,71 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/string.upb.h" #include "envoy/type/matcher/v3/regex.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_StringMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_StringMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_RegexMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_StringMatcher__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_StringMatcher__fields[6] = { + {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init = { &envoy_type_matcher_v3_StringMatcher_submsgs[0], &envoy_type_matcher_v3_StringMatcher__fields[0], - UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040100000a, &upb_pos_1bt}, + {0x0008000402000012, &upb_pos_1bt}, + {0x000800040300001a, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040500002a, &upb_pom_1bt_maxmaxb}, + {0x000000003f000030, &upb_psb1_1bt}, + {0x000800040700003a, &upb_pos_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_ListStringMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_ListStringMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msg_init = { &envoy_type_matcher_v3_ListStringMatcher_submsgs[0], &envoy_type_matcher_v3_ListStringMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_type_matcher_v3_StringMatcher_msginit, - &envoy_type_matcher_v3_ListStringMatcher_msginit, + &envoy_type_matcher_v3_StringMatcher_msg_init, + &envoy_type_matcher_v3_ListStringMatcher_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_string_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_string_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -63,5 +80,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_string_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 332e2f145ad..6e986d3566c 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_StringMatcher; -struct envoy_type_matcher_v3_ListStringMatcher; typedef struct envoy_type_matcher_v3_StringMatcher envoy_type_matcher_v3_StringMatcher; typedef struct envoy_type_matcher_v3_ListStringMatcher envoy_type_matcher_v3_ListStringMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msg_init; struct envoy_type_matcher_v3_RegexMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msg_init; /* envoy.type.matcher.v3.StringMatcher */ UPB_INLINE envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_StringMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); + return (envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_StringMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_StringMatcher* ret = envoy_type_matcher_v3_StringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_StringMatc int options, upb_Arena* arena) { envoy_type_matcher_v3_StringMatcher* ret = envoy_type_matcher_v3_StringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,13 +60,13 @@ UPB_INLINE envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_StringMatc } UPB_INLINE char* envoy_type_matcher_v3_StringMatcher_serialize(const envoy_type_matcher_v3_StringMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -75,97 +78,138 @@ typedef enum { envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET = 0 } envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases; UPB_INLINE envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases envoy_type_matcher_v3_StringMatcher_match_pattern_case(const envoy_type_matcher_v3_StringMatcher* msg) { - return (envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_exact(const envoy_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_exact(const envoy_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_exact(envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_exact(const envoy_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_exact(const envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_prefix(const envoy_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_prefix(envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_prefix(const envoy_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_suffix(const envoy_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_suffix(envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_suffix(const envoy_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_safe_regex(const envoy_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_safe_regex(envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_safe_regex(const envoy_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL); + const struct envoy_type_matcher_v3_RegexMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_RegexMatcher* ret; + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_ignore_case(const envoy_type_matcher_v3_StringMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_ignore_case(envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_ignore_case(const envoy_type_matcher_v3_StringMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_contains(const envoy_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; -} -UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_contains(const envoy_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_contains(envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_contains(const envoy_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 7, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_contains(const envoy_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_exact(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_prefix(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_suffix(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_mutable_safe_regex(envoy_type_matcher_v3_StringMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_StringMatcher_safe_regex(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub); + sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_ignore_case(envoy_type_matcher_v3_StringMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_contains(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.matcher.v3.ListStringMatcher */ UPB_INLINE envoy_type_matcher_v3_ListStringMatcher* envoy_type_matcher_v3_ListStringMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena); + return (envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_ListStringMatcher* envoy_type_matcher_v3_ListStringMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_ListStringMatcher* ret = envoy_type_matcher_v3_ListStringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -175,7 +219,7 @@ UPB_INLINE envoy_type_matcher_v3_ListStringMatcher* envoy_type_matcher_v3_ListSt int options, upb_Arena* arena) { envoy_type_matcher_v3_ListStringMatcher* ret = envoy_type_matcher_v3_ListStringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -183,44 +227,69 @@ UPB_INLINE envoy_type_matcher_v3_ListStringMatcher* envoy_type_matcher_v3_ListSt } UPB_INLINE char* envoy_type_matcher_v3_ListStringMatcher_serialize(const envoy_type_matcher_v3_ListStringMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_type_matcher_v3_ListStringMatcher_clear_patterns(envoy_type_matcher_v3_ListStringMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_type_matcher_v3_StringMatcher* const* envoy_type_matcher_v3_ListStringMatcher_patterns(const envoy_type_matcher_v3_ListStringMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_type_matcher_v3_StringMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool envoy_type_matcher_v3_ListStringMatcher_has_patterns(const envoy_type_matcher_v3_ListStringMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void envoy_type_matcher_v3_ListStringMatcher_clear_patterns(const envoy_type_matcher_v3_ListStringMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const envoy_type_matcher_v3_StringMatcher* const* envoy_type_matcher_v3_ListStringMatcher_patterns(const envoy_type_matcher_v3_ListStringMatcher* msg, size_t* len) { - return (const envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + envoy_type_matcher_v3_ListStringMatcher_patterns(msg, &size); + return size != 0; } -UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_mutable_patterns(envoy_type_matcher_v3_ListStringMatcher* msg, size_t* len) { - return (envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_mutable_patterns(envoy_type_matcher_v3_ListStringMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_type_matcher_v3_StringMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_resize_patterns(envoy_type_matcher_v3_ListStringMatcher* msg, size_t len, upb_Arena* arena) { - return (envoy_type_matcher_v3_StringMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_resize_patterns(envoy_type_matcher_v3_ListStringMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_StringMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ListStringMatcher_add_patterns(envoy_type_matcher_v3_ListStringMatcher* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File envoy_type_matcher_v3_string_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_string_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ */ 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 4441fa487bd..e6878eb3861 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 @@ -7,47 +7,60 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/struct.upb.h" #include "envoy/type/matcher/v3/value.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_StructMatcher_submsgs[2] = { - {.submsg = &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit}, - {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_StructMatcher_submsgs[2] = { + {.submsg = &envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init}, + {.submsg = &envoy_type_matcher_v3_ValueMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher__fields[2] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_StructMatcher__fields[2] = { + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msg_init = { &envoy_type_matcher_v3_StructMatcher_submsgs[0], &envoy_type_matcher_v3_StructMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x001000000101001a, &upb_psm_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher_PathSegment__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_StructMatcher_PathSegment__fields[1] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msginit = { +const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init = { NULL, &envoy_type_matcher_v3_StructMatcher_PathSegment__fields[0], - UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_type_matcher_v3_StructMatcher_msginit, - &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, + &envoy_type_matcher_v3_StructMatcher_msg_init, + &envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_struct_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_struct_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -56,5 +69,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_struct_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 e1f8e55843b..c6829c9baff 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 @@ -9,37 +9,40 @@ #ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_StructMatcher; -struct envoy_type_matcher_v3_StructMatcher_PathSegment; typedef struct envoy_type_matcher_v3_StructMatcher envoy_type_matcher_v3_StructMatcher; typedef struct envoy_type_matcher_v3_StructMatcher_PathSegment envoy_type_matcher_v3_StructMatcher_PathSegment; -extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init; struct envoy_type_matcher_v3_ValueMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msg_init; /* envoy.type.matcher.v3.StructMatcher */ UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_StructMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_msginit, arena); + return (envoy_type_matcher_v3_StructMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_StructMatcher* ret = envoy_type_matcher_v3_StructMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatc int options, upb_Arena* arena) { envoy_type_matcher_v3_StructMatcher* ret = envoy_type_matcher_v3_StructMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,56 +60,86 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatc } UPB_INLINE char* envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void envoy_type_matcher_v3_StructMatcher_clear_path(envoy_type_matcher_v3_StructMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + envoy_type_matcher_v3_StructMatcher_path(msg, &size); + return size != 0; } -UPB_INLINE void envoy_type_matcher_v3_StructMatcher_clear_path(const envoy_type_matcher_v3_StructMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher* msg, size_t* len) { - return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_type_matcher_v3_StructMatcher_clear_value(const envoy_type_matcher_v3_StructMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_matcher_v3_StructMatcher_clear_value(envoy_type_matcher_v3_StructMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_matcher_v3_ValueMatcher*); + const struct envoy_type_matcher_v3_ValueMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_ValueMatcher* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher* msg, size_t* len) { - return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher* msg, size_t len, upb_Arena* arena) { - return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_StructMatcher_PathSegment**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_add_path(envoy_type_matcher_v3_StructMatcher* msg, upb_Arena* arena) { - struct envoy_type_matcher_v3_StructMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_matcher_v3_StructMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void envoy_type_matcher_v3_StructMatcher_set_value(envoy_type_matcher_v3_StructMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_matcher_v3_ValueMatcher*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_mutable_value(envoy_type_matcher_v3_StructMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_StructMatcher_value(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_StructMatcher_set_value(msg, sub); + sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_StructMatcher_set_value(msg, sub); } return sub; } @@ -114,12 +147,12 @@ UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_Stru /* envoy.type.matcher.v3.StructMatcher.PathSegment */ UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_PathSegment_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena); + return (envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_StructMatcher_PathSegment* ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -129,7 +162,7 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v int options, upb_Arena* arena) { envoy_type_matcher_v3_StructMatcher_PathSegment* ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -137,13 +170,13 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v } UPB_INLINE char* envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -151,28 +184,36 @@ typedef enum { envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET = 0 } envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases; UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_StructMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { - return (envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_clear_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_clear_key(envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_matcher_v3_struct_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_struct_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_ */ 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 28b680088bc..f43bc9be1e1 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 @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/matcher/v3/value.upb.h" #include "envoy/type/matcher/v3/number.upb.h" #include "envoy/type/matcher/v3/string.upb.h" @@ -15,57 +17,72 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_matcher_v3_ValueMatcher_submsgs[4] = { - {.submsg = &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit}, - {.submsg = &envoy_type_matcher_v3_DoubleMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &envoy_type_matcher_v3_ListMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_ValueMatcher_submsgs[4] = { + {.submsg = &envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init}, + {.submsg = &envoy_type_matcher_v3_DoubleMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &envoy_type_matcher_v3_ListMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_ValueMatcher__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_ValueMatcher__fields[6] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msg_init = { &envoy_type_matcher_v3_ValueMatcher_submsgs[0], &envoy_type_matcher_v3_ValueMatcher__fields[0], - UPB_SIZE(8, 16), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(8, 16), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_maxmaxb}, + {0x000800000302001a, &upb_pom_1bt_maxmaxb}, + {0x0008000004000020, &upb_pob1_1bt}, + {0x0008000005000028, &upb_pob1_1bt}, + {0x0008000006030032, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = { +const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub envoy_type_matcher_v3_ListMatcher_submsgs[1] = { - {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit}, +static const upb_MiniTableSub envoy_type_matcher_v3_ListMatcher_submsgs[1] = { + {.submsg = &envoy_type_matcher_v3_ValueMatcher_msg_init}, }; -static const upb_MiniTable_Field envoy_type_matcher_v3_ListMatcher__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_matcher_v3_ListMatcher__fields[1] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_matcher_v3_ListMatcher_msginit = { +const upb_MiniTable envoy_type_matcher_v3_ListMatcher_msg_init = { &envoy_type_matcher_v3_ListMatcher_submsgs[0], &envoy_type_matcher_v3_ListMatcher__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_type_matcher_v3_ValueMatcher_msginit, - &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, - &envoy_type_matcher_v3_ListMatcher_msginit, + &envoy_type_matcher_v3_ValueMatcher_msg_init, + &envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, + &envoy_type_matcher_v3_ListMatcher_msg_init, }; -const upb_MiniTable_File envoy_type_matcher_v3_value_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_matcher_v3_value_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -74,5 +91,5 @@ const upb_MiniTable_File envoy_type_matcher_v3_value_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 9f12e583128..40b7bdf6bfb 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 @@ -9,42 +9,44 @@ #ifndef ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_ #define ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_matcher_v3_ValueMatcher; -struct envoy_type_matcher_v3_ValueMatcher_NullMatch; -struct envoy_type_matcher_v3_ListMatcher; typedef struct envoy_type_matcher_v3_ValueMatcher envoy_type_matcher_v3_ValueMatcher; typedef struct envoy_type_matcher_v3_ValueMatcher_NullMatch envoy_type_matcher_v3_ValueMatcher_NullMatch; typedef struct envoy_type_matcher_v3_ListMatcher envoy_type_matcher_v3_ListMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_ListMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_ListMatcher_msg_init; struct envoy_type_matcher_v3_DoubleMatcher; struct envoy_type_matcher_v3_StringMatcher; -extern const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msginit; -extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit; +extern const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msg_init; +extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msg_init; /* envoy.type.matcher.v3.ValueMatcher */ UPB_INLINE envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ValueMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena); + return (envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ValueMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_ValueMatcher* ret = envoy_type_matcher_v3_ValueMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -54,7 +56,7 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ValueMatche int options, upb_Arena* arena) { envoy_type_matcher_v3_ValueMatcher* ret = envoy_type_matcher_v3_ValueMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -62,13 +64,13 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ValueMatche } UPB_INLINE char* envoy_type_matcher_v3_ValueMatcher_serialize(const envoy_type_matcher_v3_ValueMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -81,114 +83,153 @@ typedef enum { envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET = 0 } envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases; UPB_INLINE envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases envoy_type_matcher_v3_ValueMatcher_match_pattern_case(const envoy_type_matcher_v3_ValueMatcher* msg) { - return (envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_null_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_null_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_null_match(envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_null_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_type_matcher_v3_ValueMatcher_NullMatch* default_val = NULL; + const envoy_type_matcher_v3_ValueMatcher_NullMatch* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_double_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_null_match(const envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_double_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_double_match(envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_ValueMatcher_double_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct envoy_type_matcher_v3_DoubleMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_DoubleMatcher* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_string_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_double_match(const envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_string_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_string_match(envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ValueMatcher_string_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const struct envoy_type_matcher_v3_StringMatcher* default_val = NULL; + const struct envoy_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_bool_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_string_match(const envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_bool_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_bool_match(envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_bool_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_present_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_bool_match(const envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_present_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_present_match(envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_present_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_list_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_present_match(const envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_list_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_list_match(envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ValueMatcher_list_match(const envoy_type_matcher_v3_ValueMatcher* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const envoy_type_matcher_v3_ListMatcher* default_val = NULL; + const envoy_type_matcher_v3_ListMatcher* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_list_match(const envoy_type_matcher_v3_ValueMatcher* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_null_match(envoy_type_matcher_v3_ValueMatcher *msg, envoy_type_matcher_v3_ValueMatcher_NullMatch* value) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_mutable_null_match(envoy_type_matcher_v3_ValueMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ValueMatcher_NullMatch* sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)envoy_type_matcher_v3_ValueMatcher_null_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_ValueMatcher_set_null_match(msg, sub); + sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, arena); + if (sub) envoy_type_matcher_v3_ValueMatcher_set_null_match(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_double_match(envoy_type_matcher_v3_ValueMatcher *msg, struct envoy_type_matcher_v3_DoubleMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_double_match(envoy_type_matcher_v3_ValueMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_DoubleMatcher* sub = (struct envoy_type_matcher_v3_DoubleMatcher*)envoy_type_matcher_v3_ValueMatcher_double_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_DoubleMatcher*)_upb_Message_New(&envoy_type_matcher_v3_DoubleMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_ValueMatcher_set_double_match(msg, sub); + sub = (struct envoy_type_matcher_v3_DoubleMatcher*)_upb_Message_New(&envoy_type_matcher_v3_DoubleMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_ValueMatcher_set_double_match(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_string_match(envoy_type_matcher_v3_ValueMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_string_match(envoy_type_matcher_v3_ValueMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_ValueMatcher_string_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_ValueMatcher_set_string_match(msg, sub); + sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_ValueMatcher_set_string_match(msg, sub); } return sub; } UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_bool_match(envoy_type_matcher_v3_ValueMatcher *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_present_match(envoy_type_matcher_v3_ValueMatcher *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_list_match(envoy_type_matcher_v3_ValueMatcher *msg, envoy_type_matcher_v3_ListMatcher* value) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_list_match(envoy_type_matcher_v3_ValueMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ListMatcher* sub = (struct envoy_type_matcher_v3_ListMatcher*)envoy_type_matcher_v3_ValueMatcher_list_match(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ListMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_ValueMatcher_set_list_match(msg, sub); + sub = (struct envoy_type_matcher_v3_ListMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_ValueMatcher_set_list_match(msg, sub); } return sub; } @@ -196,12 +237,12 @@ UPB_INLINE struct envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_Value /* envoy.type.matcher.v3.ValueMatcher.NullMatch */ UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_NullMatch_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena); + return (envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_NullMatch_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_ValueMatcher_NullMatch* ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -211,7 +252,7 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_V int options, upb_Arena* arena) { envoy_type_matcher_v3_ValueMatcher_NullMatch* ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -219,13 +260,13 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_V } UPB_INLINE char* envoy_type_matcher_v3_ValueMatcher_NullMatch_serialize(const envoy_type_matcher_v3_ValueMatcher_NullMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msg_init, options, arena, &ptr, len); return ptr; } @@ -233,12 +274,12 @@ UPB_INLINE char* envoy_type_matcher_v3_ValueMatcher_NullMatch_serialize_ex(const /* envoy.type.matcher.v3.ListMatcher */ UPB_INLINE envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ListMatcher_new(upb_Arena* arena) { - return (envoy_type_matcher_v3_ListMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListMatcher_msginit, arena); + return (envoy_type_matcher_v3_ListMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListMatcher_msg_init, arena); } UPB_INLINE envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ListMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_matcher_v3_ListMatcher* ret = envoy_type_matcher_v3_ListMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -248,7 +289,7 @@ UPB_INLINE envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ListMatcher_ int options, upb_Arena* arena) { envoy_type_matcher_v3_ListMatcher* ret = envoy_type_matcher_v3_ListMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -256,13 +297,13 @@ UPB_INLINE envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ListMatcher_ } UPB_INLINE char* envoy_type_matcher_v3_ListMatcher_serialize(const envoy_type_matcher_v3_ListMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -270,37 +311,44 @@ typedef enum { envoy_type_matcher_v3_ListMatcher_match_pattern_NOT_SET = 0 } envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases; UPB_INLINE envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases envoy_type_matcher_v3_ListMatcher_match_pattern_case(const envoy_type_matcher_v3_ListMatcher* msg) { - return (envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_matcher_v3_ListMatcher_has_one_of(const envoy_type_matcher_v3_ListMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_matcher_v3_ListMatcher_clear_one_of(const envoy_type_matcher_v3_ListMatcher* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ListMatcher_match_pattern_NOT_SET); +UPB_INLINE void envoy_type_matcher_v3_ListMatcher_clear_one_of(envoy_type_matcher_v3_ListMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ListMatcher_one_of(const envoy_type_matcher_v3_ListMatcher* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_type_matcher_v3_ValueMatcher* default_val = NULL; + const envoy_type_matcher_v3_ValueMatcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_matcher_v3_ListMatcher_has_one_of(const envoy_type_matcher_v3_ListMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_matcher_v3_ListMatcher_set_one_of(envoy_type_matcher_v3_ListMatcher *msg, envoy_type_matcher_v3_ValueMatcher* value) { - UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ListMatcher_mutable_one_of(envoy_type_matcher_v3_ListMatcher* msg, upb_Arena* arena) { struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_ListMatcher_one_of(msg); if (sub == NULL) { - sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena); - if (!sub) return NULL; - envoy_type_matcher_v3_ListMatcher_set_one_of(msg, sub); + sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msg_init, arena); + if (sub) envoy_type_matcher_v3_ListMatcher_set_one_of(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_type_matcher_v3_value_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_matcher_v3_value_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_ */ 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 3eee584cea3..9e3c865e202 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 @@ -7,94 +7,117 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/metadata/v3/metadata.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_metadata_v3_MetadataKey_submsgs[1] = { - {.submsg = &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit}, +static const upb_MiniTableSub envoy_type_metadata_v3_MetadataKey_submsgs[1] = { + {.submsg = &envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init}, }; -static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_metadata_v3_MetadataKey__fields[2] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msg_init = { &envoy_type_metadata_v3_MetadataKey_submsgs[0], &envoy_type_metadata_v3_MetadataKey__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init = { NULL, &envoy_type_metadata_v3_MetadataKey_PathSegment__fields[0], - UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + }) }; -static const upb_MiniTable_Sub envoy_type_metadata_v3_MetadataKind_submsgs[4] = { - {.submsg = &envoy_type_metadata_v3_MetadataKind_Request_msginit}, - {.submsg = &envoy_type_metadata_v3_MetadataKind_Route_msginit}, - {.submsg = &envoy_type_metadata_v3_MetadataKind_Cluster_msginit}, - {.submsg = &envoy_type_metadata_v3_MetadataKind_Host_msginit}, +static const upb_MiniTableSub envoy_type_metadata_v3_MetadataKind_submsgs[4] = { + {.submsg = &envoy_type_metadata_v3_MetadataKind_Request_msg_init}, + {.submsg = &envoy_type_metadata_v3_MetadataKind_Route_msg_init}, + {.submsg = &envoy_type_metadata_v3_MetadataKind_Cluster_msg_init}, + {.submsg = &envoy_type_metadata_v3_MetadataKind_Host_msg_init}, }; -static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKind__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_metadata_v3_MetadataKind__fields[4] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msg_init = { &envoy_type_metadata_v3_MetadataKind_submsgs[0], &envoy_type_metadata_v3_MetadataKind__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004030022, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Request_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Request_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Host_msginit = { +const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Host_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[7] = { - &envoy_type_metadata_v3_MetadataKey_msginit, - &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, - &envoy_type_metadata_v3_MetadataKind_msginit, - &envoy_type_metadata_v3_MetadataKind_Request_msginit, - &envoy_type_metadata_v3_MetadataKind_Route_msginit, - &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, - &envoy_type_metadata_v3_MetadataKind_Host_msginit, + &envoy_type_metadata_v3_MetadataKey_msg_init, + &envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, + &envoy_type_metadata_v3_MetadataKind_msg_init, + &envoy_type_metadata_v3_MetadataKind_Request_msg_init, + &envoy_type_metadata_v3_MetadataKind_Route_msg_init, + &envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, + &envoy_type_metadata_v3_MetadataKind_Host_msg_init, }; -const upb_MiniTable_File envoy_type_metadata_v3_metadata_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_metadata_v3_metadata_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -103,5 +126,5 @@ const upb_MiniTable_File envoy_type_metadata_v3_metadata_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 3623eb41e90..b7180fd94d9 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 @@ -9,24 +9,22 @@ #ifndef ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_ #define ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_metadata_v3_MetadataKey; -struct envoy_type_metadata_v3_MetadataKey_PathSegment; -struct envoy_type_metadata_v3_MetadataKind; -struct envoy_type_metadata_v3_MetadataKind_Request; -struct envoy_type_metadata_v3_MetadataKind_Route; -struct envoy_type_metadata_v3_MetadataKind_Cluster; -struct envoy_type_metadata_v3_MetadataKind_Host; typedef struct envoy_type_metadata_v3_MetadataKey envoy_type_metadata_v3_MetadataKey; typedef struct envoy_type_metadata_v3_MetadataKey_PathSegment envoy_type_metadata_v3_MetadataKey_PathSegment; typedef struct envoy_type_metadata_v3_MetadataKind envoy_type_metadata_v3_MetadataKind; @@ -34,25 +32,25 @@ typedef struct envoy_type_metadata_v3_MetadataKind_Request envoy_type_metadata_v typedef struct envoy_type_metadata_v3_MetadataKind_Route envoy_type_metadata_v3_MetadataKind_Route; typedef struct envoy_type_metadata_v3_MetadataKind_Cluster envoy_type_metadata_v3_MetadataKind_Cluster; typedef struct envoy_type_metadata_v3_MetadataKind_Host envoy_type_metadata_v3_MetadataKind_Host; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Request_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Host_msginit; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Request_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Host_msg_init; /* envoy.type.metadata.v3.MetadataKey */ UPB_INLINE envoy_type_metadata_v3_MetadataKey* envoy_type_metadata_v3_MetadataKey_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena); + return (envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKey* envoy_type_metadata_v3_MetadataKey_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKey* ret = envoy_type_metadata_v3_MetadataKey_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -62,7 +60,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey* envoy_type_metadata_v3_MetadataKe int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKey* ret = envoy_type_metadata_v3_MetadataKey_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -70,56 +68,87 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey* envoy_type_metadata_v3_MetadataKe } UPB_INLINE char* envoy_type_metadata_v3_MetadataKey_serialize(const envoy_type_metadata_v3_MetadataKey* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msg_init, 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); +UPB_INLINE void envoy_type_metadata_v3_MetadataKey_clear_key(envoy_type_metadata_v3_MetadataKey* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_metadata_v3_MetadataKey_key(const envoy_type_metadata_v3_MetadataKey* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void envoy_type_metadata_v3_MetadataKey_clear_path(envoy_type_metadata_v3_MetadataKey* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const envoy_type_metadata_v3_MetadataKey_PathSegment* const* envoy_type_metadata_v3_MetadataKey_path(const envoy_type_metadata_v3_MetadataKey* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const envoy_type_metadata_v3_MetadataKey_PathSegment* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_has_path(const envoy_type_metadata_v3_MetadataKey* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void envoy_type_metadata_v3_MetadataKey_clear_path(const envoy_type_metadata_v3_MetadataKey* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const envoy_type_metadata_v3_MetadataKey_PathSegment* const* envoy_type_metadata_v3_MetadataKey_path(const envoy_type_metadata_v3_MetadataKey* msg, size_t* len) { - return (const envoy_type_metadata_v3_MetadataKey_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + envoy_type_metadata_v3_MetadataKey_path(msg, &size); + return size != 0; } UPB_INLINE void envoy_type_metadata_v3_MetadataKey_set_key(envoy_type_metadata_v3_MetadataKey *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_mutable_path(envoy_type_metadata_v3_MetadataKey* msg, size_t* len) { - return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_mutable_path(envoy_type_metadata_v3_MetadataKey* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_resize_path(envoy_type_metadata_v3_MetadataKey* msg, size_t len, upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_resize_path(envoy_type_metadata_v3_MetadataKey* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_metadata_v3_MetadataKey_PathSegment**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v3_MetadataKey_add_path(envoy_type_metadata_v3_MetadataKey* msg, upb_Arena* arena) { - struct envoy_type_metadata_v3_MetadataKey_PathSegment* sub = (struct envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct envoy_type_metadata_v3_MetadataKey_PathSegment* sub = (struct envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* envoy.type.metadata.v3.MetadataKey.PathSegment */ UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v3_MetadataKey_PathSegment_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena); + return (envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v3_MetadataKey_PathSegment_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKey_PathSegment* ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -129,7 +158,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKey_PathSegment* ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -137,13 +166,13 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v } UPB_INLINE char* envoy_type_metadata_v3_MetadataKey_PathSegment_serialize(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -151,31 +180,39 @@ typedef enum { envoy_type_metadata_v3_MetadataKey_PathSegment_segment_NOT_SET = 0 } envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases; UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases envoy_type_metadata_v3_MetadataKey_PathSegment_segment_case(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { - return (envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_PathSegment_has_key(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_clear_key(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKey_PathSegment_segment_NOT_SET); +UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_clear_key(envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_metadata_v3_MetadataKey_PathSegment_key(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_PathSegment_has_key(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_set_key(envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.metadata.v3.MetadataKind */ UPB_INLINE envoy_type_metadata_v3_MetadataKind* envoy_type_metadata_v3_MetadataKind_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKind*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_msginit, arena); + return (envoy_type_metadata_v3_MetadataKind*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKind* envoy_type_metadata_v3_MetadataKind_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind* ret = envoy_type_metadata_v3_MetadataKind_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -185,7 +222,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind* envoy_type_metadata_v3_MetadataK int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind* ret = envoy_type_metadata_v3_MetadataKind_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -193,13 +230,13 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind* envoy_type_metadata_v3_MetadataK } UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_serialize(const envoy_type_metadata_v3_MetadataKind* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -210,90 +247,115 @@ typedef enum { envoy_type_metadata_v3_MetadataKind_kind_NOT_SET = 0 } envoy_type_metadata_v3_MetadataKind_kind_oneofcases; UPB_INLINE envoy_type_metadata_v3_MetadataKind_kind_oneofcases envoy_type_metadata_v3_MetadataKind_kind_case(const envoy_type_metadata_v3_MetadataKind* msg) { - return (envoy_type_metadata_v3_MetadataKind_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_metadata_v3_MetadataKind_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_request(const envoy_type_metadata_v3_MetadataKind* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_request(const envoy_type_metadata_v3_MetadataKind* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET); +UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_request(envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_request(const envoy_type_metadata_v3_MetadataKind* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_type_metadata_v3_MetadataKind_Request* default_val = NULL; + const envoy_type_metadata_v3_MetadataKind_Request* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_route(const envoy_type_metadata_v3_MetadataKind* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_request(const envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_route(const envoy_type_metadata_v3_MetadataKind* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET); +UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_route(envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_route(const envoy_type_metadata_v3_MetadataKind* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_type_metadata_v3_MetadataKind_Route* default_val = NULL; + const envoy_type_metadata_v3_MetadataKind_Route* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_cluster(const envoy_type_metadata_v3_MetadataKind* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_route(const envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_cluster(const envoy_type_metadata_v3_MetadataKind* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET); +UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_cluster(envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_cluster(const envoy_type_metadata_v3_MetadataKind* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const envoy_type_metadata_v3_MetadataKind_Cluster* default_val = NULL; + const envoy_type_metadata_v3_MetadataKind_Cluster* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_host(const envoy_type_metadata_v3_MetadataKind* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_cluster(const envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_host(const envoy_type_metadata_v3_MetadataKind* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET); +UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_host(envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_host(const envoy_type_metadata_v3_MetadataKind* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const envoy_type_metadata_v3_MetadataKind_Host* default_val = NULL; + const envoy_type_metadata_v3_MetadataKind_Host* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_host(const envoy_type_metadata_v3_MetadataKind* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_request(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Request* value) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_mutable_request(envoy_type_metadata_v3_MetadataKind* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKind_Request* sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)envoy_type_metadata_v3_MetadataKind_request(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Request_msginit, arena); - if (!sub) return NULL; - envoy_type_metadata_v3_MetadataKind_set_request(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Request_msg_init, arena); + if (sub) envoy_type_metadata_v3_MetadataKind_set_request(msg, sub); } return sub; } UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_route(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Route* value) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_mutable_route(envoy_type_metadata_v3_MetadataKind* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKind_Route* sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)envoy_type_metadata_v3_MetadataKind_route(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Route_msginit, arena); - if (!sub) return NULL; - envoy_type_metadata_v3_MetadataKind_set_route(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Route_msg_init, arena); + if (sub) envoy_type_metadata_v3_MetadataKind_set_route(msg, sub); } return sub; } UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_cluster(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Cluster* value) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_mutable_cluster(envoy_type_metadata_v3_MetadataKind* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKind_Cluster* sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)envoy_type_metadata_v3_MetadataKind_cluster(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena); - if (!sub) return NULL; - envoy_type_metadata_v3_MetadataKind_set_cluster(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, arena); + if (sub) envoy_type_metadata_v3_MetadataKind_set_cluster(msg, sub); } return sub; } UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_host(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Host* value) { - UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_mutable_host(envoy_type_metadata_v3_MetadataKind* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKind_Host* sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)envoy_type_metadata_v3_MetadataKind_host(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena); - if (!sub) return NULL; - envoy_type_metadata_v3_MetadataKind_set_host(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Host_msg_init, arena); + if (sub) envoy_type_metadata_v3_MetadataKind_set_host(msg, sub); } return sub; } @@ -301,12 +363,12 @@ UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_ /* envoy.type.metadata.v3.MetadataKind.Request */ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_Request_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKind_Request*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Request_msginit, arena); + return (envoy_type_metadata_v3_MetadataKind_Request*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Request_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_Request_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Request* ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -316,7 +378,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_M int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Request* ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -324,13 +386,13 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_M } UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Request_serialize(const envoy_type_metadata_v3_MetadataKind_Request* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msg_init, options, arena, &ptr, len); return ptr; } @@ -338,12 +400,12 @@ UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Request_serialize_ex(const /* envoy.type.metadata.v3.MetadataKind.Route */ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_Route_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKind_Route*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Route_msginit, arena); + return (envoy_type_metadata_v3_MetadataKind_Route*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Route_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_Route_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Route* ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -353,7 +415,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_Met int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Route* ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -361,13 +423,13 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_Met } UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Route_serialize(const envoy_type_metadata_v3_MetadataKind_Route* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msg_init, options, arena, &ptr, len); return ptr; } @@ -375,12 +437,12 @@ UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Route_serialize_ex(const en /* envoy.type.metadata.v3.MetadataKind.Cluster */ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_Cluster_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena); + return (envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_Cluster_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Cluster* ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -390,7 +452,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_M int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Cluster* ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -398,13 +460,13 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_M } UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Cluster_serialize(const envoy_type_metadata_v3_MetadataKind_Cluster* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msg_init, options, arena, &ptr, len); return ptr; } @@ -412,12 +474,12 @@ UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Cluster_serialize_ex(const /* envoy.type.metadata.v3.MetadataKind.Host */ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_Host_new(upb_Arena* arena) { - return (envoy_type_metadata_v3_MetadataKind_Host*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena); + return (envoy_type_metadata_v3_MetadataKind_Host*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Host_msg_init, arena); } UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_Host_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Host* ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -427,7 +489,7 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_Meta int options, upb_Arena* arena) { envoy_type_metadata_v3_MetadataKind_Host* ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -435,23 +497,23 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_Meta } UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Host_serialize(const envoy_type_metadata_v3_MetadataKind_Host* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File envoy_type_metadata_v3_metadata_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_metadata_v3_metadata_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_ */ 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 3a48dec20b2..34695ccff85 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 @@ -7,94 +7,129 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/tracing/v3/custom_tag.upb.h" #include "envoy/type/metadata/v3/metadata.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_tracing_v3_CustomTag_submsgs[4] = { - {.submsg = &envoy_type_tracing_v3_CustomTag_Literal_msginit}, - {.submsg = &envoy_type_tracing_v3_CustomTag_Environment_msginit}, - {.submsg = &envoy_type_tracing_v3_CustomTag_Header_msginit}, - {.submsg = &envoy_type_tracing_v3_CustomTag_Metadata_msginit}, +static const upb_MiniTableSub envoy_type_tracing_v3_CustomTag_submsgs[4] = { + {.submsg = &envoy_type_tracing_v3_CustomTag_Literal_msg_init}, + {.submsg = &envoy_type_tracing_v3_CustomTag_Environment_msg_init}, + {.submsg = &envoy_type_tracing_v3_CustomTag_Header_msg_init}, + {.submsg = &envoy_type_tracing_v3_CustomTag_Metadata_msg_init}, }; -static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_tracing_v3_CustomTag__fields[5] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit = { +const upb_MiniTable envoy_type_tracing_v3_CustomTag_msg_init = { &envoy_type_tracing_v3_CustomTag_submsgs[0], &envoy_type_tracing_v3_CustomTag__fields[0], - UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_max64b}, + {0x001800000301001a, &upb_pom_1bt_max64b}, + {0x0018000004020022, &upb_pom_1bt_max64b}, + {0x001800000503002a, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_tracing_v3_CustomTag_Literal__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msginit = { +const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msg_init = { NULL, &envoy_type_tracing_v3_CustomTag_Literal__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Environment__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_tracing_v3_CustomTag_Environment__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msginit = { +const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msg_init = { NULL, &envoy_type_tracing_v3_CustomTag_Environment__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Header__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_tracing_v3_CustomTag_Header__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msginit = { +const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msg_init = { NULL, &envoy_type_tracing_v3_CustomTag_Header__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = { - {.submsg = &envoy_type_metadata_v3_MetadataKind_msginit}, - {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit}, +static const upb_MiniTableSub envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = { + {.submsg = &envoy_type_metadata_v3_MetadataKind_msg_init}, + {.submsg = &envoy_type_metadata_v3_MetadataKey_msg_init}, }; -static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_tracing_v3_CustomTag_Metadata_msginit = { +const upb_MiniTable envoy_type_tracing_v3_CustomTag_Metadata_msg_init = { &envoy_type_tracing_v3_CustomTag_Metadata_submsgs[0], &envoy_type_tracing_v3_CustomTag_Metadata__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800003f00001a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[5] = { - &envoy_type_tracing_v3_CustomTag_msginit, - &envoy_type_tracing_v3_CustomTag_Literal_msginit, - &envoy_type_tracing_v3_CustomTag_Environment_msginit, - &envoy_type_tracing_v3_CustomTag_Header_msginit, - &envoy_type_tracing_v3_CustomTag_Metadata_msginit, + &envoy_type_tracing_v3_CustomTag_msg_init, + &envoy_type_tracing_v3_CustomTag_Literal_msg_init, + &envoy_type_tracing_v3_CustomTag_Environment_msg_init, + &envoy_type_tracing_v3_CustomTag_Header_msg_init, + &envoy_type_tracing_v3_CustomTag_Metadata_msg_init, }; -const upb_MiniTable_File envoy_type_tracing_v3_custom_tag_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_tracing_v3_custom_tag_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -103,5 +138,5 @@ const upb_MiniTable_File envoy_type_tracing_v3_custom_tag_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d51fa4d4218..7a8186de96d 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 @@ -9,48 +9,48 @@ #ifndef ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_ #define ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_tracing_v3_CustomTag; -struct envoy_type_tracing_v3_CustomTag_Literal; -struct envoy_type_tracing_v3_CustomTag_Environment; -struct envoy_type_tracing_v3_CustomTag_Header; -struct envoy_type_tracing_v3_CustomTag_Metadata; typedef struct envoy_type_tracing_v3_CustomTag envoy_type_tracing_v3_CustomTag; typedef struct envoy_type_tracing_v3_CustomTag_Literal envoy_type_tracing_v3_CustomTag_Literal; typedef struct envoy_type_tracing_v3_CustomTag_Environment envoy_type_tracing_v3_CustomTag_Environment; typedef struct envoy_type_tracing_v3_CustomTag_Header envoy_type_tracing_v3_CustomTag_Header; typedef struct envoy_type_tracing_v3_CustomTag_Metadata envoy_type_tracing_v3_CustomTag_Metadata; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msginit; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msginit; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msginit; -extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Metadata_msginit; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msg_init; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msg_init; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msg_init; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msg_init; +extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Metadata_msg_init; struct envoy_type_metadata_v3_MetadataKey; struct envoy_type_metadata_v3_MetadataKind; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit; -extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msginit; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msg_init; +extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msg_init; /* envoy.type.tracing.v3.CustomTag */ UPB_INLINE envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_new(upb_Arena* arena) { - return (envoy_type_tracing_v3_CustomTag*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_msginit, arena); + return (envoy_type_tracing_v3_CustomTag*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_msg_init, arena); } UPB_INLINE envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag* ret = envoy_type_tracing_v3_CustomTag_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -60,7 +60,7 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_pars int options, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag* ret = envoy_type_tracing_v3_CustomTag_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -68,13 +68,13 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_pars } UPB_INLINE char* envoy_type_tracing_v3_CustomTag_serialize(const envoy_type_tracing_v3_CustomTag* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -85,99 +85,130 @@ typedef enum { envoy_type_tracing_v3_CustomTag_type_NOT_SET = 0 } envoy_type_tracing_v3_CustomTag_type_oneofcases; UPB_INLINE envoy_type_tracing_v3_CustomTag_type_oneofcases envoy_type_tracing_v3_CustomTag_type_case(const envoy_type_tracing_v3_CustomTag* msg) { - return (envoy_type_tracing_v3_CustomTag_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_tracing_v3_CustomTag_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_tag(const envoy_type_tracing_v3_CustomTag* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_tag(envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_tag(const envoy_type_tracing_v3_CustomTag* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_literal(const envoy_type_tracing_v3_CustomTag* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_literal(const envoy_type_tracing_v3_CustomTag* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_literal(envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_literal(const envoy_type_tracing_v3_CustomTag* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const envoy_type_tracing_v3_CustomTag_Literal* default_val = NULL; + const envoy_type_tracing_v3_CustomTag_Literal* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_environment(const envoy_type_tracing_v3_CustomTag* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_literal(const envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_environment(const envoy_type_tracing_v3_CustomTag* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_environment(envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_environment(const envoy_type_tracing_v3_CustomTag* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const envoy_type_tracing_v3_CustomTag_Environment* default_val = NULL; + const envoy_type_tracing_v3_CustomTag_Environment* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_request_header(const envoy_type_tracing_v3_CustomTag* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_environment(const envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_request_header(const envoy_type_tracing_v3_CustomTag* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_request_header(envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_request_header(const envoy_type_tracing_v3_CustomTag* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 4, NULL); + const envoy_type_tracing_v3_CustomTag_Header* default_val = NULL; + const envoy_type_tracing_v3_CustomTag_Header* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_metadata(const envoy_type_tracing_v3_CustomTag* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_request_header(const envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_metadata(const envoy_type_tracing_v3_CustomTag* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_metadata(envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_metadata(const envoy_type_tracing_v3_CustomTag* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, NULL); + const envoy_type_tracing_v3_CustomTag_Metadata* default_val = NULL; + const envoy_type_tracing_v3_CustomTag_Metadata* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_metadata(const envoy_type_tracing_v3_CustomTag* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_tag(envoy_type_tracing_v3_CustomTag *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_literal(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Literal* value) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_mutable_literal(envoy_type_tracing_v3_CustomTag* msg, upb_Arena* arena) { struct envoy_type_tracing_v3_CustomTag_Literal* sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)envoy_type_tracing_v3_CustomTag_literal(msg); if (sub == NULL) { - sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Literal_msginit, arena); - if (!sub) return NULL; - envoy_type_tracing_v3_CustomTag_set_literal(msg, sub); + sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Literal_msg_init, arena); + if (sub) envoy_type_tracing_v3_CustomTag_set_literal(msg, sub); } return sub; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_environment(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Environment* value) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_mutable_environment(envoy_type_tracing_v3_CustomTag* msg, upb_Arena* arena) { struct envoy_type_tracing_v3_CustomTag_Environment* sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)envoy_type_tracing_v3_CustomTag_environment(msg); if (sub == NULL) { - sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Environment_msginit, arena); - if (!sub) return NULL; - envoy_type_tracing_v3_CustomTag_set_environment(msg, sub); + sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Environment_msg_init, arena); + if (sub) envoy_type_tracing_v3_CustomTag_set_environment(msg, sub); } return sub; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_request_header(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Header* value) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_mutable_request_header(envoy_type_tracing_v3_CustomTag* msg, upb_Arena* arena) { struct envoy_type_tracing_v3_CustomTag_Header* sub = (struct envoy_type_tracing_v3_CustomTag_Header*)envoy_type_tracing_v3_CustomTag_request_header(msg); if (sub == NULL) { - sub = (struct envoy_type_tracing_v3_CustomTag_Header*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Header_msginit, arena); - if (!sub) return NULL; - envoy_type_tracing_v3_CustomTag_set_request_header(msg, sub); + sub = (struct envoy_type_tracing_v3_CustomTag_Header*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Header_msg_init, arena); + if (sub) envoy_type_tracing_v3_CustomTag_set_request_header(msg, sub); } return sub; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_metadata(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Metadata* value) { - UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 24), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_mutable_metadata(envoy_type_tracing_v3_CustomTag* msg, upb_Arena* arena) { struct envoy_type_tracing_v3_CustomTag_Metadata* sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)envoy_type_tracing_v3_CustomTag_metadata(msg); if (sub == NULL) { - sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena); - if (!sub) return NULL; - envoy_type_tracing_v3_CustomTag_set_metadata(msg, sub); + sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Metadata_msg_init, arena); + if (sub) envoy_type_tracing_v3_CustomTag_set_metadata(msg, sub); } return sub; } @@ -185,12 +216,12 @@ UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v /* envoy.type.tracing.v3.CustomTag.Literal */ UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_Literal_new(upb_Arena* arena) { - return (envoy_type_tracing_v3_CustomTag_Literal*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Literal_msginit, arena); + return (envoy_type_tracing_v3_CustomTag_Literal*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Literal_msg_init, arena); } UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_Literal_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Literal* ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -200,7 +231,7 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_Custom int options, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Literal* ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -208,35 +239,41 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_Custom } UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Literal_serialize(const envoy_type_tracing_v3_CustomTag_Literal* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msg_init, 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); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Literal_clear_value(envoy_type_tracing_v3_CustomTag_Literal* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Literal_value(const envoy_type_tracing_v3_CustomTag_Literal* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Literal_set_value(envoy_type_tracing_v3_CustomTag_Literal *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.tracing.v3.CustomTag.Environment */ UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_Environment_new(upb_Arena* arena) { - return (envoy_type_tracing_v3_CustomTag_Environment*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Environment_msginit, arena); + return (envoy_type_tracing_v3_CustomTag_Environment*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Environment_msg_init, arena); } UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_Environment_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Environment* ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -246,7 +283,7 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_Cu int options, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Environment* ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -254,44 +291,56 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_Cu } UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Environment_serialize(const envoy_type_tracing_v3_CustomTag_Environment* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msg_init, 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); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_clear_name(envoy_type_tracing_v3_CustomTag_Environment* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Environment_name(const envoy_type_tracing_v3_CustomTag_Environment* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_clear_default_value(const envoy_type_tracing_v3_CustomTag_Environment* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_clear_default_value(envoy_type_tracing_v3_CustomTag_Environment* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Environment_default_value(const envoy_type_tracing_v3_CustomTag_Environment* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_name(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_default_value(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.tracing.v3.CustomTag.Header */ UPB_INLINE envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_Header_new(upb_Arena* arena) { - return (envoy_type_tracing_v3_CustomTag_Header*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Header_msginit, arena); + return (envoy_type_tracing_v3_CustomTag_Header*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Header_msg_init, arena); } UPB_INLINE envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_Header_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Header* ret = envoy_type_tracing_v3_CustomTag_Header_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -301,7 +350,7 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomT int options, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Header* ret = envoy_type_tracing_v3_CustomTag_Header_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -309,44 +358,56 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomT } UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Header_serialize(const envoy_type_tracing_v3_CustomTag_Header* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msg_init, 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); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_clear_name(envoy_type_tracing_v3_CustomTag_Header* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Header_name(const envoy_type_tracing_v3_CustomTag_Header* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_clear_default_value(const envoy_type_tracing_v3_CustomTag_Header* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_clear_default_value(envoy_type_tracing_v3_CustomTag_Header* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Header_default_value(const envoy_type_tracing_v3_CustomTag_Header* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_name(envoy_type_tracing_v3_CustomTag_Header *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_default_value(envoy_type_tracing_v3_CustomTag_Header *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.tracing.v3.CustomTag.Metadata */ UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_Metadata_new(upb_Arena* arena) { - return (envoy_type_tracing_v3_CustomTag_Metadata*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena); + return (envoy_type_tracing_v3_CustomTag_Metadata*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Metadata_msg_init, arena); } UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_Metadata_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Metadata* ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -356,7 +417,7 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_Custo int options, upb_Arena* arena) { envoy_type_tracing_v3_CustomTag_Metadata* ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -364,76 +425,92 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_Custo } UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Metadata_serialize(const envoy_type_tracing_v3_CustomTag_Metadata* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msg_init, 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); -} -UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_kind(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_kind(envoy_type_tracing_v3_CustomTag_Metadata* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_CustomTag_Metadata_kind(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_metadata_v3_MetadataKind*); + const struct envoy_type_metadata_v3_MetadataKind* default_val = NULL; + const struct envoy_type_metadata_v3_MetadataKind* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_kind(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_type_tracing_v3_CustomTag_Metadata_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_metadata_v3_MetadataKey*); + const struct envoy_type_metadata_v3_MetadataKey* default_val = NULL; + const struct envoy_type_metadata_v3_MetadataKey* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_default_value(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_default_value(envoy_type_tracing_v3_CustomTag_Metadata* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Metadata_default_value(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_kind(envoy_type_tracing_v3_CustomTag_Metadata *msg, struct envoy_type_metadata_v3_MetadataKind* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_metadata_v3_MetadataKind*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_CustomTag_Metadata_mutable_kind(envoy_type_tracing_v3_CustomTag_Metadata* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKind* sub = (struct envoy_type_metadata_v3_MetadataKind*)envoy_type_tracing_v3_CustomTag_Metadata_kind(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKind*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_msginit, arena); - if (!sub) return NULL; - envoy_type_tracing_v3_CustomTag_Metadata_set_kind(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKind*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_msg_init, arena); + if (sub) envoy_type_tracing_v3_CustomTag_Metadata_set_kind(msg, sub); } return sub; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata *msg, struct envoy_type_metadata_v3_MetadataKey* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_metadata_v3_MetadataKey*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_type_tracing_v3_CustomTag_Metadata_mutable_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata* msg, upb_Arena* arena) { struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_type_tracing_v3_CustomTag_Metadata_metadata_key(msg); if (sub == NULL) { - sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena); - if (!sub) return NULL; - envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(msg, sub); + sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msg_init, arena); + if (sub) envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(msg, sub); } return sub; } UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_default_value(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_tracing_v3_custom_tag_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_tracing_v3_custom_tag_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_ */ 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 942f94fc23e..1a39802a557 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 @@ -7,53 +7,66 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/hash_policy.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_v3_HashPolicy_submsgs[2] = { - {.submsg = &envoy_type_v3_HashPolicy_SourceIp_msginit}, - {.submsg = &envoy_type_v3_HashPolicy_FilterState_msginit}, +static const upb_MiniTableSub envoy_type_v3_HashPolicy_submsgs[2] = { + {.submsg = &envoy_type_v3_HashPolicy_SourceIp_msg_init}, + {.submsg = &envoy_type_v3_HashPolicy_FilterState_msg_init}, }; -static const upb_MiniTable_Field envoy_type_v3_HashPolicy__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_HashPolicy__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_HashPolicy_msginit = { +const upb_MiniTable envoy_type_v3_HashPolicy_msg_init = { &envoy_type_v3_HashPolicy_submsgs[0], &envoy_type_v3_HashPolicy__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable envoy_type_v3_HashPolicy_SourceIp_msginit = { +const upb_MiniTable envoy_type_v3_HashPolicy_SourceIp_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Field envoy_type_v3_HashPolicy_FilterState__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_HashPolicy_FilterState__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_HashPolicy_FilterState_msginit = { +const upb_MiniTable envoy_type_v3_HashPolicy_FilterState_msg_init = { NULL, &envoy_type_v3_HashPolicy_FilterState__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_type_v3_HashPolicy_msginit, - &envoy_type_v3_HashPolicy_SourceIp_msginit, - &envoy_type_v3_HashPolicy_FilterState_msginit, + &envoy_type_v3_HashPolicy_msg_init, + &envoy_type_v3_HashPolicy_SourceIp_msg_init, + &envoy_type_v3_HashPolicy_FilterState_msg_init, }; -const upb_MiniTable_File envoy_type_v3_hash_policy_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_hash_policy_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -62,5 +75,5 @@ const upb_MiniTable_File envoy_type_v3_hash_policy_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 837de3c6590..bad697d4c7b 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 @@ -9,38 +9,40 @@ #ifndef ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPB_H_ #define ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_HashPolicy; -struct envoy_type_v3_HashPolicy_SourceIp; -struct envoy_type_v3_HashPolicy_FilterState; typedef struct envoy_type_v3_HashPolicy envoy_type_v3_HashPolicy; typedef struct envoy_type_v3_HashPolicy_SourceIp envoy_type_v3_HashPolicy_SourceIp; typedef struct envoy_type_v3_HashPolicy_FilterState envoy_type_v3_HashPolicy_FilterState; -extern const upb_MiniTable envoy_type_v3_HashPolicy_msginit; -extern const upb_MiniTable envoy_type_v3_HashPolicy_SourceIp_msginit; -extern const upb_MiniTable envoy_type_v3_HashPolicy_FilterState_msginit; +extern const upb_MiniTable envoy_type_v3_HashPolicy_msg_init; +extern const upb_MiniTable envoy_type_v3_HashPolicy_SourceIp_msg_init; +extern const upb_MiniTable envoy_type_v3_HashPolicy_FilterState_msg_init; /* envoy.type.v3.HashPolicy */ UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_new(upb_Arena* arena) { - return (envoy_type_v3_HashPolicy*)_upb_Message_New(&envoy_type_v3_HashPolicy_msginit, arena); + return (envoy_type_v3_HashPolicy*)_upb_Message_New(&envoy_type_v3_HashPolicy_msg_init, arena); } UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_HashPolicy* ret = envoy_type_v3_HashPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +52,7 @@ UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_parse_ex(const cha int options, upb_Arena* arena) { envoy_type_v3_HashPolicy* ret = envoy_type_v3_HashPolicy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,13 +60,13 @@ UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_parse_ex(const cha } UPB_INLINE char* envoy_type_v3_HashPolicy_serialize(const envoy_type_v3_HashPolicy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -73,48 +75,61 @@ typedef enum { envoy_type_v3_HashPolicy_policy_specifier_NOT_SET = 0 } envoy_type_v3_HashPolicy_policy_specifier_oneofcases; UPB_INLINE envoy_type_v3_HashPolicy_policy_specifier_oneofcases envoy_type_v3_HashPolicy_policy_specifier_case(const envoy_type_v3_HashPolicy* msg) { - return (envoy_type_v3_HashPolicy_policy_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (envoy_type_v3_HashPolicy_policy_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_v3_HashPolicy_has_source_ip(const envoy_type_v3_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_v3_HashPolicy_clear_source_ip(const envoy_type_v3_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_SourceIp*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_type_v3_HashPolicy_clear_source_ip(envoy_type_v3_HashPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_source_ip(const envoy_type_v3_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_v3_HashPolicy_SourceIp*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const envoy_type_v3_HashPolicy_SourceIp* default_val = NULL; + const envoy_type_v3_HashPolicy_SourceIp* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_v3_HashPolicy_has_filter_state(const envoy_type_v3_HashPolicy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_type_v3_HashPolicy_has_source_ip(const envoy_type_v3_HashPolicy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_v3_HashPolicy_clear_filter_state(const envoy_type_v3_HashPolicy* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_FilterState*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_HashPolicy_policy_specifier_NOT_SET); +UPB_INLINE void envoy_type_v3_HashPolicy_clear_filter_state(envoy_type_v3_HashPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_filter_state(const envoy_type_v3_HashPolicy* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_v3_HashPolicy_FilterState*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_type_v3_HashPolicy_FilterState* default_val = NULL; + const envoy_type_v3_HashPolicy_FilterState* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_v3_HashPolicy_has_filter_state(const envoy_type_v3_HashPolicy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_v3_HashPolicy_set_source_ip(envoy_type_v3_HashPolicy *msg, envoy_type_v3_HashPolicy_SourceIp* value) { - UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_SourceIp*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_mutable_source_ip(envoy_type_v3_HashPolicy* msg, upb_Arena* arena) { struct envoy_type_v3_HashPolicy_SourceIp* sub = (struct envoy_type_v3_HashPolicy_SourceIp*)envoy_type_v3_HashPolicy_source_ip(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_HashPolicy_SourceIp*)_upb_Message_New(&envoy_type_v3_HashPolicy_SourceIp_msginit, arena); - if (!sub) return NULL; - envoy_type_v3_HashPolicy_set_source_ip(msg, sub); + sub = (struct envoy_type_v3_HashPolicy_SourceIp*)_upb_Message_New(&envoy_type_v3_HashPolicy_SourceIp_msg_init, arena); + if (sub) envoy_type_v3_HashPolicy_set_source_ip(msg, sub); } return sub; } UPB_INLINE void envoy_type_v3_HashPolicy_set_filter_state(envoy_type_v3_HashPolicy *msg, envoy_type_v3_HashPolicy_FilterState* value) { - UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_FilterState*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_mutable_filter_state(envoy_type_v3_HashPolicy* msg, upb_Arena* arena) { struct envoy_type_v3_HashPolicy_FilterState* sub = (struct envoy_type_v3_HashPolicy_FilterState*)envoy_type_v3_HashPolicy_filter_state(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_HashPolicy_FilterState*)_upb_Message_New(&envoy_type_v3_HashPolicy_FilterState_msginit, arena); - if (!sub) return NULL; - envoy_type_v3_HashPolicy_set_filter_state(msg, sub); + sub = (struct envoy_type_v3_HashPolicy_FilterState*)_upb_Message_New(&envoy_type_v3_HashPolicy_FilterState_msg_init, arena); + if (sub) envoy_type_v3_HashPolicy_set_filter_state(msg, sub); } return sub; } @@ -122,12 +137,12 @@ UPB_INLINE struct envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy /* envoy.type.v3.HashPolicy.SourceIp */ UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_new(upb_Arena* arena) { - return (envoy_type_v3_HashPolicy_SourceIp*)_upb_Message_New(&envoy_type_v3_HashPolicy_SourceIp_msginit, arena); + return (envoy_type_v3_HashPolicy_SourceIp*)_upb_Message_New(&envoy_type_v3_HashPolicy_SourceIp_msg_init, arena); } UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_HashPolicy_SourceIp* ret = envoy_type_v3_HashPolicy_SourceIp_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_SourceIp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_SourceIp_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -137,7 +152,7 @@ UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_ int options, upb_Arena* arena) { envoy_type_v3_HashPolicy_SourceIp* ret = envoy_type_v3_HashPolicy_SourceIp_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_SourceIp_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_SourceIp_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -145,13 +160,13 @@ UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_ } UPB_INLINE char* envoy_type_v3_HashPolicy_SourceIp_serialize(const envoy_type_v3_HashPolicy_SourceIp* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msg_init, options, arena, &ptr, len); return ptr; } @@ -159,12 +174,12 @@ UPB_INLINE char* envoy_type_v3_HashPolicy_SourceIp_serialize_ex(const envoy_type /* envoy.type.v3.HashPolicy.FilterState */ UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_FilterState_new(upb_Arena* arena) { - return (envoy_type_v3_HashPolicy_FilterState*)_upb_Message_New(&envoy_type_v3_HashPolicy_FilterState_msginit, arena); + return (envoy_type_v3_HashPolicy_FilterState*)_upb_Message_New(&envoy_type_v3_HashPolicy_FilterState_msg_init, arena); } UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_FilterState_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_HashPolicy_FilterState* ret = envoy_type_v3_HashPolicy_FilterState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_FilterState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_FilterState_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -174,7 +189,7 @@ UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_Filter int options, upb_Arena* arena) { envoy_type_v3_HashPolicy_FilterState* ret = envoy_type_v3_HashPolicy_FilterState_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_FilterState_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_FilterState_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -182,32 +197,38 @@ UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_Filter } UPB_INLINE char* envoy_type_v3_HashPolicy_FilterState_serialize(const envoy_type_v3_HashPolicy_FilterState* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msg_init, 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); +UPB_INLINE void envoy_type_v3_HashPolicy_FilterState_clear_key(envoy_type_v3_HashPolicy_FilterState* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView envoy_type_v3_HashPolicy_FilterState_key(const envoy_type_v3_HashPolicy_FilterState* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_HashPolicy_FilterState_set_key(envoy_type_v3_HashPolicy_FilterState *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_v3_hash_policy_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_hash_policy_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/v3/http.upb.c b/src/core/ext/upb-generated/envoy/type/v3/http.upb.c index 44ea84b6ba5..677570872f2 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/http.upb.c @@ -7,13 +7,16 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/http.upb.h" #include "udpa/annotations/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable_File envoy_type_v3_http_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_http_proto_upb_file_layout = { NULL, NULL, NULL, @@ -22,5 +25,5 @@ const upb_MiniTable_File envoy_type_v3_http_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/type/v3/http.upb.h b/src/core/ext/upb-generated/envoy/type/v3/http.upb.h index 48c5f2f97a5..0ef545c16cf 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/http.upb.h @@ -9,12 +9,17 @@ #ifndef ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_ #define ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -28,12 +33,12 @@ typedef enum { -extern const upb_MiniTable_File envoy_type_v3_http_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_http_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_ */ 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 264107bc6c3..780afc6ac00 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 @@ -7,29 +7,36 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/http_status.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_type_v3_HttpStatus__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_HttpStatus__fields[1] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_HttpStatus_msginit = { +const upb_MiniTable envoy_type_v3_HttpStatus_msg_init = { NULL, &envoy_type_v3_HttpStatus__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_v3_HttpStatus_msginit, + &envoy_type_v3_HttpStatus_msg_init, }; -const upb_MiniTable_File envoy_type_v3_http_status_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_http_status_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -38,5 +45,5 @@ const upb_MiniTable_File envoy_type_v3_http_status_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 6882f7d0835..71263fa9bcf 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 @@ -9,20 +9,24 @@ #ifndef ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPB_H_ #define ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_HttpStatus; typedef struct envoy_type_v3_HttpStatus envoy_type_v3_HttpStatus; -extern const upb_MiniTable envoy_type_v3_HttpStatus_msginit; +extern const upb_MiniTable envoy_type_v3_HttpStatus_msg_init; typedef enum { envoy_type_v3_Empty = 0, @@ -89,12 +93,12 @@ typedef enum { /* envoy.type.v3.HttpStatus */ UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_new(upb_Arena* arena) { - return (envoy_type_v3_HttpStatus*)_upb_Message_New(&envoy_type_v3_HttpStatus_msginit, arena); + return (envoy_type_v3_HttpStatus*)_upb_Message_New(&envoy_type_v3_HttpStatus_msg_init, arena); } UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_HttpStatus* ret = envoy_type_v3_HttpStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HttpStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_HttpStatus_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -104,7 +108,7 @@ UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_parse_ex(const cha int options, upb_Arena* arena) { envoy_type_v3_HttpStatus* ret = envoy_type_v3_HttpStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_HttpStatus_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_HttpStatus_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -112,32 +116,38 @@ UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_parse_ex(const cha } UPB_INLINE char* envoy_type_v3_HttpStatus_serialize(const envoy_type_v3_HttpStatus* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HttpStatus_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HttpStatus_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_HttpStatus_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_HttpStatus_msg_init, 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; +UPB_INLINE void envoy_type_v3_HttpStatus_clear_code(envoy_type_v3_HttpStatus* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_type_v3_HttpStatus_code(const envoy_type_v3_HttpStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_HttpStatus_set_code(envoy_type_v3_HttpStatus *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_v3_http_status_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_http_status_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c b/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c index fdb7e4d970a..03e3e450e7d 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c @@ -7,41 +7,54 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/percent.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_type_v3_Percent__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_Percent__fields[1] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_Percent_msginit = { +const upb_MiniTable envoy_type_v3_Percent_msg_init = { NULL, &envoy_type_v3_Percent__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + }) }; -static const upb_MiniTable_Field envoy_type_v3_FractionalPercent__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_FractionalPercent__fields[2] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_FractionalPercent_msginit = { +const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init = { NULL, &envoy_type_v3_FractionalPercent__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_type_v3_Percent_msginit, - &envoy_type_v3_FractionalPercent_msginit, + &envoy_type_v3_Percent_msg_init, + &envoy_type_v3_FractionalPercent_msg_init, }; -const upb_MiniTable_File envoy_type_v3_percent_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_percent_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -50,5 +63,5 @@ const upb_MiniTable_File envoy_type_v3_percent_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 56be5a6800d..ade9b8de14e 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 @@ -9,23 +9,26 @@ #ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_ #define ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_Percent; -struct envoy_type_v3_FractionalPercent; typedef struct envoy_type_v3_Percent envoy_type_v3_Percent; typedef struct envoy_type_v3_FractionalPercent envoy_type_v3_FractionalPercent; -extern const upb_MiniTable envoy_type_v3_Percent_msginit; -extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit; +extern const upb_MiniTable envoy_type_v3_Percent_msg_init; +extern const upb_MiniTable envoy_type_v3_FractionalPercent_msg_init; typedef enum { envoy_type_v3_FractionalPercent_HUNDRED = 0, @@ -38,12 +41,12 @@ typedef enum { /* envoy.type.v3.Percent */ UPB_INLINE envoy_type_v3_Percent* envoy_type_v3_Percent_new(upb_Arena* arena) { - return (envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena); + return (envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msg_init, arena); } UPB_INLINE envoy_type_v3_Percent* envoy_type_v3_Percent_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_Percent* ret = envoy_type_v3_Percent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_Percent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_Percent_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE envoy_type_v3_Percent* envoy_type_v3_Percent_parse_ex(const char* buf int options, upb_Arena* arena) { envoy_type_v3_Percent* ret = envoy_type_v3_Percent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_Percent_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_Percent_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,35 +64,41 @@ UPB_INLINE envoy_type_v3_Percent* envoy_type_v3_Percent_parse_ex(const char* buf } UPB_INLINE char* envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_Percent_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_Percent_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_Percent_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_Percent_msg_init, 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; +UPB_INLINE void envoy_type_v3_Percent_clear_value(envoy_type_v3_Percent* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_type_v3_Percent_value(const envoy_type_v3_Percent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_Percent_set_value(envoy_type_v3_Percent *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.v3.FractionalPercent */ UPB_INLINE envoy_type_v3_FractionalPercent* envoy_type_v3_FractionalPercent_new(upb_Arena* arena) { - return (envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena); + return (envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msg_init, arena); } UPB_INLINE envoy_type_v3_FractionalPercent* envoy_type_v3_FractionalPercent_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_FractionalPercent* ret = envoy_type_v3_FractionalPercent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -99,7 +108,7 @@ UPB_INLINE envoy_type_v3_FractionalPercent* envoy_type_v3_FractionalPercent_pars int options, upb_Arena* arena) { envoy_type_v3_FractionalPercent* ret = envoy_type_v3_FractionalPercent_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -107,41 +116,53 @@ UPB_INLINE envoy_type_v3_FractionalPercent* envoy_type_v3_FractionalPercent_pars } UPB_INLINE char* envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_FractionalPercent_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_FractionalPercent_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_FractionalPercent_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_FractionalPercent_msg_init, 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; +UPB_INLINE void envoy_type_v3_FractionalPercent_clear_numerator(envoy_type_v3_FractionalPercent* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_FractionalPercent_clear_denominator(const envoy_type_v3_FractionalPercent* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_type_v3_FractionalPercent_clear_denominator(envoy_type_v3_FractionalPercent* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_FractionalPercent_set_numerator(envoy_type_v3_FractionalPercent *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_FractionalPercent *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_v3_percent_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_percent_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_ */ 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 9f65e19ca46..0cbcbf7b664 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 @@ -7,53 +7,74 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/range.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_type_v3_Int64Range__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_Int64Range__fields[2] = { + {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_Int64Range_msginit = { +const upb_MiniTable envoy_type_v3_Int64Range_msg_init = { NULL, &envoy_type_v3_Int64Range__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + {0x000800003f000010, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_type_v3_Int32Range__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_Int32Range__fields[2] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_Int32Range_msginit = { +const upb_MiniTable envoy_type_v3_Int32Range_msg_init = { NULL, &envoy_type_v3_Int32Range__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field envoy_type_v3_DoubleRange__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_DoubleRange__fields[2] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_DoubleRange_msginit = { +const upb_MiniTable envoy_type_v3_DoubleRange_msg_init = { NULL, &envoy_type_v3_DoubleRange__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + {0x000800003f000011, &upb_psf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &envoy_type_v3_Int64Range_msginit, - &envoy_type_v3_Int32Range_msginit, - &envoy_type_v3_DoubleRange_msginit, + &envoy_type_v3_Int64Range_msg_init, + &envoy_type_v3_Int32Range_msg_init, + &envoy_type_v3_DoubleRange_msg_init, }; -const upb_MiniTable_File envoy_type_v3_range_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_range_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -62,5 +83,5 @@ const upb_MiniTable_File envoy_type_v3_range_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 a8ba4efb63d..b0a8a3837ab 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 @@ -9,38 +9,40 @@ #ifndef ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_ #define ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_Int64Range; -struct envoy_type_v3_Int32Range; -struct envoy_type_v3_DoubleRange; typedef struct envoy_type_v3_Int64Range envoy_type_v3_Int64Range; typedef struct envoy_type_v3_Int32Range envoy_type_v3_Int32Range; typedef struct envoy_type_v3_DoubleRange envoy_type_v3_DoubleRange; -extern const upb_MiniTable envoy_type_v3_Int64Range_msginit; -extern const upb_MiniTable envoy_type_v3_Int32Range_msginit; -extern const upb_MiniTable envoy_type_v3_DoubleRange_msginit; +extern const upb_MiniTable envoy_type_v3_Int64Range_msg_init; +extern const upb_MiniTable envoy_type_v3_Int32Range_msg_init; +extern const upb_MiniTable envoy_type_v3_DoubleRange_msg_init; /* envoy.type.v3.Int64Range */ UPB_INLINE envoy_type_v3_Int64Range* envoy_type_v3_Int64Range_new(upb_Arena* arena) { - return (envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msginit, arena); + return (envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msg_init, arena); } UPB_INLINE envoy_type_v3_Int64Range* envoy_type_v3_Int64Range_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_Int64Range* ret = envoy_type_v3_Int64Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_Int64Range_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +52,7 @@ UPB_INLINE envoy_type_v3_Int64Range* envoy_type_v3_Int64Range_parse_ex(const cha int options, upb_Arena* arena) { envoy_type_v3_Int64Range* ret = envoy_type_v3_Int64Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_Int64Range_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,44 +60,56 @@ UPB_INLINE envoy_type_v3_Int64Range* envoy_type_v3_Int64Range_parse_ex(const cha } UPB_INLINE char* envoy_type_v3_Int64Range_serialize(const envoy_type_v3_Int64Range* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_Int64Range_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_Int64Range_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_Int64Range_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_Int64Range_msg_init, 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; +UPB_INLINE void envoy_type_v3_Int64Range_clear_start(envoy_type_v3_Int64Range* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_type_v3_Int64Range_start(const envoy_type_v3_Int64Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_Int64Range_clear_end(const envoy_type_v3_Int64Range* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0; +UPB_INLINE void envoy_type_v3_Int64Range_clear_end(envoy_type_v3_Int64Range* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t envoy_type_v3_Int64Range_end(const envoy_type_v3_Int64Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_Int64Range_set_start(envoy_type_v3_Int64Range *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_Int64Range_set_end(envoy_type_v3_Int64Range *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.v3.Int32Range */ UPB_INLINE envoy_type_v3_Int32Range* envoy_type_v3_Int32Range_new(upb_Arena* arena) { - return (envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msginit, arena); + return (envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msg_init, arena); } UPB_INLINE envoy_type_v3_Int32Range* envoy_type_v3_Int32Range_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_Int32Range* ret = envoy_type_v3_Int32Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_Int32Range_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -105,7 +119,7 @@ UPB_INLINE envoy_type_v3_Int32Range* envoy_type_v3_Int32Range_parse_ex(const cha int options, upb_Arena* arena) { envoy_type_v3_Int32Range* ret = envoy_type_v3_Int32Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_Int32Range_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -113,44 +127,56 @@ UPB_INLINE envoy_type_v3_Int32Range* envoy_type_v3_Int32Range_parse_ex(const cha } UPB_INLINE char* envoy_type_v3_Int32Range_serialize(const envoy_type_v3_Int32Range* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_Int32Range_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_Int32Range_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_Int32Range_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_Int32Range_msg_init, 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; +UPB_INLINE void envoy_type_v3_Int32Range_clear_start(envoy_type_v3_Int32Range* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_type_v3_Int32Range_start(const envoy_type_v3_Int32Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_Int32Range_clear_end(const envoy_type_v3_Int32Range* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void envoy_type_v3_Int32Range_clear_end(envoy_type_v3_Int32Range* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_type_v3_Int32Range_end(const envoy_type_v3_Int32Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_Int32Range_set_start(envoy_type_v3_Int32Range *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_Int32Range_set_end(envoy_type_v3_Int32Range *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* envoy.type.v3.DoubleRange */ UPB_INLINE envoy_type_v3_DoubleRange* envoy_type_v3_DoubleRange_new(upb_Arena* arena) { - return (envoy_type_v3_DoubleRange*)_upb_Message_New(&envoy_type_v3_DoubleRange_msginit, arena); + return (envoy_type_v3_DoubleRange*)_upb_Message_New(&envoy_type_v3_DoubleRange_msg_init, arena); } UPB_INLINE envoy_type_v3_DoubleRange* envoy_type_v3_DoubleRange_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_DoubleRange* ret = envoy_type_v3_DoubleRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_DoubleRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -160,7 +186,7 @@ UPB_INLINE envoy_type_v3_DoubleRange* envoy_type_v3_DoubleRange_parse_ex(const c int options, upb_Arena* arena) { envoy_type_v3_DoubleRange* ret = envoy_type_v3_DoubleRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_DoubleRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -168,41 +194,53 @@ UPB_INLINE envoy_type_v3_DoubleRange* envoy_type_v3_DoubleRange_parse_ex(const c } UPB_INLINE char* envoy_type_v3_DoubleRange_serialize(const envoy_type_v3_DoubleRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_DoubleRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_DoubleRange_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_DoubleRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_DoubleRange_msg_init, 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; +UPB_INLINE void envoy_type_v3_DoubleRange_clear_start(envoy_type_v3_DoubleRange* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_type_v3_DoubleRange_start(const envoy_type_v3_DoubleRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_DoubleRange_clear_end(const envoy_type_v3_DoubleRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = 0; +UPB_INLINE void envoy_type_v3_DoubleRange_clear_end(envoy_type_v3_DoubleRange* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double envoy_type_v3_DoubleRange_end(const envoy_type_v3_DoubleRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_DoubleRange_set_start(envoy_type_v3_DoubleRange *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_DoubleRange_set_end(envoy_type_v3_DoubleRange *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_v3_range_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_range_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c index 8d4bf3eccfe..d4594739395 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/ratelimit_strategy.upb.h" #include "envoy/type/v3/ratelimit_unit.upb.h" #include "envoy/type/v3/token_bucket.upb.h" @@ -15,42 +17,55 @@ #include "udpa/annotations/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_v3_RateLimitStrategy_submsgs[2] = { - {.submsg = &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit}, - {.submsg = &envoy_type_v3_TokenBucket_msginit}, +static const upb_MiniTableSub envoy_type_v3_RateLimitStrategy_submsgs[2] = { + {.submsg = &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init}, + {.submsg = &envoy_type_v3_TokenBucket_msg_init}, }; -static const upb_MiniTable_Field envoy_type_v3_RateLimitStrategy__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_RateLimitStrategy__fields[3] = { + {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_RateLimitStrategy_msginit = { +const upb_MiniTable envoy_type_v3_RateLimitStrategy_msg_init = { &envoy_type_v3_RateLimitStrategy_submsgs[0], &envoy_type_v3_RateLimitStrategy__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_pov4_1bt}, + {0x0008000002000012, &upb_pom_1bt_max64b}, + {0x000800000301001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Field envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit__fields[2] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit__fields[2] = { + {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit = { +const upb_MiniTable envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init = { NULL, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &envoy_type_v3_RateLimitStrategy_msginit, - &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, + &envoy_type_v3_RateLimitStrategy_msg_init, + &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, }; -const upb_MiniTable_File envoy_type_v3_ratelimit_strategy_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_ratelimit_strategy_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -59,5 +74,5 @@ const upb_MiniTable_File envoy_type_v3_ratelimit_strategy_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h index ce0249e6c04..1393bc5ba14 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h @@ -9,25 +9,28 @@ #ifndef ENVOY_TYPE_V3_RATELIMIT_STRATEGY_PROTO_UPB_H_ #define ENVOY_TYPE_V3_RATELIMIT_STRATEGY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_RateLimitStrategy; -struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit; typedef struct envoy_type_v3_RateLimitStrategy envoy_type_v3_RateLimitStrategy; typedef struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit; -extern const upb_MiniTable envoy_type_v3_RateLimitStrategy_msginit; -extern const upb_MiniTable envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit; +extern const upb_MiniTable envoy_type_v3_RateLimitStrategy_msg_init; +extern const upb_MiniTable envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init; struct envoy_type_v3_TokenBucket; -extern const upb_MiniTable envoy_type_v3_TokenBucket_msginit; +extern const upb_MiniTable envoy_type_v3_TokenBucket_msg_init; typedef enum { envoy_type_v3_RateLimitStrategy_ALLOW_ALL = 0, @@ -39,12 +42,12 @@ typedef enum { /* envoy.type.v3.RateLimitStrategy */ UPB_INLINE envoy_type_v3_RateLimitStrategy* envoy_type_v3_RateLimitStrategy_new(upb_Arena* arena) { - return (envoy_type_v3_RateLimitStrategy*)_upb_Message_New(&envoy_type_v3_RateLimitStrategy_msginit, arena); + return (envoy_type_v3_RateLimitStrategy*)_upb_Message_New(&envoy_type_v3_RateLimitStrategy_msg_init, arena); } UPB_INLINE envoy_type_v3_RateLimitStrategy* envoy_type_v3_RateLimitStrategy_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_RateLimitStrategy* ret = envoy_type_v3_RateLimitStrategy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -54,7 +57,7 @@ UPB_INLINE envoy_type_v3_RateLimitStrategy* envoy_type_v3_RateLimitStrategy_pars int options, upb_Arena* arena) { envoy_type_v3_RateLimitStrategy* ret = envoy_type_v3_RateLimitStrategy_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -62,13 +65,13 @@ UPB_INLINE envoy_type_v3_RateLimitStrategy* envoy_type_v3_RateLimitStrategy_pars } UPB_INLINE char* envoy_type_v3_RateLimitStrategy_serialize(const envoy_type_v3_RateLimitStrategy* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_type_v3_RateLimitStrategy_serialize_ex(const envoy_type_v3_RateLimitStrategy* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -78,60 +81,80 @@ typedef enum { envoy_type_v3_RateLimitStrategy_strategy_NOT_SET = 0 } envoy_type_v3_RateLimitStrategy_strategy_oneofcases; UPB_INLINE envoy_type_v3_RateLimitStrategy_strategy_oneofcases envoy_type_v3_RateLimitStrategy_strategy_case(const envoy_type_v3_RateLimitStrategy* msg) { - return (envoy_type_v3_RateLimitStrategy_strategy_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (envoy_type_v3_RateLimitStrategy_strategy_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool envoy_type_v3_RateLimitStrategy_has_blanket_rule(const envoy_type_v3_RateLimitStrategy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void envoy_type_v3_RateLimitStrategy_clear_blanket_rule(const envoy_type_v3_RateLimitStrategy* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_RateLimitStrategy_strategy_NOT_SET); +UPB_INLINE void envoy_type_v3_RateLimitStrategy_clear_blanket_rule(envoy_type_v3_RateLimitStrategy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_type_v3_RateLimitStrategy_blanket_rule(const envoy_type_v3_RateLimitStrategy* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_v3_RateLimitStrategy_has_requests_per_time_unit(const envoy_type_v3_RateLimitStrategy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool envoy_type_v3_RateLimitStrategy_has_blanket_rule(const envoy_type_v3_RateLimitStrategy* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_v3_RateLimitStrategy_clear_requests_per_time_unit(const envoy_type_v3_RateLimitStrategy* msg) { - UPB_WRITE_ONEOF(msg, envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_RateLimitStrategy_strategy_NOT_SET); +UPB_INLINE void envoy_type_v3_RateLimitStrategy_clear_requests_per_time_unit(envoy_type_v3_RateLimitStrategy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* envoy_type_v3_RateLimitStrategy_requests_per_time_unit(const envoy_type_v3_RateLimitStrategy* msg) { - return UPB_READ_ONEOF(msg, const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* default_val = NULL; + const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_v3_RateLimitStrategy_has_token_bucket(const envoy_type_v3_RateLimitStrategy* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool envoy_type_v3_RateLimitStrategy_has_requests_per_time_unit(const envoy_type_v3_RateLimitStrategy* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_v3_RateLimitStrategy_clear_token_bucket(const envoy_type_v3_RateLimitStrategy* msg) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_TokenBucket*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_RateLimitStrategy_strategy_NOT_SET); +UPB_INLINE void envoy_type_v3_RateLimitStrategy_clear_token_bucket(envoy_type_v3_RateLimitStrategy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct envoy_type_v3_TokenBucket* envoy_type_v3_RateLimitStrategy_token_bucket(const envoy_type_v3_RateLimitStrategy* msg) { - return UPB_READ_ONEOF(msg, const struct envoy_type_v3_TokenBucket*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const struct envoy_type_v3_TokenBucket* default_val = NULL; + const struct envoy_type_v3_TokenBucket* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_v3_RateLimitStrategy_has_token_bucket(const envoy_type_v3_RateLimitStrategy* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_v3_RateLimitStrategy_set_blanket_rule(envoy_type_v3_RateLimitStrategy *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_RateLimitStrategy_set_requests_per_time_unit(envoy_type_v3_RateLimitStrategy *msg, envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* value) { - UPB_WRITE_ONEOF(msg, envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* envoy_type_v3_RateLimitStrategy_mutable_requests_per_time_unit(envoy_type_v3_RateLimitStrategy* msg, upb_Arena* arena) { struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* sub = (struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*)envoy_type_v3_RateLimitStrategy_requests_per_time_unit(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*)_upb_Message_New(&envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, arena); - if (!sub) return NULL; - envoy_type_v3_RateLimitStrategy_set_requests_per_time_unit(msg, sub); + sub = (struct envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*)_upb_Message_New(&envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, arena); + if (sub) envoy_type_v3_RateLimitStrategy_set_requests_per_time_unit(msg, sub); } return sub; } UPB_INLINE void envoy_type_v3_RateLimitStrategy_set_token_bucket(envoy_type_v3_RateLimitStrategy *msg, struct envoy_type_v3_TokenBucket* value) { - UPB_WRITE_ONEOF(msg, struct envoy_type_v3_TokenBucket*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct envoy_type_v3_TokenBucket* envoy_type_v3_RateLimitStrategy_mutable_token_bucket(envoy_type_v3_RateLimitStrategy* msg, upb_Arena* arena) { struct envoy_type_v3_TokenBucket* sub = (struct envoy_type_v3_TokenBucket*)envoy_type_v3_RateLimitStrategy_token_bucket(msg); if (sub == NULL) { - sub = (struct envoy_type_v3_TokenBucket*)_upb_Message_New(&envoy_type_v3_TokenBucket_msginit, arena); - if (!sub) return NULL; - envoy_type_v3_RateLimitStrategy_set_token_bucket(msg, sub); + sub = (struct envoy_type_v3_TokenBucket*)_upb_Message_New(&envoy_type_v3_TokenBucket_msg_init, arena); + if (sub) envoy_type_v3_RateLimitStrategy_set_token_bucket(msg, sub); } return sub; } @@ -139,12 +162,12 @@ UPB_INLINE struct envoy_type_v3_TokenBucket* envoy_type_v3_RateLimitStrategy_mut /* envoy.type.v3.RateLimitStrategy.RequestsPerTimeUnit */ UPB_INLINE envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_new(upb_Arena* arena) { - return (envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*)_upb_Message_New(&envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, arena); + return (envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit*)_upb_Message_New(&envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, arena); } UPB_INLINE envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* ret = envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -154,7 +177,7 @@ UPB_INLINE envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* envoy_type_v3_Ra int options, upb_Arena* arena) { envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* ret = envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -162,41 +185,53 @@ UPB_INLINE envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* envoy_type_v3_Ra } UPB_INLINE char* envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_serialize(const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_serialize_ex(const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_clear_requests_per_time_unit(const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = 0; +UPB_INLINE void envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_clear_requests_per_time_unit(envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_requests_per_time_unit(const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_clear_time_unit(const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_clear_time_unit(envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_time_unit(const envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_set_requests_per_time_unit(envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit_set_time_unit(envoy_type_v3_RateLimitStrategy_RequestsPerTimeUnit *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_v3_ratelimit_strategy_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_ratelimit_strategy_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_RATELIMIT_STRATEGY_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c index 4af6515f30a..664ef84ae27 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c @@ -7,13 +7,16 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/ratelimit_unit.upb.h" #include "udpa/annotations/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable_File envoy_type_v3_ratelimit_unit_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_ratelimit_unit_proto_upb_file_layout = { NULL, NULL, NULL, @@ -22,5 +25,5 @@ const upb_MiniTable_File envoy_type_v3_ratelimit_unit_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h index fcf8312023a..908af779007 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h @@ -9,12 +9,17 @@ #ifndef ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPB_H_ #define ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -32,12 +37,12 @@ typedef enum { -extern const upb_MiniTable_File envoy_type_v3_ratelimit_unit_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_ratelimit_unit_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPB_H_ */ 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 38e75e0ec1b..e850b3fd77e 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 @@ -7,30 +7,39 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/semantic_version.upb.h" #include "udpa/annotations/status.upb.h" #include "udpa/annotations/versioning.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field envoy_type_v3_SemanticVersion__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_SemanticVersion__fields[3] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 8, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_SemanticVersion_msginit = { +const upb_MiniTable envoy_type_v3_SemanticVersion_msg_init = { NULL, &envoy_type_v3_SemanticVersion__fields[0], - UPB_SIZE(16, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + 16, 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x000800003f000018, &upb_psv4_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_v3_SemanticVersion_msginit, + &envoy_type_v3_SemanticVersion_msg_init, }; -const upb_MiniTable_File envoy_type_v3_semantic_version_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_semantic_version_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -39,5 +48,5 @@ const upb_MiniTable_File envoy_type_v3_semantic_version_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 98025bd5ac2..74df54bb792 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 @@ -9,32 +9,36 @@ #ifndef ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_ #define ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_SemanticVersion; typedef struct envoy_type_v3_SemanticVersion envoy_type_v3_SemanticVersion; -extern const upb_MiniTable envoy_type_v3_SemanticVersion_msginit; +extern const upb_MiniTable envoy_type_v3_SemanticVersion_msg_init; /* envoy.type.v3.SemanticVersion */ UPB_INLINE envoy_type_v3_SemanticVersion* envoy_type_v3_SemanticVersion_new(upb_Arena* arena) { - return (envoy_type_v3_SemanticVersion*)_upb_Message_New(&envoy_type_v3_SemanticVersion_msginit, arena); + return (envoy_type_v3_SemanticVersion*)_upb_Message_New(&envoy_type_v3_SemanticVersion_msg_init, arena); } UPB_INLINE envoy_type_v3_SemanticVersion* envoy_type_v3_SemanticVersion_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_SemanticVersion* ret = envoy_type_v3_SemanticVersion_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE envoy_type_v3_SemanticVersion* envoy_type_v3_SemanticVersion_parse_ex int options, upb_Arena* arena) { envoy_type_v3_SemanticVersion* ret = envoy_type_v3_SemanticVersion_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,50 +56,68 @@ UPB_INLINE envoy_type_v3_SemanticVersion* envoy_type_v3_SemanticVersion_parse_ex } UPB_INLINE char* envoy_type_v3_SemanticVersion_serialize(const envoy_type_v3_SemanticVersion* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_SemanticVersion_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_SemanticVersion_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_SemanticVersion_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_SemanticVersion_msg_init, 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; +UPB_INLINE void envoy_type_v3_SemanticVersion_clear_major_number(envoy_type_v3_SemanticVersion* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_major_number(const envoy_type_v3_SemanticVersion* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_SemanticVersion_clear_minor_number(const envoy_type_v3_SemanticVersion* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE void envoy_type_v3_SemanticVersion_clear_minor_number(envoy_type_v3_SemanticVersion* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_minor_number(const envoy_type_v3_SemanticVersion* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void envoy_type_v3_SemanticVersion_clear_patch(const envoy_type_v3_SemanticVersion* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0; +UPB_INLINE void envoy_type_v3_SemanticVersion_clear_patch(envoy_type_v3_SemanticVersion* msg) { + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_patch(const envoy_type_v3_SemanticVersion* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void envoy_type_v3_SemanticVersion_set_major_number(envoy_type_v3_SemanticVersion *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_SemanticVersion_set_minor_number(envoy_type_v3_SemanticVersion *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_SemanticVersion_set_patch(envoy_type_v3_SemanticVersion *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value; + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File envoy_type_v3_semantic_version_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_semantic_version_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c b/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c index f5b2a2dded8..75b1cf31d1d 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "envoy/type/v3/token_bucket.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" @@ -15,30 +17,37 @@ #include "udpa/annotations/versioning.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub envoy_type_v3_TokenBucket_submsgs[2] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub envoy_type_v3_TokenBucket_submsgs[2] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field envoy_type_v3_TokenBucket__fields[3] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField envoy_type_v3_TokenBucket__fields[3] = { + {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable envoy_type_v3_TokenBucket_msginit = { +const upb_MiniTable envoy_type_v3_TokenBucket_msg_init = { &envoy_type_v3_TokenBucket_submsgs[0], &envoy_type_v3_TokenBucket__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x001000000201001a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &envoy_type_v3_TokenBucket_msginit, + &envoy_type_v3_TokenBucket_msg_init, }; -const upb_MiniTable_File envoy_type_v3_token_bucket_proto_upb_file_layout = { +const upb_MiniTableFile envoy_type_v3_token_bucket_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -47,5 +56,5 @@ const upb_MiniTable_File envoy_type_v3_token_bucket_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 7ebf2314c95..be108a169ac 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 @@ -9,36 +9,40 @@ #ifndef ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPB_H_ #define ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct envoy_type_v3_TokenBucket; typedef struct envoy_type_v3_TokenBucket envoy_type_v3_TokenBucket; -extern const upb_MiniTable envoy_type_v3_TokenBucket_msginit; +extern const upb_MiniTable envoy_type_v3_TokenBucket_msg_init; struct google_protobuf_Duration; struct google_protobuf_UInt32Value; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* envoy.type.v3.TokenBucket */ UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_new(upb_Arena* arena) { - return (envoy_type_v3_TokenBucket*)_upb_Message_New(&envoy_type_v3_TokenBucket_msginit, arena); + return (envoy_type_v3_TokenBucket*)_upb_Message_New(&envoy_type_v3_TokenBucket_msg_init, arena); } UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_parse(const char* buf, size_t size, upb_Arena* arena) { envoy_type_v3_TokenBucket* ret = envoy_type_v3_TokenBucket_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_TokenBucket_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &envoy_type_v3_TokenBucket_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -48,7 +52,7 @@ UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_parse_ex(const c int options, upb_Arena* arena) { envoy_type_v3_TokenBucket* ret = envoy_type_v3_TokenBucket_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &envoy_type_v3_TokenBucket_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &envoy_type_v3_TokenBucket_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -56,76 +60,92 @@ UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_parse_ex(const c } UPB_INLINE char* envoy_type_v3_TokenBucket_serialize(const envoy_type_v3_TokenBucket* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_TokenBucket_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_TokenBucket_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &envoy_type_v3_TokenBucket_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &envoy_type_v3_TokenBucket_msg_init, 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; +UPB_INLINE void envoy_type_v3_TokenBucket_clear_max_tokens(envoy_type_v3_TokenBucket* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t envoy_type_v3_TokenBucket_max_tokens(const envoy_type_v3_TokenBucket* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_v3_TokenBucket_has_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void envoy_type_v3_TokenBucket_clear_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_v3_TokenBucket_clear_tokens_per_fill(envoy_type_v3_TokenBucket* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_type_v3_TokenBucket_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool envoy_type_v3_TokenBucket_has_fill_interval(const envoy_type_v3_TokenBucket* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool envoy_type_v3_TokenBucket_has_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) { + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void envoy_type_v3_TokenBucket_clear_fill_interval(const envoy_type_v3_TokenBucket* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void envoy_type_v3_TokenBucket_clear_fill_interval(envoy_type_v3_TokenBucket* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* envoy_type_v3_TokenBucket_fill_interval(const envoy_type_v3_TokenBucket* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool envoy_type_v3_TokenBucket_has_fill_interval(const envoy_type_v3_TokenBucket* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void envoy_type_v3_TokenBucket_set_max_tokens(envoy_type_v3_TokenBucket *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void envoy_type_v3_TokenBucket_set_tokens_per_fill(envoy_type_v3_TokenBucket *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, 8, 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_v3_TokenBucket_mutable_tokens_per_fill(envoy_type_v3_TokenBucket* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_type_v3_TokenBucket_tokens_per_fill(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - envoy_type_v3_TokenBucket_set_tokens_per_fill(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) envoy_type_v3_TokenBucket_set_tokens_per_fill(msg, sub); } return sub; } UPB_INLINE void envoy_type_v3_TokenBucket_set_fill_interval(envoy_type_v3_TokenBucket *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* envoy_type_v3_TokenBucket_mutable_fill_interval(envoy_type_v3_TokenBucket* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_type_v3_TokenBucket_fill_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - envoy_type_v3_TokenBucket_set_fill_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) envoy_type_v3_TokenBucket_set_fill_interval(msg, sub); } return sub; } -extern const upb_MiniTable_File envoy_type_v3_token_bucket_proto_upb_file_layout; +extern const upb_MiniTableFile envoy_type_v3_token_bucket_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/google/api/annotations.upb.c b/src/core/ext/upb-generated/google/api/annotations.upb.c index c446cfd21be..1b0f3f4f92c 100644 --- a/src/core/ext/upb-generated/google/api/annotations.upb.c +++ b/src/core/ext/upb-generated/google/api/annotations.upb.c @@ -7,27 +7,30 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/api/annotations.upb.h" #include "google/api/http.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -extern const upb_MiniTable google_api_HttpRule_msginit; -extern const upb_MiniTable google_protobuf_MethodOptions_msginit; -const upb_MiniTable_Extension google_api_http_ext = { - {72295728, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_MethodOptions_msginit, - {.submsg = &google_api_HttpRule_msginit}, +extern const upb_MiniTable google_api_HttpRule_msg_init; +extern const upb_MiniTable google_protobuf_MethodOptions_msg_init; +const upb_MiniTableExtension google_api_http_ext = { + {72295728, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MethodOptions_msg_init, + {.submsg = &google_api_HttpRule_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &google_api_http_ext, }; -const upb_MiniTable_File google_api_annotations_proto_upb_file_layout = { +const upb_MiniTableFile google_api_annotations_proto_upb_file_layout = { NULL, NULL, extensions_layout, @@ -36,5 +39,5 @@ const upb_MiniTable_File google_api_annotations_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 60df095cbaa..b0d29a3be88 100644 --- a/src/core/ext/upb-generated/google/api/annotations.upb.h +++ b/src/core/ext/upb-generated/google/api/annotations.upb.h @@ -9,45 +9,55 @@ #ifndef GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_ #define GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -extern const upb_MiniTable_Extension google_api_http_ext; +extern const upb_MiniTableExtension google_api_http_ext; struct google_protobuf_MethodOptions; -extern const upb_MiniTable google_protobuf_MethodOptions_msginit; +extern const upb_MiniTable google_protobuf_MethodOptions_msg_init; UPB_INLINE bool google_api_has_http(const struct google_protobuf_MethodOptions* msg) { - return _upb_Message_Getext(msg, &google_api_http_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &google_api_http_ext); } UPB_INLINE void google_api_clear_http(struct google_protobuf_MethodOptions* msg) { - _upb_Message_Clearext(msg, &google_api_http_ext); + _upb_Message_ClearExtensionField(msg, &google_api_http_ext); } UPB_INLINE const struct google_api_HttpRule* google_api_http(const struct google_protobuf_MethodOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &google_api_http_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const struct google_api_HttpRule*); + const upb_MiniTableExtension* ext = &google_api_http_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const struct google_api_HttpRule* default_val = NULL; + const struct google_api_HttpRule* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &google_api_http_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const struct google_api_HttpRule*) = ext; +UPB_INLINE void google_api_set_http(struct google_protobuf_MethodOptions* msg, const struct google_api_HttpRule* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &google_api_http_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File google_api_annotations_proto_upb_file_layout; +extern const upb_MiniTableFile google_api_annotations_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_ */ 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 416ce312a8d..ecb5b274035 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 @@ -7,258 +7,359 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/api/expr/v1alpha1/checked.upb.h" #include "google/api/expr/v1alpha1/syntax.upb.h" #include "google/protobuf/empty.upb.h" #include "google/protobuf/struct.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = { - {.submsg = &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit}, - {.submsg = &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_SourceInfo_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = { + {.submsg = &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msg_init}, + {.submsg = &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_SourceInfo_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr__fields[4] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_CheckedExpr__fields[4] = { + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msg_init = { &google_api_expr_v1alpha1_CheckedExpr_submsgs[0], &google_api_expr_v1alpha1_CheckedExpr__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0018000001020022, &upb_psm_1bt_maxmaxb}, + {0x002000000203002a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Reference_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Reference_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msg_init = { &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[0], &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msg_init = { &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[0], &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_submsgs[7] = { - {.submsg = &google_protobuf_Empty_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_ListType_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_MapType_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_FunctionType_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, - {.submsg = &google_protobuf_Empty_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_AbstractType_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Type_submsgs[7] = { + {.submsg = &google_protobuf_Empty_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_ListType_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_MapType_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_FunctionType_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, + {.submsg = &google_protobuf_Empty_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_AbstractType_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Type__fields[13] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Type__fields[13] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Type_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Type_msg_init = { &google_api_expr_v1alpha1_Type_submsgs[0], &google_api_expr_v1alpha1_Type__fields[0], - UPB_SIZE(16, 24), 13, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(16, 24), 13, kUpb_ExtMode_NonExtendable, 12, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + {0x0008000002000010, &upb_pov4_1bt}, + {0x0008000003000018, &upb_pov4_1bt}, + {0x0008000004000020, &upb_pov4_1bt}, + {0x0008000005000028, &upb_pov4_1bt}, + {0x0008000006010032, &upb_pom_1bt_max64b}, + {0x000800000702003a, &upb_pom_1bt_max64b}, + {0x0008000008030042, &upb_pom_1bt_max64b}, + {0x000800000900004a, &upb_pos_1bt}, + {0x000800000a000052, &upb_pos_1bt}, + {0x000800000b04005a, &upb_pom_1bt_max64b}, + {0x000800000c050062, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000e060072, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_ListType_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Type_ListType_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_ListType__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Type_ListType__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Type_ListType_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Type_ListType_msg_init = { &google_api_expr_v1alpha1_Type_ListType_submsgs[0], &google_api_expr_v1alpha1_Type_ListType__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_MapType_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Type_MapType_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_MapType__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Type_MapType__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Type_MapType_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Type_MapType_msg_init = { &google_api_expr_v1alpha1_Type_MapType_submsgs[0], &google_api_expr_v1alpha1_Type_MapType__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_FunctionType_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Type_FunctionType_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_FunctionType__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Type_FunctionType__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Type_FunctionType_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Type_FunctionType_msg_init = { &google_api_expr_v1alpha1_Type_FunctionType_submsgs[0], &google_api_expr_v1alpha1_Type_FunctionType__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_AbstractType__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Type_AbstractType__fields[2] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Type_AbstractType_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Type_AbstractType_msg_init = { &google_api_expr_v1alpha1_Type_AbstractType_submsgs[0], &google_api_expr_v1alpha1_Type_AbstractType__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Decl_IdentDecl_msginit}, - {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Decl_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Decl_IdentDecl_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Decl__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Decl_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Decl_msg_init = { &google_api_expr_v1alpha1_Decl_submsgs[0], &google_api_expr_v1alpha1_Decl__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pom_1bt_max64b}, + {0x001800000301001a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, - {.submsg = &google_api_expr_v1alpha1_Constant_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Constant_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Decl_IdentDecl_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Decl_IdentDecl_msg_init = { &google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[0], &google_api_expr_v1alpha1_Decl_IdentDecl__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x001800003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_FunctionDecl__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Decl_FunctionDecl__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init = { &google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[0], &google_api_expr_v1alpha1_Decl_FunctionDecl__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, - {.submsg = &google_api_expr_v1alpha1_Type_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Type_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[6] = { + {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init = { &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[0], &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[0], - UPB_SIZE(32, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000003f00001a, &upb_prs_1bt}, + {0x0028000001010022, &upb_psm_1bt_max64b}, + {0x000100003f000028, &upb_psb1_1bt}, + {0x003000003f000032, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Reference_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Constant_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Reference_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Constant_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Reference__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Reference__fields[3] = { + {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Reference_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Reference_msg_init = { &google_api_expr_v1alpha1_Reference_submsgs[0], &google_api_expr_v1alpha1_Reference__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00001a, &upb_prs_1bt}, + {0x0020000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[13] = { - &google_api_expr_v1alpha1_CheckedExpr_msginit, - &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit, - &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit, - &google_api_expr_v1alpha1_Type_msginit, - &google_api_expr_v1alpha1_Type_ListType_msginit, - &google_api_expr_v1alpha1_Type_MapType_msginit, - &google_api_expr_v1alpha1_Type_FunctionType_msginit, - &google_api_expr_v1alpha1_Type_AbstractType_msginit, - &google_api_expr_v1alpha1_Decl_msginit, - &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, - &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, - &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, - &google_api_expr_v1alpha1_Reference_msginit, + &google_api_expr_v1alpha1_CheckedExpr_msg_init, + &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msg_init, + &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msg_init, + &google_api_expr_v1alpha1_Type_msg_init, + &google_api_expr_v1alpha1_Type_ListType_msg_init, + &google_api_expr_v1alpha1_Type_MapType_msg_init, + &google_api_expr_v1alpha1_Type_FunctionType_msg_init, + &google_api_expr_v1alpha1_Type_AbstractType_msg_init, + &google_api_expr_v1alpha1_Decl_msg_init, + &google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, + &google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, + &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, + &google_api_expr_v1alpha1_Reference_msg_init, }; -const upb_MiniTable_File google_api_expr_v1alpha1_checked_proto_upb_file_layout = { +const upb_MiniTableFile google_api_expr_v1alpha1_checked_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -267,5 +368,5 @@ const upb_MiniTable_File google_api_expr_v1alpha1_checked_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 62875b994ca..5c8eeca2fc6 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 @@ -9,30 +9,22 @@ #ifndef GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_ #define GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_api_expr_v1alpha1_CheckedExpr; -struct google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry; -struct google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry; -struct google_api_expr_v1alpha1_Type; -struct google_api_expr_v1alpha1_Type_ListType; -struct google_api_expr_v1alpha1_Type_MapType; -struct google_api_expr_v1alpha1_Type_FunctionType; -struct google_api_expr_v1alpha1_Type_AbstractType; -struct google_api_expr_v1alpha1_Decl; -struct google_api_expr_v1alpha1_Decl_IdentDecl; -struct google_api_expr_v1alpha1_Decl_FunctionDecl; -struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload; -struct google_api_expr_v1alpha1_Reference; typedef struct google_api_expr_v1alpha1_CheckedExpr google_api_expr_v1alpha1_CheckedExpr; typedef struct google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry; typedef struct google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry; @@ -46,27 +38,27 @@ typedef struct google_api_expr_v1alpha1_Decl_IdentDecl google_api_expr_v1alpha1_ typedef struct google_api_expr_v1alpha1_Decl_FunctionDecl google_api_expr_v1alpha1_Decl_FunctionDecl; typedef struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload google_api_expr_v1alpha1_Decl_FunctionDecl_Overload; typedef struct google_api_expr_v1alpha1_Reference google_api_expr_v1alpha1_Reference; -extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Type_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Type_ListType_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Type_MapType_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Type_FunctionType_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Type_AbstractType_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Decl_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Decl_IdentDecl_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Reference_msginit; +extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Type_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Type_ListType_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Type_MapType_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Type_FunctionType_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Type_AbstractType_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Decl_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Decl_IdentDecl_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Reference_msg_init; struct google_api_expr_v1alpha1_Constant; struct google_api_expr_v1alpha1_Expr; struct google_api_expr_v1alpha1_SourceInfo; struct google_protobuf_Empty; -extern const upb_MiniTable google_api_expr_v1alpha1_Constant_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msginit; -extern const upb_MiniTable google_protobuf_Empty_msginit; +extern const upb_MiniTable google_api_expr_v1alpha1_Constant_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msg_init; +extern const upb_MiniTable google_protobuf_Empty_msg_init; typedef enum { google_api_expr_v1alpha1_Type_PRIMITIVE_TYPE_UNSPECIFIED = 0, @@ -90,12 +82,12 @@ typedef enum { /* google.api.expr.v1alpha1.CheckedExpr */ UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_CheckedExpr_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena); + return (google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_CheckedExpr_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_CheckedExpr* ret = google_api_expr_v1alpha1_CheckedExpr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -105,7 +97,7 @@ UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_Checke int options, upb_Arena* arena) { google_api_expr_v1alpha1_CheckedExpr* ret = google_api_expr_v1alpha1_CheckedExpr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -113,107 +105,163 @@ UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_Checke } UPB_INLINE char* google_api_expr_v1alpha1_CheckedExpr_serialize(const google_api_expr_v1alpha1_CheckedExpr* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msg_init, 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)); -} -UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_reference_map(const google_api_expr_v1alpha1_CheckedExpr* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_reference_map(google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t google_api_expr_v1alpha1_CheckedExpr_reference_map_size(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(4, 8)); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_get(const google_api_expr_v1alpha1_CheckedExpr* msg, int64_t key, google_api_expr_v1alpha1_Reference** val) { - return _upb_msg_map_get(msg, UPB_SIZE(4, 8), &key, sizeof(key), val, sizeof(*val)); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, sizeof(key), val, sizeof(*val)); } UPB_INLINE const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* google_api_expr_v1alpha1_CheckedExpr_reference_map_next(const google_api_expr_v1alpha1_CheckedExpr* msg, size_t* iter) { - return (const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_type_map(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); +UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_reference_map(const google_api_expr_v1alpha1_CheckedExpr* msg) { + return google_api_expr_v1alpha1_CheckedExpr_reference_map_size(msg) != 0; } -UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_type_map(const google_api_expr_v1alpha1_CheckedExpr* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_type_map(google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t google_api_expr_v1alpha1_CheckedExpr_type_map_size(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(8, 16)); + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_get(const google_api_expr_v1alpha1_CheckedExpr* msg, int64_t key, google_api_expr_v1alpha1_Type** val) { - return _upb_msg_map_get(msg, UPB_SIZE(8, 16), &key, sizeof(key), val, sizeof(*val)); + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, sizeof(key), val, sizeof(*val)); } UPB_INLINE const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* google_api_expr_v1alpha1_CheckedExpr_type_map_next(const google_api_expr_v1alpha1_CheckedExpr* msg, size_t* iter) { - return (const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_expr(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_type_map(const google_api_expr_v1alpha1_CheckedExpr* msg) { + return google_api_expr_v1alpha1_CheckedExpr_type_map_size(msg) != 0; } -UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_expr(const google_api_expr_v1alpha1_CheckedExpr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_expr(google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_CheckedExpr_expr(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_api_expr_v1alpha1_Expr*); + const struct google_api_expr_v1alpha1_Expr* default_val = NULL; + const struct google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_source_info(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_expr(const google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_source_info(const google_api_expr_v1alpha1_CheckedExpr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_source_info(google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_CheckedExpr_source_info(const google_api_expr_v1alpha1_CheckedExpr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_api_expr_v1alpha1_SourceInfo*); + const struct google_api_expr_v1alpha1_SourceInfo* default_val = NULL; + const struct google_api_expr_v1alpha1_SourceInfo* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_source_info(const google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_reference_map_clear(google_api_expr_v1alpha1_CheckedExpr* msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); } +UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_reference_map_clear(google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_set(google_api_expr_v1alpha1_CheckedExpr* msg, int64_t key, google_api_expr_v1alpha1_Reference* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, sizeof(key), &val, sizeof(val), a); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, sizeof(key), sizeof(val), a); + return _upb_Map_Insert(map, &key, sizeof(key), &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_delete(google_api_expr_v1alpha1_CheckedExpr* msg, int64_t key) { - return _upb_msg_map_delete(msg, UPB_SIZE(4, 8), &key, sizeof(key)); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, sizeof(key), NULL); } UPB_INLINE google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* google_api_expr_v1alpha1_CheckedExpr_reference_map_nextmutable(google_api_expr_v1alpha1_CheckedExpr* msg, size_t* iter) { - return (google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_map_next(map, iter); +} +UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_type_map_clear(google_api_expr_v1alpha1_CheckedExpr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_type_map_clear(google_api_expr_v1alpha1_CheckedExpr* msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 16)); } UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_set(google_api_expr_v1alpha1_CheckedExpr* msg, int64_t key, google_api_expr_v1alpha1_Type* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(8, 16), &key, sizeof(key), &val, sizeof(val), a); + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, sizeof(key), sizeof(val), a); + return _upb_Map_Insert(map, &key, sizeof(key), &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_delete(google_api_expr_v1alpha1_CheckedExpr* msg, int64_t key) { - return _upb_msg_map_delete(msg, UPB_SIZE(8, 16), &key, sizeof(key)); + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, sizeof(key), NULL); } UPB_INLINE google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* google_api_expr_v1alpha1_CheckedExpr_type_map_nextmutable(google_api_expr_v1alpha1_CheckedExpr* msg, size_t* iter) { - return (google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_map_next(map, iter); } UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_set_expr(google_api_expr_v1alpha1_CheckedExpr *msg, struct google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_CheckedExpr_mutable_expr(google_api_expr_v1alpha1_CheckedExpr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_CheckedExpr_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_CheckedExpr_set_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_CheckedExpr_set_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_set_source_info(google_api_expr_v1alpha1_CheckedExpr *msg, struct google_api_expr_v1alpha1_SourceInfo* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_api_expr_v1alpha1_SourceInfo*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_CheckedExpr_mutable_source_info(google_api_expr_v1alpha1_CheckedExpr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_SourceInfo* sub = (struct google_api_expr_v1alpha1_SourceInfo*)google_api_expr_v1alpha1_CheckedExpr_source_info(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_CheckedExpr_set_source_info(msg, sub); + sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msg_init, arena); + if (sub) google_api_expr_v1alpha1_CheckedExpr_set_source_info(msg, sub); } return sub; } @@ -225,14 +273,15 @@ UPB_INLINE int64_t google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_key(co _upb_msg_map_key(msg, &ret, sizeof(ret)); return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* msg) { google_api_expr_v1alpha1_Reference* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_set_value(google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg, google_api_expr_v1alpha1_Reference* value) { _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Reference*)); @@ -245,14 +294,15 @@ UPB_INLINE int64_t google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_key(const g _upb_msg_map_key(msg, &ret, sizeof(ret)); return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* msg) { google_api_expr_v1alpha1_Type* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_set_value(google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg, google_api_expr_v1alpha1_Type* value) { _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Type*)); @@ -261,12 +311,12 @@ UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_set_value(goog /* google.api.expr.v1alpha1.Type */ UPB_INLINE google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); + return (google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Type* ret = google_api_expr_v1alpha1_Type_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -276,7 +326,7 @@ UPB_INLINE google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_parse_ex int options, upb_Arena* arena) { google_api_expr_v1alpha1_Type* ret = google_api_expr_v1alpha1_Type_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -284,13 +334,13 @@ UPB_INLINE google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_parse_ex } UPB_INLINE char* google_api_expr_v1alpha1_Type_serialize(const google_api_expr_v1alpha1_Type* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -310,225 +360,310 @@ typedef enum { google_api_expr_v1alpha1_Type_type_kind_NOT_SET = 0 } google_api_expr_v1alpha1_Type_type_kind_oneofcases; UPB_INLINE google_api_expr_v1alpha1_Type_type_kind_oneofcases google_api_expr_v1alpha1_Type_type_kind_case(const google_api_expr_v1alpha1_Type* msg) { - return (google_api_expr_v1alpha1_Type_type_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Type_type_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_dyn(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_dyn(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_dyn(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_dyn(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const struct google_protobuf_Empty* default_val = NULL; + const struct google_protobuf_Empty* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_null(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_dyn(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_null(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_null(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_Type_null(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_primitive(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_null(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_primitive(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_primitive(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_Type_primitive(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_wrapper(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_primitive(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_wrapper(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_wrapper(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_Type_wrapper(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_well_known(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_wrapper(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_well_known(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_well_known(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_Type_well_known(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_list_type(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_well_known(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_list_type(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_list_type(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_list_type(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const google_api_expr_v1alpha1_Type_ListType* default_val = NULL; + const google_api_expr_v1alpha1_Type_ListType* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_map_type(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_list_type(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_map_type(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_map_type(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_map_type(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const google_api_expr_v1alpha1_Type_MapType* default_val = NULL; + const google_api_expr_v1alpha1_Type_MapType* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_function(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_map_type(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_function(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_function(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_function(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const google_api_expr_v1alpha1_Type_FunctionType* default_val = NULL; + const google_api_expr_v1alpha1_Type_FunctionType* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_message_type(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_function(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_message_type(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_message_type(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Type_message_type(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type_param(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_message_type(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_type_param(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_type_param(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Type_type_param(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type_param(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_type(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_type(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_type(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 11, NULL); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_error(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 12; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_error(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_error(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_error(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 12, NULL); + const struct google_protobuf_Empty* default_val = NULL; + const struct google_protobuf_Empty* ret; + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_has_abstract_type(const google_api_expr_v1alpha1_Type* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 14; +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_error(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_clear_abstract_type(const google_api_expr_v1alpha1_Type* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Type_clear_abstract_type(google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_abstract_type(const google_api_expr_v1alpha1_Type* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 14, NULL); + const google_api_expr_v1alpha1_Type_AbstractType* default_val = NULL; + const google_api_expr_v1alpha1_Type_AbstractType* ret; + const upb_MiniTableField field = {14, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Type_has_abstract_type(const google_api_expr_v1alpha1_Type* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_dyn(google_api_expr_v1alpha1_Type *msg, struct google_protobuf_Empty* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_dyn(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)google_api_expr_v1alpha1_Type_dyn(msg); if (sub == NULL) { - sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_dyn(msg, sub); + sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_dyn(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_set_null(google_api_expr_v1alpha1_Type *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_primitive(google_api_expr_v1alpha1_Type *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_wrapper(google_api_expr_v1alpha1_Type *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_well_known(google_api_expr_v1alpha1_Type *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 8), -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_list_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_ListType* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_mutable_list_type(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type_ListType* sub = (struct google_api_expr_v1alpha1_Type_ListType*)google_api_expr_v1alpha1_Type_list_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type_ListType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_ListType_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_list_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type_ListType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_ListType_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_list_type(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_set_map_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_MapType* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_mutable_map_type(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type_MapType* sub = (struct google_api_expr_v1alpha1_Type_MapType*)google_api_expr_v1alpha1_Type_map_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type_MapType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_MapType_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_map_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type_MapType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_MapType_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_map_type(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_set_function(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_FunctionType* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_mutable_function(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type_FunctionType* sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)google_api_expr_v1alpha1_Type_function(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_FunctionType_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_function(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_FunctionType_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_function(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_set_message_type(google_api_expr_v1alpha1_Type *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_type_param(google_api_expr_v1alpha1_Type *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10); + const upb_MiniTableField field = {10, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Type_set_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 11); + const upb_MiniTableField field = {11, UPB_SIZE(4, 8), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_mutable_type(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_type(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_set_error(google_api_expr_v1alpha1_Type *msg, struct google_protobuf_Empty* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 12); + const upb_MiniTableField field = {12, UPB_SIZE(4, 8), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_error(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)google_api_expr_v1alpha1_Type_error(msg); if (sub == NULL) { - sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_error(msg, sub); + sub = (struct google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_error(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_set_abstract_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_AbstractType* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 14); + const upb_MiniTableField field = {14, UPB_SIZE(4, 8), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_mutable_abstract_type(google_api_expr_v1alpha1_Type* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type_AbstractType* sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)google_api_expr_v1alpha1_Type_abstract_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_set_abstract_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_AbstractType_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_set_abstract_type(msg, sub); } return sub; } @@ -536,12 +671,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1 /* google.api.expr.v1alpha1.Type.ListType */ UPB_INLINE google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_ListType_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type_ListType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_ListType_msginit, arena); + return (google_api_expr_v1alpha1_Type_ListType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_ListType_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_ListType_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Type_ListType* ret = google_api_expr_v1alpha1_Type_ListType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -551,7 +686,7 @@ UPB_INLINE google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type int options, upb_Arena* arena) { google_api_expr_v1alpha1_Type_ListType* ret = google_api_expr_v1alpha1_Type_ListType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -559,35 +694,40 @@ UPB_INLINE google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type } UPB_INLINE char* google_api_expr_v1alpha1_Type_ListType_serialize(const google_api_expr_v1alpha1_Type_ListType* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_Type_ListType_clear_elem_type(const google_api_expr_v1alpha1_Type_ListType* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Type_ListType_clear_elem_type(google_api_expr_v1alpha1_Type_ListType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_ListType_elem_type(const google_api_expr_v1alpha1_Type_ListType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Type*); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Type_ListType_has_elem_type(const google_api_expr_v1alpha1_Type_ListType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Type_ListType_set_elem_type(google_api_expr_v1alpha1_Type_ListType *msg, google_api_expr_v1alpha1_Type* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Type*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_ListType_mutable_elem_type(google_api_expr_v1alpha1_Type_ListType* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_ListType_elem_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_ListType_set_elem_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_ListType_set_elem_type(msg, sub); } return sub; } @@ -595,12 +735,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_L /* google.api.expr.v1alpha1.Type.MapType */ UPB_INLINE google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_MapType_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type_MapType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_MapType_msginit, arena); + return (google_api_expr_v1alpha1_Type_MapType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_MapType_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_MapType_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Type_MapType* ret = google_api_expr_v1alpha1_Type_MapType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -610,7 +750,7 @@ UPB_INLINE google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Type_MapType* ret = google_api_expr_v1alpha1_Type_MapType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -618,57 +758,67 @@ UPB_INLINE google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_ } UPB_INLINE char* google_api_expr_v1alpha1_Type_MapType_serialize(const google_api_expr_v1alpha1_Type_MapType* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_clear_key_type(const google_api_expr_v1alpha1_Type_MapType* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_clear_key_type(google_api_expr_v1alpha1_Type_MapType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_key_type(const google_api_expr_v1alpha1_Type_MapType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Type*); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_value_type(const google_api_expr_v1alpha1_Type_MapType* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_key_type(const google_api_expr_v1alpha1_Type_MapType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_clear_value_type(const google_api_expr_v1alpha1_Type_MapType* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_clear_value_type(google_api_expr_v1alpha1_Type_MapType* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_value_type(const google_api_expr_v1alpha1_Type_MapType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Type*); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_value_type(const google_api_expr_v1alpha1_Type_MapType* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_key_type(google_api_expr_v1alpha1_Type_MapType *msg, google_api_expr_v1alpha1_Type* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Type*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_mutable_key_type(google_api_expr_v1alpha1_Type_MapType* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_MapType_key_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_MapType_set_key_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_MapType_set_key_type(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_value_type(google_api_expr_v1alpha1_Type_MapType *msg, google_api_expr_v1alpha1_Type* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Type*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_mutable_value_type(google_api_expr_v1alpha1_Type_MapType* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_MapType_value_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_MapType_set_value_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_MapType_set_value_type(msg, sub); } return sub; } @@ -676,12 +826,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_M /* google.api.expr.v1alpha1.Type.FunctionType */ UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_FunctionType_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type_FunctionType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_FunctionType_msginit, arena); + return (google_api_expr_v1alpha1_Type_FunctionType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_FunctionType_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_FunctionType_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Type_FunctionType* ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -691,7 +841,7 @@ UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Type_FunctionType* ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -699,69 +849,99 @@ UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_ } UPB_INLINE char* google_api_expr_v1alpha1_Type_FunctionType_serialize(const google_api_expr_v1alpha1_Type_FunctionType* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_clear_result_type(const google_api_expr_v1alpha1_Type_FunctionType* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_clear_result_type(google_api_expr_v1alpha1_Type_FunctionType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_result_type(const google_api_expr_v1alpha1_Type_FunctionType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Type*); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_result_type(const google_api_expr_v1alpha1_Type_FunctionType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_clear_arg_types(google_api_expr_v1alpha1_Type_FunctionType* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_FunctionType_arg_types(const google_api_expr_v1alpha1_Type_FunctionType* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Type* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_arg_types(const google_api_expr_v1alpha1_Type_FunctionType* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_clear_arg_types(const google_api_expr_v1alpha1_Type_FunctionType* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_FunctionType_arg_types(const google_api_expr_v1alpha1_Type_FunctionType* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + google_api_expr_v1alpha1_Type_FunctionType_arg_types(msg, &size); + return size != 0; } UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_set_result_type(google_api_expr_v1alpha1_Type_FunctionType *msg, google_api_expr_v1alpha1_Type* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Type*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_mutable_result_type(google_api_expr_v1alpha1_Type_FunctionType* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_FunctionType_result_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Type_FunctionType_set_result_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Type_FunctionType_set_result_type(msg, sub); } return sub; } -UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_mutable_arg_types(google_api_expr_v1alpha1_Type_FunctionType* msg, size_t* len) { - return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_mutable_arg_types(google_api_expr_v1alpha1_Type_FunctionType* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Type**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_resize_arg_types(google_api_expr_v1alpha1_Type_FunctionType* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_resize_arg_types(google_api_expr_v1alpha1_Type_FunctionType* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Type**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_add_arg_types(google_api_expr_v1alpha1_Type_FunctionType* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.api.expr.v1alpha1.Type.AbstractType */ UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_AbstractType_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type_AbstractType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena); + return (google_api_expr_v1alpha1_Type_AbstractType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_AbstractType_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_AbstractType_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Type_AbstractType* ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -771,7 +951,7 @@ UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Type_AbstractType* ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -779,56 +959,87 @@ UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_ } UPB_INLINE char* google_api_expr_v1alpha1_Type_AbstractType_serialize(const google_api_expr_v1alpha1_Type_AbstractType* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_Type_AbstractType_clear_name(google_api_expr_v1alpha1_Type_AbstractType* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Type_AbstractType_name(const google_api_expr_v1alpha1_Type_AbstractType* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void google_api_expr_v1alpha1_Type_AbstractType_clear_parameter_types(google_api_expr_v1alpha1_Type_AbstractType* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_AbstractType_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Type* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_expr_v1alpha1_Type_AbstractType_has_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void google_api_expr_v1alpha1_Type_AbstractType_clear_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_AbstractType_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + google_api_expr_v1alpha1_Type_AbstractType_parameter_types(msg, &size); + return size != 0; } UPB_INLINE void google_api_expr_v1alpha1_Type_AbstractType_set_name(google_api_expr_v1alpha1_Type_AbstractType *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_mutable_parameter_types(google_api_expr_v1alpha1_Type_AbstractType* msg, size_t* len) { - return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_mutable_parameter_types(google_api_expr_v1alpha1_Type_AbstractType* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Type**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_resize_parameter_types(google_api_expr_v1alpha1_Type_AbstractType* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_resize_parameter_types(google_api_expr_v1alpha1_Type_AbstractType* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Type**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_AbstractType_add_parameter_types(google_api_expr_v1alpha1_Type_AbstractType* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.api.expr.v1alpha1.Decl */ UPB_INLINE google_api_expr_v1alpha1_Decl* google_api_expr_v1alpha1_Decl_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Decl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_msginit, arena); + return (google_api_expr_v1alpha1_Decl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Decl* google_api_expr_v1alpha1_Decl_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Decl* ret = google_api_expr_v1alpha1_Decl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -838,7 +1049,7 @@ UPB_INLINE google_api_expr_v1alpha1_Decl* google_api_expr_v1alpha1_Decl_parse_ex int options, upb_Arena* arena) { google_api_expr_v1alpha1_Decl* ret = google_api_expr_v1alpha1_Decl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -846,13 +1057,13 @@ UPB_INLINE google_api_expr_v1alpha1_Decl* google_api_expr_v1alpha1_Decl_parse_ex } UPB_INLINE char* google_api_expr_v1alpha1_Decl_serialize(const google_api_expr_v1alpha1_Decl* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -861,57 +1072,76 @@ typedef enum { google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET = 0 } google_api_expr_v1alpha1_Decl_decl_kind_oneofcases; UPB_INLINE google_api_expr_v1alpha1_Decl_decl_kind_oneofcases google_api_expr_v1alpha1_Decl_decl_kind_case(const google_api_expr_v1alpha1_Decl* msg) { - return (google_api_expr_v1alpha1_Decl_decl_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Decl_decl_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_name(const google_api_expr_v1alpha1_Decl* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_name(google_api_expr_v1alpha1_Decl* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_name(const google_api_expr_v1alpha1_Decl* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_ident(const google_api_expr_v1alpha1_Decl* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_ident(const google_api_expr_v1alpha1_Decl* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_ident(google_api_expr_v1alpha1_Decl* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_ident(const google_api_expr_v1alpha1_Decl* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL); + const google_api_expr_v1alpha1_Decl_IdentDecl* default_val = NULL; + const google_api_expr_v1alpha1_Decl_IdentDecl* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_function(const google_api_expr_v1alpha1_Decl* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_ident(const google_api_expr_v1alpha1_Decl* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_function(const google_api_expr_v1alpha1_Decl* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_function(google_api_expr_v1alpha1_Decl* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_function(const google_api_expr_v1alpha1_Decl* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL); + const google_api_expr_v1alpha1_Decl_FunctionDecl* default_val = NULL; + const google_api_expr_v1alpha1_Decl_FunctionDecl* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_function(const google_api_expr_v1alpha1_Decl* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Decl_set_name(google_api_expr_v1alpha1_Decl *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Decl_set_ident(google_api_expr_v1alpha1_Decl *msg, google_api_expr_v1alpha1_Decl_IdentDecl* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_mutable_ident(google_api_expr_v1alpha1_Decl* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Decl_IdentDecl* sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)google_api_expr_v1alpha1_Decl_ident(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Decl_set_ident(msg, sub); + sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Decl_set_ident(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Decl_set_function(google_api_expr_v1alpha1_Decl *msg, google_api_expr_v1alpha1_Decl_FunctionDecl* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_mutable_function(google_api_expr_v1alpha1_Decl* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Decl_FunctionDecl* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)google_api_expr_v1alpha1_Decl_function(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Decl_set_function(msg, sub); + sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Decl_set_function(msg, sub); } return sub; } @@ -919,12 +1149,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1 /* google.api.expr.v1alpha1.Decl.IdentDecl */ UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_IdentDecl_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena); + return (google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_IdentDecl_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Decl_IdentDecl* ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -934,7 +1164,7 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Dec int options, upb_Arena* arena) { google_api_expr_v1alpha1_Decl_IdentDecl* ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -942,79 +1172,95 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Dec } UPB_INLINE char* google_api_expr_v1alpha1_Decl_IdentDecl_serialize(const google_api_expr_v1alpha1_Decl_IdentDecl* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_type(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_type(google_api_expr_v1alpha1_Decl_IdentDecl* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_IdentDecl_type(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Type*); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_value(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_type(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_value(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_value(google_api_expr_v1alpha1_Decl_IdentDecl* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Decl_IdentDecl_value(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_api_expr_v1alpha1_Constant*); + const struct google_api_expr_v1alpha1_Constant* default_val = NULL; + const struct google_api_expr_v1alpha1_Constant* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_doc(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_value(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_doc(google_api_expr_v1alpha1_Decl_IdentDecl* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_IdentDecl_doc(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_type(google_api_expr_v1alpha1_Decl_IdentDecl *msg, google_api_expr_v1alpha1_Type* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Type*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_IdentDecl_mutable_type(google_api_expr_v1alpha1_Decl_IdentDecl* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Decl_IdentDecl_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Decl_IdentDecl_set_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Decl_IdentDecl_set_type(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_value(google_api_expr_v1alpha1_Decl_IdentDecl *msg, struct google_api_expr_v1alpha1_Constant* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_api_expr_v1alpha1_Constant*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Decl_IdentDecl_mutable_value(google_api_expr_v1alpha1_Decl_IdentDecl* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Decl_IdentDecl_value(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Decl_IdentDecl_set_value(msg, sub); + sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Decl_IdentDecl_set_value(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_doc(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.api.expr.v1alpha1.Decl.FunctionDecl */ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_FunctionDecl_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena); + return (google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_FunctionDecl_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Decl_FunctionDecl* ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1024,7 +1270,7 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Decl_FunctionDecl* ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1032,47 +1278,72 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_ } UPB_INLINE char* google_api_expr_v1alpha1_Decl_FunctionDecl_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_clear_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const* google_api_expr_v1alpha1_Decl_FunctionDecl_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_has_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_clear_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const* google_api_expr_v1alpha1_Decl_FunctionDecl_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_api_expr_v1alpha1_Decl_FunctionDecl_overloads(msg, &size); + return size != 0; } -UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_mutable_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl* msg, size_t* len) { - return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_mutable_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_resize_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_resize_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_v1alpha1_Decl_FunctionDecl_add_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.api.expr.v1alpha1.Decl.FunctionDecl.Overload */ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena); + return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1082,7 +1353,7 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1090,111 +1361,188 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_ } 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_overload_id(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_overload_id(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Type* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_params(msg, &size); + return size != 0; } -UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + size_t size; + google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_type_params(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); -} -UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const google_api_expr_v1alpha1_Type*); + const google_api_expr_v1alpha1_Type* default_val = NULL; + const google_api_expr_v1alpha1_Type* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_is_instance_function(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_is_instance_function(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_is_instance_function(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_doc(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_doc(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_doc(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_overload_id(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* len) { - return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Type**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Type**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Type**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, google_api_expr_v1alpha1_Type* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), google_api_expr_v1alpha1_Type*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_result_type(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(msg, sub); + sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_is_instance_function(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_doc(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(28, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.api.expr.v1alpha1.Reference */ UPB_INLINE google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_Reference_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Reference*)_upb_Message_New(&google_api_expr_v1alpha1_Reference_msginit, arena); + return (google_api_expr_v1alpha1_Reference*)_upb_Message_New(&google_api_expr_v1alpha1_Reference_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_Reference_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Reference* ret = google_api_expr_v1alpha1_Reference_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1204,7 +1552,7 @@ UPB_INLINE google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_Referenc int options, upb_Arena* arena) { google_api_expr_v1alpha1_Reference* ret = google_api_expr_v1alpha1_Reference_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1212,69 +1560,109 @@ UPB_INLINE google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_Referenc } UPB_INLINE char* google_api_expr_v1alpha1_Reference_serialize(const google_api_expr_v1alpha1_Reference* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_name(google_api_expr_v1alpha1_Reference* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Reference_name(const google_api_expr_v1alpha1_Reference* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_overload_id(const google_api_expr_v1alpha1_Reference* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_overload_id(google_api_expr_v1alpha1_Reference* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* google_api_expr_v1alpha1_Reference_overload_id(const google_api_expr_v1alpha1_Reference* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView const* google_api_expr_v1alpha1_Reference_overload_id(const google_api_expr_v1alpha1_Reference* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool google_api_expr_v1alpha1_Reference_has_value(const google_api_expr_v1alpha1_Reference* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool google_api_expr_v1alpha1_Reference_has_overload_id(const google_api_expr_v1alpha1_Reference* msg) { + size_t size; + google_api_expr_v1alpha1_Reference_overload_id(msg, &size); + return size != 0; } -UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_value(const google_api_expr_v1alpha1_Reference* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_value(google_api_expr_v1alpha1_Reference* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Reference_value(const google_api_expr_v1alpha1_Reference* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_api_expr_v1alpha1_Constant*); + const struct google_api_expr_v1alpha1_Constant* default_val = NULL; + const struct google_api_expr_v1alpha1_Constant* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Reference_has_value(const google_api_expr_v1alpha1_Reference* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Reference_set_name(google_api_expr_v1alpha1_Reference *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Reference_mutable_overload_id(google_api_expr_v1alpha1_Reference* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Reference_mutable_overload_id(google_api_expr_v1alpha1_Reference* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Reference_resize_overload_id(google_api_expr_v1alpha1_Reference* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Reference_resize_overload_id(google_api_expr_v1alpha1_Reference* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_api_expr_v1alpha1_Reference_add_overload_id(google_api_expr_v1alpha1_Reference* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void google_api_expr_v1alpha1_Reference_set_value(google_api_expr_v1alpha1_Reference *msg, struct google_api_expr_v1alpha1_Constant* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_api_expr_v1alpha1_Constant*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Reference_mutable_value(google_api_expr_v1alpha1_Reference* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Reference_value(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Reference_set_value(msg, sub); + sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Reference_set_value(msg, sub); } return sub; } -extern const upb_MiniTable_File google_api_expr_v1alpha1_checked_proto_upb_file_layout; +extern const upb_MiniTableFile google_api_expr_v1alpha1_checked_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_ */ 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 0056cca443d..84135418088 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 @@ -7,270 +7,389 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/api/expr/v1alpha1/syntax.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/struct.upb.h" #include "google/protobuf/timestamp.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_SourceInfo_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_SourceInfo_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_ParsedExpr__fields[2] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_ParsedExpr__fields[2] = { + {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msg_init = { &google_api_expr_v1alpha1_ParsedExpr_submsgs[0], &google_api_expr_v1alpha1_ParsedExpr__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000012, &upb_psm_1bt_max64b}, + {0x001000000201001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_submsgs[7] = { - {.submsg = &google_api_expr_v1alpha1_Constant_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_Ident_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_Select_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_Call_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_CreateList_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_Comprehension_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_submsgs[7] = { + {.submsg = &google_api_expr_v1alpha1_Constant_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_Ident_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_Select_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_Call_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_CreateList_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_Comprehension_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr__fields[8] = { - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr__fields[8] = { + {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 16), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 16), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 16), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 16), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 16), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 16), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(4, 16), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_msg_init = { &google_api_expr_v1alpha1_Expr_submsgs[0], &google_api_expr_v1alpha1_Expr__fields[0], - UPB_SIZE(16, 24), 8, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 8, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000010, &upb_psv8_1bt}, + {0x001000000300001a, &upb_pom_1bt_max64b}, + {0x0010000004010022, &upb_pom_1bt_max64b}, + {0x001000000502002a, &upb_pom_1bt_max64b}, + {0x0010000006030032, &upb_pom_1bt_max64b}, + {0x001000000704003a, &upb_pom_1bt_max64b}, + {0x0010000008050042, &upb_pom_1bt_max64b}, + {0x001000000906004a, &upb_pom_1bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Ident__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_Ident__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msg_init = { NULL, &google_api_expr_v1alpha1_Expr_Ident__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Select_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_Select_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Select__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_Select__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_Select_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_Select_msg_init = { &google_api_expr_v1alpha1_Expr_Select_submsgs[0], &google_api_expr_v1alpha1_Expr_Select__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x001000003f000012, &upb_pss_1bt}, + {0x000100003f000018, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Call_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_Call_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Call__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_Call__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_Call_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_Call_msg_init = { &google_api_expr_v1alpha1_Expr_Call_submsgs[0], &google_api_expr_v1alpha1_Expr_Call__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f01001a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_CreateList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateList_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateList_msg_init = { &google_api_expr_v1alpha1_Expr_CreateList_submsgs[0], &google_api_expr_v1alpha1_Expr_CreateList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateStruct__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_CreateStruct__fields[2] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_msg_init = { &google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[0], &google_api_expr_v1alpha1_Expr_CreateStruct__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = { - {1, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = { + {1, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init = { &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[0], &google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[0], - UPB_SIZE(32, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f000008, &upb_psv8_1bt}, + {0x0008000402000012, &upb_pos_1bt}, + {0x000800040300001a, &upb_pom_1bt_max64b}, + {0x0020000001010022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Comprehension_submsgs[5] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Expr_Comprehension_submsgs[5] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 56), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 64), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(36, 72), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = { + {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 32, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 72), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Expr_Comprehension_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Expr_Comprehension_msg_init = { &google_api_expr_v1alpha1_Expr_Comprehension_submsgs[0], &google_api_expr_v1alpha1_Expr_Comprehension__fields[0], - UPB_SIZE(40, 80), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 80), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x002000003f00001a, &upb_pss_1bt}, + {0x0030000002010022, &upb_psm_1bt_max64b}, + {0x003800000302002a, &upb_psm_1bt_max64b}, + {0x0040000004030032, &upb_psm_1bt_max64b}, + {0x004800000504003a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_Constant_submsgs[2] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_Constant_submsgs[2] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_Constant__fields[9] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_Constant__fields[9] = { + {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 8, -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, 8, -1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, 8, -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_Constant_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_Constant_msg_init = { &google_api_expr_v1alpha1_Constant_submsgs[0], &google_api_expr_v1alpha1_Constant__fields[0], - UPB_SIZE(16, 24), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(16, 24), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_pov4_1bt}, + {0x0008000002000010, &upb_pob1_1bt}, + {0x0008000003000018, &upb_pov8_1bt}, + {0x0008000004000020, &upb_pov8_1bt}, + {0x0008000005000029, &upb_pof8_1bt}, + {0x0008000006000032, &upb_pos_1bt}, + {0x000800000700003a, &upb_pob_1bt}, + {0x0008000008000042, &upb_pom_1bt_maxmaxb}, + {0x000800000901004a, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_SourceInfo_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit}, - {.submsg = &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_SourceInfo_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msg_init}, + {.submsg = &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo__fields[5] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_SourceInfo__fields[5] = { + {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(0, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msg_init = { &google_api_expr_v1alpha1_SourceInfo_submsgs[0], &google_api_expr_v1alpha1_SourceInfo__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_ppv4_1bt}, + }) }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msg_init = { NULL, &google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x001800003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[1] = { - {.submsg = &google_api_expr_v1alpha1_Expr_msginit}, +static const upb_MiniTableSub google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[1] = { + {.submsg = &google_api_expr_v1alpha1_Expr_msg_init}, }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msg_init = { &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[0], &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field google_api_expr_v1alpha1_SourcePosition__fields[4] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_expr_v1alpha1_SourcePosition__fields[4] = { + {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_expr_v1alpha1_SourcePosition_msginit = { +const upb_MiniTable google_api_expr_v1alpha1_SourcePosition_msg_init = { NULL, &google_api_expr_v1alpha1_SourcePosition__fields[0], - UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x000400003f000018, &upb_psv4_1bt}, + {0x000800003f000020, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[14] = { - &google_api_expr_v1alpha1_ParsedExpr_msginit, - &google_api_expr_v1alpha1_Expr_msginit, - &google_api_expr_v1alpha1_Expr_Ident_msginit, - &google_api_expr_v1alpha1_Expr_Select_msginit, - &google_api_expr_v1alpha1_Expr_Call_msginit, - &google_api_expr_v1alpha1_Expr_CreateList_msginit, - &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, - &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, - &google_api_expr_v1alpha1_Expr_Comprehension_msginit, - &google_api_expr_v1alpha1_Constant_msginit, - &google_api_expr_v1alpha1_SourceInfo_msginit, - &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit, - &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit, - &google_api_expr_v1alpha1_SourcePosition_msginit, + &google_api_expr_v1alpha1_ParsedExpr_msg_init, + &google_api_expr_v1alpha1_Expr_msg_init, + &google_api_expr_v1alpha1_Expr_Ident_msg_init, + &google_api_expr_v1alpha1_Expr_Select_msg_init, + &google_api_expr_v1alpha1_Expr_Call_msg_init, + &google_api_expr_v1alpha1_Expr_CreateList_msg_init, + &google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, + &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, + &google_api_expr_v1alpha1_Expr_Comprehension_msg_init, + &google_api_expr_v1alpha1_Constant_msg_init, + &google_api_expr_v1alpha1_SourceInfo_msg_init, + &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msg_init, + &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msg_init, + &google_api_expr_v1alpha1_SourcePosition_msg_init, }; -const upb_MiniTable_File google_api_expr_v1alpha1_syntax_proto_upb_file_layout = { +const upb_MiniTableFile google_api_expr_v1alpha1_syntax_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -279,5 +398,5 @@ const upb_MiniTable_File google_api_expr_v1alpha1_syntax_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 89570657a37..6ad21118cd2 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 @@ -9,31 +9,22 @@ #ifndef GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_ #define GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_api_expr_v1alpha1_ParsedExpr; -struct google_api_expr_v1alpha1_Expr; -struct google_api_expr_v1alpha1_Expr_Ident; -struct google_api_expr_v1alpha1_Expr_Select; -struct google_api_expr_v1alpha1_Expr_Call; -struct google_api_expr_v1alpha1_Expr_CreateList; -struct google_api_expr_v1alpha1_Expr_CreateStruct; -struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry; -struct google_api_expr_v1alpha1_Expr_Comprehension; -struct google_api_expr_v1alpha1_Constant; -struct google_api_expr_v1alpha1_SourceInfo; -struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry; -struct google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry; -struct google_api_expr_v1alpha1_SourcePosition; typedef struct google_api_expr_v1alpha1_ParsedExpr google_api_expr_v1alpha1_ParsedExpr; typedef struct google_api_expr_v1alpha1_Expr google_api_expr_v1alpha1_Expr; typedef struct google_api_expr_v1alpha1_Expr_Ident google_api_expr_v1alpha1_Expr_Ident; @@ -48,36 +39,36 @@ typedef struct google_api_expr_v1alpha1_SourceInfo google_api_expr_v1alpha1_Sour typedef struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry google_api_expr_v1alpha1_SourceInfo_PositionsEntry; typedef struct google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry; typedef struct google_api_expr_v1alpha1_SourcePosition google_api_expr_v1alpha1_SourcePosition; -extern const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Select_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Call_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateList_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Comprehension_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_Constant_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_SourcePosition_msginit; +extern const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Select_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Call_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateList_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Comprehension_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_Constant_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_SourcePosition_msg_init; struct google_protobuf_Duration; struct google_protobuf_Timestamp; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; /* google.api.expr.v1alpha1.ParsedExpr */ UPB_INLINE google_api_expr_v1alpha1_ParsedExpr* google_api_expr_v1alpha1_ParsedExpr_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_ParsedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_ParsedExpr_msginit, arena); + return (google_api_expr_v1alpha1_ParsedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_ParsedExpr_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_ParsedExpr* google_api_expr_v1alpha1_ParsedExpr_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_ParsedExpr* ret = google_api_expr_v1alpha1_ParsedExpr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -87,7 +78,7 @@ UPB_INLINE google_api_expr_v1alpha1_ParsedExpr* google_api_expr_v1alpha1_ParsedE int options, upb_Arena* arena) { google_api_expr_v1alpha1_ParsedExpr* ret = google_api_expr_v1alpha1_ParsedExpr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -95,57 +86,67 @@ UPB_INLINE google_api_expr_v1alpha1_ParsedExpr* google_api_expr_v1alpha1_ParsedE } UPB_INLINE char* google_api_expr_v1alpha1_ParsedExpr_serialize(const google_api_expr_v1alpha1_ParsedExpr* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_clear_expr(const google_api_expr_v1alpha1_ParsedExpr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_clear_expr(google_api_expr_v1alpha1_ParsedExpr* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_ParsedExpr_expr(const google_api_expr_v1alpha1_ParsedExpr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_source_info(const google_api_expr_v1alpha1_ParsedExpr* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_expr(const google_api_expr_v1alpha1_ParsedExpr* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_clear_source_info(const google_api_expr_v1alpha1_ParsedExpr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_clear_source_info(google_api_expr_v1alpha1_ParsedExpr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ParsedExpr_source_info(const google_api_expr_v1alpha1_ParsedExpr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_SourceInfo*); + const google_api_expr_v1alpha1_SourceInfo* default_val = NULL; + const google_api_expr_v1alpha1_SourceInfo* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_source_info(const google_api_expr_v1alpha1_ParsedExpr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_expr(google_api_expr_v1alpha1_ParsedExpr *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_ParsedExpr_mutable_expr(google_api_expr_v1alpha1_ParsedExpr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_ParsedExpr_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_ParsedExpr_set_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_ParsedExpr_set_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_source_info(google_api_expr_v1alpha1_ParsedExpr *msg, google_api_expr_v1alpha1_SourceInfo* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_SourceInfo*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ParsedExpr_mutable_source_info(google_api_expr_v1alpha1_ParsedExpr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_SourceInfo* sub = (struct google_api_expr_v1alpha1_SourceInfo*)google_api_expr_v1alpha1_ParsedExpr_source_info(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_ParsedExpr_set_source_info(msg, sub); + sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msg_init, arena); + if (sub) google_api_expr_v1alpha1_ParsedExpr_set_source_info(msg, sub); } return sub; } @@ -153,12 +154,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ /* google.api.expr.v1alpha1.Expr */ UPB_INLINE google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); + return (google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr* ret = google_api_expr_v1alpha1_Expr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -168,7 +169,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_parse_ex int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr* ret = google_api_expr_v1alpha1_Expr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -176,13 +177,13 @@ UPB_INLINE google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_parse_ex } UPB_INLINE char* google_api_expr_v1alpha1_Expr_serialize(const google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -196,162 +197,211 @@ typedef enum { google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET = 0 } google_api_expr_v1alpha1_Expr_expr_kind_oneofcases; UPB_INLINE google_api_expr_v1alpha1_Expr_expr_kind_oneofcases google_api_expr_v1alpha1_Expr_expr_kind_case(const google_api_expr_v1alpha1_Expr* msg) { - return (google_api_expr_v1alpha1_Expr_expr_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {3, UPB_SIZE(4, 16), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Expr_expr_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_id(const google_api_expr_v1alpha1_Expr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = 0; +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_id(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_id(const google_api_expr_v1alpha1_Expr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_const_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_const_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Constant*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_const_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 16), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Expr_const_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Constant*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const google_api_expr_v1alpha1_Constant* default_val = NULL; + const google_api_expr_v1alpha1_Constant* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 16), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_ident_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_const_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 16), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_ident_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_ident_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 16), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_ident_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const google_api_expr_v1alpha1_Expr_Ident* default_val = NULL; + const google_api_expr_v1alpha1_Expr_Ident* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 16), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_select_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_ident_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 16), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_select_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_select_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 16), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_select_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL); + const google_api_expr_v1alpha1_Expr_Select* default_val = NULL; + const google_api_expr_v1alpha1_Expr_Select* ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 16), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_call_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_select_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 16), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_call_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_call_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 16), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_call_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL); + const google_api_expr_v1alpha1_Expr_Call* default_val = NULL; + const google_api_expr_v1alpha1_Expr_Call* ret; + const upb_MiniTableField field = {6, UPB_SIZE(4, 16), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_list_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_call_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 16), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_list_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_list_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 16), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_list_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL); + const google_api_expr_v1alpha1_Expr_CreateList* default_val = NULL; + const google_api_expr_v1alpha1_Expr_CreateList* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 16), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_struct_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_list_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 16), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_struct_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_struct_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 16), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_struct_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const google_api_expr_v1alpha1_Expr_CreateStruct* default_val = NULL; + const google_api_expr_v1alpha1_Expr_CreateStruct* ret; + const upb_MiniTableField field = {8, UPB_SIZE(4, 16), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_comprehension_expr(const google_api_expr_v1alpha1_Expr* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_struct_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 16), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_comprehension_expr(const google_api_expr_v1alpha1_Expr* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_comprehension_expr(google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 16), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_comprehension_expr(const google_api_expr_v1alpha1_Expr* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL); + const google_api_expr_v1alpha1_Expr_Comprehension* default_val = NULL; + const google_api_expr_v1alpha1_Expr_Comprehension* ret; + const upb_MiniTableField field = {9, UPB_SIZE(4, 16), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_comprehension_expr(const google_api_expr_v1alpha1_Expr* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(4, 16), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_id(google_api_expr_v1alpha1_Expr *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_const_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Constant* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Constant*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 16), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Expr_mutable_const_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Expr_const_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_const_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_const_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_ident_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Ident* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 16), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_mutable_ident_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr_Ident* sub = (struct google_api_expr_v1alpha1_Expr_Ident*)google_api_expr_v1alpha1_Expr_ident_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr_Ident*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Ident_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_ident_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr_Ident*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Ident_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_ident_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_select_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Select* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, UPB_SIZE(4, 16), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_mutable_select_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr_Select* sub = (struct google_api_expr_v1alpha1_Expr_Select*)google_api_expr_v1alpha1_Expr_select_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr_Select*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Select_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_select_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr_Select*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Select_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_select_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_call_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Call* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, UPB_SIZE(4, 16), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_mutable_call_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr_Call* sub = (struct google_api_expr_v1alpha1_Expr_Call*)google_api_expr_v1alpha1_Expr_call_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr_Call*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Call_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_call_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr_Call*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Call_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_call_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_list_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_CreateList* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, UPB_SIZE(4, 16), -1, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_mutable_list_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr_CreateList* sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)google_api_expr_v1alpha1_Expr_list_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateList_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_list_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateList_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_list_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_struct_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_CreateStruct* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, UPB_SIZE(4, 16), -1, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_mutable_struct_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr_CreateStruct* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)google_api_expr_v1alpha1_Expr_struct_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_struct_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_struct_expr(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_set_comprehension_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Comprehension* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, UPB_SIZE(4, 16), -1, 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_mutable_comprehension_expr(google_api_expr_v1alpha1_Expr* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr_Comprehension* sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)google_api_expr_v1alpha1_Expr_comprehension_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_set_comprehension_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Comprehension_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_set_comprehension_expr(msg, sub); } return sub; } @@ -359,12 +409,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v /* google.api.expr.v1alpha1.Expr.Ident */ UPB_INLINE google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_Ident_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_Ident*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Ident_msginit, arena); + return (google_api_expr_v1alpha1_Expr_Ident*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Ident_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_Ident_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Ident* ret = google_api_expr_v1alpha1_Expr_Ident_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -374,7 +424,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_Id int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Ident* ret = google_api_expr_v1alpha1_Expr_Ident_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -382,35 +432,41 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_Id } UPB_INLINE char* google_api_expr_v1alpha1_Expr_Ident_serialize(const google_api_expr_v1alpha1_Expr_Ident* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_Expr_Ident_clear_name(google_api_expr_v1alpha1_Expr_Ident* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Ident_name(const google_api_expr_v1alpha1_Expr_Ident* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Ident_set_name(google_api_expr_v1alpha1_Expr_Ident *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.api.expr.v1alpha1.Expr.Select */ UPB_INLINE google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_Select_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_Select*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Select_msginit, arena); + return (google_api_expr_v1alpha1_Expr_Select*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Select_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_Select_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Select* ret = google_api_expr_v1alpha1_Expr_Select_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -420,7 +476,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_S int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Select* ret = google_api_expr_v1alpha1_Expr_Select_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -428,66 +484,83 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_S } UPB_INLINE char* google_api_expr_v1alpha1_Expr_Select_serialize(const google_api_expr_v1alpha1_Expr_Select* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_operand(const google_api_expr_v1alpha1_Expr_Select* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_operand(google_api_expr_v1alpha1_Expr_Select* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Select_operand(const google_api_expr_v1alpha1_Expr_Select* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_field(const google_api_expr_v1alpha1_Expr_Select* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_has_operand(const google_api_expr_v1alpha1_Expr_Select* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_field(google_api_expr_v1alpha1_Expr_Select* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Select_field(const google_api_expr_v1alpha1_Expr_Select* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_test_only(const google_api_expr_v1alpha1_Expr_Select* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_test_only(google_api_expr_v1alpha1_Expr_Select* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_test_only(const google_api_expr_v1alpha1_Expr_Select* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_operand(google_api_expr_v1alpha1_Expr_Select *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Select_mutable_operand(google_api_expr_v1alpha1_Expr_Select* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Select_operand(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Select_set_operand(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Select_set_operand(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_field(google_api_expr_v1alpha1_Expr_Select *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_test_only(google_api_expr_v1alpha1_Expr_Select *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.api.expr.v1alpha1.Expr.Call */ UPB_INLINE google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_Call_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_Call*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Call_msginit, arena); + return (google_api_expr_v1alpha1_Expr_Call*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Call_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_Call_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Call* ret = google_api_expr_v1alpha1_Expr_Call_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -497,7 +570,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_Cal int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Call* ret = google_api_expr_v1alpha1_Expr_Call_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -505,78 +578,114 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_Cal } UPB_INLINE char* google_api_expr_v1alpha1_Expr_Call_serialize(const google_api_expr_v1alpha1_Expr_Call* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msg_init, 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); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_target(const google_api_expr_v1alpha1_Expr_Call* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_target(google_api_expr_v1alpha1_Expr_Call* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_target(const google_api_expr_v1alpha1_Expr_Call* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_function(const google_api_expr_v1alpha1_Expr_Call* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_target(const google_api_expr_v1alpha1_Expr_Call* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_function(google_api_expr_v1alpha1_Expr_Call* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Call_function(const google_api_expr_v1alpha1_Expr_Call* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_args(google_api_expr_v1alpha1_Expr_Call* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_Call_args(const google_api_expr_v1alpha1_Expr_Call* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_args(const google_api_expr_v1alpha1_Expr_Call* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_args(const google_api_expr_v1alpha1_Expr_Call* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_Call_args(const google_api_expr_v1alpha1_Expr_Call* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + google_api_expr_v1alpha1_Expr_Call_args(msg, &size); + return size != 0; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_target(google_api_expr_v1alpha1_Expr_Call *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_mutable_target(google_api_expr_v1alpha1_Expr_Call* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Call_target(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Call_set_target(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Call_set_target(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_function(google_api_expr_v1alpha1_Expr_Call *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_mutable_args(google_api_expr_v1alpha1_Expr_Call* msg, size_t* len) { - return (google_api_expr_v1alpha1_Expr**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_mutable_args(google_api_expr_v1alpha1_Expr_Call* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Expr**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_resize_args(google_api_expr_v1alpha1_Expr_Call* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_resize_args(google_api_expr_v1alpha1_Expr_Call* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Expr**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_add_args(google_api_expr_v1alpha1_Expr_Call* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.api.expr.v1alpha1.Expr.CreateList */ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_CreateList_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_CreateList*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateList_msginit, arena); + return (google_api_expr_v1alpha1_Expr_CreateList*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateList_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_CreateList_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_CreateList* ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -586,7 +695,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Ex int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_CreateList* ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -594,47 +703,72 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Ex } UPB_INLINE char* google_api_expr_v1alpha1_Expr_CreateList_serialize(const google_api_expr_v1alpha1_Expr_CreateList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateList_clear_elements(google_api_expr_v1alpha1_Expr_CreateList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_CreateList_elements(const google_api_expr_v1alpha1_Expr_CreateList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateList_has_elements(const google_api_expr_v1alpha1_Expr_CreateList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateList_clear_elements(const google_api_expr_v1alpha1_Expr_CreateList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_CreateList_elements(const google_api_expr_v1alpha1_Expr_CreateList* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_api_expr_v1alpha1_Expr_CreateList_elements(msg, &size); + return size != 0; } -UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_mutable_elements(google_api_expr_v1alpha1_Expr_CreateList* msg, size_t* len) { - return (google_api_expr_v1alpha1_Expr**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_mutable_elements(google_api_expr_v1alpha1_Expr_CreateList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Expr**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_resize_elements(google_api_expr_v1alpha1_Expr_CreateList* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_resize_elements(google_api_expr_v1alpha1_Expr_CreateList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Expr**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateList_add_elements(google_api_expr_v1alpha1_Expr_CreateList* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.api.expr.v1alpha1.Expr.CreateStruct */ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_CreateStruct_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena); + return (google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_CreateStruct_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_CreateStruct* ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -644,7 +778,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_CreateStruct* ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -652,56 +786,87 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_ } UPB_INLINE char* google_api_expr_v1alpha1_Expr_CreateStruct_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_clear_message_name(google_api_expr_v1alpha1_Expr_CreateStruct* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_CreateStruct_message_name(const google_api_expr_v1alpha1_Expr_CreateStruct* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_clear_entries(google_api_expr_v1alpha1_Expr_CreateStruct* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const* google_api_expr_v1alpha1_Expr_CreateStruct_entries(const google_api_expr_v1alpha1_Expr_CreateStruct* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_has_entries(const google_api_expr_v1alpha1_Expr_CreateStruct* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_clear_entries(const google_api_expr_v1alpha1_Expr_CreateStruct* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const* google_api_expr_v1alpha1_Expr_CreateStruct_entries(const google_api_expr_v1alpha1_Expr_CreateStruct* msg, size_t* len) { - return (const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + google_api_expr_v1alpha1_Expr_CreateStruct_entries(msg, &size); + return size != 0; } UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_set_message_name(google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_mutable_entries(google_api_expr_v1alpha1_Expr_CreateStruct* msg, size_t* len) { - return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_mutable_entries(google_api_expr_v1alpha1_Expr_CreateStruct* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_resize_entries(google_api_expr_v1alpha1_Expr_CreateStruct* msg, size_t len, upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_resize_entries(google_api_expr_v1alpha1_Expr_CreateStruct* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1alpha1_Expr_CreateStruct_add_entries(google_api_expr_v1alpha1_Expr_CreateStruct* msg, upb_Arena* arena) { - struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(0, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.api.expr.v1alpha1.Expr.CreateStruct.Entry */ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena); + return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_CreateStruct_Entry* ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -711,7 +876,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1a int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_CreateStruct_Entry* ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -719,13 +884,13 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1a } 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -734,70 +899,95 @@ typedef enum { google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET = 0 } google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases; UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_case(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_id(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0; +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_id(google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {1, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_CreateStruct_Entry_id(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_field_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_CreateStruct_Entry_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, NULL); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_id(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value; + const upb_MiniTableField field = {1, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_field_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 8), -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, google_api_expr_v1alpha1_Expr* value) { - UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 8), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_mutable_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_CreateStruct_Entry_map_key(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_mutable_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_CreateStruct_Entry_value(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(msg, sub); } return sub; } @@ -805,12 +995,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_C /* google.api.expr.v1alpha1.Expr.Comprehension */ UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_Comprehension_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Expr_Comprehension*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena); + return (google_api_expr_v1alpha1_Expr_Comprehension*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Comprehension_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_Comprehension_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Comprehension* ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -820,7 +1010,7 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1 int options, upb_Arena* arena) { google_api_expr_v1alpha1_Expr_Comprehension* ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -828,141 +1018,178 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1 } UPB_INLINE char* google_api_expr_v1alpha1_Expr_Comprehension_serialize(const google_api_expr_v1alpha1_Expr_Comprehension* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_iter_var(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Comprehension_iter_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_iter_range(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_accu_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_accu_var(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {3, 32, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Comprehension_accu_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 32, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_accu_init(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_loop_step(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_result(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_result(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL; +UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_result(google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_result(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const google_api_expr_v1alpha1_Expr*); + const google_api_expr_v1alpha1_Expr* default_val = NULL; + const google_api_expr_v1alpha1_Expr* ret; + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_result(const google_api_expr_v1alpha1_Expr_Comprehension* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_iter_range(google_api_expr_v1alpha1_Expr_Comprehension* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_iter_range(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, 32, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_accu_init(google_api_expr_v1alpha1_Expr_Comprehension* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_accu_init(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_loop_condition(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 4, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_loop_step(google_api_expr_v1alpha1_Expr_Comprehension* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_loop_step(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_result(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), google_api_expr_v1alpha1_Expr*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 5, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_result(google_api_expr_v1alpha1_Expr_Comprehension* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_result(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Expr_Comprehension_set_result(msg, sub); + sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Expr_Comprehension_set_result(msg, sub); } return sub; } @@ -970,12 +1197,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_C /* google.api.expr.v1alpha1.Constant */ UPB_INLINE google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Constant_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msginit, arena); + return (google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Constant_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_Constant* ret = google_api_expr_v1alpha1_Constant_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -985,7 +1212,7 @@ UPB_INLINE google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Constant_ int options, upb_Arena* arena) { google_api_expr_v1alpha1_Constant* ret = google_api_expr_v1alpha1_Constant_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -993,13 +1220,13 @@ UPB_INLINE google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Constant_ } UPB_INLINE char* google_api_expr_v1alpha1_Constant_serialize(const google_api_expr_v1alpha1_Constant* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -1015,132 +1242,194 @@ typedef enum { google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET = 0 } google_api_expr_v1alpha1_Constant_constant_kind_oneofcases; UPB_INLINE google_api_expr_v1alpha1_Constant_constant_kind_oneofcases google_api_expr_v1alpha1_Constant_constant_kind_case(const google_api_expr_v1alpha1_Constant* msg) { - return (google_api_expr_v1alpha1_Constant_constant_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (google_api_expr_v1alpha1_Constant_constant_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_null_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_null_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_null_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_Constant_null_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 1, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bool_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_null_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_bool_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_bool_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_api_expr_v1alpha1_Constant_bool_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 2, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_int64_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bool_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_int64_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_int64_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_api_expr_v1alpha1_Constant_int64_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 3, _upb_Int64_FromLL(0ll)); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_uint64_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_int64_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_uint64_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_uint64_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t google_api_expr_v1alpha1_Constant_uint64_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, uint64_t, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 4, _upb_UInt64_FromULL(0ull)); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_double_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_uint64_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_double_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_double_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double google_api_expr_v1alpha1_Constant_double_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, double, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 5, 0); + double default_val = 0; + double ret; + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_string_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_double_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_string_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_string_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Constant_string_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 6, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bytes_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_string_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_bytes_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_bytes_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {7, 8, -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_Constant_bytes_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 7, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, 8, -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_duration_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bytes_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {7, 8, -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_duration_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_duration_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_duration_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 8, NULL); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_timestamp_value(const google_api_expr_v1alpha1_Constant* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9; +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_duration_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_timestamp_value(const google_api_expr_v1alpha1_Constant* msg) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Timestamp*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET); +UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_timestamp_value(google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {9, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_timestamp_value(const google_api_expr_v1alpha1_Constant* msg) { - return UPB_READ_ONEOF(msg, const struct google_protobuf_Timestamp*, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 9, NULL); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {9, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_timestamp_value(const google_api_expr_v1alpha1_Constant* msg) { + const upb_MiniTableField field = {9, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_null_value(google_api_expr_v1alpha1_Constant *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_bool_value(google_api_expr_v1alpha1_Constant *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_int64_value(google_api_expr_v1alpha1_Constant *msg, int64_t value) { - UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_uint64_value(google_api_expr_v1alpha1_Constant *msg, uint64_t value) { - UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_double_value(google_api_expr_v1alpha1_Constant *msg, double value) { - UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_string_value(google_api_expr_v1alpha1_Constant *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_bytes_value(google_api_expr_v1alpha1_Constant *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 7); + const upb_MiniTableField field = {7, 8, -1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_duration_value(google_api_expr_v1alpha1_Constant *msg, struct google_protobuf_Duration* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_mutable_duration_value(google_api_expr_v1alpha1_Constant* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)google_api_expr_v1alpha1_Constant_duration_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Constant_set_duration_value(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Constant_set_duration_value(msg, sub); } return sub; } UPB_INLINE void google_api_expr_v1alpha1_Constant_set_timestamp_value(google_api_expr_v1alpha1_Constant *msg, struct google_protobuf_Timestamp* value) { - UPB_WRITE_ONEOF(msg, struct google_protobuf_Timestamp*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 9); + const upb_MiniTableField field = {9, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_mutable_timestamp_value(google_api_expr_v1alpha1_Constant* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)google_api_expr_v1alpha1_Constant_timestamp_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - google_api_expr_v1alpha1_Constant_set_timestamp_value(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) google_api_expr_v1alpha1_Constant_set_timestamp_value(msg, sub); } return sub; } @@ -1148,12 +1437,12 @@ UPB_INLINE struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_m /* google.api.expr.v1alpha1.SourceInfo */ UPB_INLINE google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_SourceInfo_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msginit, arena); + return (google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_SourceInfo_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_SourceInfo* ret = google_api_expr_v1alpha1_SourceInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1163,7 +1452,7 @@ UPB_INLINE google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_SourceI int options, upb_Arena* arena) { google_api_expr_v1alpha1_SourceInfo* ret = google_api_expr_v1alpha1_SourceInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1171,98 +1460,185 @@ UPB_INLINE google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_SourceI } UPB_INLINE char* google_api_expr_v1alpha1_SourceInfo_serialize(const google_api_expr_v1alpha1_SourceInfo* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_syntax_version(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_SourceInfo_syntax_version(const google_api_expr_v1alpha1_SourceInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_location(const google_api_expr_v1alpha1_SourceInfo* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_location(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_SourceInfo_location(const google_api_expr_v1alpha1_SourceInfo* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_line_offsets(const google_api_expr_v1alpha1_SourceInfo* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_line_offsets(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* google_api_expr_v1alpha1_SourceInfo_line_offsets(const google_api_expr_v1alpha1_SourceInfo* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE int32_t const* google_api_expr_v1alpha1_SourceInfo_line_offsets(const google_api_expr_v1alpha1_SourceInfo* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_positions(const google_api_expr_v1alpha1_SourceInfo* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); +UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_line_offsets(const google_api_expr_v1alpha1_SourceInfo* msg) { + size_t size; + google_api_expr_v1alpha1_SourceInfo_line_offsets(msg, &size); + return size != 0; } -UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_positions(const google_api_expr_v1alpha1_SourceInfo* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_positions(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t google_api_expr_v1alpha1_SourceInfo_positions_size(const google_api_expr_v1alpha1_SourceInfo* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(20, 40)); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_get(const google_api_expr_v1alpha1_SourceInfo* msg, int64_t key, int32_t* val) { - return _upb_msg_map_get(msg, UPB_SIZE(20, 40), &key, sizeof(key), val, sizeof(*val)); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, sizeof(key), val, sizeof(*val)); } UPB_INLINE const google_api_expr_v1alpha1_SourceInfo_PositionsEntry* google_api_expr_v1alpha1_SourceInfo_positions_next(const google_api_expr_v1alpha1_SourceInfo* msg, size_t* iter) { - return (const google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_macro_calls(const google_api_expr_v1alpha1_SourceInfo* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); +UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_positions(const google_api_expr_v1alpha1_SourceInfo* msg) { + return google_api_expr_v1alpha1_SourceInfo_positions_size(msg) != 0; } -UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_macro_calls(const google_api_expr_v1alpha1_SourceInfo* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_macro_calls(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t google_api_expr_v1alpha1_SourceInfo_macro_calls_size(const google_api_expr_v1alpha1_SourceInfo* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(24, 48)); + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_get(const google_api_expr_v1alpha1_SourceInfo* msg, int64_t key, google_api_expr_v1alpha1_Expr** val) { - return _upb_msg_map_get(msg, UPB_SIZE(24, 48), &key, sizeof(key), val, sizeof(*val)); + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, sizeof(key), val, sizeof(*val)); } UPB_INLINE const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* google_api_expr_v1alpha1_SourceInfo_macro_calls_next(const google_api_expr_v1alpha1_SourceInfo* msg, size_t* iter) { - return (const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), iter); + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_macro_calls(const google_api_expr_v1alpha1_SourceInfo* msg) { + return google_api_expr_v1alpha1_SourceInfo_macro_calls_size(msg) != 0; } UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_set_syntax_version(google_api_expr_v1alpha1_SourceInfo *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_set_location(google_api_expr_v1alpha1_SourceInfo *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(20, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_mutable_line_offsets(google_api_expr_v1alpha1_SourceInfo* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_mutable_line_offsets(google_api_expr_v1alpha1_SourceInfo* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_resize_line_offsets(google_api_expr_v1alpha1_SourceInfo* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, 2, arena); +UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_resize_line_offsets(google_api_expr_v1alpha1_SourceInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_add_line_offsets(google_api_expr_v1alpha1_SourceInfo* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), 2, &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_positions_clear(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_positions_clear(google_api_expr_v1alpha1_SourceInfo* msg) { _upb_msg_map_clear(msg, UPB_SIZE(20, 40)); } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_set(google_api_expr_v1alpha1_SourceInfo* msg, int64_t key, int32_t val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(20, 40), &key, sizeof(key), &val, sizeof(val), a); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, sizeof(key), sizeof(val), a); + return _upb_Map_Insert(map, &key, sizeof(key), &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_delete(google_api_expr_v1alpha1_SourceInfo* msg, int64_t key) { - return _upb_msg_map_delete(msg, UPB_SIZE(20, 40), &key, sizeof(key)); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, sizeof(key), NULL); } UPB_INLINE google_api_expr_v1alpha1_SourceInfo_PositionsEntry* google_api_expr_v1alpha1_SourceInfo_positions_nextmutable(google_api_expr_v1alpha1_SourceInfo* msg, size_t* iter) { - return (google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); + const upb_MiniTableField field = {4, UPB_SIZE(4, 40), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_macro_calls_clear(google_api_expr_v1alpha1_SourceInfo* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_macro_calls_clear(google_api_expr_v1alpha1_SourceInfo* msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 48)); } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_set(google_api_expr_v1alpha1_SourceInfo* msg, int64_t key, google_api_expr_v1alpha1_Expr* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(24, 48), &key, sizeof(key), &val, sizeof(val), a); + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, sizeof(key), sizeof(val), a); + return _upb_Map_Insert(map, &key, sizeof(key), &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_delete(google_api_expr_v1alpha1_SourceInfo* msg, int64_t key) { - return _upb_msg_map_delete(msg, UPB_SIZE(24, 48), &key, sizeof(key)); + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, sizeof(key), NULL); } UPB_INLINE google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* google_api_expr_v1alpha1_SourceInfo_macro_calls_nextmutable(google_api_expr_v1alpha1_SourceInfo* msg, size_t* iter) { - return (google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), iter); + const upb_MiniTableField field = {5, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_map_next(map, iter); } /* google.api.expr.v1alpha1.SourceInfo.PositionsEntry */ @@ -1289,14 +1665,15 @@ UPB_INLINE int64_t google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_key(const _upb_msg_map_key(msg, &ret, sizeof(ret)); return ret; } -UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_has_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* msg) { google_api_expr_v1alpha1_Expr* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_has_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_set_value(google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry *msg, google_api_expr_v1alpha1_Expr* value) { _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Expr*)); @@ -1305,12 +1682,12 @@ UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_set_value(go /* google.api.expr.v1alpha1.SourcePosition */ UPB_INLINE google_api_expr_v1alpha1_SourcePosition* google_api_expr_v1alpha1_SourcePosition_new(upb_Arena* arena) { - return (google_api_expr_v1alpha1_SourcePosition*)_upb_Message_New(&google_api_expr_v1alpha1_SourcePosition_msginit, arena); + return (google_api_expr_v1alpha1_SourcePosition*)_upb_Message_New(&google_api_expr_v1alpha1_SourcePosition_msg_init, arena); } UPB_INLINE google_api_expr_v1alpha1_SourcePosition* google_api_expr_v1alpha1_SourcePosition_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_expr_v1alpha1_SourcePosition* ret = google_api_expr_v1alpha1_SourcePosition_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1320,7 +1697,7 @@ UPB_INLINE google_api_expr_v1alpha1_SourcePosition* google_api_expr_v1alpha1_Sou int options, upb_Arena* arena) { google_api_expr_v1alpha1_SourcePosition* ret = google_api_expr_v1alpha1_SourcePosition_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1328,59 +1705,83 @@ UPB_INLINE google_api_expr_v1alpha1_SourcePosition* google_api_expr_v1alpha1_Sou } UPB_INLINE char* google_api_expr_v1alpha1_SourcePosition_serialize(const google_api_expr_v1alpha1_SourcePosition* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msg_init, 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); +UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_location(google_api_expr_v1alpha1_SourcePosition* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_expr_v1alpha1_SourcePosition_location(const google_api_expr_v1alpha1_SourcePosition* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_offset(const google_api_expr_v1alpha1_SourcePosition* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_offset(google_api_expr_v1alpha1_SourcePosition* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_offset(const google_api_expr_v1alpha1_SourcePosition* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_line(const google_api_expr_v1alpha1_SourcePosition* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_line(google_api_expr_v1alpha1_SourcePosition* msg) { + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_line(const google_api_expr_v1alpha1_SourcePosition* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_column(const google_api_expr_v1alpha1_SourcePosition* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; +UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_column(google_api_expr_v1alpha1_SourcePosition* msg) { + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_column(const google_api_expr_v1alpha1_SourcePosition* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_location(google_api_expr_v1alpha1_SourcePosition *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_offset(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_line(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_column(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_api_expr_v1alpha1_syntax_proto_upb_file_layout; +extern const upb_MiniTableFile google_api_expr_v1alpha1_syntax_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_ */ 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 8a823e0c3a2..591aa2efb8e 100644 --- a/src/core/ext/upb-generated/google/api/http.upb.c +++ b/src/core/ext/upb-generated/google/api/http.upb.c @@ -7,68 +7,101 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/api/http.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_api_Http_submsgs[1] = { - {.submsg = &google_api_HttpRule_msginit}, +static const upb_MiniTableSub google_api_Http_submsgs[1] = { + {.submsg = &google_api_HttpRule_msg_init}, }; -static const upb_MiniTable_Field google_api_Http__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_Http__fields[2] = { + {1, UPB_SIZE(0, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_Http_msginit = { +const upb_MiniTable google_api_Http_msg_init = { &google_api_Http_submsgs[0], &google_api_Http__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max128b}, + {0x000000003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_api_HttpRule_submsgs[2] = { - {.submsg = &google_api_CustomHttpPattern_msginit}, - {.submsg = &google_api_HttpRule_msginit}, +static const upb_MiniTableSub google_api_HttpRule_submsgs[2] = { + {.submsg = &google_api_CustomHttpPattern_msg_init}, + {.submsg = &google_api_HttpRule_msg_init}, }; -static const upb_MiniTable_Field google_api_HttpRule__fields[10] = { - {1, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_HttpRule__fields[10] = { + {1, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(4, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_HttpRule_msginit = { +const upb_MiniTable google_api_HttpRule_msg_init = { &google_api_HttpRule_submsgs[0], &google_api_HttpRule__fields[0], - UPB_SIZE(40, 80), 10, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 80), 10, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00000a, &upb_pss_1bt}, + {0x0008000002000012, &upb_pos_1bt}, + {0x000800000300001a, &upb_pos_1bt}, + {0x0008000004000022, &upb_pos_1bt}, + {0x000800000500002a, &upb_pos_1bt}, + {0x0008000006000032, &upb_pos_1bt}, + {0x002800003f00003a, &upb_pss_1bt}, + {0x0008000008000042, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f01005a, &upb_prm_1bt_max128b}, + {0x004000003f000062, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field google_api_CustomHttpPattern__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_CustomHttpPattern__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_CustomHttpPattern_msginit = { +const upb_MiniTable google_api_CustomHttpPattern_msg_init = { NULL, &google_api_CustomHttpPattern__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &google_api_Http_msginit, - &google_api_HttpRule_msginit, - &google_api_CustomHttpPattern_msginit, + &google_api_Http_msg_init, + &google_api_HttpRule_msg_init, + &google_api_CustomHttpPattern_msg_init, }; -const upb_MiniTable_File google_api_http_proto_upb_file_layout = { +const upb_MiniTableFile google_api_http_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -77,5 +110,5 @@ const upb_MiniTable_File google_api_http_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 afb5b754e95..332f99ebf48 100644 --- a/src/core/ext/upb-generated/google/api/http.upb.h +++ b/src/core/ext/upb-generated/google/api/http.upb.h @@ -9,38 +9,40 @@ #ifndef GOOGLE_API_HTTP_PROTO_UPB_H_ #define GOOGLE_API_HTTP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_api_Http; -struct google_api_HttpRule; -struct google_api_CustomHttpPattern; typedef struct google_api_Http google_api_Http; typedef struct google_api_HttpRule google_api_HttpRule; typedef struct google_api_CustomHttpPattern google_api_CustomHttpPattern; -extern const upb_MiniTable google_api_Http_msginit; -extern const upb_MiniTable google_api_HttpRule_msginit; -extern const upb_MiniTable google_api_CustomHttpPattern_msginit; +extern const upb_MiniTable google_api_Http_msg_init; +extern const upb_MiniTable google_api_HttpRule_msg_init; +extern const upb_MiniTable google_api_CustomHttpPattern_msg_init; /* google.api.Http */ UPB_INLINE google_api_Http* google_api_Http_new(upb_Arena* arena) { - return (google_api_Http*)_upb_Message_New(&google_api_Http_msginit, arena); + return (google_api_Http*)_upb_Message_New(&google_api_Http_msg_init, arena); } UPB_INLINE google_api_Http* google_api_Http_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_Http* ret = google_api_Http_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_Http_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_Http_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +52,7 @@ UPB_INLINE google_api_Http* google_api_Http_parse_ex(const char* buf, size_t siz int options, upb_Arena* arena) { google_api_Http* ret = google_api_Http_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_Http_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_Http_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,56 +60,87 @@ UPB_INLINE google_api_Http* google_api_Http_parse_ex(const char* buf, size_t siz } UPB_INLINE char* google_api_Http_serialize(const google_api_Http* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_Http_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_Http_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_Http_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_Http_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_api_Http_clear_rules(google_api_Http* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_HttpRule* const* google_api_Http_rules(const google_api_Http* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_HttpRule* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_api_Http_has_rules(const google_api_Http* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + google_api_Http_rules(msg, &size); + return size != 0; } -UPB_INLINE void google_api_Http_clear_rules(const google_api_Http* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const google_api_HttpRule* const* google_api_Http_rules(const google_api_Http* msg, size_t* len) { - return (const google_api_HttpRule* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE void google_api_Http_clear_fully_decode_reserved_expansion(const google_api_Http* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE void google_api_Http_clear_fully_decode_reserved_expansion(google_api_Http* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http* msg, size_t* len) { - return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_HttpRule**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_HttpRule** google_api_Http_resize_rules(google_api_Http* msg, size_t len, upb_Arena* arena) { - return (google_api_HttpRule**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_HttpRule** google_api_Http_resize_rules(google_api_Http* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_HttpRule**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_HttpRule* google_api_Http_add_rules(google_api_Http* msg, upb_Arena* arena) { - struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(0, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.api.HttpRule */ UPB_INLINE google_api_HttpRule* google_api_HttpRule_new(upb_Arena* arena) { - return (google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msginit, arena); + return (google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msg_init, arena); } UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_HttpRule* ret = google_api_HttpRule_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_HttpRule_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_HttpRule_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -117,7 +150,7 @@ UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse_ex(const char* buf, si int options, upb_Arena* arena) { google_api_HttpRule* ret = google_api_HttpRule_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_HttpRule_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_HttpRule_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -125,13 +158,13 @@ UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse_ex(const char* buf, si } UPB_INLINE char* google_api_HttpRule_serialize(const google_api_HttpRule* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_HttpRule_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_HttpRule_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_HttpRule_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_HttpRule_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -144,148 +177,233 @@ typedef enum { google_api_HttpRule_pattern_NOT_SET = 0 } google_api_HttpRule_pattern_oneofcases; UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule* msg) { - return (google_api_HttpRule_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (google_api_HttpRule_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void google_api_HttpRule_clear_selector(const google_api_HttpRule* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_HttpRule_clear_selector(google_api_HttpRule* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_selector(const google_api_HttpRule* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; -} -UPB_INLINE void google_api_HttpRule_clear_get(const google_api_HttpRule* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET); +UPB_INLINE void google_api_HttpRule_clear_get(google_api_HttpRule* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_get(const google_api_HttpRule* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_HttpRule_clear_put(const google_api_HttpRule* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET); +UPB_INLINE void google_api_HttpRule_clear_put(google_api_HttpRule* msg) { + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_put(const google_api_HttpRule* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule* msg) { + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_HttpRule_clear_post(const google_api_HttpRule* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET); +UPB_INLINE void google_api_HttpRule_clear_post(google_api_HttpRule* msg) { + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_post(const google_api_HttpRule* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule* msg) { + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_HttpRule_clear_delete(const google_api_HttpRule* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET); +UPB_INLINE void google_api_HttpRule_clear_delete(google_api_HttpRule* msg) { + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_delete(const google_api_HttpRule* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule* msg) { + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_api_HttpRule_clear_patch(const google_api_HttpRule* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET); +UPB_INLINE void google_api_HttpRule_clear_patch(google_api_HttpRule* msg) { + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_patch(const google_api_HttpRule* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_HttpRule_clear_body(const google_api_HttpRule* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule* msg) { + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_HttpRule_clear_body(google_api_HttpRule* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_body(const google_api_HttpRule* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8; -} -UPB_INLINE void google_api_HttpRule_clear_custom(const google_api_HttpRule* msg) { - UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET); +UPB_INLINE void google_api_HttpRule_clear_custom(google_api_HttpRule* msg) { + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_api_CustomHttpPattern* google_api_HttpRule_custom(const google_api_HttpRule* msg) { - return UPB_READ_ONEOF(msg, const google_api_CustomHttpPattern*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL); + const google_api_CustomHttpPattern* default_val = NULL; + const google_api_CustomHttpPattern* ret; + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule* msg) { + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_api_HttpRule_clear_additional_bindings(google_api_HttpRule* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_api_HttpRule* const* google_api_HttpRule_additional_bindings(const google_api_HttpRule* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(4, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_api_HttpRule* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_HttpRule_has_additional_bindings(const google_api_HttpRule* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); + size_t size; + google_api_HttpRule_additional_bindings(msg, &size); + return size != 0; } -UPB_INLINE void google_api_HttpRule_clear_additional_bindings(const google_api_HttpRule* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE const google_api_HttpRule* const* google_api_HttpRule_additional_bindings(const google_api_HttpRule* msg, size_t* len) { - return (const google_api_HttpRule* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); -} -UPB_INLINE void google_api_HttpRule_clear_response_body(const google_api_HttpRule* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_HttpRule_clear_response_body(google_api_HttpRule* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpRule_response_body(const google_api_HttpRule* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern* value) { - UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8); + const upb_MiniTableField field = {8, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule* msg, upb_Arena* arena) { struct google_api_CustomHttpPattern* sub = (struct google_api_CustomHttpPattern*)google_api_HttpRule_custom(msg); if (sub == NULL) { - sub = (struct google_api_CustomHttpPattern*)_upb_Message_New(&google_api_CustomHttpPattern_msginit, arena); - if (!sub) return NULL; - google_api_HttpRule_set_custom(msg, sub); + sub = (struct google_api_CustomHttpPattern*)_upb_Message_New(&google_api_CustomHttpPattern_msg_init, arena); + if (sub) google_api_HttpRule_set_custom(msg, sub); } return sub; } -UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule* msg, size_t* len) { - return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(4, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_api_HttpRule**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule* msg, size_t len, upb_Arena* arena) { - return (google_api_HttpRule**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(4, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_api_HttpRule**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_api_HttpRule* google_api_HttpRule_add_additional_bindings(google_api_HttpRule* msg, upb_Arena* arena) { - struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {11, UPB_SIZE(4, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = value; + const upb_MiniTableField field = {12, UPB_SIZE(32, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.api.CustomHttpPattern */ UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_new(upb_Arena* arena) { - return (google_api_CustomHttpPattern*)_upb_Message_New(&google_api_CustomHttpPattern_msginit, arena); + return (google_api_CustomHttpPattern*)_upb_Message_New(&google_api_CustomHttpPattern_msg_init, arena); } UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_CustomHttpPattern* ret = google_api_CustomHttpPattern_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_CustomHttpPattern_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -295,7 +413,7 @@ UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse_ex(c int options, upb_Arena* arena) { google_api_CustomHttpPattern* ret = google_api_CustomHttpPattern_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_CustomHttpPattern_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -303,41 +421,53 @@ UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse_ex(c } UPB_INLINE char* google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_CustomHttpPattern_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_CustomHttpPattern_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_CustomHttpPattern_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_CustomHttpPattern_msg_init, 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); +UPB_INLINE void google_api_CustomHttpPattern_clear_kind(google_api_CustomHttpPattern* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_CustomHttpPattern_clear_path(const google_api_CustomHttpPattern* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_CustomHttpPattern_clear_path(google_api_CustomHttpPattern* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_api_http_proto_upb_file_layout; +extern const upb_MiniTableFile google_api_http_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_HTTP_PROTO_UPB_H_ */ 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 832eb6b5da8..8e160ee18ac 100644 --- a/src/core/ext/upb-generated/google/api/httpbody.upb.c +++ b/src/core/ext/upb-generated/google/api/httpbody.upb.c @@ -7,33 +7,42 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/api/httpbody.upb.h" #include "google/protobuf/any.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_api_HttpBody_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub google_api_HttpBody_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field google_api_HttpBody__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_api_HttpBody__fields[3] = { + {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_api_HttpBody_msginit = { +const upb_MiniTable google_api_HttpBody_msg_init = { &google_api_HttpBody_submsgs[0], &google_api_HttpBody__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_psb_1bt}, + {0x002000003f00001a, &upb_prm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &google_api_HttpBody_msginit, + &google_api_HttpBody_msg_init, }; -const upb_MiniTable_File google_api_httpbody_proto_upb_file_layout = { +const upb_MiniTableFile google_api_httpbody_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +51,5 @@ const upb_MiniTable_File google_api_httpbody_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 19ef4ec0a77..42da0da976c 100644 --- a/src/core/ext/upb-generated/google/api/httpbody.upb.h +++ b/src/core/ext/upb-generated/google/api/httpbody.upb.h @@ -9,34 +9,38 @@ #ifndef GOOGLE_API_HTTPBODY_PROTO_UPB_H_ #define GOOGLE_API_HTTPBODY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_api_HttpBody; typedef struct google_api_HttpBody google_api_HttpBody; -extern const upb_MiniTable google_api_HttpBody_msginit; +extern const upb_MiniTable google_api_HttpBody_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* google.api.HttpBody */ UPB_INLINE google_api_HttpBody* google_api_HttpBody_new(upb_Arena* arena) { - return (google_api_HttpBody*)_upb_Message_New(&google_api_HttpBody_msginit, arena); + return (google_api_HttpBody*)_upb_Message_New(&google_api_HttpBody_msg_init, arena); } UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse(const char* buf, size_t size, upb_Arena* arena) { google_api_HttpBody* ret = google_api_HttpBody_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_HttpBody_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_api_HttpBody_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse_ex(const char* buf, si int options, upb_Arena* arena) { google_api_HttpBody* ret = google_api_HttpBody_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_api_HttpBody_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_api_HttpBody_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,62 +58,99 @@ UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse_ex(const char* buf, si } UPB_INLINE char* google_api_HttpBody_serialize(const google_api_HttpBody* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_api_HttpBody_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_HttpBody_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_api_HttpBody_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_api_HttpBody_msg_init, 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); +UPB_INLINE void google_api_HttpBody_clear_content_type(google_api_HttpBody* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpBody_content_type(const google_api_HttpBody* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_api_HttpBody_clear_data(const google_api_HttpBody* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_api_HttpBody_clear_data(google_api_HttpBody* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_api_HttpBody_data(const google_api_HttpBody* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void google_api_HttpBody_clear_extensions(google_api_HttpBody* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Any* const* google_api_HttpBody_extensions(const google_api_HttpBody* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_api_HttpBody_has_extensions(const google_api_HttpBody* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void google_api_HttpBody_clear_extensions(const google_api_HttpBody* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE const struct google_protobuf_Any* const* google_api_HttpBody_extensions(const google_api_HttpBody* msg, size_t* len) { - return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); + size_t size; + google_api_HttpBody_extensions(msg, &size); + return size != 0; } UPB_INLINE void google_api_HttpBody_set_content_type(google_api_HttpBody *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_api_HttpBody_set_data(google_api_HttpBody *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_mutable_extensions(google_api_HttpBody* msg, size_t* len) { - return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_mutable_extensions(google_api_HttpBody* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Any**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_resize_extensions(google_api_HttpBody* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_resize_extensions(google_api_HttpBody* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Any* google_api_HttpBody_add_extensions(google_api_HttpBody* msg, upb_Arena* arena) { - struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File google_api_httpbody_proto_upb_file_layout; +extern const upb_MiniTableFile google_api_httpbody_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_HTTPBODY_PROTO_UPB_H_ */ 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 9a6718b46c1..1d1b285f5fd 100644 --- a/src/core/ext/upb-generated/google/protobuf/any.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/any.upb.c @@ -7,27 +7,36 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/any.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field google_protobuf_Any__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Any__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Any_msginit = { +const upb_MiniTable google_protobuf_Any_msg_init = { NULL, &google_protobuf_Any__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &google_protobuf_Any_msginit, + &google_protobuf_Any_msg_init, }; -const upb_MiniTable_File google_protobuf_any_proto_upb_file_layout = { +const upb_MiniTableFile google_protobuf_any_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -36,5 +45,5 @@ const upb_MiniTable_File google_protobuf_any_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 8ef20c3ab25..9e55d034e94 100644 --- a/src/core/ext/upb-generated/google/protobuf/any.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/any.upb.h @@ -9,32 +9,36 @@ #ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_Any; typedef struct google_protobuf_Any google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* google.protobuf.Any */ UPB_INLINE google_protobuf_Any* google_protobuf_Any_new(upb_Arena* arena) { - return (google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); + return (google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); } UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Any* ret = google_protobuf_Any_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Any_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Any_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse_ex(const char* buf, si int options, upb_Arena* arena) { google_protobuf_Any* ret = google_protobuf_Any_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Any_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Any_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,41 +56,53 @@ UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse_ex(const char* buf, si } UPB_INLINE char* google_protobuf_Any_serialize(const google_protobuf_Any* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Any_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Any_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Any_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Any_msg_init, 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); +UPB_INLINE void google_protobuf_Any_clear_type_url(google_protobuf_Any* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_Any_type_url(const google_protobuf_Any* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_protobuf_Any_clear_value(const google_protobuf_Any* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_protobuf_Any_clear_value(google_protobuf_Any* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_Any_value(const google_protobuf_Any* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_protobuf_any_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_any_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ */ 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 bb7a88f5de6..8a5b5e1e050 100644 --- a/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c @@ -7,572 +7,1124 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_protobuf_FileDescriptorSet_submsgs[1] = { - {.submsg = &google_protobuf_FileDescriptorProto_msginit}, +static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = { + {.submsg = &google_protobuf_FileDescriptorProto_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_FileDescriptorSet__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_FileDescriptorSet_msginit = { +const upb_MiniTable google_protobuf_FileDescriptorSet_msg_init = { &google_protobuf_FileDescriptorSet_submsgs[0], &google_protobuf_FileDescriptorSet__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max192b}, + }) }; -static const upb_MiniTable_Sub google_protobuf_FileDescriptorProto_submsgs[6] = { - {.submsg = &google_protobuf_DescriptorProto_msginit}, - {.submsg = &google_protobuf_EnumDescriptorProto_msginit}, - {.submsg = &google_protobuf_ServiceDescriptorProto_msginit}, - {.submsg = &google_protobuf_FieldDescriptorProto_msginit}, - {.submsg = &google_protobuf_FileOptions_msginit}, - {.submsg = &google_protobuf_SourceCodeInfo_msginit}, +static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[6] = { + {.submsg = &google_protobuf_DescriptorProto_msg_init}, + {.submsg = &google_protobuf_EnumDescriptorProto_msg_init}, + {.submsg = &google_protobuf_ServiceDescriptorProto_msg_init}, + {.submsg = &google_protobuf_FieldDescriptorProto_msg_init}, + {.submsg = &google_protobuf_FileOptions_msg_init}, + {.submsg = &google_protobuf_SourceCodeInfo_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_FileDescriptorProto__fields[12] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 64), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(36, 72), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(40, 80), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(44, 88), UPB_SIZE(4, 4), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(48, 96), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(52, 104), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(56, 112), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] = { + {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_FileDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_FileDescriptorProto_msg_init = { &google_protobuf_FileDescriptorProto_submsgs[0], &google_protobuf_FileDescriptorProto__fields[0], - UPB_SIZE(64, 128), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(72, 144), 13, kUpb_ExtMode_NonExtendable, 13, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800003f00001a, &upb_prb_1bt}, + {0x003000003f000022, &upb_prm_1bt_max128b}, + {0x003800003f01002a, &upb_prm_1bt_max64b}, + {0x004000003f020032, &upb_prm_1bt_max64b}, + {0x004800003f03003a, &upb_prm_1bt_max128b}, + {0x0050000003040042, &upb_psm_1bt_max256b}, + {0x005800000405004a, &upb_psm_1bt_max64b}, + {0x006000003f000050, &upb_prv4_1bt}, + {0x006800003f000058, &upb_prv4_1bt}, + {0x0070000005000062, &upb_psb_1bt}, + {0x008000000600006a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_DescriptorProto_submsgs[8] = { - {.submsg = &google_protobuf_FieldDescriptorProto_msginit}, - {.submsg = &google_protobuf_DescriptorProto_msginit}, - {.submsg = &google_protobuf_EnumDescriptorProto_msginit}, - {.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msginit}, - {.submsg = &google_protobuf_FieldDescriptorProto_msginit}, - {.submsg = &google_protobuf_MessageOptions_msginit}, - {.submsg = &google_protobuf_OneofDescriptorProto_msginit}, - {.submsg = &google_protobuf_DescriptorProto_ReservedRange_msginit}, +static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = { + {.submsg = &google_protobuf_FieldDescriptorProto_msg_init}, + {.submsg = &google_protobuf_DescriptorProto_msg_init}, + {.submsg = &google_protobuf_EnumDescriptorProto_msg_init}, + {.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msg_init}, + {.submsg = &google_protobuf_FieldDescriptorProto_msg_init}, + {.submsg = &google_protobuf_MessageOptions_msg_init}, + {.submsg = &google_protobuf_OneofDescriptorProto_msg_init}, + {.submsg = &google_protobuf_DescriptorProto_ReservedRange_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_DescriptorProto__fields[10] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 64), UPB_SIZE(2, 2), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(44, 88), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = { + {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_DescriptorProto_msginit = { +const upb_MiniTable google_protobuf_DescriptorProto_msg_init = { &google_protobuf_DescriptorProto_submsgs[0], &google_protobuf_DescriptorProto__fields[0], - UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000003f01001a, &upb_prm_1bt_max128b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f03002a, &upb_prm_1bt_max64b}, + {0x003800003f040032, &upb_prm_1bt_max128b}, + {0x004000000205003a, &upb_psm_1bt_max64b}, + {0x004800003f060042, &upb_prm_1bt_max64b}, + {0x005000003f07004a, &upb_prm_1bt_max64b}, + {0x005800003f000052, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { - {.submsg = &google_protobuf_ExtensionRangeOptions_msginit}, +static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { + {.submsg = &google_protobuf_ExtensionRangeOptions_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(3, 3), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__fields[3] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msginit = { +const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msg_init = { &google_protobuf_DescriptorProto_ExtensionRange_submsgs[0], &google_protobuf_DescriptorProto_ExtensionRange__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x001000000300001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field google_protobuf_DescriptorProto_ReservedRange__fields[2] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_DescriptorProto_ReservedRange__fields[2] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit = { +const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = { NULL, &google_protobuf_DescriptorProto_ReservedRange__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_ExtensionRangeOptions_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_ExtensionRangeOptions__fields[1] = { - {999, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[1] = { + {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit = { +const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { &google_protobuf_ExtensionRangeOptions_submsgs[0], &google_protobuf_ExtensionRangeOptions__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_FieldDescriptorProto_submsgs[3] = { - {.subenum = &google_protobuf_FieldDescriptorProto_Label_enuminit}, - {.subenum = &google_protobuf_FieldDescriptorProto_Type_enuminit}, - {.submsg = &google_protobuf_FieldOptions_msginit}, +static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = { + {.subenum = &google_protobuf_FieldDescriptorProto_Label_enum_init}, + {.subenum = &google_protobuf_FieldDescriptorProto_Type_enum_init}, + {.submsg = &google_protobuf_FieldOptions_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_FieldDescriptorProto__fields[11] = { - {1, UPB_SIZE(24, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(32, 40), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(3, 3), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 12), UPB_SIZE(5, 5), 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 56), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(48, 72), UPB_SIZE(7, 7), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(56, 88), UPB_SIZE(8, 8), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(16, 16), UPB_SIZE(9, 9), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(60, 96), UPB_SIZE(10, 10), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(20, 20), UPB_SIZE(11, 11), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] = { + {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init = { &google_protobuf_FieldDescriptorProto_submsgs[0], &google_protobuf_FieldDescriptorProto__fields[0], - UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0028000002000012, &upb_psb_1bt}, + {0x0004000003000018, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0038000006000032, &upb_psb_1bt}, + {0x004800000700003a, &upb_psb_1bt}, + {0x0058000008020042, &upb_psm_1bt_max64b}, + {0x0010000009000048, &upb_psv4_1bt}, + {0x006000000a000052, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001400000b000188, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_OneofDescriptorProto_submsgs[1] = { - {.submsg = &google_protobuf_OneofOptions_msginit}, +static const upb_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = { + {.submsg = &google_protobuf_OneofOptions_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_OneofDescriptorProto__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] = { + {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_OneofDescriptorProto_msg_init = { &google_protobuf_OneofDescriptorProto_submsgs[0], &google_protobuf_OneofDescriptorProto__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_EnumDescriptorProto_submsgs[3] = { - {.submsg = &google_protobuf_EnumValueDescriptorProto_msginit}, - {.submsg = &google_protobuf_EnumOptions_msginit}, - {.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit}, +static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = { + {.submsg = &google_protobuf_EnumValueDescriptorProto_msg_init}, + {.submsg = &google_protobuf_EnumOptions_msg_init}, + {.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = { + {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_EnumDescriptorProto_msg_init = { &google_protobuf_EnumDescriptorProto_submsgs[0], &google_protobuf_EnumDescriptorProto__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f00002a, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = { +const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init = { NULL, &google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_EnumValueDescriptorProto_submsgs[1] = { - {.submsg = &google_protobuf_EnumValueOptions_msginit}, +static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = { + {.submsg = &google_protobuf_EnumValueOptions_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_EnumValueDescriptorProto__fields[3] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields[3] = { + {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msg_init = { &google_protobuf_EnumValueDescriptorProto_submsgs[0], &google_protobuf_EnumValueDescriptorProto__fields[0], - UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0004000002000010, &upb_psv4_1bt}, + {0x001800000300001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_protobuf_ServiceDescriptorProto_submsgs[2] = { - {.submsg = &google_protobuf_MethodDescriptorProto_msginit}, - {.submsg = &google_protobuf_ServiceOptions_msginit}, +static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = { + {.submsg = &google_protobuf_MethodDescriptorProto_msg_init}, + {.submsg = &google_protobuf_ServiceOptions_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_ServiceDescriptorProto__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3] = { + {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_ServiceDescriptorProto_msg_init = { &google_protobuf_ServiceDescriptorProto_submsgs[0], &google_protobuf_ServiceDescriptorProto__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub google_protobuf_MethodDescriptorProto_submsgs[1] = { - {.submsg = &google_protobuf_MethodOptions_msginit}, +static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = { + {.submsg = &google_protobuf_MethodOptions_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_MethodDescriptorProto__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(3, 3), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 56), UPB_SIZE(4, 4), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(1, 1), UPB_SIZE(5, 5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(2, 2), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] = { + {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit = { +const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init = { &google_protobuf_MethodDescriptorProto_submsgs[0], &google_protobuf_MethodDescriptorProto__fields[0], - UPB_SIZE(32, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800000300001a, &upb_psb_1bt}, + {0x0038000004000022, &upb_psm_1bt_max64b}, + {0x0001000005000028, &upb_psb1_1bt}, + {0x0002000006000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_FileOptions_submsgs[2] = { - {.subenum = &google_protobuf_FileOptions_OptimizeMode_enuminit}, - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[2] = { + {.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init}, + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_FileOptions__fields[21] = { - {1, UPB_SIZE(20, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(28, 40), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(4, 4), UPB_SIZE(3, 3), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(8, 8), UPB_SIZE(4, 4), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(36, 56), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(9, 9), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(10, 10), UPB_SIZE(7, 7), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(11, 11), UPB_SIZE(8, 8), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(12, 12), UPB_SIZE(9, 9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(13, 13), UPB_SIZE(10, 10), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {27, UPB_SIZE(14, 14), UPB_SIZE(11, 11), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {31, UPB_SIZE(15, 15), UPB_SIZE(12, 12), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(44, 72), UPB_SIZE(13, 13), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(52, 88), UPB_SIZE(14, 14), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {39, UPB_SIZE(60, 104), UPB_SIZE(15, 15), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {40, UPB_SIZE(68, 120), UPB_SIZE(16, 16), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {41, UPB_SIZE(76, 136), UPB_SIZE(17, 17), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {42, UPB_SIZE(16, 16), UPB_SIZE(18, 18), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {44, UPB_SIZE(84, 152), UPB_SIZE(19, 19), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {45, UPB_SIZE(92, 168), UPB_SIZE(20, 20), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(100, 184), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { + {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_FileOptions_msginit = { +const upb_MiniTable google_protobuf_FileOptions_msg_init = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0028000002000042, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000004000050, &upb_psb1_1bt}, + {0x003800000500005a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0009000006000180, &upb_psb1_2bt}, + {0x000a000007000188, &upb_psb1_2bt}, + {0x000b000008000190, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000c0000090001a0, &upb_psb1_2bt}, + {0x005800000e0002aa, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000d00000a0001b8, &upb_psb1_2bt}, + {0x00780000100002c2, &upb_psb_2bt}, + {0x00880000110002ca, &upb_psb_2bt}, + {0x00100000120002d0, &upb_psb1_2bt}, + {0x000e00000b0001d8, &upb_psb1_2bt}, + {0x00980000130002e2, &upb_psb_2bt}, + {0x00a80000140002ea, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000f00000c0001f8, &upb_psb1_2bt}, + }) }; -static const upb_MiniTable_Sub google_protobuf_MessageOptions_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_MessageOptions__fields[5] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(2, 2), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(3, 3), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 4), UPB_SIZE(4, 4), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_MessageOptions__fields[6] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_MessageOptions_msginit = { +const upb_MiniTable google_protobuf_MessageOptions_msg_init = { &google_protobuf_MessageOptions_submsgs[0], &google_protobuf_MessageOptions__fields[0], - UPB_SIZE(16, 16), 5, kUpb_ExtMode_Extendable, 3, 255, 0, + 16, 6, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0002000002000010, &upb_psb1_1bt}, + {0x0003000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000004000038, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0005000005000058, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_FieldOptions_submsgs[3] = { - {.subenum = &google_protobuf_FieldOptions_CType_enuminit}, - {.subenum = &google_protobuf_FieldOptions_JSType_enuminit}, - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[5] = { + {.subenum = &google_protobuf_FieldOptions_CType_enum_init}, + {.subenum = &google_protobuf_FieldOptions_JSType_enum_init}, + {.subenum = &google_protobuf_FieldOptions_OptionRetention_enum_init}, + {.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init}, + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_FieldOptions__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(9, 9), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(10, 10), UPB_SIZE(4, 4), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(12, 12), UPB_SIZE(5, 5), 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(16, 16), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(17, 17), UPB_SIZE(7, 7), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(20, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FieldOptions__fields[11] = { + {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_FieldOptions_msginit = { +const upb_MiniTable google_protobuf_FieldOptions_msg_init = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(24, 32), 8, kUpb_ExtMode_Extendable, 3, 255, 0, + UPB_SIZE(32, 40), 11, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000002000010, &upb_psb1_1bt}, + {0x0009000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000a000004000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000006000050, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0011000007000078, &upb_psb1_1bt}, + {0x0012000008000180, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f043eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_OneofOptions_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_OneofOptions__fields[1] = { - {999, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_OneofOptions__fields[1] = { + {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_OneofOptions_msginit = { +const upb_MiniTable google_protobuf_OneofOptions_msg_init = { &google_protobuf_OneofOptions_submsgs[0], &google_protobuf_OneofOptions__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_EnumOptions_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_EnumOptions__fields[3] = { - {2, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(2, 2), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_EnumOptions__fields[4] = { + {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_EnumOptions_msginit = { +const upb_MiniTable google_protobuf_EnumOptions_msg_init = { &google_protobuf_EnumOptions_submsgs[0], &google_protobuf_EnumOptions__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000010, &upb_psb1_1bt}, + {0x0002000002000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0003000003000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_EnumValueOptions_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_EnumValueOptions__fields[2] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[2] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_EnumValueOptions_msginit = { +const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { &google_protobuf_EnumValueOptions_submsgs[0], &google_protobuf_EnumValueOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_ServiceOptions_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_ServiceOptions__fields[2] = { - {33, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_ServiceOptions__fields[2] = { + {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_ServiceOptions_msginit = { +const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { &google_protobuf_ServiceOptions_submsgs[0], &google_protobuf_ServiceOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_MethodOptions_submsgs[2] = { - {.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enuminit}, - {.submsg = &google_protobuf_UninterpretedOption_msginit}, +static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[2] = { + {.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init}, + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_MethodOptions__fields[3] = { - {33, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {34, UPB_SIZE(4, 4), UPB_SIZE(2, 2), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_MethodOptions__fields[3] = { + {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_MethodOptions_msginit = { +const upb_MiniTable google_protobuf_MethodOptions_msg_init = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - UPB_SIZE(16, 16), 3, kUpb_ExtMode_Extendable, 0, 255, 0, + 16, 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f013eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_UninterpretedOption_submsgs[1] = { - {.submsg = &google_protobuf_UninterpretedOption_NamePart_msginit}, +static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_NamePart_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_UninterpretedOption__fields[7] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 64), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(40, 72), UPB_SIZE(3, 3), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(48, 80), UPB_SIZE(4, 4), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(16, 32), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 48), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = { + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_UninterpretedOption_msginit = { +const upb_MiniTable google_protobuf_UninterpretedOption_msg_init = { &google_protobuf_UninterpretedOption_submsgs[0], &google_protobuf_UninterpretedOption__fields[0], - UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x001000000100001a, &upb_psb_1bt}, + {0x0020000002000020, &upb_psv8_1bt}, + {0x0028000003000028, &upb_psv8_1bt}, + {0x0030000004000031, &upb_psf8_1bt}, + {0x003800000500003a, &upb_psb_1bt}, + {0x0048000006000042, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field google_protobuf_UninterpretedOption_NamePart__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_UninterpretedOption_NamePart__fields[2] = { + {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit = { +const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init = { NULL, &google_protobuf_UninterpretedOption_NamePart__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 2, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0001000002000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_SourceCodeInfo_submsgs[1] = { - {.submsg = &google_protobuf_SourceCodeInfo_Location_msginit}, +static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = { + {.submsg = &google_protobuf_SourceCodeInfo_Location_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_SourceCodeInfo__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_SourceCodeInfo_msginit = { +const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init = { &google_protobuf_SourceCodeInfo_submsgs[0], &google_protobuf_SourceCodeInfo__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + }) }; -static const upb_MiniTable_Field google_protobuf_SourceCodeInfo_Location__fields[5] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_SourceCodeInfo_Location__fields[5] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit = { +const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init = { NULL, &google_protobuf_SourceCodeInfo_Location__fields[0], - UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_ppv4_1bt}, + {0x001000003f000012, &upb_ppv4_1bt}, + {0x001800000100001a, &upb_psb_1bt}, + {0x0028000002000022, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f000032, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_GeneratedCodeInfo_submsgs[1] = { - {.submsg = &google_protobuf_GeneratedCodeInfo_Annotation_msginit}, +static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = { + {.submsg = &google_protobuf_GeneratedCodeInfo_Annotation_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit = { +const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init = { &google_protobuf_GeneratedCodeInfo_submsgs[0], &google_protobuf_GeneratedCodeInfo__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(3, 3), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = { + {.subenum = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init}, }; -const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit = { - NULL, +static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fields[5] = { + {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = { + &google_protobuf_GeneratedCodeInfo_Annotation_submsgs[0], &google_protobuf_GeneratedCodeInfo_Annotation__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_ppv4_1bt}, + {0x0018000001000012, &upb_psb_1bt}, + {0x0004000002000018, &upb_psv4_1bt}, + {0x0008000003000020, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[27] = { - &google_protobuf_FileDescriptorSet_msginit, - &google_protobuf_FileDescriptorProto_msginit, - &google_protobuf_DescriptorProto_msginit, - &google_protobuf_DescriptorProto_ExtensionRange_msginit, - &google_protobuf_DescriptorProto_ReservedRange_msginit, - &google_protobuf_ExtensionRangeOptions_msginit, - &google_protobuf_FieldDescriptorProto_msginit, - &google_protobuf_OneofDescriptorProto_msginit, - &google_protobuf_EnumDescriptorProto_msginit, - &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, - &google_protobuf_EnumValueDescriptorProto_msginit, - &google_protobuf_ServiceDescriptorProto_msginit, - &google_protobuf_MethodDescriptorProto_msginit, - &google_protobuf_FileOptions_msginit, - &google_protobuf_MessageOptions_msginit, - &google_protobuf_FieldOptions_msginit, - &google_protobuf_OneofOptions_msginit, - &google_protobuf_EnumOptions_msginit, - &google_protobuf_EnumValueOptions_msginit, - &google_protobuf_ServiceOptions_msginit, - &google_protobuf_MethodOptions_msginit, - &google_protobuf_UninterpretedOption_msginit, - &google_protobuf_UninterpretedOption_NamePart_msginit, - &google_protobuf_SourceCodeInfo_msginit, - &google_protobuf_SourceCodeInfo_Location_msginit, - &google_protobuf_GeneratedCodeInfo_msginit, - &google_protobuf_GeneratedCodeInfo_Annotation_msginit, + &google_protobuf_FileDescriptorSet_msg_init, + &google_protobuf_FileDescriptorProto_msg_init, + &google_protobuf_DescriptorProto_msg_init, + &google_protobuf_DescriptorProto_ExtensionRange_msg_init, + &google_protobuf_DescriptorProto_ReservedRange_msg_init, + &google_protobuf_ExtensionRangeOptions_msg_init, + &google_protobuf_FieldDescriptorProto_msg_init, + &google_protobuf_OneofDescriptorProto_msg_init, + &google_protobuf_EnumDescriptorProto_msg_init, + &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, + &google_protobuf_EnumValueDescriptorProto_msg_init, + &google_protobuf_ServiceDescriptorProto_msg_init, + &google_protobuf_MethodDescriptorProto_msg_init, + &google_protobuf_FileOptions_msg_init, + &google_protobuf_MessageOptions_msg_init, + &google_protobuf_FieldOptions_msg_init, + &google_protobuf_OneofOptions_msg_init, + &google_protobuf_EnumOptions_msg_init, + &google_protobuf_EnumValueOptions_msg_init, + &google_protobuf_ServiceOptions_msg_init, + &google_protobuf_MethodOptions_msg_init, + &google_protobuf_UninterpretedOption_msg_init, + &google_protobuf_UninterpretedOption_NamePart_msg_init, + &google_protobuf_SourceCodeInfo_msg_init, + &google_protobuf_SourceCodeInfo_Location_msg_init, + &google_protobuf_GeneratedCodeInfo_msg_init, + &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, }; -const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Type_enuminit = { - NULL, - 0x7fffeULL, +const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init = { + 64, 0, + { + 0xe, + 0x0, + }, }; -const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Label_enuminit = { - NULL, - 0xeULL, +const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init = { + 64, 0, + { + 0x7fffe, + 0x0, + }, }; -const upb_MiniTable_Enum google_protobuf_FileOptions_OptimizeMode_enuminit = { - NULL, - 0xeULL, +const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init = { + 64, 0, + { + 0x7, + 0x0, + }, }; -const upb_MiniTable_Enum google_protobuf_FieldOptions_CType_enuminit = { - NULL, - 0x7ULL, +const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init = { + 64, 0, + { + 0x7, + 0x0, + }, }; -const upb_MiniTable_Enum google_protobuf_FieldOptions_JSType_enuminit = { - NULL, - 0x7ULL, +const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init = { + 64, 0, + { + 0x7, + 0x0, + }, }; -const upb_MiniTable_Enum google_protobuf_MethodOptions_IdempotencyLevel_enuminit = { - NULL, - 0x7ULL, +const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init = { + 64, 0, + { + 0x3ff, + 0x0, + }, }; -static const upb_MiniTable_Enum *enums_layout[6] = { - &google_protobuf_FieldDescriptorProto_Type_enuminit, - &google_protobuf_FieldDescriptorProto_Label_enuminit, - &google_protobuf_FileOptions_OptimizeMode_enuminit, - &google_protobuf_FieldOptions_CType_enuminit, - &google_protobuf_FieldOptions_JSType_enuminit, - &google_protobuf_MethodOptions_IdempotencyLevel_enuminit, +const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init = { + 64, + 0, + { + 0xe, + 0x0, + }, }; -const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout = { +const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +static const upb_MiniTableEnum *enums_layout[9] = { + &google_protobuf_FieldDescriptorProto_Label_enum_init, + &google_protobuf_FieldDescriptorProto_Type_enum_init, + &google_protobuf_FieldOptions_CType_enum_init, + &google_protobuf_FieldOptions_JSType_enum_init, + &google_protobuf_FieldOptions_OptionRetention_enum_init, + &google_protobuf_FieldOptions_OptionTargetType_enum_init, + &google_protobuf_FileOptions_OptimizeMode_enum_init, + &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init, + &google_protobuf_MethodOptions_IdempotencyLevel_enum_init, +}; + +const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = { messages_layout, enums_layout, NULL, 27, - 6, + 9, 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 05269f4be96..a464bb26cb3 100644 --- a/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h @@ -9,44 +9,22 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_FileDescriptorSet; -struct google_protobuf_FileDescriptorProto; -struct google_protobuf_DescriptorProto; -struct google_protobuf_DescriptorProto_ExtensionRange; -struct google_protobuf_DescriptorProto_ReservedRange; -struct google_protobuf_ExtensionRangeOptions; -struct google_protobuf_FieldDescriptorProto; -struct google_protobuf_OneofDescriptorProto; -struct google_protobuf_EnumDescriptorProto; -struct google_protobuf_EnumDescriptorProto_EnumReservedRange; -struct google_protobuf_EnumValueDescriptorProto; -struct google_protobuf_ServiceDescriptorProto; -struct google_protobuf_MethodDescriptorProto; -struct google_protobuf_FileOptions; -struct google_protobuf_MessageOptions; -struct google_protobuf_FieldOptions; -struct google_protobuf_OneofOptions; -struct google_protobuf_EnumOptions; -struct google_protobuf_EnumValueOptions; -struct google_protobuf_ServiceOptions; -struct google_protobuf_MethodOptions; -struct google_protobuf_UninterpretedOption; -struct google_protobuf_UninterpretedOption_NamePart; -struct google_protobuf_SourceCodeInfo; -struct google_protobuf_SourceCodeInfo_Location; -struct google_protobuf_GeneratedCodeInfo; -struct google_protobuf_GeneratedCodeInfo_Annotation; typedef struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet; typedef struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto; typedef struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto; @@ -74,33 +52,33 @@ typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo; typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location; typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo; typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation; -extern const upb_MiniTable google_protobuf_FileDescriptorSet_msginit; -extern const upb_MiniTable google_protobuf_FileDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_DescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msginit; -extern const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit; -extern const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit; -extern const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_OneofOptions_msginit; -extern const upb_MiniTable google_protobuf_EnumOptions_msginit; -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_ServiceOptions_msginit; -extern const upb_MiniTable google_protobuf_MethodOptions_msginit; -extern const upb_MiniTable google_protobuf_UninterpretedOption_msginit; -extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit; -extern const upb_MiniTable google_protobuf_SourceCodeInfo_msginit; -extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit; -extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit; -extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit; +extern const upb_MiniTable google_protobuf_FileDescriptorSet_msg_init; +extern const upb_MiniTable google_protobuf_FileDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_DescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msg_init; +extern const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init; +extern const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_OneofDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_EnumDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_ServiceDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_OneofOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_ServiceOptions_msg_init; +extern const upb_MiniTable google_protobuf_MethodOptions_msg_init; +extern const upb_MiniTable google_protobuf_UninterpretedOption_msg_init; +extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init; +extern const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init; +extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init; +extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init; +extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init; typedef enum { google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, @@ -141,12 +119,37 @@ typedef enum { google_protobuf_FieldOptions_JS_NUMBER = 2 } google_protobuf_FieldOptions_JSType; +typedef enum { + google_protobuf_FieldOptions_RETENTION_UNKNOWN = 0, + google_protobuf_FieldOptions_RETENTION_RUNTIME = 1, + google_protobuf_FieldOptions_RETENTION_SOURCE = 2 +} google_protobuf_FieldOptions_OptionRetention; + +typedef enum { + google_protobuf_FieldOptions_TARGET_TYPE_UNKNOWN = 0, + google_protobuf_FieldOptions_TARGET_TYPE_FILE = 1, + google_protobuf_FieldOptions_TARGET_TYPE_EXTENSION_RANGE = 2, + google_protobuf_FieldOptions_TARGET_TYPE_MESSAGE = 3, + google_protobuf_FieldOptions_TARGET_TYPE_FIELD = 4, + google_protobuf_FieldOptions_TARGET_TYPE_ONEOF = 5, + google_protobuf_FieldOptions_TARGET_TYPE_ENUM = 6, + google_protobuf_FieldOptions_TARGET_TYPE_ENUM_ENTRY = 7, + google_protobuf_FieldOptions_TARGET_TYPE_SERVICE = 8, + google_protobuf_FieldOptions_TARGET_TYPE_METHOD = 9 +} google_protobuf_FieldOptions_OptionTargetType; + typedef enum { google_protobuf_FileOptions_SPEED = 1, google_protobuf_FileOptions_CODE_SIZE = 2, google_protobuf_FileOptions_LITE_RUNTIME = 3 } google_protobuf_FileOptions_OptimizeMode; +typedef enum { + google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0, + google_protobuf_GeneratedCodeInfo_Annotation_SET = 1, + google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2 +} google_protobuf_GeneratedCodeInfo_Annotation_Semantic; + typedef enum { google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0, google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1, @@ -154,22 +157,25 @@ typedef enum { } google_protobuf_MethodOptions_IdempotencyLevel; -extern const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Label_enuminit; -extern const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Type_enuminit; -extern const upb_MiniTable_Enum google_protobuf_FieldOptions_CType_enuminit; -extern const upb_MiniTable_Enum google_protobuf_FieldOptions_JSType_enuminit; -extern const upb_MiniTable_Enum google_protobuf_FileOptions_OptimizeMode_enuminit; -extern const upb_MiniTable_Enum google_protobuf_MethodOptions_IdempotencyLevel_enuminit; +extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; +extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; +extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init; /* google.protobuf.FileDescriptorSet */ UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) { - return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google_protobuf_FileDescriptorSet_msginit, arena); + return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google_protobuf_FileDescriptorSet_msg_init, arena); } UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -179,7 +185,7 @@ UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_ int options, upb_Arena* arena) { google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -187,47 +193,72 @@ UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_ } UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* len) { - return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_protobuf_FileDescriptorSet_file(msg, &size); + return size != 0; } -UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* len) { - return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_FileDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) { - struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.FileDescriptorProto */ UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msginit, arena); + return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -237,7 +268,7 @@ UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorPr int options, upb_Arena* arena) { google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -245,241 +276,472 @@ UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorPr } UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); + size_t size; + google_protobuf_FileDescriptorProto_message_type(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); + size_t size; + google_protobuf_FileDescriptorProto_enum_type(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); + size_t size; + google_protobuf_FileDescriptorProto_service(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 64)); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); + size_t size; + google_protobuf_FileDescriptorProto_extension(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 72)); -} -UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); -} -UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const google_protobuf_FileOptions*); + const google_protobuf_FileOptions* default_val = NULL; + const google_protobuf_FileOptions* ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const google_protobuf_SourceCodeInfo*); + const google_protobuf_SourceCodeInfo* default_val = NULL; + const google_protobuf_SourceCodeInfo* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(48, 96)); +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 104)); +UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_public_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_public_dependency(msg, &size); + return size != 0; } -UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 5); +UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_weak_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_weak_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_ServiceDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_ServiceDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(40, 80), google_protobuf_FileOptions*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_FileDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msg_init, arena); + if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub); } return sub; } UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(44, 88), google_protobuf_SourceCodeInfo*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg); if (sub == NULL) { - sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msginit, arena); - if (!sub) return NULL; - google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub); + sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msg_init, arena); + if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub); } return sub; } -UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len); +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, 2, arena); +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), 2, &val, arena); + upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len); +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 104), len, 2, arena); +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), 2, &val, arena); + upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = value; + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.DescriptorProto */ UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena); + return (google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -489,7 +751,7 @@ UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_pars int options, upb_Arena* arena) { google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -497,224 +759,438 @@ UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_pars } UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + google_protobuf_DescriptorProto_field(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); + size_t size; + google_protobuf_DescriptorProto_nested_type(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + google_protobuf_DescriptorProto_enum_type(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); + size_t size; + google_protobuf_DescriptorProto_extension_range(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); + size_t size; + google_protobuf_DescriptorProto_extension(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); -} -UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_MessageOptions*); + const google_protobuf_MessageOptions* default_val = NULL; + const google_protobuf_MessageOptions* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); + size_t size; + google_protobuf_DescriptorProto_oneof_decl(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(36, 72)); +UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); + size_t size; + google_protobuf_DescriptorProto_reserved_range(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(40, 80)); +UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 88)); -} -UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); +UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_reserved_name(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_MessageOptions*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_DescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msg_init, arena); + if (sub) google_protobuf_DescriptorProto_set_options(msg, sub); } return sub; } -UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len); +UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_OneofDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_OneofDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* len) { - return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_DescriptorProto_ReservedRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len); +UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* google.protobuf.DescriptorProto.ExtensionRange */ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) { - return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena); + return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msg_init, arena); } UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -724,7 +1200,7 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_Descr int options, upb_Arena* arena) { google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -732,63 +1208,78 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_Descr } UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, 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); -} -UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*); + const google_protobuf_ExtensionRangeOptions* default_val = NULL; + const google_protobuf_ExtensionRangeOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), google_protobuf_ExtensionRangeOptions*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub); + sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msg_init, arena); + if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub); } return sub; } @@ -796,12 +1287,12 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_Descrip /* google.protobuf.DescriptorProto.ReservedRange */ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) { - return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena); + return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msg_init, arena); } UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -811,7 +1302,7 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_Descri int options, upb_Arena* arena) { google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -819,54 +1310,64 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_Descri } UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msg_init, 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); -} -UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.ExtensionRangeOptions */ UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) { - return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msginit, arena); + return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msg_init, arena); } UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -876,7 +1377,7 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRange int options, upb_Arena* arena) { google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -884,47 +1385,72 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRange } UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_protobuf_ExtensionRangeOptions_uninterpreted_option(msg, &size); + return size != 0; } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.FieldDescriptorProto */ UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena); + return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -934,7 +1460,7 @@ UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptor int options, upb_Arena* arena) { google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -942,188 +1468,243 @@ UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptor } UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) { - return google_protobuf_FieldDescriptorProto_has_label(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) : 1; + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) { - return google_protobuf_FieldDescriptorProto_has_type(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) : 1; + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 6); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 7); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const google_protobuf_FieldOptions*); + const google_protobuf_FieldOptions* default_val = NULL; + const google_protobuf_FieldOptions* ret; + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0; - _upb_clearhas(msg, 9); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 10); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0; - _upb_clearhas(msg, 11); +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(56, 88), google_protobuf_FieldOptions*) = value; + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_FieldDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msg_init, arena); + if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub); } return sub; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = value; + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.OneofDescriptorProto */ UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msginit, arena); + return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1133,7 +1714,7 @@ UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptor int options, upb_Arena* arena) { google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1141,49 +1722,59 @@ UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptor } UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*); + const google_protobuf_OneofOptions* default_val = NULL; + const google_protobuf_OneofOptions* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_OneofOptions*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_OneofDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msg_init, arena); + if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub); } return sub; } @@ -1191,12 +1782,12 @@ UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorP /* google.protobuf.EnumDescriptorProto */ UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena); + return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1206,7 +1797,7 @@ UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorPr int options, upb_Arena* arena) { google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1214,119 +1805,208 @@ UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorPr } UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + google_protobuf_EnumDescriptorProto_value(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* len) { - return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_EnumOptions*); + const google_protobuf_EnumOptions* default_val = NULL; + const google_protobuf_EnumOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); + size_t size; + google_protobuf_EnumDescriptorProto_reserved_range(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 40)); +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* len) { - return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); -} -UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_reserved_name(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* len) { - return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumValueDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_EnumValueDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_protobuf_EnumOptions*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_EnumDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msg_init, arena); + if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub); } return sub; } -UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* len) { - return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* google.protobuf.EnumDescriptorProto.EnumReservedRange */ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) { - return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena); + return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, arena); } UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1336,7 +2016,7 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobu int options, upb_Arena* arena) { google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1344,54 +2024,64 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobu } UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, 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); -} -UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.EnumValueDescriptorProto */ UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena); + return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1401,7 +2091,7 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDe int options, upb_Arena* arena) { google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1409,63 +2099,78 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDe } UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*); + const google_protobuf_EnumValueOptions* default_val = NULL; + const google_protobuf_EnumValueOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_protobuf_EnumValueOptions*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_EnumValueDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msg_init, arena); + if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub); } return sub; } @@ -1473,12 +2178,12 @@ UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDes /* google.protobuf.ServiceDescriptorProto */ UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena); + return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1488,7 +2193,7 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescri int options, upb_Arena* arena) { google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1496,70 +2201,105 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescri } UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + google_protobuf_ServiceDescriptorProto_method(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* len) { - return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_ServiceOptions*); + const google_protobuf_ServiceOptions* default_val = NULL; + const google_protobuf_ServiceOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* len) { - return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_MethodDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_MethodDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { - struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_protobuf_ServiceOptions*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_ServiceDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msg_init, arena); + if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub); } return sub; } @@ -1567,12 +2307,12 @@ UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescrip /* google.protobuf.MethodDescriptorProto */ UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) { - return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena); + return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msg_init, arena); } UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1582,7 +2322,7 @@ UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescript int options, upb_Arena* arena) { google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1590,118 +2330,148 @@ UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescript } UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*); + const google_protobuf_MethodOptions* default_val = NULL; + const google_protobuf_MethodOptions* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg); if (sub == NULL) { - sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msginit, arena); - if (!sub) return NULL; - google_protobuf_MethodDescriptorProto_set_options(msg, sub); + sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msg_init, arena); + if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub); } return sub; } UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.FileOptions */ UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) { - return (google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msginit, arena); + return (google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msg_init, arena); } UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1711,7 +2481,7 @@ UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(con int options, upb_Arena* arena) { google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1719,327 +2489,452 @@ UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(con } UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FileOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FileOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FileOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FileOptions_msg_init, 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); -} -UPB_INLINE void google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) { - return google_protobuf_FileOptions_has_optimize_for(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) : 1; + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 5); +UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0; - _upb_clearhas(msg, 7); +UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0; - _upb_clearhas(msg, 8); +UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0; - _upb_clearhas(msg, 9); +UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = 0; - _upb_clearhas(msg, 10); +UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = 0; - _upb_clearhas(msg, 11); +UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 12); +UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = 0; - _upb_clearhas(msg, 12); +UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) { - return google_protobuf_FileOptions_has_cc_enable_arenas(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) : true; + bool default_val = true; + bool ret; + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 13); +UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 14); +UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 15); +UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 15); +UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 16); +UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 16); +UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 17); +UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 17); +UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 18); +UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0; - _upb_clearhas(msg, 18); +UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 19); +UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 19); +UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { - return _upb_hasbit(msg, 20); +UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 20); +UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184)); -} -UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(100, 184)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len); + size_t size; + google_protobuf_FileOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = value; + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = value; + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value; + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value; + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value; + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value; + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value; + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = value; + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = value; + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = value; + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = value; + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = value; + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { - _upb_sethas(msg, 18); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value; + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 19); - *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = value; + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { - _upb_sethas(msg, 20); - *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = value; + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 184), len); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.MessageOptions */ UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) { - return (google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msginit, arena); + return (google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msg_init, arena); } UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2049,7 +2944,7 @@ UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ int options, upb_Arena* arena) { google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2057,103 +2952,167 @@ UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ } UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_MessageOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_MessageOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_MessageOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_MessageOptions_msg_init, 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); -} -UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); -} -UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 8)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); + size_t size; + google_protobuf_MessageOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.FieldOptions */ UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) { - return (google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msginit, arena); + return (google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msg_init, arena); } UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2163,7 +3122,7 @@ UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(c int options, upb_Arena* arena) { google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2171,145 +3130,262 @@ UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(c } UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FieldOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FieldOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FieldOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FieldOptions_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(const google_protobuf_FieldOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = 0; - _upb_clearhas(msg, 7); +UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_target(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_target(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_target(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); -} -UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 24)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); + size_t size; + google_protobuf_FieldOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value; + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value; + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value; + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len); +UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_target(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.OneofOptions */ UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) { - return (google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msginit, arena); + return (google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msg_init, arena); } UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2319,7 +3395,7 @@ UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(c int options, upb_Arena* arena) { google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2327,47 +3403,72 @@ UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(c } UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_OneofOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_OneofOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_protobuf_OneofOptions_uninterpreted_option(msg, &size); + return size != 0; } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.EnumOptions */ UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) { - return (google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msginit, arena); + return (google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msg_init, arena); } UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2377,7 +3478,7 @@ UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(con int options, upb_Arena* arena) { google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2385,75 +3486,129 @@ UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(con } UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumOptions_msg_init, 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); -} -UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + google_protobuf_EnumOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.EnumValueOptions */ UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) { - return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msginit, arena); + return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msg_init, arena); } UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2463,7 +3618,7 @@ UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_pa int options, upb_Arena* arena) { google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2471,61 +3626,91 @@ UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_pa } UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + google_protobuf_EnumValueOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.ServiceOptions */ UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) { - return (google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msginit, arena); + return (google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msg_init, arena); } UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2535,7 +3720,7 @@ UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ int options, upb_Arena* arena) { google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2543,61 +3728,91 @@ UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ } UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + google_protobuf_ServiceOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.MethodOptions */ UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) { - return (google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msginit, arena); + return (google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msg_init, arena); } UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2607,7 +3822,7 @@ UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex int options, upb_Arena* arena) { google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2615,75 +3830,110 @@ UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex } UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_MethodOptions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_MethodOptions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_MethodOptions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_MethodOptions_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); -} -UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 8)); -} -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); + size_t size; + google_protobuf_MethodOptions_uninterpreted_option(msg, &size); + return size != 0; } UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.UninterpretedOption */ UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) { - return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena); + return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); } UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2693,7 +3943,7 @@ UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOpt int options, upb_Arena* arena) { google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2701,131 +3951,186 @@ UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOpt } UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + google_protobuf_UninterpretedOption_name(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* len) { - return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 5); +UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 6); +UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* len) { - return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_UninterpretedOption_NamePart**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) { - struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = value; + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.UninterpretedOption.NamePart */ UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) { - return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msginit, arena); + return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msg_init, arena); } UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2835,7 +4140,7 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_Uninter int options, upb_Arena* arena) { google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2843,54 +4148,64 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_Uninter } UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msg_init, 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); -} -UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.SourceCodeInfo */ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { - return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msginit, arena); + return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msg_init, arena); } UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2900,7 +4215,7 @@ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ int options, upb_Arena* arena) { google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2908,47 +4223,72 @@ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ } UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* len) { - return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_protobuf_SourceCodeInfo_location(msg, &size); + return size != 0; } -UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* len) { - return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_SourceCodeInfo_Location**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_SourceCodeInfo_Location**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) { - struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.SourceCodeInfo.Location */ UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) { - return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msginit, arena); + return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msg_init, arena); } UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2958,7 +4298,7 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeIn int options, upb_Arena* arena) { google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2966,99 +4306,196 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeIn } UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msg_init, 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)); +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_path(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_path(msg, &size); + return size != 0; } -UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_span(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_span(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_leading_detached_comments(msg, &size); + return size != 0; } -UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 2, arena); +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 2, &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 2, arena); +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 2, &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* google.protobuf.GeneratedCodeInfo */ UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) { - return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_msginit, arena); + return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_msg_init, arena); } UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3068,7 +4505,7 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_ int options, upb_Arena* arena) { google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3076,47 +4513,72 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_ } UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* len) { - return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_protobuf_GeneratedCodeInfo_annotation(msg, &size); + return size != 0; } -UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* len) { - return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) { - struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* google.protobuf.GeneratedCodeInfo.Annotation */ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) { - return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena); + return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msg_init, arena); } UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3126,7 +4588,7 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_Generat int options, upb_Arena* arena) { google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3134,75 +4596,138 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_Generat } UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, 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)); +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + size_t size; + google_protobuf_GeneratedCodeInfo_Annotation_path(msg, &size); + return size != 0; } -UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, 2, arena); +UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), 2, &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; /* Max size 32 is google.protobuf.FileOptions */ /* Max size 64 is google.protobuf.FileOptions */ @@ -3212,6 +4737,6 @@ extern const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */ 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 d95bb374ef6..e4b4ea85053 100644 --- a/src/core/ext/upb-generated/google/protobuf/duration.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/duration.upb.c @@ -7,27 +7,36 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/duration.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field google_protobuf_Duration__fields[2] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Duration__fields[2] = { + {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Duration_msginit = { +const upb_MiniTable google_protobuf_Duration_msg_init = { NULL, &google_protobuf_Duration__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &google_protobuf_Duration_msginit, + &google_protobuf_Duration_msg_init, }; -const upb_MiniTable_File google_protobuf_duration_proto_upb_file_layout = { +const upb_MiniTableFile google_protobuf_duration_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -36,5 +45,5 @@ const upb_MiniTable_File google_protobuf_duration_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 e766862e77d..a70deba96ae 100644 --- a/src/core/ext/upb-generated/google/protobuf/duration.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/duration.upb.h @@ -9,32 +9,36 @@ #ifndef GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_Duration; typedef struct google_protobuf_Duration google_protobuf_Duration; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* google.protobuf.Duration */ UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_new(upb_Arena* arena) { - return (google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); + return (google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); } UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Duration* ret = google_protobuf_Duration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Duration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Duration_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_parse_ex(const cha int options, upb_Arena* arena) { google_protobuf_Duration* ret = google_protobuf_Duration_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Duration_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Duration_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,41 +56,53 @@ UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_parse_ex(const cha } UPB_INLINE char* google_protobuf_Duration_serialize(const google_protobuf_Duration* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Duration_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Duration_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Duration_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Duration_msg_init, 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; +UPB_INLINE void google_protobuf_Duration_clear_seconds(google_protobuf_Duration* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_protobuf_Duration_clear_nanos(const google_protobuf_Duration* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void google_protobuf_Duration_clear_nanos(google_protobuf_Duration* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_Duration_set_seconds(google_protobuf_Duration *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_protobuf_duration_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_duration_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ */ 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 0baf7664ab7..abc55cb84ea 100644 --- a/src/core/ext/upb-generated/google/protobuf/empty.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/empty.upb.c @@ -7,22 +7,25 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/empty.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable google_protobuf_Empty_msginit = { +const upb_MiniTable google_protobuf_Empty_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[1] = { - &google_protobuf_Empty_msginit, + &google_protobuf_Empty_msg_init, }; -const upb_MiniTable_File google_protobuf_empty_proto_upb_file_layout = { +const upb_MiniTableFile google_protobuf_empty_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -31,5 +34,5 @@ const upb_MiniTable_File google_protobuf_empty_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 477ef006994..699ad8157b4 100644 --- a/src/core/ext/upb-generated/google/protobuf/empty.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/empty.upb.h @@ -9,32 +9,36 @@ #ifndef GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_Empty; typedef struct google_protobuf_Empty google_protobuf_Empty; -extern const upb_MiniTable google_protobuf_Empty_msginit; +extern const upb_MiniTable google_protobuf_Empty_msg_init; /* google.protobuf.Empty */ UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_new(upb_Arena* arena) { - return (google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msginit, arena); + return (google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msg_init, arena); } UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Empty* ret = google_protobuf_Empty_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Empty_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Empty_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_parse_ex(const char* buf int options, upb_Arena* arena) { google_protobuf_Empty* ret = google_protobuf_Empty_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Empty_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Empty_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,23 +56,23 @@ UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_parse_ex(const char* buf } UPB_INLINE char* google_protobuf_Empty_serialize(const google_protobuf_Empty* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Empty_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Empty_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Empty_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Empty_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File google_protobuf_empty_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_empty_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_ */ 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 5183b64e5ec..2c07c09a9d4 100644 --- a/src/core/ext/upb-generated/google/protobuf/struct.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/struct.upb.c @@ -7,82 +7,105 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/struct.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_protobuf_Struct_submsgs[1] = { - {.submsg = &google_protobuf_Struct_FieldsEntry_msginit}, +static const upb_MiniTableSub google_protobuf_Struct_submsgs[1] = { + {.submsg = &google_protobuf_Struct_FieldsEntry_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_Struct__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Struct__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Struct_msginit = { +const upb_MiniTable google_protobuf_Struct_msg_init = { &google_protobuf_Struct_submsgs[0], &google_protobuf_Struct__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub google_protobuf_Struct_FieldsEntry_submsgs[1] = { - {.submsg = &google_protobuf_Value_msginit}, +static const upb_MiniTableSub google_protobuf_Struct_FieldsEntry_submsgs[1] = { + {.submsg = &google_protobuf_Value_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_Struct_FieldsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Struct_FieldsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Struct_FieldsEntry_msginit = { +const upb_MiniTable google_protobuf_Struct_FieldsEntry_msg_init = { &google_protobuf_Struct_FieldsEntry_submsgs[0], &google_protobuf_Struct_FieldsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_Value_submsgs[2] = { - {.submsg = &google_protobuf_Struct_msginit}, - {.submsg = &google_protobuf_ListValue_msginit}, +static const upb_MiniTableSub google_protobuf_Value_submsgs[2] = { + {.submsg = &google_protobuf_Struct_msg_init}, + {.submsg = &google_protobuf_ListValue_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_Value__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Value__fields[6] = { + {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Value_msginit = { +const upb_MiniTable google_protobuf_Value_msg_init = { &google_protobuf_Value_submsgs[0], &google_protobuf_Value__fields[0], - UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_pov4_1bt}, + {0x0008000002000011, &upb_pof8_1bt}, + {0x000800000300001a, &upb_pos_1bt}, + {0x0008000004000020, &upb_pob1_1bt}, + {0x000800000500002a, &upb_pom_1bt_max64b}, + {0x0008000006010032, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub google_protobuf_ListValue_submsgs[1] = { - {.submsg = &google_protobuf_Value_msginit}, +static const upb_MiniTableSub google_protobuf_ListValue_submsgs[1] = { + {.submsg = &google_protobuf_Value_msg_init}, }; -static const upb_MiniTable_Field google_protobuf_ListValue__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_ListValue__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_ListValue_msginit = { +const upb_MiniTable google_protobuf_ListValue_msg_init = { &google_protobuf_ListValue_submsgs[0], &google_protobuf_ListValue__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[4] = { - &google_protobuf_Struct_msginit, - &google_protobuf_Struct_FieldsEntry_msginit, - &google_protobuf_Value_msginit, - &google_protobuf_ListValue_msginit, + &google_protobuf_Struct_msg_init, + &google_protobuf_Struct_FieldsEntry_msg_init, + &google_protobuf_Value_msg_init, + &google_protobuf_ListValue_msg_init, }; -const upb_MiniTable_File google_protobuf_struct_proto_upb_file_layout = { +const upb_MiniTableFile google_protobuf_struct_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -91,5 +114,5 @@ const upb_MiniTable_File google_protobuf_struct_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d4ec05bc7e7..aa8d41a7d51 100644 --- a/src/core/ext/upb-generated/google/protobuf/struct.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/struct.upb.h @@ -9,29 +9,30 @@ #ifndef GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_Struct; -struct google_protobuf_Struct_FieldsEntry; -struct google_protobuf_Value; -struct google_protobuf_ListValue; typedef struct google_protobuf_Struct google_protobuf_Struct; typedef struct google_protobuf_Struct_FieldsEntry google_protobuf_Struct_FieldsEntry; typedef struct google_protobuf_Value google_protobuf_Value; typedef struct google_protobuf_ListValue google_protobuf_ListValue; -extern const upb_MiniTable google_protobuf_Struct_msginit; -extern const upb_MiniTable google_protobuf_Struct_FieldsEntry_msginit; -extern const upb_MiniTable google_protobuf_Value_msginit; -extern const upb_MiniTable google_protobuf_ListValue_msginit; +extern const upb_MiniTable google_protobuf_Struct_msg_init; +extern const upb_MiniTable google_protobuf_Struct_FieldsEntry_msg_init; +extern const upb_MiniTable google_protobuf_Value_msg_init; +extern const upb_MiniTable google_protobuf_ListValue_msg_init; typedef enum { google_protobuf_NULL_VALUE = 0 @@ -42,12 +43,12 @@ typedef enum { /* google.protobuf.Struct */ UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_new(upb_Arena* arena) { - return (google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); + return (google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); } UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Struct* ret = google_protobuf_Struct_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Struct_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Struct_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -57,7 +58,7 @@ UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_parse_ex(const char* b int options, upb_Arena* arena) { google_protobuf_Struct* ret = google_protobuf_Struct_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Struct_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Struct_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -65,40 +66,63 @@ UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_parse_ex(const char* b } UPB_INLINE char* google_protobuf_Struct_serialize(const google_protobuf_Struct* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Struct_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Struct_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Struct_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Struct_msg_init, 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)); -} -UPB_INLINE void google_protobuf_Struct_clear_fields(const google_protobuf_Struct* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void google_protobuf_Struct_clear_fields(google_protobuf_Struct* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t google_protobuf_Struct_fields_size(const google_protobuf_Struct* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool google_protobuf_Struct_fields_get(const google_protobuf_Struct* msg, upb_StringView key, google_protobuf_Value** val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_fields_next(const google_protobuf_Struct* msg, size_t* iter) { - return (const google_protobuf_Struct_FieldsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const google_protobuf_Struct_FieldsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool google_protobuf_Struct_has_fields(const google_protobuf_Struct* msg) { + return google_protobuf_Struct_fields_size(msg) != 0; } -UPB_INLINE void google_protobuf_Struct_fields_clear(google_protobuf_Struct* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } +UPB_INLINE void google_protobuf_Struct_fields_clear(google_protobuf_Struct* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool google_protobuf_Struct_fields_set(google_protobuf_Struct* msg, upb_StringView key, google_protobuf_Value* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool google_protobuf_Struct_fields_delete(google_protobuf_Struct* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_fields_nextmutable(google_protobuf_Struct* msg, size_t* iter) { - return (google_protobuf_Struct_FieldsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (google_protobuf_Struct_FieldsEntry*)_upb_map_next(map, iter); } /* google.protobuf.Struct.FieldsEntry */ @@ -108,14 +132,15 @@ UPB_INLINE upb_StringView google_protobuf_Struct_FieldsEntry_key(const google_pr _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool google_protobuf_Struct_FieldsEntry_has_value(const google_protobuf_Struct_FieldsEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const google_protobuf_Value* google_protobuf_Struct_FieldsEntry_value(const google_protobuf_Struct_FieldsEntry* msg) { google_protobuf_Value* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool google_protobuf_Struct_FieldsEntry_has_value(const google_protobuf_Struct_FieldsEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_value(google_protobuf_Struct_FieldsEntry *msg, google_protobuf_Value* value) { _upb_msg_map_set_value(msg, &value, sizeof(google_protobuf_Value*)); @@ -124,12 +149,12 @@ UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_value(google_protobuf_Str /* google.protobuf.Value */ UPB_INLINE google_protobuf_Value* google_protobuf_Value_new(upb_Arena* arena) { - return (google_protobuf_Value*)_upb_Message_New(&google_protobuf_Value_msginit, arena); + return (google_protobuf_Value*)_upb_Message_New(&google_protobuf_Value_msg_init, arena); } UPB_INLINE google_protobuf_Value* google_protobuf_Value_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Value* ret = google_protobuf_Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -139,7 +164,7 @@ UPB_INLINE google_protobuf_Value* google_protobuf_Value_parse_ex(const char* buf int options, upb_Arena* arena) { google_protobuf_Value* ret = google_protobuf_Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Value_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Value_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -147,13 +172,13 @@ UPB_INLINE google_protobuf_Value* google_protobuf_Value_parse_ex(const char* buf } UPB_INLINE char* google_protobuf_Value_serialize(const google_protobuf_Value* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Value_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Value_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Value_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Value_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -166,96 +191,137 @@ typedef enum { google_protobuf_Value_kind_NOT_SET = 0 } google_protobuf_Value_kind_oneofcases; UPB_INLINE google_protobuf_Value_kind_oneofcases google_protobuf_Value_kind_case(const google_protobuf_Value* msg) { - return (google_protobuf_Value_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return (google_protobuf_Value_kind_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void google_protobuf_Value_clear_null_value(const google_protobuf_Value* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET); +UPB_INLINE void google_protobuf_Value_clear_null_value(google_protobuf_Value* msg) { + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_Value_null_value(const google_protobuf_Value* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 1, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value* msg) { + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_Value_clear_number_value(const google_protobuf_Value* msg) { - UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET); +UPB_INLINE void google_protobuf_Value_clear_number_value(google_protobuf_Value* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double google_protobuf_Value_number_value(const google_protobuf_Value* msg) { - return UPB_READ_ONEOF(msg, double, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 2, 0); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_Value_clear_string_value(const google_protobuf_Value* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET); +UPB_INLINE void google_protobuf_Value_clear_string_value(google_protobuf_Value* msg) { + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_Value_string_value(const google_protobuf_Value* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value* msg) { + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_Value_clear_bool_value(const google_protobuf_Value* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET); +UPB_INLINE void google_protobuf_Value_clear_bool_value(google_protobuf_Value* msg) { + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_Value_bool_value(const google_protobuf_Value* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 4, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5; +UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value* msg) { + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_Value_clear_struct_value(const google_protobuf_Value* msg) { - UPB_WRITE_ONEOF(msg, google_protobuf_Struct*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET); +UPB_INLINE void google_protobuf_Value_clear_struct_value(google_protobuf_Value* msg) { + const upb_MiniTableField field = {5, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_Struct* google_protobuf_Value_struct_value(const google_protobuf_Value* msg) { - return UPB_READ_ONEOF(msg, const google_protobuf_Struct*, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 5, NULL); + const google_protobuf_Struct* default_val = NULL; + const google_protobuf_Struct* ret; + const upb_MiniTableField field = {5, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6; +UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value* msg) { + const upb_MiniTableField field = {5, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void google_protobuf_Value_clear_list_value(const google_protobuf_Value* msg) { - UPB_WRITE_ONEOF(msg, google_protobuf_ListValue*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET); +UPB_INLINE void google_protobuf_Value_clear_list_value(google_protobuf_Value* msg) { + const upb_MiniTableField field = {6, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_ListValue* google_protobuf_Value_list_value(const google_protobuf_Value* msg) { - return UPB_READ_ONEOF(msg, const google_protobuf_ListValue*, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 6, NULL); + const google_protobuf_ListValue* default_val = NULL; + const google_protobuf_ListValue* ret; + const upb_MiniTableField field = {6, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value* msg) { + const upb_MiniTableField field = {6, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_Value_set_null_value(google_protobuf_Value *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Value_set_number_value(google_protobuf_Value *msg, double value) { - UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Value_set_string_value(google_protobuf_Value *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Value_set_bool_value(google_protobuf_Value *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, 8, -1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Value_set_struct_value(google_protobuf_Value *msg, google_protobuf_Struct* value) { - UPB_WRITE_ONEOF(msg, google_protobuf_Struct*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 5); + const upb_MiniTableField field = {5, 8, -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* google_protobuf_Value_mutable_struct_value(google_protobuf_Value* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)google_protobuf_Value_struct_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - google_protobuf_Value_set_struct_value(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) google_protobuf_Value_set_struct_value(msg, sub); } return sub; } UPB_INLINE void google_protobuf_Value_set_list_value(google_protobuf_Value *msg, google_protobuf_ListValue* value) { - UPB_WRITE_ONEOF(msg, google_protobuf_ListValue*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 6); + const upb_MiniTableField field = {6, 8, -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_ListValue* google_protobuf_Value_mutable_list_value(google_protobuf_Value* msg, upb_Arena* arena) { struct google_protobuf_ListValue* sub = (struct google_protobuf_ListValue*)google_protobuf_Value_list_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_ListValue*)_upb_Message_New(&google_protobuf_ListValue_msginit, arena); - if (!sub) return NULL; - google_protobuf_Value_set_list_value(msg, sub); + sub = (struct google_protobuf_ListValue*)_upb_Message_New(&google_protobuf_ListValue_msg_init, arena); + if (sub) google_protobuf_Value_set_list_value(msg, sub); } return sub; } @@ -263,12 +329,12 @@ UPB_INLINE struct google_protobuf_ListValue* google_protobuf_Value_mutable_list_ /* google.protobuf.ListValue */ UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_new(upb_Arena* arena) { - return (google_protobuf_ListValue*)_upb_Message_New(&google_protobuf_ListValue_msginit, arena); + return (google_protobuf_ListValue*)_upb_Message_New(&google_protobuf_ListValue_msg_init, arena); } UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_ListValue* ret = google_protobuf_ListValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ListValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_ListValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -278,7 +344,7 @@ UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_parse_ex(const c int options, upb_Arena* arena) { google_protobuf_ListValue* ret = google_protobuf_ListValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_ListValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_ListValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -286,44 +352,69 @@ UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_parse_ex(const c } UPB_INLINE char* google_protobuf_ListValue_serialize(const google_protobuf_ListValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ListValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ListValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_ListValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_ListValue_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_ListValue_clear_values(google_protobuf_ListValue* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_Value* const* google_protobuf_ListValue_values(const google_protobuf_ListValue* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_Value* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool google_protobuf_ListValue_has_values(const google_protobuf_ListValue* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void google_protobuf_ListValue_clear_values(const google_protobuf_ListValue* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const google_protobuf_Value* const* google_protobuf_ListValue_values(const google_protobuf_ListValue* msg, size_t* len) { - return (const google_protobuf_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + google_protobuf_ListValue_values(msg, &size); + return size != 0; } -UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_mutable_values(google_protobuf_ListValue* msg, size_t* len) { - return (google_protobuf_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_mutable_values(google_protobuf_ListValue* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_Value**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_resize_values(google_protobuf_ListValue* msg, size_t len, upb_Arena* arena) { - return (google_protobuf_Value**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_resize_values(google_protobuf_ListValue* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_Value**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Value* google_protobuf_ListValue_add_values(google_protobuf_ListValue* msg, upb_Arena* arena) { - struct google_protobuf_Value* sub = (struct google_protobuf_Value*)_upb_Message_New(&google_protobuf_Value_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Value* sub = (struct google_protobuf_Value*)_upb_Message_New(&google_protobuf_Value_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File google_protobuf_struct_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_struct_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ */ 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 5283d8c8a67..9c36f5acd8a 100644 --- a/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c @@ -7,27 +7,36 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/timestamp.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field google_protobuf_Timestamp__fields[2] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Timestamp__fields[2] = { + {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Timestamp_msginit = { +const upb_MiniTable google_protobuf_Timestamp_msg_init = { NULL, &google_protobuf_Timestamp__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv8_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &google_protobuf_Timestamp_msginit, + &google_protobuf_Timestamp_msg_init, }; -const upb_MiniTable_File google_protobuf_timestamp_proto_upb_file_layout = { +const upb_MiniTableFile google_protobuf_timestamp_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -36,5 +45,5 @@ const upb_MiniTable_File google_protobuf_timestamp_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 089a56cf601..fcd5f1c6dbd 100644 --- a/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h @@ -9,32 +9,36 @@ #ifndef GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_Timestamp; typedef struct google_protobuf_Timestamp google_protobuf_Timestamp; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; /* google.protobuf.Timestamp */ UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_new(upb_Arena* arena) { - return (google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); + return (google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); } UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Timestamp* ret = google_protobuf_Timestamp_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse_ex(const c int options, upb_Arena* arena) { google_protobuf_Timestamp* ret = google_protobuf_Timestamp_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,41 +56,53 @@ UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse_ex(const c } UPB_INLINE char* google_protobuf_Timestamp_serialize(const google_protobuf_Timestamp* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Timestamp_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Timestamp_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Timestamp_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Timestamp_msg_init, 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; +UPB_INLINE void google_protobuf_Timestamp_clear_seconds(google_protobuf_Timestamp* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_protobuf_Timestamp_seconds(const google_protobuf_Timestamp* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_protobuf_Timestamp_clear_nanos(const google_protobuf_Timestamp* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void google_protobuf_Timestamp_clear_nanos(google_protobuf_Timestamp* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_Timestamp_nanos(const google_protobuf_Timestamp* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_Timestamp_set_seconds(google_protobuf_Timestamp *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_Timestamp_set_nanos(google_protobuf_Timestamp *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_protobuf_timestamp_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_timestamp_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ */ 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 6ac414ef1ae..5e8f675b1f4 100644 --- a/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c @@ -7,114 +7,153 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field google_protobuf_DoubleValue__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_DoubleValue__fields[1] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_DoubleValue_msginit = { +const upb_MiniTable google_protobuf_DoubleValue_msg_init = { NULL, &google_protobuf_DoubleValue__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_FloatValue__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FloatValue__fields[1] = { + {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_FloatValue_msginit = { +const upb_MiniTable google_protobuf_FloatValue_msg_init = { NULL, &google_protobuf_FloatValue__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000d, &upb_psf4_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_Int64Value__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Int64Value__fields[1] = { + {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Int64Value_msginit = { +const upb_MiniTable google_protobuf_Int64Value_msg_init = { NULL, &google_protobuf_Int64Value__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_UInt64Value__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_UInt64Value__fields[1] = { + {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_UInt64Value_msginit = { +const upb_MiniTable google_protobuf_UInt64Value_msg_init = { NULL, &google_protobuf_UInt64Value__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_Int32Value__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_Int32Value__fields[1] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_Int32Value_msginit = { +const upb_MiniTable google_protobuf_Int32Value_msg_init = { NULL, &google_protobuf_Int32Value__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_UInt32Value__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_UInt32Value__fields[1] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_UInt32Value_msginit = { +const upb_MiniTable google_protobuf_UInt32Value_msg_init = { NULL, &google_protobuf_UInt32Value__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_BoolValue__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_BoolValue__fields[1] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_BoolValue_msginit = { +const upb_MiniTable google_protobuf_BoolValue_msg_init = { NULL, &google_protobuf_BoolValue__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_StringValue__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_StringValue__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_StringValue_msginit = { +const upb_MiniTable google_protobuf_StringValue_msg_init = { NULL, &google_protobuf_StringValue__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field google_protobuf_BytesValue__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_BytesValue__fields[1] = { + {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_protobuf_BytesValue_msginit = { +const upb_MiniTable google_protobuf_BytesValue_msg_init = { NULL, &google_protobuf_BytesValue__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_psb_1bt}, + }) }; static const upb_MiniTable *messages_layout[9] = { - &google_protobuf_DoubleValue_msginit, - &google_protobuf_FloatValue_msginit, - &google_protobuf_Int64Value_msginit, - &google_protobuf_UInt64Value_msginit, - &google_protobuf_Int32Value_msginit, - &google_protobuf_UInt32Value_msginit, - &google_protobuf_BoolValue_msginit, - &google_protobuf_StringValue_msginit, - &google_protobuf_BytesValue_msginit, + &google_protobuf_DoubleValue_msg_init, + &google_protobuf_FloatValue_msg_init, + &google_protobuf_Int64Value_msg_init, + &google_protobuf_UInt64Value_msg_init, + &google_protobuf_Int32Value_msg_init, + &google_protobuf_UInt32Value_msg_init, + &google_protobuf_BoolValue_msg_init, + &google_protobuf_StringValue_msg_init, + &google_protobuf_BytesValue_msg_init, }; -const upb_MiniTable_File google_protobuf_wrappers_proto_upb_file_layout = { +const upb_MiniTableFile google_protobuf_wrappers_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -123,5 +162,5 @@ const upb_MiniTable_File google_protobuf_wrappers_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d730b28d800..891df4d8c38 100644 --- a/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h @@ -9,26 +9,22 @@ #ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_DoubleValue; -struct google_protobuf_FloatValue; -struct google_protobuf_Int64Value; -struct google_protobuf_UInt64Value; -struct google_protobuf_Int32Value; -struct google_protobuf_UInt32Value; -struct google_protobuf_BoolValue; -struct google_protobuf_StringValue; -struct google_protobuf_BytesValue; typedef struct google_protobuf_DoubleValue google_protobuf_DoubleValue; typedef struct google_protobuf_FloatValue google_protobuf_FloatValue; typedef struct google_protobuf_Int64Value google_protobuf_Int64Value; @@ -38,27 +34,27 @@ typedef struct google_protobuf_UInt32Value google_protobuf_UInt32Value; typedef struct google_protobuf_BoolValue google_protobuf_BoolValue; typedef struct google_protobuf_StringValue google_protobuf_StringValue; typedef struct google_protobuf_BytesValue google_protobuf_BytesValue; -extern const upb_MiniTable google_protobuf_DoubleValue_msginit; -extern const upb_MiniTable google_protobuf_FloatValue_msginit; -extern const upb_MiniTable google_protobuf_Int64Value_msginit; -extern const upb_MiniTable google_protobuf_UInt64Value_msginit; -extern const upb_MiniTable google_protobuf_Int32Value_msginit; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; -extern const upb_MiniTable google_protobuf_BoolValue_msginit; -extern const upb_MiniTable google_protobuf_StringValue_msginit; -extern const upb_MiniTable google_protobuf_BytesValue_msginit; +extern const upb_MiniTable google_protobuf_DoubleValue_msg_init; +extern const upb_MiniTable google_protobuf_FloatValue_msg_init; +extern const upb_MiniTable google_protobuf_Int64Value_msg_init; +extern const upb_MiniTable google_protobuf_UInt64Value_msg_init; +extern const upb_MiniTable google_protobuf_Int32Value_msg_init; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; +extern const upb_MiniTable google_protobuf_BoolValue_msg_init; +extern const upb_MiniTable google_protobuf_StringValue_msg_init; +extern const upb_MiniTable google_protobuf_BytesValue_msg_init; /* google.protobuf.DoubleValue */ UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_new(upb_Arena* arena) { - return (google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena); + return (google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msg_init, arena); } UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_DoubleValue* ret = google_protobuf_DoubleValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -68,7 +64,7 @@ UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse_ex(con int options, upb_Arena* arena) { google_protobuf_DoubleValue* ret = google_protobuf_DoubleValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -76,35 +72,41 @@ UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse_ex(con } UPB_INLINE char* google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DoubleValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DoubleValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_DoubleValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_DoubleValue_msg_init, 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; +UPB_INLINE void google_protobuf_DoubleValue_clear_value(google_protobuf_DoubleValue* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.FloatValue */ UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_new(upb_Arena* arena) { - return (google_protobuf_FloatValue*)_upb_Message_New(&google_protobuf_FloatValue_msginit, arena); + return (google_protobuf_FloatValue*)_upb_Message_New(&google_protobuf_FloatValue_msg_init, arena); } UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_FloatValue* ret = google_protobuf_FloatValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -114,7 +116,7 @@ UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse_ex(const int options, upb_Arena* arena) { google_protobuf_FloatValue* ret = google_protobuf_FloatValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -122,35 +124,41 @@ UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse_ex(const } UPB_INLINE char* google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FloatValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FloatValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_FloatValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_FloatValue_msg_init, 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; +UPB_INLINE void google_protobuf_FloatValue_clear_value(google_protobuf_FloatValue* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float); + float default_val = 0; + float ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue *msg, float value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.Int64Value */ UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_new(upb_Arena* arena) { - return (google_protobuf_Int64Value*)_upb_Message_New(&google_protobuf_Int64Value_msginit, arena); + return (google_protobuf_Int64Value*)_upb_Message_New(&google_protobuf_Int64Value_msg_init, arena); } UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Int64Value* ret = google_protobuf_Int64Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -160,7 +168,7 @@ UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse_ex(const int options, upb_Arena* arena) { google_protobuf_Int64Value* ret = google_protobuf_Int64Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -168,35 +176,41 @@ UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse_ex(const } UPB_INLINE char* google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Int64Value_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Int64Value_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Int64Value_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Int64Value_msg_init, 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; +UPB_INLINE void google_protobuf_Int64Value_clear_value(google_protobuf_Int64Value* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.UInt64Value */ UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_new(upb_Arena* arena) { - return (google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena); + return (google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena); } UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_UInt64Value* ret = google_protobuf_UInt64Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -206,7 +220,7 @@ UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse_ex(con int options, upb_Arena* arena) { google_protobuf_UInt64Value* ret = google_protobuf_UInt64Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -214,35 +228,41 @@ UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse_ex(con } UPB_INLINE char* google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UInt64Value_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UInt64Value_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UInt64Value_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UInt64Value_msg_init, 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; +UPB_INLINE void google_protobuf_UInt64Value_clear_value(google_protobuf_UInt64Value* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.Int32Value */ UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_new(upb_Arena* arena) { - return (google_protobuf_Int32Value*)_upb_Message_New(&google_protobuf_Int32Value_msginit, arena); + return (google_protobuf_Int32Value*)_upb_Message_New(&google_protobuf_Int32Value_msg_init, arena); } UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_Int32Value* ret = google_protobuf_Int32Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -252,7 +272,7 @@ UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse_ex(const int options, upb_Arena* arena) { google_protobuf_Int32Value* ret = google_protobuf_Int32Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -260,35 +280,41 @@ UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse_ex(const } UPB_INLINE char* google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Int32Value_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Int32Value_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_Int32Value_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_Int32Value_msg_init, 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; +UPB_INLINE void google_protobuf_Int32Value_clear_value(google_protobuf_Int32Value* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.UInt32Value */ UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_new(upb_Arena* arena) { - return (google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); + return (google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); } UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_UInt32Value* ret = google_protobuf_UInt32Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -298,7 +324,7 @@ UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse_ex(con int options, upb_Arena* arena) { google_protobuf_UInt32Value* ret = google_protobuf_UInt32Value_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -306,35 +332,41 @@ UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse_ex(con } UPB_INLINE char* google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UInt32Value_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UInt32Value_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_UInt32Value_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_UInt32Value_msg_init, 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; +UPB_INLINE void google_protobuf_UInt32Value_clear_value(google_protobuf_UInt32Value* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.BoolValue */ UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_new(upb_Arena* arena) { - return (google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena); + return (google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena); } UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_BoolValue* ret = google_protobuf_BoolValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -344,7 +376,7 @@ UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse_ex(const c int options, upb_Arena* arena) { google_protobuf_BoolValue* ret = google_protobuf_BoolValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -352,35 +384,41 @@ UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse_ex(const c } UPB_INLINE char* google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_BoolValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_BoolValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_BoolValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_BoolValue_msg_init, 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; +UPB_INLINE void google_protobuf_BoolValue_clear_value(google_protobuf_BoolValue* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.StringValue */ UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_new(upb_Arena* arena) { - return (google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msginit, arena); + return (google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msg_init, arena); } UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_StringValue* ret = google_protobuf_StringValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -390,7 +428,7 @@ UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse_ex(con int options, upb_Arena* arena) { google_protobuf_StringValue* ret = google_protobuf_StringValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -398,35 +436,41 @@ UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse_ex(con } UPB_INLINE char* google_protobuf_StringValue_serialize(const google_protobuf_StringValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_StringValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_StringValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_StringValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_StringValue_msg_init, 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); +UPB_INLINE void google_protobuf_StringValue_clear_value(google_protobuf_StringValue* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_StringValue_value(const google_protobuf_StringValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* google.protobuf.BytesValue */ UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_new(upb_Arena* arena) { - return (google_protobuf_BytesValue*)_upb_Message_New(&google_protobuf_BytesValue_msginit, arena); + return (google_protobuf_BytesValue*)_upb_Message_New(&google_protobuf_BytesValue_msg_init, arena); } UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse(const char* buf, size_t size, upb_Arena* arena) { google_protobuf_BytesValue* ret = google_protobuf_BytesValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -436,7 +480,7 @@ UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse_ex(const int options, upb_Arena* arena) { google_protobuf_BytesValue* ret = google_protobuf_BytesValue_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -444,32 +488,38 @@ UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse_ex(const } UPB_INLINE char* google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_BytesValue_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_BytesValue_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_protobuf_BytesValue_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_protobuf_BytesValue_msg_init, 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); +UPB_INLINE void google_protobuf_BytesValue_clear_value(google_protobuf_BytesValue* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_BytesValue_value(const google_protobuf_BytesValue* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_protobuf_wrappers_proto_upb_file_layout; +extern const upb_MiniTableFile google_protobuf_wrappers_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ */ 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 c215e1b2fac..922b3c8618b 100644 --- a/src/core/ext/upb-generated/google/rpc/status.upb.c +++ b/src/core/ext/upb-generated/google/rpc/status.upb.c @@ -7,33 +7,42 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/rpc/status.upb.h" #include "google/protobuf/any.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub google_rpc_Status_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub google_rpc_Status_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field google_rpc_Status__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_rpc_Status__fields[3] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_rpc_Status_msginit = { +const upb_MiniTable google_rpc_Status_msg_init = { &google_rpc_Status_submsgs[0], &google_rpc_Status__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_pss_1bt}, + {0x001800003f00001a, &upb_prm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &google_rpc_Status_msginit, + &google_rpc_Status_msg_init, }; -const upb_MiniTable_File google_rpc_status_proto_upb_file_layout = { +const upb_MiniTableFile google_rpc_status_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +51,5 @@ const upb_MiniTable_File google_rpc_status_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1a4a95d7c06..d1964fe4212 100644 --- a/src/core/ext/upb-generated/google/rpc/status.upb.h +++ b/src/core/ext/upb-generated/google/rpc/status.upb.h @@ -9,34 +9,38 @@ #ifndef GOOGLE_RPC_STATUS_PROTO_UPB_H_ #define GOOGLE_RPC_STATUS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_rpc_Status; typedef struct google_rpc_Status google_rpc_Status; -extern const upb_MiniTable google_rpc_Status_msginit; +extern const upb_MiniTable google_rpc_Status_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* google.rpc.Status */ UPB_INLINE google_rpc_Status* google_rpc_Status_new(upb_Arena* arena) { - return (google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena); + return (google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msg_init, arena); } UPB_INLINE google_rpc_Status* google_rpc_Status_parse(const char* buf, size_t size, upb_Arena* arena) { google_rpc_Status* ret = google_rpc_Status_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_rpc_Status_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_rpc_Status_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE google_rpc_Status* google_rpc_Status_parse_ex(const char* buf, size_t int options, upb_Arena* arena) { google_rpc_Status* ret = google_rpc_Status_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_rpc_Status_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_rpc_Status_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,62 +58,99 @@ UPB_INLINE google_rpc_Status* google_rpc_Status_parse_ex(const char* buf, size_t } UPB_INLINE char* google_rpc_Status_serialize(const google_rpc_Status* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_rpc_Status_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_rpc_Status_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_rpc_Status_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_rpc_Status_msg_init, 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; +UPB_INLINE void google_rpc_Status_clear_code(google_rpc_Status* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_rpc_Status_clear_message(const google_rpc_Status* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_rpc_Status_clear_message(google_rpc_Status* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_rpc_Status_message(const google_rpc_Status* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void google_rpc_Status_clear_details(google_rpc_Status* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Any* const* google_rpc_Status_details(const google_rpc_Status* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool google_rpc_Status_has_details(const google_rpc_Status* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE void google_rpc_Status_clear_details(const google_rpc_Status* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const struct google_protobuf_Any* const* google_rpc_Status_details(const google_rpc_Status* msg, size_t* len) { - return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); + size_t size; + google_rpc_Status_details(msg, &size); + return size != 0; } UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE struct google_protobuf_Any** google_rpc_Status_mutable_details(google_rpc_Status* msg, size_t* len) { - return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE struct google_protobuf_Any** google_rpc_Status_mutable_details(google_rpc_Status* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Any**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Any** google_rpc_Status_resize_details(google_rpc_Status* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Any** google_rpc_Status_resize_details(google_rpc_Status* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Any* google_rpc_Status_add_details(google_rpc_Status* msg, upb_Arena* arena) { - struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File google_rpc_status_proto_upb_file_layout; +extern const upb_MiniTableFile google_rpc_status_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_RPC_STATUS_PROTO_UPB_H_ */ 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 183191b170a..5fb2dd8eb9f 100644 --- a/src/core/ext/upb-generated/google/type/expr.upb.c +++ b/src/core/ext/upb-generated/google/type/expr.upb.c @@ -7,29 +7,42 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "google/type/expr.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field google_type_Expr__fields[4] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_type_Expr__fields[4] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable google_type_Expr_msginit = { +const upb_MiniTable google_type_Expr_msg_init = { NULL, &google_type_Expr__fields[0], - UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_pss_1bt}, + {0x003000003f000022, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &google_type_Expr_msginit, + &google_type_Expr_msg_init, }; -const upb_MiniTable_File google_type_expr_proto_upb_file_layout = { +const upb_MiniTableFile google_type_expr_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -38,5 +51,5 @@ const upb_MiniTable_File google_type_expr_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 d4b8db6f878..6d5fbaf81d2 100644 --- a/src/core/ext/upb-generated/google/type/expr.upb.h +++ b/src/core/ext/upb-generated/google/type/expr.upb.h @@ -9,32 +9,36 @@ #ifndef GOOGLE_TYPE_EXPR_PROTO_UPB_H_ #define GOOGLE_TYPE_EXPR_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct google_type_Expr; typedef struct google_type_Expr google_type_Expr; -extern const upb_MiniTable google_type_Expr_msginit; +extern const upb_MiniTable google_type_Expr_msg_init; /* google.type.Expr */ UPB_INLINE google_type_Expr* google_type_Expr_new(upb_Arena* arena) { - return (google_type_Expr*)_upb_Message_New(&google_type_Expr_msginit, arena); + return (google_type_Expr*)_upb_Message_New(&google_type_Expr_msg_init, arena); } UPB_INLINE google_type_Expr* google_type_Expr_parse(const char* buf, size_t size, upb_Arena* arena) { google_type_Expr* ret = google_type_Expr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_type_Expr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &google_type_Expr_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE google_type_Expr* google_type_Expr_parse_ex(const char* buf, size_t s int options, upb_Arena* arena) { google_type_Expr* ret = google_type_Expr_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &google_type_Expr_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &google_type_Expr_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,59 +56,83 @@ UPB_INLINE google_type_Expr* google_type_Expr_parse_ex(const char* buf, size_t s } UPB_INLINE char* google_type_Expr_serialize(const google_type_Expr* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &google_type_Expr_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &google_type_Expr_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &google_type_Expr_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &google_type_Expr_msg_init, 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); +UPB_INLINE void google_type_Expr_clear_expression(google_type_Expr* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_type_Expr_expression(const google_type_Expr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_type_Expr_clear_title(const google_type_Expr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_type_Expr_clear_title(google_type_Expr* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_type_Expr_title(const google_type_Expr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_type_Expr_clear_description(const google_type_Expr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_type_Expr_clear_description(google_type_Expr* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_type_Expr_description(const google_type_Expr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void google_type_Expr_clear_location(const google_type_Expr* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void google_type_Expr_clear_location(google_type_Expr* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_type_Expr_location(const google_type_Expr* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void google_type_Expr_set_expression(google_type_Expr *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_type_Expr_set_title(google_type_Expr *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_type_Expr_set_description(google_type_Expr *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_type_Expr_set_location(google_type_Expr *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(24, 48), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File google_type_expr_proto_upb_file_layout; +extern const upb_MiniTableFile google_type_expr_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_TYPE_EXPR_PROTO_UPB_H_ */ 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 20737272258..5ef9e02f3a6 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 @@ -7,71 +7,96 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "opencensus/proto/trace/v1/trace_config.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub opencensus_proto_trace_v1_TraceConfig_submsgs[3] = { - {.submsg = &opencensus_proto_trace_v1_ProbabilitySampler_msginit}, - {.submsg = &opencensus_proto_trace_v1_ConstantSampler_msginit}, - {.submsg = &opencensus_proto_trace_v1_RateLimitingSampler_msginit}, +static const upb_MiniTableSub opencensus_proto_trace_v1_TraceConfig_submsgs[3] = { + {.submsg = &opencensus_proto_trace_v1_ProbabilitySampler_msg_init}, + {.submsg = &opencensus_proto_trace_v1_ConstantSampler_msg_init}, + {.submsg = &opencensus_proto_trace_v1_RateLimitingSampler_msg_init}, }; -static const upb_MiniTable_Field opencensus_proto_trace_v1_TraceConfig__fields[7] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField opencensus_proto_trace_v1_TraceConfig__fields[7] = { + {1, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 40), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {7, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msginit = { +const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msg_init = { &opencensus_proto_trace_v1_TraceConfig_submsgs[0], &opencensus_proto_trace_v1_TraceConfig__fields[0], - UPB_SIZE(40, 48), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 48), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002800000100000a, &upb_pom_1bt_max64b}, + {0x0028000002010012, &upb_pom_1bt_max64b}, + {0x002800000302001a, &upb_pom_1bt_max64b}, + {0x000800003f000020, &upb_psv8_1bt}, + {0x001000003f000028, &upb_psv8_1bt}, + {0x001800003f000030, &upb_psv8_1bt}, + {0x002000003f000038, &upb_psv8_1bt}, + }) }; -static const upb_MiniTable_Field opencensus_proto_trace_v1_ProbabilitySampler__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField opencensus_proto_trace_v1_ProbabilitySampler__fields[1] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable opencensus_proto_trace_v1_ProbabilitySampler_msginit = { +const upb_MiniTable opencensus_proto_trace_v1_ProbabilitySampler_msg_init = { NULL, &opencensus_proto_trace_v1_ProbabilitySampler__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + }) }; -static const upb_MiniTable_Field opencensus_proto_trace_v1_ConstantSampler__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField opencensus_proto_trace_v1_ConstantSampler__fields[1] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable opencensus_proto_trace_v1_ConstantSampler_msginit = { +const upb_MiniTable opencensus_proto_trace_v1_ConstantSampler_msg_init = { NULL, &opencensus_proto_trace_v1_ConstantSampler__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Field opencensus_proto_trace_v1_RateLimitingSampler__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField opencensus_proto_trace_v1_RateLimitingSampler__fields[1] = { + {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable opencensus_proto_trace_v1_RateLimitingSampler_msginit = { +const upb_MiniTable opencensus_proto_trace_v1_RateLimitingSampler_msg_init = { NULL, &opencensus_proto_trace_v1_RateLimitingSampler__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + }) }; static const upb_MiniTable *messages_layout[4] = { - &opencensus_proto_trace_v1_TraceConfig_msginit, - &opencensus_proto_trace_v1_ProbabilitySampler_msginit, - &opencensus_proto_trace_v1_ConstantSampler_msginit, - &opencensus_proto_trace_v1_RateLimitingSampler_msginit, + &opencensus_proto_trace_v1_TraceConfig_msg_init, + &opencensus_proto_trace_v1_ProbabilitySampler_msg_init, + &opencensus_proto_trace_v1_ConstantSampler_msg_init, + &opencensus_proto_trace_v1_RateLimitingSampler_msg_init, }; -const upb_MiniTable_File opencensus_proto_trace_v1_trace_config_proto_upb_file_layout = { +const upb_MiniTableFile opencensus_proto_trace_v1_trace_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -80,5 +105,5 @@ const upb_MiniTable_File opencensus_proto_trace_v1_trace_config_proto_upb_file_l 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 7915939a835..4d8b56ee65d 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 @@ -9,29 +9,30 @@ #ifndef OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPB_H_ #define OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct opencensus_proto_trace_v1_TraceConfig; -struct opencensus_proto_trace_v1_ProbabilitySampler; -struct opencensus_proto_trace_v1_ConstantSampler; -struct opencensus_proto_trace_v1_RateLimitingSampler; typedef struct opencensus_proto_trace_v1_TraceConfig opencensus_proto_trace_v1_TraceConfig; typedef struct opencensus_proto_trace_v1_ProbabilitySampler opencensus_proto_trace_v1_ProbabilitySampler; typedef struct opencensus_proto_trace_v1_ConstantSampler opencensus_proto_trace_v1_ConstantSampler; typedef struct opencensus_proto_trace_v1_RateLimitingSampler opencensus_proto_trace_v1_RateLimitingSampler; -extern const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msginit; -extern const upb_MiniTable opencensus_proto_trace_v1_ProbabilitySampler_msginit; -extern const upb_MiniTable opencensus_proto_trace_v1_ConstantSampler_msginit; -extern const upb_MiniTable opencensus_proto_trace_v1_RateLimitingSampler_msginit; +extern const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msg_init; +extern const upb_MiniTable opencensus_proto_trace_v1_ProbabilitySampler_msg_init; +extern const upb_MiniTable opencensus_proto_trace_v1_ConstantSampler_msg_init; +extern const upb_MiniTable opencensus_proto_trace_v1_RateLimitingSampler_msg_init; typedef enum { opencensus_proto_trace_v1_ConstantSampler_ALWAYS_OFF = 0, @@ -44,12 +45,12 @@ typedef enum { /* opencensus.proto.trace.v1.TraceConfig */ UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_TraceConfig_new(upb_Arena* arena) { - return (opencensus_proto_trace_v1_TraceConfig*)_upb_Message_New(&opencensus_proto_trace_v1_TraceConfig_msginit, arena); + return (opencensus_proto_trace_v1_TraceConfig*)_upb_Message_New(&opencensus_proto_trace_v1_TraceConfig_msg_init, arena); } UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_TraceConfig_parse(const char* buf, size_t size, upb_Arena* arena) { opencensus_proto_trace_v1_TraceConfig* ret = opencensus_proto_trace_v1_TraceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_TraceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_TraceConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -59,7 +60,7 @@ UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_Trac int options, upb_Arena* arena) { opencensus_proto_trace_v1_TraceConfig* ret = opencensus_proto_trace_v1_TraceConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_TraceConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_TraceConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -67,13 +68,13 @@ UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_Trac } UPB_INLINE char* opencensus_proto_trace_v1_TraceConfig_serialize(const opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -83,118 +84,161 @@ typedef enum { opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET = 0 } opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases; UPB_INLINE opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases opencensus_proto_trace_v1_TraceConfig_sampler_case(const opencensus_proto_trace_v1_TraceConfig* msg) { - return (opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ProbabilitySampler*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET); +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_probability_sampler(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_TraceConfig_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - return UPB_READ_ONEOF(msg, const opencensus_proto_trace_v1_ProbabilitySampler*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const opencensus_proto_trace_v1_ProbabilitySampler* default_val = NULL; + const opencensus_proto_trace_v1_ProbabilitySampler* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ConstantSampler*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET); +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_constant_sampler(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_TraceConfig_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - return UPB_READ_ONEOF(msg, const opencensus_proto_trace_v1_ConstantSampler*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const opencensus_proto_trace_v1_ConstantSampler* default_val = NULL; + const opencensus_proto_trace_v1_ConstantSampler* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_RateLimitingSampler*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET); +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_rate_limiting_sampler(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_TraceConfig_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { - return UPB_READ_ONEOF(msg, const opencensus_proto_trace_v1_RateLimitingSampler*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const opencensus_proto_trace_v1_RateLimitingSampler* default_val = NULL; + const opencensus_proto_trace_v1_RateLimitingSampler* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_attributes(const opencensus_proto_trace_v1_TraceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = 0; +UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_attributes(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_attributes(const opencensus_proto_trace_v1_TraceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_annotations(const opencensus_proto_trace_v1_TraceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0; +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_annotations(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {5, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_annotations(const opencensus_proto_trace_v1_TraceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {5, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_message_events(const opencensus_proto_trace_v1_TraceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0; +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_message_events(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {6, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_message_events(const opencensus_proto_trace_v1_TraceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {6, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_links(const opencensus_proto_trace_v1_TraceConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0; +UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_links(opencensus_proto_trace_v1_TraceConfig* msg) { + const upb_MiniTableField field = {7, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_links(const opencensus_proto_trace_v1_TraceConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {7, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_probability_sampler(opencensus_proto_trace_v1_TraceConfig *msg, opencensus_proto_trace_v1_ProbabilitySampler* value) { - UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ProbabilitySampler*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 40), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_TraceConfig_mutable_probability_sampler(opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena) { struct opencensus_proto_trace_v1_ProbabilitySampler* sub = (struct opencensus_proto_trace_v1_ProbabilitySampler*)opencensus_proto_trace_v1_TraceConfig_probability_sampler(msg); if (sub == NULL) { - sub = (struct opencensus_proto_trace_v1_ProbabilitySampler*)_upb_Message_New(&opencensus_proto_trace_v1_ProbabilitySampler_msginit, arena); - if (!sub) return NULL; - opencensus_proto_trace_v1_TraceConfig_set_probability_sampler(msg, sub); + sub = (struct opencensus_proto_trace_v1_ProbabilitySampler*)_upb_Message_New(&opencensus_proto_trace_v1_ProbabilitySampler_msg_init, arena); + if (sub) opencensus_proto_trace_v1_TraceConfig_set_probability_sampler(msg, sub); } return sub; } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_constant_sampler(opencensus_proto_trace_v1_TraceConfig *msg, opencensus_proto_trace_v1_ConstantSampler* value) { - UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ConstantSampler*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 40), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_TraceConfig_mutable_constant_sampler(opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena) { struct opencensus_proto_trace_v1_ConstantSampler* sub = (struct opencensus_proto_trace_v1_ConstantSampler*)opencensus_proto_trace_v1_TraceConfig_constant_sampler(msg); if (sub == NULL) { - sub = (struct opencensus_proto_trace_v1_ConstantSampler*)_upb_Message_New(&opencensus_proto_trace_v1_ConstantSampler_msginit, arena); - if (!sub) return NULL; - opencensus_proto_trace_v1_TraceConfig_set_constant_sampler(msg, sub); + sub = (struct opencensus_proto_trace_v1_ConstantSampler*)_upb_Message_New(&opencensus_proto_trace_v1_ConstantSampler_msg_init, arena); + if (sub) opencensus_proto_trace_v1_TraceConfig_set_constant_sampler(msg, sub); } return sub; } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_rate_limiting_sampler(opencensus_proto_trace_v1_TraceConfig *msg, opencensus_proto_trace_v1_RateLimitingSampler* value) { - UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_RateLimitingSampler*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_TraceConfig_mutable_rate_limiting_sampler(opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena) { struct opencensus_proto_trace_v1_RateLimitingSampler* sub = (struct opencensus_proto_trace_v1_RateLimitingSampler*)opencensus_proto_trace_v1_TraceConfig_rate_limiting_sampler(msg); if (sub == NULL) { - sub = (struct opencensus_proto_trace_v1_RateLimitingSampler*)_upb_Message_New(&opencensus_proto_trace_v1_RateLimitingSampler_msginit, arena); - if (!sub) return NULL; - opencensus_proto_trace_v1_TraceConfig_set_rate_limiting_sampler(msg, sub); + sub = (struct opencensus_proto_trace_v1_RateLimitingSampler*)_upb_Message_New(&opencensus_proto_trace_v1_RateLimitingSampler_msg_init, arena); + if (sub) opencensus_proto_trace_v1_TraceConfig_set_rate_limiting_sampler(msg, sub); } return sub; } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_attributes(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = value; + const upb_MiniTableField field = {4, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_annotations(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = value; + const upb_MiniTableField field = {5, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_message_events(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value; + const upb_MiniTableField field = {6, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_links(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = value; + const upb_MiniTableField field = {7, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* opencensus.proto.trace.v1.ProbabilitySampler */ UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_ProbabilitySampler_new(upb_Arena* arena) { - return (opencensus_proto_trace_v1_ProbabilitySampler*)_upb_Message_New(&opencensus_proto_trace_v1_ProbabilitySampler_msginit, arena); + return (opencensus_proto_trace_v1_ProbabilitySampler*)_upb_Message_New(&opencensus_proto_trace_v1_ProbabilitySampler_msg_init, arena); } UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_ProbabilitySampler_parse(const char* buf, size_t size, upb_Arena* arena) { opencensus_proto_trace_v1_ProbabilitySampler* ret = opencensus_proto_trace_v1_ProbabilitySampler_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ProbabilitySampler_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -204,7 +248,7 @@ UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_ int options, upb_Arena* arena) { opencensus_proto_trace_v1_ProbabilitySampler* ret = opencensus_proto_trace_v1_ProbabilitySampler_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ProbabilitySampler_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -212,35 +256,41 @@ UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_ } UPB_INLINE char* opencensus_proto_trace_v1_ProbabilitySampler_serialize(const opencensus_proto_trace_v1_ProbabilitySampler* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msg_init, 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; +UPB_INLINE void opencensus_proto_trace_v1_ProbabilitySampler_clear_samplingProbability(opencensus_proto_trace_v1_ProbabilitySampler* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double opencensus_proto_trace_v1_ProbabilitySampler_samplingProbability(const opencensus_proto_trace_v1_ProbabilitySampler* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void opencensus_proto_trace_v1_ProbabilitySampler_set_samplingProbability(opencensus_proto_trace_v1_ProbabilitySampler *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* opencensus.proto.trace.v1.ConstantSampler */ UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ConstantSampler_new(upb_Arena* arena) { - return (opencensus_proto_trace_v1_ConstantSampler*)_upb_Message_New(&opencensus_proto_trace_v1_ConstantSampler_msginit, arena); + return (opencensus_proto_trace_v1_ConstantSampler*)_upb_Message_New(&opencensus_proto_trace_v1_ConstantSampler_msg_init, arena); } UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ConstantSampler_parse(const char* buf, size_t size, upb_Arena* arena) { opencensus_proto_trace_v1_ConstantSampler* ret = opencensus_proto_trace_v1_ConstantSampler_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ConstantSampler_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ConstantSampler_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -250,7 +300,7 @@ UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ int options, upb_Arena* arena) { opencensus_proto_trace_v1_ConstantSampler* ret = opencensus_proto_trace_v1_ConstantSampler_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ConstantSampler_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ConstantSampler_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -258,35 +308,41 @@ UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ } UPB_INLINE char* opencensus_proto_trace_v1_ConstantSampler_serialize(const opencensus_proto_trace_v1_ConstantSampler* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msg_init, 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; +UPB_INLINE void opencensus_proto_trace_v1_ConstantSampler_clear_decision(opencensus_proto_trace_v1_ConstantSampler* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t opencensus_proto_trace_v1_ConstantSampler_decision(const opencensus_proto_trace_v1_ConstantSampler* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void opencensus_proto_trace_v1_ConstantSampler_set_decision(opencensus_proto_trace_v1_ConstantSampler *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* opencensus.proto.trace.v1.RateLimitingSampler */ UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_RateLimitingSampler_new(upb_Arena* arena) { - return (opencensus_proto_trace_v1_RateLimitingSampler*)_upb_Message_New(&opencensus_proto_trace_v1_RateLimitingSampler_msginit, arena); + return (opencensus_proto_trace_v1_RateLimitingSampler*)_upb_Message_New(&opencensus_proto_trace_v1_RateLimitingSampler_msg_init, arena); } UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_RateLimitingSampler_parse(const char* buf, size_t size, upb_Arena* arena) { opencensus_proto_trace_v1_RateLimitingSampler* ret = opencensus_proto_trace_v1_RateLimitingSampler_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_RateLimitingSampler_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -296,7 +352,7 @@ UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace int options, upb_Arena* arena) { opencensus_proto_trace_v1_RateLimitingSampler* ret = opencensus_proto_trace_v1_RateLimitingSampler_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_RateLimitingSampler_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -304,32 +360,38 @@ UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace } UPB_INLINE char* opencensus_proto_trace_v1_RateLimitingSampler_serialize(const opencensus_proto_trace_v1_RateLimitingSampler* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msg_init, 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; +UPB_INLINE void opencensus_proto_trace_v1_RateLimitingSampler_clear_qps(opencensus_proto_trace_v1_RateLimitingSampler* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t opencensus_proto_trace_v1_RateLimitingSampler_qps(const opencensus_proto_trace_v1_RateLimitingSampler* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void opencensus_proto_trace_v1_RateLimitingSampler_set_qps(opencensus_proto_trace_v1_RateLimitingSampler *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File opencensus_proto_trace_v1_trace_config_proto_upb_file_layout; +extern const upb_MiniTableFile opencensus_proto_trace_v1_trace_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c index 265b5c22ef4..2d4395e0960 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c @@ -7,50 +7,69 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/gcp/altscontext.upb.h" #include "src/proto/grpc/gcp/transport_security_common.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub grpc_gcp_AltsContext_submsgs[2] = { - {.submsg = &grpc_gcp_RpcProtocolVersions_msginit}, - {.submsg = &grpc_gcp_AltsContext_PeerAttributesEntry_msginit}, +static const upb_MiniTableSub grpc_gcp_AltsContext_submsgs[2] = { + {.submsg = &grpc_gcp_RpcProtocolVersions_msg_init}, + {.submsg = &grpc_gcp_AltsContext_PeerAttributesEntry_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_AltsContext__fields[7] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 72), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_AltsContext__fields[7] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_AltsContext_msginit = { +const upb_MiniTable grpc_gcp_AltsContext_msg_init = { &grpc_gcp_AltsContext_submsgs[0], &grpc_gcp_AltsContext__fields[0], - UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x000400003f000018, &upb_psv4_1bt}, + {0x002800003f000022, &upb_pss_1bt}, + {0x003800003f00002a, &upb_pss_1bt}, + {0x0048000001000032, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_gcp_AltsContext_PeerAttributesEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_AltsContext_PeerAttributesEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msginit = { +const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msg_init = { NULL, &grpc_gcp_AltsContext_PeerAttributesEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &grpc_gcp_AltsContext_msginit, - &grpc_gcp_AltsContext_PeerAttributesEntry_msginit, + &grpc_gcp_AltsContext_msg_init, + &grpc_gcp_AltsContext_PeerAttributesEntry_msg_init, }; -const upb_MiniTable_File src_proto_grpc_gcp_altscontext_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_gcp_altscontext_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -59,5 +78,5 @@ const upb_MiniTable_File src_proto_grpc_gcp_altscontext_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 e4b6e44010d..1fbeab94606 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 @@ -9,37 +9,40 @@ #ifndef SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ #define SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_gcp_AltsContext; -struct grpc_gcp_AltsContext_PeerAttributesEntry; typedef struct grpc_gcp_AltsContext grpc_gcp_AltsContext; typedef struct grpc_gcp_AltsContext_PeerAttributesEntry grpc_gcp_AltsContext_PeerAttributesEntry; -extern const upb_MiniTable grpc_gcp_AltsContext_msginit; -extern const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msginit; +extern const upb_MiniTable grpc_gcp_AltsContext_msg_init; +extern const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msg_init; struct grpc_gcp_RpcProtocolVersions; -extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit; +extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msg_init; /* grpc.gcp.AltsContext */ UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_new(upb_Arena* arena) { - return (grpc_gcp_AltsContext*)_upb_Message_New(&grpc_gcp_AltsContext_msginit, arena); + return (grpc_gcp_AltsContext*)_upb_Message_New(&grpc_gcp_AltsContext_msg_init, arena); } UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_AltsContext* ret = grpc_gcp_AltsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse_ex(const char* buf, int options, upb_Arena* arena) { grpc_gcp_AltsContext* ret = grpc_gcp_AltsContext_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,107 +60,165 @@ UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse_ex(const char* buf, } UPB_INLINE char* grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_AltsContext_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_AltsContext_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_AltsContext_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_AltsContext_msg_init, 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); +UPB_INLINE void grpc_gcp_AltsContext_clear_application_protocol(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_AltsContext_clear_record_protocol(const grpc_gcp_AltsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_gcp_AltsContext_clear_record_protocol(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_AltsContext_clear_security_level(const grpc_gcp_AltsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void grpc_gcp_AltsContext_clear_security_level(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_AltsContext_clear_peer_service_account(const grpc_gcp_AltsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_gcp_AltsContext_clear_peer_service_account(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_AltsContext_clear_local_service_account(const grpc_gcp_AltsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_gcp_AltsContext_clear_local_service_account(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_gcp_AltsContext_clear_peer_rpc_versions(const grpc_gcp_AltsContext* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_AltsContext_clear_peer_rpc_versions(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); + const struct grpc_gcp_RpcProtocolVersions* default_val = NULL; + const struct grpc_gcp_RpcProtocolVersions* ret; + const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_AltsContext_has_peer_attributes(const grpc_gcp_AltsContext* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); +UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_AltsContext_clear_peer_attributes(const grpc_gcp_AltsContext* msg) { - _upb_array_detach(msg, UPB_SIZE(44, 80)); +UPB_INLINE void grpc_gcp_AltsContext_clear_peer_attributes(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(44, 80)); + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(44, 80), &key, 0, val, 0); + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext* msg, size_t* iter) { - return (const grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool grpc_gcp_AltsContext_has_peer_attributes(const grpc_gcp_AltsContext* msg) { + return grpc_gcp_AltsContext_peer_attributes_size(msg) != 0; } UPB_INLINE void grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext *msg, struct grpc_gcp_RpcProtocolVersions* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_mutable_peer_rpc_versions(grpc_gcp_AltsContext* msg, upb_Arena* arena) { struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_AltsContext_peer_rpc_versions(msg); if (sub == NULL) { - sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena); - if (!sub) return NULL; - grpc_gcp_AltsContext_set_peer_rpc_versions(msg, sub); + sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msg_init, arena); + if (sub) grpc_gcp_AltsContext_set_peer_rpc_versions(msg, sub); } return sub; } -UPB_INLINE void grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext* msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 80)); } +UPB_INLINE void grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(44, 80), &key, 0, &val, 0, a); + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(44, 80), &key, 0); + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext* msg, size_t* iter) { - return (grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); + const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_map_next(map, iter); } /* grpc.gcp.AltsContext.PeerAttributesEntry */ @@ -177,12 +238,12 @@ UPB_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_Alts _upb_msg_map_set_value(msg, &value, 0); } -extern const upb_MiniTable_File src_proto_grpc_gcp_altscontext_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_gcp_altscontext_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ */ 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 c16c5ac08da..a9b8ff135db 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 @@ -7,227 +7,332 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/gcp/handshaker.upb.h" #include "src/proto/grpc/gcp/transport_security_common.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field grpc_gcp_Endpoint__fields[3] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_Endpoint__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_Endpoint_msginit = { +const upb_MiniTable grpc_gcp_Endpoint_msg_init = { NULL, &grpc_gcp_Endpoint__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x000400003f000018, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_Identity_submsgs[1] = { - {.submsg = &grpc_gcp_Identity_AttributesEntry_msginit}, +static const upb_MiniTableSub grpc_gcp_Identity_submsgs[1] = { + {.submsg = &grpc_gcp_Identity_AttributesEntry_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_Identity__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_Identity__fields[3] = { + {1, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_Identity_msginit = { +const upb_MiniTable grpc_gcp_Identity_msg_init = { &grpc_gcp_Identity_submsgs[0], &grpc_gcp_Identity__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pos_1bt}, + {0x0008000002000012, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_gcp_Identity_AttributesEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_Identity_AttributesEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_Identity_AttributesEntry_msginit = { +const upb_MiniTable grpc_gcp_Identity_AttributesEntry_msg_init = { NULL, &grpc_gcp_Identity_AttributesEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_StartClientHandshakeReq_submsgs[5] = { - {.submsg = &grpc_gcp_Identity_msginit}, - {.submsg = &grpc_gcp_Identity_msginit}, - {.submsg = &grpc_gcp_Endpoint_msginit}, - {.submsg = &grpc_gcp_Endpoint_msginit}, - {.submsg = &grpc_gcp_RpcProtocolVersions_msginit}, +static const upb_MiniTableSub grpc_gcp_StartClientHandshakeReq_submsgs[5] = { + {.submsg = &grpc_gcp_Identity_msg_init}, + {.submsg = &grpc_gcp_Identity_msg_init}, + {.submsg = &grpc_gcp_Endpoint_msg_init}, + {.submsg = &grpc_gcp_Endpoint_msg_init}, + {.submsg = &grpc_gcp_RpcProtocolVersions_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_StartClientHandshakeReq__fields[10] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_StartClientHandshakeReq__fields[10] = { + {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(20, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(40, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msginit = { +const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msg_init = { &grpc_gcp_StartClientHandshakeReq_submsgs[0], &grpc_gcp_StartClientHandshakeReq__fields[0], - UPB_SIZE(48, 88), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(48, 88), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400003f000008, &upb_psv4_1bt}, + {0x001000003f000012, &upb_prs_1bt}, + {0x001800003f00001a, &upb_prs_1bt}, + {0x002000003f000022, &upb_prm_1bt_max64b}, + {0x002800000101002a, &upb_psm_1bt_max64b}, + {0x0030000002020032, &upb_psm_1bt_max64b}, + {0x003800000303003a, &upb_psm_1bt_max64b}, + {0x004000003f000042, &upb_pss_1bt}, + {0x005000000404004a, &upb_psm_1bt_maxmaxb}, + {0x000800003f000050, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_ServerHandshakeParameters_submsgs[1] = { - {.submsg = &grpc_gcp_Identity_msginit}, +static const upb_MiniTableSub grpc_gcp_ServerHandshakeParameters_submsgs[1] = { + {.submsg = &grpc_gcp_Identity_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_ServerHandshakeParameters__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_ServerHandshakeParameters__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit = { +const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msg_init = { &grpc_gcp_ServerHandshakeParameters_submsgs[0], &grpc_gcp_ServerHandshakeParameters__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prs_1bt}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_StartServerHandshakeReq_submsgs[4] = { - {.submsg = &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit}, - {.submsg = &grpc_gcp_Endpoint_msginit}, - {.submsg = &grpc_gcp_Endpoint_msginit}, - {.submsg = &grpc_gcp_RpcProtocolVersions_msginit}, +static const upb_MiniTableSub grpc_gcp_StartServerHandshakeReq_submsgs[4] = { + {.submsg = &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msg_init}, + {.submsg = &grpc_gcp_Endpoint_msg_init}, + {.submsg = &grpc_gcp_Endpoint_msg_init}, + {.submsg = &grpc_gcp_RpcProtocolVersions_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_StartServerHandshakeReq__fields[7] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_StartServerHandshakeReq__fields[7] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit = { +const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msg_init = { &grpc_gcp_StartServerHandshakeReq_submsgs[0], &grpc_gcp_StartServerHandshakeReq__fields[0], - UPB_SIZE(40, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 64), 7, kUpb_ExtMode_NonExtendable, 7, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f00001a, &upb_psb_1bt}, + {0x0028000001010022, &upb_psm_1bt_max64b}, + {0x003000000202002a, &upb_psm_1bt_max64b}, + {0x0038000003030032, &upb_psm_1bt_maxmaxb}, + {0x000400003f000038, &upb_psv4_1bt}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = { - {.submsg = &grpc_gcp_ServerHandshakeParameters_msginit}, +static const upb_MiniTableSub grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = { + {.submsg = &grpc_gcp_ServerHandshakeParameters_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit = { +const upb_MiniTable grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msg_init = { &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[0], &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000008, &upb_psv4_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_gcp_NextHandshakeMessageReq__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_NextHandshakeMessageReq__fields[1] = { + {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit = { +const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msg_init = { NULL, &grpc_gcp_NextHandshakeMessageReq__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_psb_1bt}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_HandshakerReq_submsgs[3] = { - {.submsg = &grpc_gcp_StartClientHandshakeReq_msginit}, - {.submsg = &grpc_gcp_StartServerHandshakeReq_msginit}, - {.submsg = &grpc_gcp_NextHandshakeMessageReq_msginit}, +static const upb_MiniTableSub grpc_gcp_HandshakerReq_submsgs[3] = { + {.submsg = &grpc_gcp_StartClientHandshakeReq_msg_init}, + {.submsg = &grpc_gcp_StartServerHandshakeReq_msg_init}, + {.submsg = &grpc_gcp_NextHandshakeMessageReq_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_HandshakerReq__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_HandshakerReq__fields[3] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_HandshakerReq_msginit = { +const upb_MiniTable grpc_gcp_HandshakerReq_msg_init = { &grpc_gcp_HandshakerReq_submsgs[0], &grpc_gcp_HandshakerReq__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max128b}, + {0x0008000002010012, &upb_pom_1bt_max128b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_HandshakerResult_submsgs[3] = { - {.submsg = &grpc_gcp_Identity_msginit}, - {.submsg = &grpc_gcp_Identity_msginit}, - {.submsg = &grpc_gcp_RpcProtocolVersions_msginit}, +static const upb_MiniTableSub grpc_gcp_HandshakerResult_submsgs[3] = { + {.submsg = &grpc_gcp_Identity_msg_init}, + {.submsg = &grpc_gcp_Identity_msg_init}, + {.submsg = &grpc_gcp_RpcProtocolVersions_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_HandshakerResult__fields[8] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(32, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(36, 64), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 72), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_HandshakerResult__fields[8] = { + {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 40, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(16, 72), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_HandshakerResult_msginit = { +const upb_MiniTable grpc_gcp_HandshakerResult_msg_init = { &grpc_gcp_HandshakerResult_submsgs[0], &grpc_gcp_HandshakerResult__fields[0], - UPB_SIZE(48, 80), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(48, 80), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_psb_1bt}, + {0x0038000001000022, &upb_psm_1bt_max64b}, + {0x004000000201002a, &upb_psm_1bt_max64b}, + {0x000100003f000030, &upb_psb1_1bt}, + {0x004800000302003a, &upb_psm_1bt_maxmaxb}, + {0x000400003f000040, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_gcp_HandshakerStatus__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_HandshakerStatus__fields[2] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_HandshakerStatus_msginit = { +const upb_MiniTable grpc_gcp_HandshakerStatus_msg_init = { NULL, &grpc_gcp_HandshakerStatus__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_gcp_HandshakerResp_submsgs[2] = { - {.submsg = &grpc_gcp_HandshakerResult_msginit}, - {.submsg = &grpc_gcp_HandshakerStatus_msginit}, +static const upb_MiniTableSub grpc_gcp_HandshakerResp_submsgs[2] = { + {.submsg = &grpc_gcp_HandshakerResult_msg_init}, + {.submsg = &grpc_gcp_HandshakerStatus_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_HandshakerResp__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_HandshakerResp__fields[4] = { + {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_HandshakerResp_msginit = { +const upb_MiniTable grpc_gcp_HandshakerResp_msg_init = { &grpc_gcp_HandshakerResp_submsgs[0], &grpc_gcp_HandshakerResp__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x001800000100001a, &upb_psm_1bt_max128b}, + {0x0020000002010022, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[12] = { - &grpc_gcp_Endpoint_msginit, - &grpc_gcp_Identity_msginit, - &grpc_gcp_Identity_AttributesEntry_msginit, - &grpc_gcp_StartClientHandshakeReq_msginit, - &grpc_gcp_ServerHandshakeParameters_msginit, - &grpc_gcp_StartServerHandshakeReq_msginit, - &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit, - &grpc_gcp_NextHandshakeMessageReq_msginit, - &grpc_gcp_HandshakerReq_msginit, - &grpc_gcp_HandshakerResult_msginit, - &grpc_gcp_HandshakerStatus_msginit, - &grpc_gcp_HandshakerResp_msginit, + &grpc_gcp_Endpoint_msg_init, + &grpc_gcp_Identity_msg_init, + &grpc_gcp_Identity_AttributesEntry_msg_init, + &grpc_gcp_StartClientHandshakeReq_msg_init, + &grpc_gcp_ServerHandshakeParameters_msg_init, + &grpc_gcp_StartServerHandshakeReq_msg_init, + &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msg_init, + &grpc_gcp_NextHandshakeMessageReq_msg_init, + &grpc_gcp_HandshakerReq_msg_init, + &grpc_gcp_HandshakerResult_msg_init, + &grpc_gcp_HandshakerStatus_msg_init, + &grpc_gcp_HandshakerResp_msg_init, }; -const upb_MiniTable_File src_proto_grpc_gcp_handshaker_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_gcp_handshaker_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -236,5 +341,5 @@ const upb_MiniTable_File src_proto_grpc_gcp_handshaker_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 8f35fb37006..bbe7ffb7489 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 @@ -9,29 +9,22 @@ #ifndef SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ #define SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_gcp_Endpoint; -struct grpc_gcp_Identity; -struct grpc_gcp_Identity_AttributesEntry; -struct grpc_gcp_StartClientHandshakeReq; -struct grpc_gcp_ServerHandshakeParameters; -struct grpc_gcp_StartServerHandshakeReq; -struct grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry; -struct grpc_gcp_NextHandshakeMessageReq; -struct grpc_gcp_HandshakerReq; -struct grpc_gcp_HandshakerResult; -struct grpc_gcp_HandshakerStatus; -struct grpc_gcp_HandshakerResp; typedef struct grpc_gcp_Endpoint grpc_gcp_Endpoint; typedef struct grpc_gcp_Identity grpc_gcp_Identity; typedef struct grpc_gcp_Identity_AttributesEntry grpc_gcp_Identity_AttributesEntry; @@ -44,20 +37,20 @@ typedef struct grpc_gcp_HandshakerReq grpc_gcp_HandshakerReq; typedef struct grpc_gcp_HandshakerResult grpc_gcp_HandshakerResult; typedef struct grpc_gcp_HandshakerStatus grpc_gcp_HandshakerStatus; typedef struct grpc_gcp_HandshakerResp grpc_gcp_HandshakerResp; -extern const upb_MiniTable grpc_gcp_Endpoint_msginit; -extern const upb_MiniTable grpc_gcp_Identity_msginit; -extern const upb_MiniTable grpc_gcp_Identity_AttributesEntry_msginit; -extern const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msginit; -extern const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit; -extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit; -extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit; -extern const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit; -extern const upb_MiniTable grpc_gcp_HandshakerReq_msginit; -extern const upb_MiniTable grpc_gcp_HandshakerResult_msginit; -extern const upb_MiniTable grpc_gcp_HandshakerStatus_msginit; -extern const upb_MiniTable grpc_gcp_HandshakerResp_msginit; +extern const upb_MiniTable grpc_gcp_Endpoint_msg_init; +extern const upb_MiniTable grpc_gcp_Identity_msg_init; +extern const upb_MiniTable grpc_gcp_Identity_AttributesEntry_msg_init; +extern const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msg_init; +extern const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msg_init; +extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msg_init; +extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msg_init; +extern const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msg_init; +extern const upb_MiniTable grpc_gcp_HandshakerReq_msg_init; +extern const upb_MiniTable grpc_gcp_HandshakerResult_msg_init; +extern const upb_MiniTable grpc_gcp_HandshakerStatus_msg_init; +extern const upb_MiniTable grpc_gcp_HandshakerResp_msg_init; struct grpc_gcp_RpcProtocolVersions; -extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit; +extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msg_init; typedef enum { grpc_gcp_HANDSHAKE_PROTOCOL_UNSPECIFIED = 0, @@ -76,12 +69,12 @@ typedef enum { /* grpc.gcp.Endpoint */ UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_new(upb_Arena* arena) { - return (grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msginit, arena); + return (grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msg_init, arena); } UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_Endpoint* ret = grpc_gcp_Endpoint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_Endpoint_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -91,7 +84,7 @@ UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_parse_ex(const char* buf, size_t int options, upb_Arena* arena) { grpc_gcp_Endpoint* ret = grpc_gcp_Endpoint_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_Endpoint_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -99,53 +92,71 @@ UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_parse_ex(const char* buf, size_t } UPB_INLINE char* grpc_gcp_Endpoint_serialize(const grpc_gcp_Endpoint* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_Endpoint_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_Endpoint_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_Endpoint_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_Endpoint_msg_init, 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); +UPB_INLINE void grpc_gcp_Endpoint_clear_ip_address(grpc_gcp_Endpoint* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_Endpoint_ip_address(const grpc_gcp_Endpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_Endpoint_clear_port(const grpc_gcp_Endpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void grpc_gcp_Endpoint_clear_port(grpc_gcp_Endpoint* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_gcp_Endpoint_port(const grpc_gcp_Endpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_Endpoint_clear_protocol(const grpc_gcp_Endpoint* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void grpc_gcp_Endpoint_clear_protocol(grpc_gcp_Endpoint* msg) { + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_gcp_Endpoint_protocol(const grpc_gcp_Endpoint* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_gcp_Endpoint_set_ip_address(grpc_gcp_Endpoint *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_Endpoint_set_port(grpc_gcp_Endpoint *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_Endpoint_set_protocol(grpc_gcp_Endpoint *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.gcp.Identity */ UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_new(upb_Arena* arena) { - return (grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena); + return (grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msg_init, arena); } UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_Identity* ret = grpc_gcp_Identity_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_Identity_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_Identity_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -155,7 +166,7 @@ UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_parse_ex(const char* buf, size_t int options, upb_Arena* arena) { grpc_gcp_Identity* ret = grpc_gcp_Identity_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_Identity_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_Identity_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -163,13 +174,13 @@ UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_parse_ex(const char* buf, size_t } UPB_INLINE char* grpc_gcp_Identity_serialize(const grpc_gcp_Identity* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_Identity_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_Identity_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_Identity_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_Identity_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -178,57 +189,95 @@ typedef enum { grpc_gcp_Identity_identity_oneof_NOT_SET = 0 } grpc_gcp_Identity_identity_oneof_oneofcases; UPB_INLINE grpc_gcp_Identity_identity_oneof_oneofcases grpc_gcp_Identity_identity_oneof_case(const grpc_gcp_Identity* msg) { - return (grpc_gcp_Identity_identity_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (grpc_gcp_Identity_identity_oneof_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool grpc_gcp_Identity_has_service_account(const grpc_gcp_Identity* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void grpc_gcp_Identity_clear_service_account(const grpc_gcp_Identity* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), grpc_gcp_Identity_identity_oneof_NOT_SET); +UPB_INLINE void grpc_gcp_Identity_clear_service_account(grpc_gcp_Identity* msg) { + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_Identity_service_account(const grpc_gcp_Identity* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_Identity_has_hostname(const grpc_gcp_Identity* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool grpc_gcp_Identity_has_service_account(const grpc_gcp_Identity* msg) { + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_Identity_clear_hostname(const grpc_gcp_Identity* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), grpc_gcp_Identity_identity_oneof_NOT_SET); +UPB_INLINE void grpc_gcp_Identity_clear_hostname(grpc_gcp_Identity* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_Identity_hostname(const grpc_gcp_Identity* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_Identity_has_attributes(const grpc_gcp_Identity* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); +UPB_INLINE bool grpc_gcp_Identity_has_hostname(const grpc_gcp_Identity* msg) { + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_Identity_clear_attributes(const grpc_gcp_Identity* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void grpc_gcp_Identity_clear_attributes(grpc_gcp_Identity* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t grpc_gcp_Identity_attributes_size(const grpc_gcp_Identity* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(12, 24)); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool grpc_gcp_Identity_attributes_get(const grpc_gcp_Identity* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(12, 24), &key, 0, val, 0); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const grpc_gcp_Identity_AttributesEntry* grpc_gcp_Identity_attributes_next(const grpc_gcp_Identity* msg, size_t* iter) { - return (const grpc_gcp_Identity_AttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const grpc_gcp_Identity_AttributesEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool grpc_gcp_Identity_has_attributes(const grpc_gcp_Identity* msg) { + return grpc_gcp_Identity_attributes_size(msg) != 0; } UPB_INLINE void grpc_gcp_Identity_set_service_account(grpc_gcp_Identity *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_Identity_set_hostname(grpc_gcp_Identity *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, 8, -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void grpc_gcp_Identity_attributes_clear(grpc_gcp_Identity* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void grpc_gcp_Identity_attributes_clear(grpc_gcp_Identity* msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 24)); } UPB_INLINE bool grpc_gcp_Identity_attributes_set(grpc_gcp_Identity* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(12, 24), &key, 0, &val, 0, a); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool grpc_gcp_Identity_attributes_delete(grpc_gcp_Identity* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(12, 24), &key, 0); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE grpc_gcp_Identity_AttributesEntry* grpc_gcp_Identity_attributes_nextmutable(grpc_gcp_Identity* msg, size_t* iter) { - return (grpc_gcp_Identity_AttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); + const upb_MiniTableField field = {3, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (grpc_gcp_Identity_AttributesEntry*)_upb_map_next(map, iter); } /* grpc.gcp.Identity.AttributesEntry */ @@ -251,12 +300,12 @@ UPB_INLINE void grpc_gcp_Identity_AttributesEntry_set_value(grpc_gcp_Identity_At /* grpc.gcp.StartClientHandshakeReq */ UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_new(upb_Arena* arena) { - return (grpc_gcp_StartClientHandshakeReq*)_upb_Message_New(&grpc_gcp_StartClientHandshakeReq_msginit, arena); + return (grpc_gcp_StartClientHandshakeReq*)_upb_Message_New(&grpc_gcp_StartClientHandshakeReq_msg_init, arena); } UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_StartClientHandshakeReq* ret = grpc_gcp_StartClientHandshakeReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -266,7 +315,7 @@ UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_pa int options, upb_Arena* arena) { grpc_gcp_StartClientHandshakeReq* ret = grpc_gcp_StartClientHandshakeReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -274,192 +323,313 @@ UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_pa } UPB_INLINE char* grpc_gcp_StartClientHandshakeReq_serialize(const grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msg_init, 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; +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_handshake_security_protocol(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_gcp_StartClientHandshakeReq_handshake_security_protocol(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_application_protocols(const grpc_gcp_StartClientHandshakeReq* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_application_protocols(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_gcp_StartClientHandshakeReq_application_protocols(const grpc_gcp_StartClientHandshakeReq* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE upb_StringView const* grpc_gcp_StartClientHandshakeReq_application_protocols(const grpc_gcp_StartClientHandshakeReq* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_record_protocols(const grpc_gcp_StartClientHandshakeReq* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); +UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_application_protocols(const grpc_gcp_StartClientHandshakeReq* msg) { + size_t size; + grpc_gcp_StartClientHandshakeReq_application_protocols(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* grpc_gcp_StartClientHandshakeReq_record_protocols(const grpc_gcp_StartClientHandshakeReq* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_record_protocols(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* grpc_gcp_StartClientHandshakeReq_record_protocols(const grpc_gcp_StartClientHandshakeReq* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_record_protocols(const grpc_gcp_StartClientHandshakeReq* msg) { + size_t size; + grpc_gcp_StartClientHandshakeReq_record_protocols(msg, &size); + return size != 0; +} +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_target_identities(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_StartClientHandshakeReq_target_identities(const grpc_gcp_StartClientHandshakeReq* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_gcp_Identity* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_target_identities(const grpc_gcp_StartClientHandshakeReq* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); + size_t size; + grpc_gcp_StartClientHandshakeReq_target_identities(msg, &size); + return size != 0; } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_target_identities(const grpc_gcp_StartClientHandshakeReq* msg) { - _upb_array_detach(msg, UPB_SIZE(20, 32)); -} -UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_StartClientHandshakeReq_target_identities(const grpc_gcp_StartClientHandshakeReq* msg, size_t* len) { - return (const grpc_gcp_Identity* const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); -} -UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_local_identity(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const grpc_gcp_Identity*); + const grpc_gcp_Identity* default_val = NULL; + const grpc_gcp_Identity* ret; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_local_endpoint(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const grpc_gcp_Endpoint*); + const grpc_gcp_Endpoint* default_val = NULL; + const grpc_gcp_Endpoint* ret; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_remote_endpoint(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const grpc_gcp_Endpoint*); + const grpc_gcp_Endpoint* default_val = NULL; + const grpc_gcp_Endpoint* ret; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_target_name(const grpc_gcp_StartClientHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_target_name(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(40, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_StartClientHandshakeReq_target_name(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(40, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) { - return _upb_hasbit(msg, 4); -} -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_rpc_versions(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const struct grpc_gcp_RpcProtocolVersions*); + const struct grpc_gcp_RpcProtocolVersions* default_val = NULL; + const struct grpc_gcp_RpcProtocolVersions* ret; + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_max_frame_size(const grpc_gcp_StartClientHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0; +UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_max_frame_size(grpc_gcp_StartClientHandshakeReq* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_StartClientHandshakeReq_max_frame_size(const grpc_gcp_StartClientHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_handshake_security_protocol(grpc_gcp_StartClientHandshakeReq *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_mutable_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_mutable_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_resize_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_resize_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_mutable_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_mutable_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_resize_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_resize_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(12, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE grpc_gcp_Identity** grpc_gcp_StartClientHandshakeReq_mutable_target_identities(grpc_gcp_StartClientHandshakeReq* msg, size_t* len) { - return (grpc_gcp_Identity**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); +UPB_INLINE grpc_gcp_Identity** grpc_gcp_StartClientHandshakeReq_mutable_target_identities(grpc_gcp_StartClientHandshakeReq* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_gcp_Identity**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_gcp_Identity** grpc_gcp_StartClientHandshakeReq_resize_target_identities(grpc_gcp_StartClientHandshakeReq* msg, size_t len, upb_Arena* arena) { - return (grpc_gcp_Identity**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_gcp_Identity** grpc_gcp_StartClientHandshakeReq_resize_target_identities(grpc_gcp_StartClientHandshakeReq* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_gcp_Identity**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_add_target_identities(grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena) { - struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_local_identity(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Identity* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), grpc_gcp_Identity*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(20, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_mutable_local_identity(grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)grpc_gcp_StartClientHandshakeReq_local_identity(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartClientHandshakeReq_set_local_identity(msg, sub); + sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msg_init, arena); + if (sub) grpc_gcp_StartClientHandshakeReq_set_local_identity(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_local_endpoint(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Endpoint* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), grpc_gcp_Endpoint*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(24, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_mutable_local_endpoint(grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartClientHandshakeReq_local_endpoint(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartClientHandshakeReq_set_local_endpoint(msg, sub); + sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msg_init, arena); + if (sub) grpc_gcp_StartClientHandshakeReq_set_local_endpoint(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_remote_endpoint(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Endpoint* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), grpc_gcp_Endpoint*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(28, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_mutable_remote_endpoint(grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartClientHandshakeReq_remote_endpoint(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartClientHandshakeReq_set_remote_endpoint(msg, sub); + sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msg_init, arena); + if (sub) grpc_gcp_StartClientHandshakeReq_set_remote_endpoint(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_target_name(grpc_gcp_StartClientHandshakeReq *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(40, 64), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_rpc_versions(grpc_gcp_StartClientHandshakeReq *msg, struct grpc_gcp_RpcProtocolVersions* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct grpc_gcp_RpcProtocolVersions*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 4, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_mutable_rpc_versions(grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_StartClientHandshakeReq_rpc_versions(msg); if (sub == NULL) { - sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartClientHandshakeReq_set_rpc_versions(msg, sub); + sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msg_init, arena); + if (sub) grpc_gcp_StartClientHandshakeReq_set_rpc_versions(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_max_frame_size(grpc_gcp_StartClientHandshakeReq *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value; + const upb_MiniTableField field = {10, UPB_SIZE(36, 8), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.gcp.ServerHandshakeParameters */ UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameters_new(upb_Arena* arena) { - return (grpc_gcp_ServerHandshakeParameters*)_upb_Message_New(&grpc_gcp_ServerHandshakeParameters_msginit, arena); + return (grpc_gcp_ServerHandshakeParameters*)_upb_Message_New(&grpc_gcp_ServerHandshakeParameters_msg_init, arena); } UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameters_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_ServerHandshakeParameters* ret = grpc_gcp_ServerHandshakeParameters_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -469,7 +639,7 @@ UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameter int options, upb_Arena* arena) { grpc_gcp_ServerHandshakeParameters* ret = grpc_gcp_ServerHandshakeParameters_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -477,62 +647,116 @@ UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameter } UPB_INLINE char* grpc_gcp_ServerHandshakeParameters_serialize(const grpc_gcp_ServerHandshakeParameters* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msg_init, 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)); +UPB_INLINE void grpc_gcp_ServerHandshakeParameters_clear_record_protocols(grpc_gcp_ServerHandshakeParameters* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_gcp_ServerHandshakeParameters_record_protocols(const grpc_gcp_ServerHandshakeParameters* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView const* grpc_gcp_ServerHandshakeParameters_record_protocols(const grpc_gcp_ServerHandshakeParameters* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_has_record_protocols(const grpc_gcp_ServerHandshakeParameters* msg) { + size_t size; + grpc_gcp_ServerHandshakeParameters_record_protocols(msg, &size); + return size != 0; +} +UPB_INLINE void grpc_gcp_ServerHandshakeParameters_clear_local_identities(grpc_gcp_ServerHandshakeParameters* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_ServerHandshakeParameters_local_identities(const grpc_gcp_ServerHandshakeParameters* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_gcp_Identity* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_has_local_identities(const grpc_gcp_ServerHandshakeParameters* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE void grpc_gcp_ServerHandshakeParameters_clear_local_identities(const grpc_gcp_ServerHandshakeParameters* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_ServerHandshakeParameters_local_identities(const grpc_gcp_ServerHandshakeParameters* msg, size_t* len) { - return (const grpc_gcp_Identity* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); + size_t size; + grpc_gcp_ServerHandshakeParameters_local_identities(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView* grpc_gcp_ServerHandshakeParameters_mutable_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView* grpc_gcp_ServerHandshakeParameters_mutable_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_gcp_ServerHandshakeParameters_resize_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_gcp_ServerHandshakeParameters_resize_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_add_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_mutable_local_identities(grpc_gcp_ServerHandshakeParameters* msg, size_t* len) { - return (grpc_gcp_Identity**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_mutable_local_identities(grpc_gcp_ServerHandshakeParameters* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_gcp_Identity**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_resize_local_identities(grpc_gcp_ServerHandshakeParameters* msg, size_t len, upb_Arena* arena) { - return (grpc_gcp_Identity**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_resize_local_identities(grpc_gcp_ServerHandshakeParameters* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_gcp_Identity**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_ServerHandshakeParameters_add_local_identities(grpc_gcp_ServerHandshakeParameters* msg, upb_Arena* arena) { - struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* grpc.gcp.StartServerHandshakeReq */ UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_new(upb_Arena* arena) { - return (grpc_gcp_StartServerHandshakeReq*)_upb_Message_New(&grpc_gcp_StartServerHandshakeReq_msginit, arena); + return (grpc_gcp_StartServerHandshakeReq*)_upb_Message_New(&grpc_gcp_StartServerHandshakeReq_msg_init, arena); } UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_StartServerHandshakeReq* ret = grpc_gcp_StartServerHandshakeReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -542,7 +766,7 @@ UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_pa int options, upb_Arena* arena) { grpc_gcp_StartServerHandshakeReq* ret = grpc_gcp_StartServerHandshakeReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -550,139 +774,218 @@ UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_pa } UPB_INLINE char* grpc_gcp_StartServerHandshakeReq_serialize(const grpc_gcp_StartServerHandshakeReq* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msg_init, 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)); +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_application_protocols(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_gcp_StartServerHandshakeReq_application_protocols(const grpc_gcp_StartServerHandshakeReq* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE upb_StringView const* grpc_gcp_StartServerHandshakeReq_application_protocols(const grpc_gcp_StartServerHandshakeReq* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_handshake_parameters(const grpc_gcp_StartServerHandshakeReq* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); +UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_application_protocols(const grpc_gcp_StartServerHandshakeReq* msg) { + size_t size; + grpc_gcp_StartServerHandshakeReq_application_protocols(msg, &size); + return size != 0; } -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_handshake_parameters(const grpc_gcp_StartServerHandshakeReq* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_handshake_parameters(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(const grpc_gcp_StartServerHandshakeReq* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(12, 16)); + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_get(const grpc_gcp_StartServerHandshakeReq* msg, int32_t key, grpc_gcp_ServerHandshakeParameters** val) { - return _upb_msg_map_get(msg, UPB_SIZE(12, 16), &key, sizeof(key), val, sizeof(*val)); + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, sizeof(key), val, sizeof(*val)); } UPB_INLINE const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* grpc_gcp_StartServerHandshakeReq_handshake_parameters_next(const grpc_gcp_StartServerHandshakeReq* msg, size_t* iter) { - return (const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 16), iter); + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_map_next(map, iter); } -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_in_bytes(const grpc_gcp_StartServerHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_handshake_parameters(const grpc_gcp_StartServerHandshakeReq* msg) { + return grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(msg) != 0; +} +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_in_bytes(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_StartServerHandshakeReq_in_bytes(const grpc_gcp_StartServerHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_local_endpoint(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const grpc_gcp_Endpoint*); + const grpc_gcp_Endpoint* default_val = NULL; + const grpc_gcp_Endpoint* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_remote_endpoint(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const grpc_gcp_Endpoint*); + const grpc_gcp_Endpoint* default_val = NULL; + const grpc_gcp_Endpoint* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_rpc_versions(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct grpc_gcp_RpcProtocolVersions*); + const struct grpc_gcp_RpcProtocolVersions* default_val = NULL; + const struct grpc_gcp_RpcProtocolVersions* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_max_frame_size(const grpc_gcp_StartServerHandshakeReq* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_max_frame_size(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_StartServerHandshakeReq_max_frame_size(const grpc_gcp_StartServerHandshakeReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE upb_StringView* grpc_gcp_StartServerHandshakeReq_mutable_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); +UPB_INLINE upb_StringView* grpc_gcp_StartServerHandshakeReq_mutable_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_gcp_StartServerHandshakeReq_resize_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_gcp_StartServerHandshakeReq_resize_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_add_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void grpc_gcp_StartServerHandshakeReq_handshake_parameters_clear(grpc_gcp_StartServerHandshakeReq* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void grpc_gcp_StartServerHandshakeReq_handshake_parameters_clear(grpc_gcp_StartServerHandshakeReq* msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 16)); } UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_set(grpc_gcp_StartServerHandshakeReq* msg, int32_t key, grpc_gcp_ServerHandshakeParameters* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(12, 16), &key, sizeof(key), &val, sizeof(val), a); + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, sizeof(key), sizeof(val), a); + return _upb_Map_Insert(map, &key, sizeof(key), &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_delete(grpc_gcp_StartServerHandshakeReq* msg, int32_t key) { - return _upb_msg_map_delete(msg, UPB_SIZE(12, 16), &key, sizeof(key)); + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, sizeof(key), NULL); } UPB_INLINE grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* grpc_gcp_StartServerHandshakeReq_handshake_parameters_nextmutable(grpc_gcp_StartServerHandshakeReq* msg, size_t* iter) { - return (grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 16), iter); + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_map_next(map, iter); } UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_in_bytes(grpc_gcp_StartServerHandshakeReq *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_local_endpoint(grpc_gcp_StartServerHandshakeReq *msg, grpc_gcp_Endpoint* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), grpc_gcp_Endpoint*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_local_endpoint(grpc_gcp_StartServerHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartServerHandshakeReq_local_endpoint(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartServerHandshakeReq_set_local_endpoint(msg, sub); + sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msg_init, arena); + if (sub) grpc_gcp_StartServerHandshakeReq_set_local_endpoint(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(grpc_gcp_StartServerHandshakeReq *msg, grpc_gcp_Endpoint* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), grpc_gcp_Endpoint*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_remote_endpoint(grpc_gcp_StartServerHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartServerHandshakeReq_remote_endpoint(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(msg, sub); + sub = (struct grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msg_init, arena); + if (sub) grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_rpc_versions(grpc_gcp_StartServerHandshakeReq *msg, struct grpc_gcp_RpcProtocolVersions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct grpc_gcp_RpcProtocolVersions*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_mutable_rpc_versions(grpc_gcp_StartServerHandshakeReq* msg, upb_Arena* arena) { struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_StartServerHandshakeReq_rpc_versions(msg); if (sub == NULL) { - sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena); - if (!sub) return NULL; - grpc_gcp_StartServerHandshakeReq_set_rpc_versions(msg, sub); + sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msg_init, arena); + if (sub) grpc_gcp_StartServerHandshakeReq_set_rpc_versions(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_max_frame_size(grpc_gcp_StartServerHandshakeReq *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.gcp.StartServerHandshakeReq.HandshakeParametersEntry */ @@ -692,14 +995,15 @@ UPB_INLINE int32_t grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_key _upb_msg_map_key(msg, &ret, sizeof(ret)); return ret; } -UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_has_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const grpc_gcp_ServerHandshakeParameters* grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* msg) { grpc_gcp_ServerHandshakeParameters* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_has_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_set_value(grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg, grpc_gcp_ServerHandshakeParameters* value) { _upb_msg_map_set_value(msg, &value, sizeof(grpc_gcp_ServerHandshakeParameters*)); @@ -708,12 +1012,12 @@ UPB_INLINE void grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_set_va /* grpc.gcp.NextHandshakeMessageReq */ UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_new(upb_Arena* arena) { - return (grpc_gcp_NextHandshakeMessageReq*)_upb_Message_New(&grpc_gcp_NextHandshakeMessageReq_msginit, arena); + return (grpc_gcp_NextHandshakeMessageReq*)_upb_Message_New(&grpc_gcp_NextHandshakeMessageReq_msg_init, arena); } UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_NextHandshakeMessageReq* ret = grpc_gcp_NextHandshakeMessageReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -723,7 +1027,7 @@ UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_pa int options, upb_Arena* arena) { grpc_gcp_NextHandshakeMessageReq* ret = grpc_gcp_NextHandshakeMessageReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -731,35 +1035,41 @@ UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_pa } UPB_INLINE char* grpc_gcp_NextHandshakeMessageReq_serialize(const grpc_gcp_NextHandshakeMessageReq* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msg_init, 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); +UPB_INLINE void grpc_gcp_NextHandshakeMessageReq_clear_in_bytes(grpc_gcp_NextHandshakeMessageReq* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_NextHandshakeMessageReq_in_bytes(const grpc_gcp_NextHandshakeMessageReq* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_gcp_NextHandshakeMessageReq_set_in_bytes(grpc_gcp_NextHandshakeMessageReq *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.gcp.HandshakerReq */ UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_new(upb_Arena* arena) { - return (grpc_gcp_HandshakerReq*)_upb_Message_New(&grpc_gcp_HandshakerReq_msginit, arena); + return (grpc_gcp_HandshakerReq*)_upb_Message_New(&grpc_gcp_HandshakerReq_msg_init, arena); } UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_HandshakerReq* ret = grpc_gcp_HandshakerReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerReq_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -769,7 +1079,7 @@ UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_parse_ex(const char* b int options, upb_Arena* arena) { grpc_gcp_HandshakerReq* ret = grpc_gcp_HandshakerReq_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerReq_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -777,13 +1087,13 @@ UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_parse_ex(const char* b } UPB_INLINE char* grpc_gcp_HandshakerReq_serialize(const grpc_gcp_HandshakerReq* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerReq_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerReq_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerReq_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerReq_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -793,69 +1103,88 @@ typedef enum { grpc_gcp_HandshakerReq_req_oneof_NOT_SET = 0 } grpc_gcp_HandshakerReq_req_oneof_oneofcases; UPB_INLINE grpc_gcp_HandshakerReq_req_oneof_oneofcases grpc_gcp_HandshakerReq_req_oneof_case(const grpc_gcp_HandshakerReq* msg) { - return (grpc_gcp_HandshakerReq_req_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_gcp_HandshakerReq_req_oneof_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool grpc_gcp_HandshakerReq_has_client_start(const grpc_gcp_HandshakerReq* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void grpc_gcp_HandshakerReq_clear_client_start(const grpc_gcp_HandshakerReq* msg) { - UPB_WRITE_ONEOF(msg, grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_gcp_HandshakerReq_req_oneof_NOT_SET); +UPB_INLINE void grpc_gcp_HandshakerReq_clear_client_start(grpc_gcp_HandshakerReq* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_StartClientHandshakeReq* grpc_gcp_HandshakerReq_client_start(const grpc_gcp_HandshakerReq* msg) { - return UPB_READ_ONEOF(msg, const grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const grpc_gcp_StartClientHandshakeReq* default_val = NULL; + const grpc_gcp_StartClientHandshakeReq* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerReq_has_server_start(const grpc_gcp_HandshakerReq* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool grpc_gcp_HandshakerReq_has_client_start(const grpc_gcp_HandshakerReq* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_HandshakerReq_clear_server_start(const grpc_gcp_HandshakerReq* msg) { - UPB_WRITE_ONEOF(msg, grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_gcp_HandshakerReq_req_oneof_NOT_SET); +UPB_INLINE void grpc_gcp_HandshakerReq_clear_server_start(grpc_gcp_HandshakerReq* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_StartServerHandshakeReq* grpc_gcp_HandshakerReq_server_start(const grpc_gcp_HandshakerReq* msg) { - return UPB_READ_ONEOF(msg, const grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const grpc_gcp_StartServerHandshakeReq* default_val = NULL; + const grpc_gcp_StartServerHandshakeReq* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerReq_has_next(const grpc_gcp_HandshakerReq* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool grpc_gcp_HandshakerReq_has_server_start(const grpc_gcp_HandshakerReq* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_HandshakerReq_clear_next(const grpc_gcp_HandshakerReq* msg) { - UPB_WRITE_ONEOF(msg, grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_gcp_HandshakerReq_req_oneof_NOT_SET); +UPB_INLINE void grpc_gcp_HandshakerReq_clear_next(grpc_gcp_HandshakerReq* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_next(const grpc_gcp_HandshakerReq* msg) { - return UPB_READ_ONEOF(msg, const grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const grpc_gcp_NextHandshakeMessageReq* default_val = NULL; + const grpc_gcp_NextHandshakeMessageReq* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_gcp_HandshakerReq_has_next(const grpc_gcp_HandshakerReq* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_gcp_HandshakerReq_set_client_start(grpc_gcp_HandshakerReq *msg, grpc_gcp_StartClientHandshakeReq* value) { - UPB_WRITE_ONEOF(msg, grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_StartClientHandshakeReq* grpc_gcp_HandshakerReq_mutable_client_start(grpc_gcp_HandshakerReq* msg, upb_Arena* arena) { struct grpc_gcp_StartClientHandshakeReq* sub = (struct grpc_gcp_StartClientHandshakeReq*)grpc_gcp_HandshakerReq_client_start(msg); if (sub == NULL) { - sub = (struct grpc_gcp_StartClientHandshakeReq*)_upb_Message_New(&grpc_gcp_StartClientHandshakeReq_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerReq_set_client_start(msg, sub); + sub = (struct grpc_gcp_StartClientHandshakeReq*)_upb_Message_New(&grpc_gcp_StartClientHandshakeReq_msg_init, arena); + if (sub) grpc_gcp_HandshakerReq_set_client_start(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_HandshakerReq_set_server_start(grpc_gcp_HandshakerReq *msg, grpc_gcp_StartServerHandshakeReq* value) { - UPB_WRITE_ONEOF(msg, grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_StartServerHandshakeReq* grpc_gcp_HandshakerReq_mutable_server_start(grpc_gcp_HandshakerReq* msg, upb_Arena* arena) { struct grpc_gcp_StartServerHandshakeReq* sub = (struct grpc_gcp_StartServerHandshakeReq*)grpc_gcp_HandshakerReq_server_start(msg); if (sub == NULL) { - sub = (struct grpc_gcp_StartServerHandshakeReq*)_upb_Message_New(&grpc_gcp_StartServerHandshakeReq_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerReq_set_server_start(msg, sub); + sub = (struct grpc_gcp_StartServerHandshakeReq*)_upb_Message_New(&grpc_gcp_StartServerHandshakeReq_msg_init, arena); + if (sub) grpc_gcp_HandshakerReq_set_server_start(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_HandshakerReq_set_next(grpc_gcp_HandshakerReq *msg, grpc_gcp_NextHandshakeMessageReq* value) { - UPB_WRITE_ONEOF(msg, grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_mutable_next(grpc_gcp_HandshakerReq* msg, upb_Arena* arena) { struct grpc_gcp_NextHandshakeMessageReq* sub = (struct grpc_gcp_NextHandshakeMessageReq*)grpc_gcp_HandshakerReq_next(msg); if (sub == NULL) { - sub = (struct grpc_gcp_NextHandshakeMessageReq*)_upb_Message_New(&grpc_gcp_NextHandshakeMessageReq_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerReq_set_next(msg, sub); + sub = (struct grpc_gcp_NextHandshakeMessageReq*)_upb_Message_New(&grpc_gcp_NextHandshakeMessageReq_msg_init, arena); + if (sub) grpc_gcp_HandshakerReq_set_next(msg, sub); } return sub; } @@ -863,12 +1192,12 @@ UPB_INLINE struct grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_mutab /* grpc.gcp.HandshakerResult */ UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_new(upb_Arena* arena) { - return (grpc_gcp_HandshakerResult*)_upb_Message_New(&grpc_gcp_HandshakerResult_msginit, arena); + return (grpc_gcp_HandshakerResult*)_upb_Message_New(&grpc_gcp_HandshakerResult_msg_init, arena); } UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_HandshakerResult* ret = grpc_gcp_HandshakerResult_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResult_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -878,7 +1207,7 @@ UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_parse_ex(const c int options, upb_Arena* arena) { grpc_gcp_HandshakerResult* ret = grpc_gcp_HandshakerResult_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResult_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -886,137 +1215,182 @@ UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_parse_ex(const c } UPB_INLINE char* grpc_gcp_HandshakerResult_serialize(const grpc_gcp_HandshakerResult* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerResult_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerResult_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerResult_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerResult_msg_init, 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); +UPB_INLINE void grpc_gcp_HandshakerResult_clear_application_protocol(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_HandshakerResult_application_protocol(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_HandshakerResult_clear_record_protocol(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_gcp_HandshakerResult_clear_record_protocol(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_HandshakerResult_record_protocol(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_HandshakerResult_clear_key_data(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_gcp_HandshakerResult_clear_key_data(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {3, 40, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_HandshakerResult_key_data(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 40, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_identity(const grpc_gcp_HandshakerResult* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_gcp_HandshakerResult_clear_peer_identity(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_HandshakerResult_clear_peer_identity(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_peer_identity(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const grpc_gcp_Identity*); + const grpc_gcp_Identity* default_val = NULL; + const grpc_gcp_Identity* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerResult_has_local_identity(const grpc_gcp_HandshakerResult* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_identity(const grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_HandshakerResult_clear_local_identity(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_HandshakerResult_clear_local_identity(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_local_identity(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const grpc_gcp_Identity*); + const grpc_gcp_Identity* default_val = NULL; + const grpc_gcp_Identity* ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_HandshakerResult_clear_keep_channel_open(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool grpc_gcp_HandshakerResult_has_local_identity(const grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_gcp_HandshakerResult_clear_keep_channel_open(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool grpc_gcp_HandshakerResult_keep_channel_open(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_rpc_versions(const grpc_gcp_HandshakerResult* msg) { - return _upb_hasbit(msg, 3); -} -UPB_INLINE void grpc_gcp_HandshakerResult_clear_peer_rpc_versions(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_HandshakerResult_clear_peer_rpc_versions(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_HandshakerResult_peer_rpc_versions(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); + const struct grpc_gcp_RpcProtocolVersions* default_val = NULL; + const struct grpc_gcp_RpcProtocolVersions* ret; + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_HandshakerResult_clear_max_frame_size(const grpc_gcp_HandshakerResult* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_rpc_versions(const grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_gcp_HandshakerResult_clear_max_frame_size(grpc_gcp_HandshakerResult* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_HandshakerResult_max_frame_size(const grpc_gcp_HandshakerResult* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {8, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_gcp_HandshakerResult_set_application_protocol(grpc_gcp_HandshakerResult *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(24, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerResult_set_record_protocol(grpc_gcp_HandshakerResult *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerResult_set_key_data(grpc_gcp_HandshakerResult *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {3, 40, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerResult_set_peer_identity(grpc_gcp_HandshakerResult *msg, grpc_gcp_Identity* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(32, 56), grpc_gcp_Identity*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_HandshakerResult_mutable_peer_identity(grpc_gcp_HandshakerResult* msg, upb_Arena* arena) { struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)grpc_gcp_HandshakerResult_peer_identity(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerResult_set_peer_identity(msg, sub); + sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msg_init, arena); + if (sub) grpc_gcp_HandshakerResult_set_peer_identity(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_HandshakerResult_set_local_identity(grpc_gcp_HandshakerResult *msg, grpc_gcp_Identity* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), grpc_gcp_Identity*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 64), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_HandshakerResult_mutable_local_identity(grpc_gcp_HandshakerResult* msg, upb_Arena* arena) { struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)grpc_gcp_HandshakerResult_local_identity(msg); if (sub == NULL) { - sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerResult_set_local_identity(msg, sub); + sub = (struct grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msg_init, arena); + if (sub) grpc_gcp_HandshakerResult_set_local_identity(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_HandshakerResult_set_keep_channel_open(grpc_gcp_HandshakerResult *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerResult_set_peer_rpc_versions(grpc_gcp_HandshakerResult *msg, struct grpc_gcp_RpcProtocolVersions* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value; + const upb_MiniTableField field = {7, UPB_SIZE(16, 72), 3, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_HandshakerResult_mutable_peer_rpc_versions(grpc_gcp_HandshakerResult* msg, upb_Arena* arena) { struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_HandshakerResult_peer_rpc_versions(msg); if (sub == NULL) { - sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerResult_set_peer_rpc_versions(msg, sub); + sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msg_init, arena); + if (sub) grpc_gcp_HandshakerResult_set_peer_rpc_versions(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_HandshakerResult_set_max_frame_size(grpc_gcp_HandshakerResult *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {8, UPB_SIZE(20, 4), 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.gcp.HandshakerStatus */ UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_new(upb_Arena* arena) { - return (grpc_gcp_HandshakerStatus*)_upb_Message_New(&grpc_gcp_HandshakerStatus_msginit, arena); + return (grpc_gcp_HandshakerStatus*)_upb_Message_New(&grpc_gcp_HandshakerStatus_msg_init, arena); } UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_HandshakerStatus* ret = grpc_gcp_HandshakerStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1026,7 +1400,7 @@ UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_parse_ex(const c int options, upb_Arena* arena) { grpc_gcp_HandshakerStatus* ret = grpc_gcp_HandshakerStatus_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1034,44 +1408,56 @@ UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_parse_ex(const c } UPB_INLINE char* grpc_gcp_HandshakerStatus_serialize(const grpc_gcp_HandshakerStatus* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerStatus_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerStatus_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerStatus_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerStatus_msg_init, 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; +UPB_INLINE void grpc_gcp_HandshakerStatus_clear_code(grpc_gcp_HandshakerStatus* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_HandshakerStatus_code(const grpc_gcp_HandshakerStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_HandshakerStatus_clear_details(const grpc_gcp_HandshakerStatus* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_gcp_HandshakerStatus_clear_details(grpc_gcp_HandshakerStatus* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_HandshakerStatus_details(const grpc_gcp_HandshakerStatus* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_gcp_HandshakerStatus_set_code(grpc_gcp_HandshakerStatus *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerStatus_set_details(grpc_gcp_HandshakerStatus *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.gcp.HandshakerResp */ UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_new(upb_Arena* arena) { - return (grpc_gcp_HandshakerResp*)_upb_Message_New(&grpc_gcp_HandshakerResp_msginit, arena); + return (grpc_gcp_HandshakerResp*)_upb_Message_New(&grpc_gcp_HandshakerResp_msg_init, arena); } UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_HandshakerResp* ret = grpc_gcp_HandshakerResp_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResp_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1081,7 +1467,7 @@ UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_parse_ex(const char* int options, upb_Arena* arena) { grpc_gcp_HandshakerResp* ret = grpc_gcp_HandshakerResp_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResp_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1089,85 +1475,107 @@ UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_parse_ex(const char* } UPB_INLINE char* grpc_gcp_HandshakerResp_serialize(const grpc_gcp_HandshakerResp* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerResp_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerResp_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_HandshakerResp_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_HandshakerResp_msg_init, 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); +UPB_INLINE void grpc_gcp_HandshakerResp_clear_out_frames(grpc_gcp_HandshakerResp* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_gcp_HandshakerResp_out_frames(const grpc_gcp_HandshakerResp* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_HandshakerResp_clear_bytes_consumed(const grpc_gcp_HandshakerResp* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE void grpc_gcp_HandshakerResp_clear_bytes_consumed(grpc_gcp_HandshakerResp* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_HandshakerResp_bytes_consumed(const grpc_gcp_HandshakerResp* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerResp_has_result(const grpc_gcp_HandshakerResp* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_gcp_HandshakerResp_clear_result(const grpc_gcp_HandshakerResp* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_HandshakerResp_clear_result(grpc_gcp_HandshakerResp* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_result(const grpc_gcp_HandshakerResp* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const grpc_gcp_HandshakerResult*); + const grpc_gcp_HandshakerResult* default_val = NULL; + const grpc_gcp_HandshakerResult* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_HandshakerResp_has_status(const grpc_gcp_HandshakerResp* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool grpc_gcp_HandshakerResp_has_result(const grpc_gcp_HandshakerResp* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_HandshakerResp_clear_status(const grpc_gcp_HandshakerResp* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_HandshakerResp_clear_status(grpc_gcp_HandshakerResp* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_status(const grpc_gcp_HandshakerResp* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const grpc_gcp_HandshakerStatus*); + const grpc_gcp_HandshakerStatus* default_val = NULL; + const grpc_gcp_HandshakerStatus* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_gcp_HandshakerResp_has_status(const grpc_gcp_HandshakerResp* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_gcp_HandshakerResp_set_out_frames(grpc_gcp_HandshakerResp *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerResp_set_bytes_consumed(grpc_gcp_HandshakerResp *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_HandshakerResp_set_result(grpc_gcp_HandshakerResp *msg, grpc_gcp_HandshakerResult* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), grpc_gcp_HandshakerResult*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_mutable_result(grpc_gcp_HandshakerResp* msg, upb_Arena* arena) { struct grpc_gcp_HandshakerResult* sub = (struct grpc_gcp_HandshakerResult*)grpc_gcp_HandshakerResp_result(msg); if (sub == NULL) { - sub = (struct grpc_gcp_HandshakerResult*)_upb_Message_New(&grpc_gcp_HandshakerResult_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerResp_set_result(msg, sub); + sub = (struct grpc_gcp_HandshakerResult*)_upb_Message_New(&grpc_gcp_HandshakerResult_msg_init, arena); + if (sub) grpc_gcp_HandshakerResp_set_result(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_HandshakerResp_set_status(grpc_gcp_HandshakerResp *msg, grpc_gcp_HandshakerStatus* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), grpc_gcp_HandshakerStatus*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_mutable_status(grpc_gcp_HandshakerResp* msg, upb_Arena* arena) { struct grpc_gcp_HandshakerStatus* sub = (struct grpc_gcp_HandshakerStatus*)grpc_gcp_HandshakerResp_status(msg); if (sub == NULL) { - sub = (struct grpc_gcp_HandshakerStatus*)_upb_Message_New(&grpc_gcp_HandshakerStatus_msginit, arena); - if (!sub) return NULL; - grpc_gcp_HandshakerResp_set_status(msg, sub); + sub = (struct grpc_gcp_HandshakerStatus*)_upb_Message_New(&grpc_gcp_HandshakerStatus_msg_init, arena); + if (sub) grpc_gcp_HandshakerResp_set_status(msg, sub); } return sub; } -extern const upb_MiniTable_File src_proto_grpc_gcp_handshaker_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_gcp_handshaker_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ */ 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 c87e955c2da..4ae8b40cf3f 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 @@ -7,44 +7,59 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/gcp/transport_security_common.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub grpc_gcp_RpcProtocolVersions_submsgs[2] = { - {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msginit}, - {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msginit}, +static const upb_MiniTableSub grpc_gcp_RpcProtocolVersions_submsgs[2] = { + {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msg_init}, + {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msg_init}, }; -static const upb_MiniTable_Field grpc_gcp_RpcProtocolVersions__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_RpcProtocolVersions__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit = { +const upb_MiniTable grpc_gcp_RpcProtocolVersions_msg_init = { &grpc_gcp_RpcProtocolVersions_submsgs[0], &grpc_gcp_RpcProtocolVersions__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_gcp_RpcProtocolVersions_Version__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_gcp_RpcProtocolVersions_Version__fields[2] = { + {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msginit = { +const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msg_init = { NULL, &grpc_gcp_RpcProtocolVersions_Version__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &grpc_gcp_RpcProtocolVersions_msginit, - &grpc_gcp_RpcProtocolVersions_Version_msginit, + &grpc_gcp_RpcProtocolVersions_msg_init, + &grpc_gcp_RpcProtocolVersions_Version_msg_init, }; -const upb_MiniTable_File src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -53,5 +68,5 @@ const upb_MiniTable_File src_proto_grpc_gcp_transport_security_common_proto_upb_ 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b60c9402672..edb76c72ca4 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 @@ -9,23 +9,26 @@ #ifndef SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ #define SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_gcp_RpcProtocolVersions; -struct grpc_gcp_RpcProtocolVersions_Version; typedef struct grpc_gcp_RpcProtocolVersions grpc_gcp_RpcProtocolVersions; typedef struct grpc_gcp_RpcProtocolVersions_Version grpc_gcp_RpcProtocolVersions_Version; -extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit; -extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msginit; +extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msg_init; +extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msg_init; typedef enum { grpc_gcp_SECURITY_NONE = 0, @@ -38,12 +41,12 @@ typedef enum { /* grpc.gcp.RpcProtocolVersions */ UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_new(upb_Arena* arena) { - return (grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena); + return (grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msg_init, arena); } UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_RpcProtocolVersions* ret = grpc_gcp_RpcProtocolVersions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_parse_ex(c int options, upb_Arena* arena) { grpc_gcp_RpcProtocolVersions* ret = grpc_gcp_RpcProtocolVersions_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,57 +64,67 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_parse_ex(c } UPB_INLINE char* grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtocolVersions* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msg_init, 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); -} -UPB_INLINE void grpc_gcp_RpcProtocolVersions_clear_max_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_RpcProtocolVersions_clear_max_rpc_version(grpc_gcp_RpcProtocolVersions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_max_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const grpc_gcp_RpcProtocolVersions_Version*); + const grpc_gcp_RpcProtocolVersions_Version* default_val = NULL; + const grpc_gcp_RpcProtocolVersions_Version* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_gcp_RpcProtocolVersions_clear_min_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void grpc_gcp_RpcProtocolVersions_clear_min_rpc_version(grpc_gcp_RpcProtocolVersions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_min_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const grpc_gcp_RpcProtocolVersions_Version*); + const grpc_gcp_RpcProtocolVersions_Version* default_val = NULL; + const grpc_gcp_RpcProtocolVersions_Version* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_max_rpc_version(grpc_gcp_RpcProtocolVersions *msg, grpc_gcp_RpcProtocolVersions_Version* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), grpc_gcp_RpcProtocolVersions_Version*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(grpc_gcp_RpcProtocolVersions* msg, upb_Arena* arena) { struct grpc_gcp_RpcProtocolVersions_Version* sub = (struct grpc_gcp_RpcProtocolVersions_Version*)grpc_gcp_RpcProtocolVersions_max_rpc_version(msg); if (sub == NULL) { - sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena); - if (!sub) return NULL; - grpc_gcp_RpcProtocolVersions_set_max_rpc_version(msg, sub); + sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msg_init, arena); + if (sub) grpc_gcp_RpcProtocolVersions_set_max_rpc_version(msg, sub); } return sub; } UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_min_rpc_version(grpc_gcp_RpcProtocolVersions *msg, grpc_gcp_RpcProtocolVersions_Version* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), grpc_gcp_RpcProtocolVersions_Version*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_mutable_min_rpc_version(grpc_gcp_RpcProtocolVersions* msg, upb_Arena* arena) { struct grpc_gcp_RpcProtocolVersions_Version* sub = (struct grpc_gcp_RpcProtocolVersions_Version*)grpc_gcp_RpcProtocolVersions_min_rpc_version(msg); if (sub == NULL) { - sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena); - if (!sub) return NULL; - grpc_gcp_RpcProtocolVersions_set_min_rpc_version(msg, sub); + sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msg_init, arena); + if (sub) grpc_gcp_RpcProtocolVersions_set_min_rpc_version(msg, sub); } return sub; } @@ -119,12 +132,12 @@ UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVers /* grpc.gcp.RpcProtocolVersions.Version */ UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Version_new(upb_Arena* arena) { - return (grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena); + return (grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msg_init, arena); } UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Version_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_gcp_RpcProtocolVersions_Version* ret = grpc_gcp_RpcProtocolVersions_Version_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -134,7 +147,7 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Ve int options, upb_Arena* arena) { grpc_gcp_RpcProtocolVersions_Version* ret = grpc_gcp_RpcProtocolVersions_Version_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -142,41 +155,53 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Ve } UPB_INLINE char* grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_RpcProtocolVersions_Version* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msg_init, 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; +UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_clear_major(grpc_gcp_RpcProtocolVersions_Version* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_major(const grpc_gcp_RpcProtocolVersions_Version* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_clear_minor(const grpc_gcp_RpcProtocolVersions_Version* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; +UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_clear_minor(grpc_gcp_RpcProtocolVersions_Version* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_minor(const grpc_gcp_RpcProtocolVersions_Version* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_major(grpc_gcp_RpcProtocolVersions_Version *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProtocolVersions_Version *msg, uint32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ */ 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 76ea0a50080..736091e6d29 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 @@ -7,37 +7,48 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/health/v1/health.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field grpc_health_v1_HealthCheckRequest__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_health_v1_HealthCheckRequest__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit = { +const upb_MiniTable grpc_health_v1_HealthCheckRequest_msg_init = { NULL, &grpc_health_v1_HealthCheckRequest__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field grpc_health_v1_HealthCheckResponse__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_health_v1_HealthCheckResponse__fields[1] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit = { +const upb_MiniTable grpc_health_v1_HealthCheckResponse_msg_init = { NULL, &grpc_health_v1_HealthCheckResponse__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &grpc_health_v1_HealthCheckRequest_msginit, - &grpc_health_v1_HealthCheckResponse_msginit, + &grpc_health_v1_HealthCheckRequest_msg_init, + &grpc_health_v1_HealthCheckResponse_msg_init, }; -const upb_MiniTable_File src_proto_grpc_health_v1_health_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_health_v1_health_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -46,5 +57,5 @@ const upb_MiniTable_File src_proto_grpc_health_v1_health_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 74f2df4458b..9217ea2312c 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 @@ -9,23 +9,26 @@ #ifndef SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ #define SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_health_v1_HealthCheckRequest; -struct grpc_health_v1_HealthCheckResponse; typedef struct grpc_health_v1_HealthCheckRequest grpc_health_v1_HealthCheckRequest; typedef struct grpc_health_v1_HealthCheckResponse grpc_health_v1_HealthCheckResponse; -extern const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit; -extern const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit; +extern const upb_MiniTable grpc_health_v1_HealthCheckRequest_msg_init; +extern const upb_MiniTable grpc_health_v1_HealthCheckResponse_msg_init; typedef enum { grpc_health_v1_HealthCheckResponse_UNKNOWN = 0, @@ -39,12 +42,12 @@ typedef enum { /* grpc.health.v1.HealthCheckRequest */ UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_new(upb_Arena* arena) { - return (grpc_health_v1_HealthCheckRequest*)_upb_Message_New(&grpc_health_v1_HealthCheckRequest_msginit, arena); + return (grpc_health_v1_HealthCheckRequest*)_upb_Message_New(&grpc_health_v1_HealthCheckRequest_msg_init, arena); } UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_health_v1_HealthCheckRequest* ret = grpc_health_v1_HealthCheckRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -54,7 +57,7 @@ UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_ int options, upb_Arena* arena) { grpc_health_v1_HealthCheckRequest* ret = grpc_health_v1_HealthCheckRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -62,35 +65,41 @@ UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_ } UPB_INLINE char* grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v1_HealthCheckRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msg_init, 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); +UPB_INLINE void grpc_health_v1_HealthCheckRequest_clear_service(grpc_health_v1_HealthCheckRequest* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_health_v1_HealthCheckRequest_service(const grpc_health_v1_HealthCheckRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_health_v1_HealthCheckRequest_set_service(grpc_health_v1_HealthCheckRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.health.v1.HealthCheckResponse */ UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckResponse_new(upb_Arena* arena) { - return (grpc_health_v1_HealthCheckResponse*)_upb_Message_New(&grpc_health_v1_HealthCheckResponse_msginit, arena); + return (grpc_health_v1_HealthCheckResponse*)_upb_Message_New(&grpc_health_v1_HealthCheckResponse_msg_init, arena); } UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckResponse_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_health_v1_HealthCheckResponse* ret = grpc_health_v1_HealthCheckResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -100,7 +109,7 @@ UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckRespons int options, upb_Arena* arena) { grpc_health_v1_HealthCheckResponse* ret = grpc_health_v1_HealthCheckResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -108,32 +117,38 @@ UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckRespons } UPB_INLINE char* grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_v1_HealthCheckResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msg_init, 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; +UPB_INLINE void grpc_health_v1_HealthCheckResponse_clear_status(grpc_health_v1_HealthCheckResponse* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_health_v1_HealthCheckResponse_status(const grpc_health_v1_HealthCheckResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_health_v1_HealthCheckResponse_set_status(grpc_health_v1_HealthCheckResponse *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File src_proto_grpc_health_v1_health_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_health_v1_health_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ */ 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 591afb886e2..017c863276d 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 @@ -7,148 +7,211 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/lb/v1/load_balancer.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/timestamp.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub grpc_lb_v1_LoadBalanceRequest_submsgs[2] = { - {.submsg = &grpc_lb_v1_InitialLoadBalanceRequest_msginit}, - {.submsg = &grpc_lb_v1_ClientStats_msginit}, +static const upb_MiniTableSub grpc_lb_v1_LoadBalanceRequest_submsgs[2] = { + {.submsg = &grpc_lb_v1_InitialLoadBalanceRequest_msg_init}, + {.submsg = &grpc_lb_v1_ClientStats_msg_init}, }; -static const upb_MiniTable_Field grpc_lb_v1_LoadBalanceRequest__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_LoadBalanceRequest__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit = { +const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msg_init = { &grpc_lb_v1_LoadBalanceRequest_submsgs[0], &grpc_lb_v1_LoadBalanceRequest__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceRequest__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_InitialLoadBalanceRequest__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit = { +const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msg_init = { NULL, &grpc_lb_v1_InitialLoadBalanceRequest__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field grpc_lb_v1_ClientStatsPerToken__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_ClientStatsPerToken__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msginit = { +const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msg_init = { NULL, &grpc_lb_v1_ClientStatsPerToken__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_lb_v1_ClientStats_submsgs[2] = { - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &grpc_lb_v1_ClientStatsPerToken_msginit}, +static const upb_MiniTableSub grpc_lb_v1_ClientStats_submsgs[2] = { + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &grpc_lb_v1_ClientStatsPerToken_msg_init}, }; -static const upb_MiniTable_Field grpc_lb_v1_ClientStats__fields[6] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(40, 48), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_ClientStats__fields[6] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {7, 40, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_ClientStats_msginit = { +const upb_MiniTable grpc_lb_v1_ClientStats_msg_init = { &grpc_lb_v1_ClientStats_submsgs[0], &grpc_lb_v1_ClientStats__fields[0], - UPB_SIZE(48, 56), 6, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(48, 56), 6, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000010, &upb_psv8_1bt}, + {0x001800003f000018, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f000030, &upb_psv8_1bt}, + {0x002800003f000038, &upb_psv8_1bt}, + {0x003000003f010042, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_lb_v1_LoadBalanceResponse_submsgs[3] = { - {.submsg = &grpc_lb_v1_InitialLoadBalanceResponse_msginit}, - {.submsg = &grpc_lb_v1_ServerList_msginit}, - {.submsg = &grpc_lb_v1_FallbackResponse_msginit}, +static const upb_MiniTableSub grpc_lb_v1_LoadBalanceResponse_submsgs[3] = { + {.submsg = &grpc_lb_v1_InitialLoadBalanceResponse_msg_init}, + {.submsg = &grpc_lb_v1_ServerList_msg_init}, + {.submsg = &grpc_lb_v1_FallbackResponse_msg_init}, }; -static const upb_MiniTable_Field grpc_lb_v1_LoadBalanceResponse__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_LoadBalanceResponse__fields[3] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit = { +const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msg_init = { &grpc_lb_v1_LoadBalanceResponse_submsgs[0], &grpc_lb_v1_LoadBalanceResponse__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + }) }; -const upb_MiniTable grpc_lb_v1_FallbackResponse_msginit = { +const upb_MiniTable grpc_lb_v1_FallbackResponse_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceResponse__fields[1] = { - {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_InitialLoadBalanceResponse__fields[1] = { + {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msginit = { +const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msg_init = { &grpc_lb_v1_InitialLoadBalanceResponse_submsgs[0], &grpc_lb_v1_InitialLoadBalanceResponse__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_lb_v1_ServerList_submsgs[1] = { - {.submsg = &grpc_lb_v1_Server_msginit}, +static const upb_MiniTableSub grpc_lb_v1_ServerList_submsgs[1] = { + {.submsg = &grpc_lb_v1_Server_msg_init}, }; -static const upb_MiniTable_Field grpc_lb_v1_ServerList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_ServerList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_ServerList_msginit = { +const upb_MiniTable grpc_lb_v1_ServerList_msg_init = { &grpc_lb_v1_ServerList_submsgs[0], &grpc_lb_v1_ServerList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field grpc_lb_v1_Server__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lb_v1_Server__fields[4] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lb_v1_Server_msginit = { +const upb_MiniTable grpc_lb_v1_Server_msg_init = { NULL, &grpc_lb_v1_Server__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x000000003f000010, &upb_psv4_1bt}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x000400003f000020, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[9] = { - &grpc_lb_v1_LoadBalanceRequest_msginit, - &grpc_lb_v1_InitialLoadBalanceRequest_msginit, - &grpc_lb_v1_ClientStatsPerToken_msginit, - &grpc_lb_v1_ClientStats_msginit, - &grpc_lb_v1_LoadBalanceResponse_msginit, - &grpc_lb_v1_FallbackResponse_msginit, - &grpc_lb_v1_InitialLoadBalanceResponse_msginit, - &grpc_lb_v1_ServerList_msginit, - &grpc_lb_v1_Server_msginit, + &grpc_lb_v1_LoadBalanceRequest_msg_init, + &grpc_lb_v1_InitialLoadBalanceRequest_msg_init, + &grpc_lb_v1_ClientStatsPerToken_msg_init, + &grpc_lb_v1_ClientStats_msg_init, + &grpc_lb_v1_LoadBalanceResponse_msg_init, + &grpc_lb_v1_FallbackResponse_msg_init, + &grpc_lb_v1_InitialLoadBalanceResponse_msg_init, + &grpc_lb_v1_ServerList_msg_init, + &grpc_lb_v1_Server_msg_init, }; -const upb_MiniTable_File src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -157,5 +220,5 @@ const upb_MiniTable_File src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layou 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 01420dfb808..159e7011dd4 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 @@ -9,26 +9,22 @@ #ifndef SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ #define SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_lb_v1_LoadBalanceRequest; -struct grpc_lb_v1_InitialLoadBalanceRequest; -struct grpc_lb_v1_ClientStatsPerToken; -struct grpc_lb_v1_ClientStats; -struct grpc_lb_v1_LoadBalanceResponse; -struct grpc_lb_v1_FallbackResponse; -struct grpc_lb_v1_InitialLoadBalanceResponse; -struct grpc_lb_v1_ServerList; -struct grpc_lb_v1_Server; typedef struct grpc_lb_v1_LoadBalanceRequest grpc_lb_v1_LoadBalanceRequest; typedef struct grpc_lb_v1_InitialLoadBalanceRequest grpc_lb_v1_InitialLoadBalanceRequest; typedef struct grpc_lb_v1_ClientStatsPerToken grpc_lb_v1_ClientStatsPerToken; @@ -38,31 +34,31 @@ typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse; typedef struct grpc_lb_v1_InitialLoadBalanceResponse grpc_lb_v1_InitialLoadBalanceResponse; typedef struct grpc_lb_v1_ServerList grpc_lb_v1_ServerList; typedef struct grpc_lb_v1_Server grpc_lb_v1_Server; -extern const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit; -extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit; -extern const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msginit; -extern const upb_MiniTable grpc_lb_v1_ClientStats_msginit; -extern const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit; -extern const upb_MiniTable grpc_lb_v1_FallbackResponse_msginit; -extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msginit; -extern const upb_MiniTable grpc_lb_v1_ServerList_msginit; -extern const upb_MiniTable grpc_lb_v1_Server_msginit; +extern const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msg_init; +extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msg_init; +extern const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msg_init; +extern const upb_MiniTable grpc_lb_v1_ClientStats_msg_init; +extern const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msg_init; +extern const upb_MiniTable grpc_lb_v1_FallbackResponse_msg_init; +extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msg_init; +extern const upb_MiniTable grpc_lb_v1_ServerList_msg_init; +extern const upb_MiniTable grpc_lb_v1_Server_msg_init; struct google_protobuf_Duration; struct google_protobuf_Timestamp; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; /* grpc.lb.v1.LoadBalanceRequest */ UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_new(upb_Arena* arena) { - return (grpc_lb_v1_LoadBalanceRequest*)_upb_Message_New(&grpc_lb_v1_LoadBalanceRequest_msginit, arena); + return (grpc_lb_v1_LoadBalanceRequest*)_upb_Message_New(&grpc_lb_v1_LoadBalanceRequest_msg_init, arena); } UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_LoadBalanceRequest* ret = grpc_lb_v1_LoadBalanceRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -72,7 +68,7 @@ UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_parse_ex int options, upb_Arena* arena) { grpc_lb_v1_LoadBalanceRequest* ret = grpc_lb_v1_LoadBalanceRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -80,13 +76,13 @@ UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_parse_ex } UPB_INLINE char* grpc_lb_v1_LoadBalanceRequest_serialize(const grpc_lb_v1_LoadBalanceRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -95,48 +91,61 @@ typedef enum { grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET = 0 } grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases; UPB_INLINE grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_case(const grpc_lb_v1_LoadBalanceRequest* msg) { - return (grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_initial_request(const grpc_lb_v1_LoadBalanceRequest* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_clear_initial_request(const grpc_lb_v1_LoadBalanceRequest* msg) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET); +UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_clear_initial_request(grpc_lb_v1_LoadBalanceRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_initial_request(const grpc_lb_v1_LoadBalanceRequest* msg) { - return UPB_READ_ONEOF(msg, const grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const grpc_lb_v1_InitialLoadBalanceRequest* default_val = NULL; + const grpc_lb_v1_InitialLoadBalanceRequest* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_client_stats(const grpc_lb_v1_LoadBalanceRequest* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_initial_request(const grpc_lb_v1_LoadBalanceRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_clear_client_stats(const grpc_lb_v1_LoadBalanceRequest* msg) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_ClientStats*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET); +UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_clear_client_stats(grpc_lb_v1_LoadBalanceRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_client_stats(const grpc_lb_v1_LoadBalanceRequest* msg) { - return UPB_READ_ONEOF(msg, const grpc_lb_v1_ClientStats*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const grpc_lb_v1_ClientStats* default_val = NULL; + const grpc_lb_v1_ClientStats* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_client_stats(const grpc_lb_v1_LoadBalanceRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_InitialLoadBalanceRequest* value) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(grpc_lb_v1_LoadBalanceRequest* msg, upb_Arena* arena) { struct grpc_lb_v1_InitialLoadBalanceRequest* sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)grpc_lb_v1_LoadBalanceRequest_initial_request(msg); if (sub == NULL) { - sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_LoadBalanceRequest_set_initial_request(msg, sub); + sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceRequest_msg_init, arena); + if (sub) grpc_lb_v1_LoadBalanceRequest_set_initial_request(msg, sub); } return sub; } UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_client_stats(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_ClientStats* value) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_ClientStats*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_mutable_client_stats(grpc_lb_v1_LoadBalanceRequest* msg, upb_Arena* arena) { struct grpc_lb_v1_ClientStats* sub = (struct grpc_lb_v1_ClientStats*)grpc_lb_v1_LoadBalanceRequest_client_stats(msg); if (sub == NULL) { - sub = (struct grpc_lb_v1_ClientStats*)_upb_Message_New(&grpc_lb_v1_ClientStats_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_LoadBalanceRequest_set_client_stats(msg, sub); + sub = (struct grpc_lb_v1_ClientStats*)_upb_Message_New(&grpc_lb_v1_ClientStats_msg_init, arena); + if (sub) grpc_lb_v1_LoadBalanceRequest_set_client_stats(msg, sub); } return sub; } @@ -144,12 +153,12 @@ UPB_INLINE struct grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_mutable_ /* grpc.lb.v1.InitialLoadBalanceRequest */ UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRequest_new(upb_Arena* arena) { - return (grpc_lb_v1_InitialLoadBalanceRequest*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena); + return (grpc_lb_v1_InitialLoadBalanceRequest*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceRequest_msg_init, arena); } UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRequest_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_InitialLoadBalanceRequest* ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -159,7 +168,7 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRe int options, upb_Arena* arena) { grpc_lb_v1_InitialLoadBalanceRequest* ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -167,35 +176,41 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRe } UPB_INLINE char* grpc_lb_v1_InitialLoadBalanceRequest_serialize(const grpc_lb_v1_InitialLoadBalanceRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msg_init, 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); +UPB_INLINE void grpc_lb_v1_InitialLoadBalanceRequest_clear_name(grpc_lb_v1_InitialLoadBalanceRequest* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lb_v1_InitialLoadBalanceRequest_name(const grpc_lb_v1_InitialLoadBalanceRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lb_v1_InitialLoadBalanceRequest_set_name(grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lb.v1.ClientStatsPerToken */ UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_new(upb_Arena* arena) { - return (grpc_lb_v1_ClientStatsPerToken*)_upb_Message_New(&grpc_lb_v1_ClientStatsPerToken_msginit, arena); + return (grpc_lb_v1_ClientStatsPerToken*)_upb_Message_New(&grpc_lb_v1_ClientStatsPerToken_msg_init, arena); } UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_ClientStatsPerToken* ret = grpc_lb_v1_ClientStatsPerToken_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -205,7 +220,7 @@ UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_parse_ int options, upb_Arena* arena) { grpc_lb_v1_ClientStatsPerToken* ret = grpc_lb_v1_ClientStatsPerToken_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -213,44 +228,56 @@ UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_parse_ } UPB_INLINE char* grpc_lb_v1_ClientStatsPerToken_serialize(const grpc_lb_v1_ClientStatsPerToken* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msg_init, 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); +UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_clear_load_balance_token(grpc_lb_v1_ClientStatsPerToken* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lb_v1_ClientStatsPerToken_load_balance_token(const grpc_lb_v1_ClientStatsPerToken* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_clear_num_calls(const grpc_lb_v1_ClientStatsPerToken* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = 0; +UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_clear_num_calls(grpc_lb_v1_ClientStatsPerToken* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t grpc_lb_v1_ClientStatsPerToken_num_calls(const grpc_lb_v1_ClientStatsPerToken* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_set_load_balance_token(grpc_lb_v1_ClientStatsPerToken *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_set_num_calls(grpc_lb_v1_ClientStatsPerToken *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lb.v1.ClientStats */ UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_new(upb_Arena* arena) { - return (grpc_lb_v1_ClientStats*)_upb_Message_New(&grpc_lb_v1_ClientStats_msginit, arena); + return (grpc_lb_v1_ClientStats*)_upb_Message_New(&grpc_lb_v1_ClientStats_msg_init, arena); } UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_ClientStats* ret = grpc_lb_v1_ClientStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStats_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -260,7 +287,7 @@ UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_parse_ex(const char* b int options, upb_Arena* arena) { grpc_lb_v1_ClientStats* ret = grpc_lb_v1_ClientStats_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStats_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -268,105 +295,159 @@ UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_parse_ex(const char* b } UPB_INLINE char* grpc_lb_v1_ClientStats_serialize(const grpc_lb_v1_ClientStats* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_ClientStats_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_ClientStats_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_ClientStats_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_ClientStats_msg_init, 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); -} -UPB_INLINE void grpc_lb_v1_ClientStats_clear_timestamp(const grpc_lb_v1_ClientStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void grpc_lb_v1_ClientStats_clear_timestamp(grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_timestamp(const grpc_lb_v1_ClientStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_started(const grpc_lb_v1_ClientStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0; +UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_started(grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_started(const grpc_lb_v1_ClientStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished(const grpc_lb_v1_ClientStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0; +UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished(grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished(const grpc_lb_v1_ClientStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished_with_client_failed_to_send(const grpc_lb_v1_ClientStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0; +UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished_with_client_failed_to_send(grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {6, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send(const grpc_lb_v1_ClientStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {6, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished_known_received(const grpc_lb_v1_ClientStats* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0; +UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished_known_received(grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {7, 40, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_known_received(const grpc_lb_v1_ClientStats* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {7, 40, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE void grpc_lb_v1_ClientStats_clear_calls_finished_with_drop(grpc_lb_v1_ClientStats* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_lb_v1_ClientStatsPerToken* const* grpc_lb_v1_ClientStats_calls_finished_with_drop(const grpc_lb_v1_ClientStats* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lb_v1_ClientStatsPerToken* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_lb_v1_ClientStats_has_calls_finished_with_drop(const grpc_lb_v1_ClientStats* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void grpc_lb_v1_ClientStats_clear_calls_finished_with_drop(const grpc_lb_v1_ClientStats* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const grpc_lb_v1_ClientStatsPerToken* const* grpc_lb_v1_ClientStats_calls_finished_with_drop(const grpc_lb_v1_ClientStats* msg, size_t* len) { - return (const grpc_lb_v1_ClientStatsPerToken* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); + size_t size; + grpc_lb_v1_ClientStats_calls_finished_with_drop(msg, &size); + return size != 0; } UPB_INLINE void grpc_lb_v1_ClientStats_set_timestamp(grpc_lb_v1_ClientStats *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_mutable_timestamp(grpc_lb_v1_ClientStats* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)grpc_lb_v1_ClientStats_timestamp(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_ClientStats_set_timestamp(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) grpc_lb_v1_ClientStats_set_timestamp(msg, sub); } return sub; } UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_started(grpc_lb_v1_ClientStats *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = value; + const upb_MiniTableField field = {2, 16, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished(grpc_lb_v1_ClientStats *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value; + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished_with_client_failed_to_send(grpc_lb_v1_ClientStats *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = value; + const upb_MiniTableField field = {6, 32, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished_known_received(grpc_lb_v1_ClientStats *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = value; + const upb_MiniTableField field = {7, 40, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_mutable_calls_finished_with_drop(grpc_lb_v1_ClientStats* msg, size_t* len) { - return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_mutable_calls_finished_with_drop(grpc_lb_v1_ClientStats* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_resize_calls_finished_with_drop(grpc_lb_v1_ClientStats* msg, size_t len, upb_Arena* arena) { - return (grpc_lb_v1_ClientStatsPerToken**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_resize_calls_finished_with_drop(grpc_lb_v1_ClientStats* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lb_v1_ClientStatsPerToken**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStats_add_calls_finished_with_drop(grpc_lb_v1_ClientStats* msg, upb_Arena* arena) { - struct grpc_lb_v1_ClientStatsPerToken* sub = (struct grpc_lb_v1_ClientStatsPerToken*)_upb_Message_New(&grpc_lb_v1_ClientStatsPerToken_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(8, 48), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lb_v1_ClientStatsPerToken* sub = (struct grpc_lb_v1_ClientStatsPerToken*)_upb_Message_New(&grpc_lb_v1_ClientStatsPerToken_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* grpc.lb.v1.LoadBalanceResponse */ UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_new(upb_Arena* arena) { - return (grpc_lb_v1_LoadBalanceResponse*)_upb_Message_New(&grpc_lb_v1_LoadBalanceResponse_msginit, arena); + return (grpc_lb_v1_LoadBalanceResponse*)_upb_Message_New(&grpc_lb_v1_LoadBalanceResponse_msg_init, arena); } UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_LoadBalanceResponse* ret = grpc_lb_v1_LoadBalanceResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -376,7 +457,7 @@ UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_parse_ int options, upb_Arena* arena) { grpc_lb_v1_LoadBalanceResponse* ret = grpc_lb_v1_LoadBalanceResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -384,13 +465,13 @@ UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_parse_ } UPB_INLINE char* grpc_lb_v1_LoadBalanceResponse_serialize(const grpc_lb_v1_LoadBalanceResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -400,69 +481,88 @@ typedef enum { grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET = 0 } grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases; UPB_INLINE grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_case(const grpc_lb_v1_LoadBalanceResponse* msg) { - return (grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_initial_response(const grpc_lb_v1_LoadBalanceResponse* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_initial_response(const grpc_lb_v1_LoadBalanceResponse* msg) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET); +UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_initial_response(grpc_lb_v1_LoadBalanceResponse* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_initial_response(const grpc_lb_v1_LoadBalanceResponse* msg) { - return UPB_READ_ONEOF(msg, const grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const grpc_lb_v1_InitialLoadBalanceResponse* default_val = NULL; + const grpc_lb_v1_InitialLoadBalanceResponse* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_server_list(const grpc_lb_v1_LoadBalanceResponse* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_initial_response(const grpc_lb_v1_LoadBalanceResponse* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_server_list(const grpc_lb_v1_LoadBalanceResponse* msg) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_ServerList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET); +UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_server_list(grpc_lb_v1_LoadBalanceResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_server_list(const grpc_lb_v1_LoadBalanceResponse* msg) { - return UPB_READ_ONEOF(msg, const grpc_lb_v1_ServerList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const grpc_lb_v1_ServerList* default_val = NULL; + const grpc_lb_v1_ServerList* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_fallback_response(const grpc_lb_v1_LoadBalanceResponse* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_server_list(const grpc_lb_v1_LoadBalanceResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_fallback_response(const grpc_lb_v1_LoadBalanceResponse* msg) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET); +UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_fallback_response(grpc_lb_v1_LoadBalanceResponse* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_fallback_response(const grpc_lb_v1_LoadBalanceResponse* msg) { - return UPB_READ_ONEOF(msg, const grpc_lb_v1_FallbackResponse*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const grpc_lb_v1_FallbackResponse* default_val = NULL; + const grpc_lb_v1_FallbackResponse* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_fallback_response(const grpc_lb_v1_LoadBalanceResponse* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_initial_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_InitialLoadBalanceResponse* value) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_mutable_initial_response(grpc_lb_v1_LoadBalanceResponse* msg, upb_Arena* arena) { struct grpc_lb_v1_InitialLoadBalanceResponse* sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)grpc_lb_v1_LoadBalanceResponse_initial_response(msg); if (sub == NULL) { - sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_LoadBalanceResponse_set_initial_response(msg, sub); + sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceResponse_msg_init, arena); + if (sub) grpc_lb_v1_LoadBalanceResponse_set_initial_response(msg, sub); } return sub; } UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_server_list(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_ServerList* value) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_ServerList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_mutable_server_list(grpc_lb_v1_LoadBalanceResponse* msg, upb_Arena* arena) { struct grpc_lb_v1_ServerList* sub = (struct grpc_lb_v1_ServerList*)grpc_lb_v1_LoadBalanceResponse_server_list(msg); if (sub == NULL) { - sub = (struct grpc_lb_v1_ServerList*)_upb_Message_New(&grpc_lb_v1_ServerList_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_LoadBalanceResponse_set_server_list(msg, sub); + sub = (struct grpc_lb_v1_ServerList*)_upb_Message_New(&grpc_lb_v1_ServerList_msg_init, arena); + if (sub) grpc_lb_v1_LoadBalanceResponse_set_server_list(msg, sub); } return sub; } UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_FallbackResponse* value) { - UPB_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mutable_fallback_response(grpc_lb_v1_LoadBalanceResponse* msg, upb_Arena* arena) { struct grpc_lb_v1_FallbackResponse* sub = (struct grpc_lb_v1_FallbackResponse*)grpc_lb_v1_LoadBalanceResponse_fallback_response(msg); if (sub == NULL) { - sub = (struct grpc_lb_v1_FallbackResponse*)_upb_Message_New(&grpc_lb_v1_FallbackResponse_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_LoadBalanceResponse_set_fallback_response(msg, sub); + sub = (struct grpc_lb_v1_FallbackResponse*)_upb_Message_New(&grpc_lb_v1_FallbackResponse_msg_init, arena); + if (sub) grpc_lb_v1_LoadBalanceResponse_set_fallback_response(msg, sub); } return sub; } @@ -470,12 +570,12 @@ UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mu /* grpc.lb.v1.FallbackResponse */ UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_new(upb_Arena* arena) { - return (grpc_lb_v1_FallbackResponse*)_upb_Message_New(&grpc_lb_v1_FallbackResponse_msginit, arena); + return (grpc_lb_v1_FallbackResponse*)_upb_Message_New(&grpc_lb_v1_FallbackResponse_msg_init, arena); } UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_FallbackResponse* ret = grpc_lb_v1_FallbackResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -485,7 +585,7 @@ UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_parse_ex(con int options, upb_Arena* arena) { grpc_lb_v1_FallbackResponse* ret = grpc_lb_v1_FallbackResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -493,13 +593,13 @@ UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_parse_ex(con } UPB_INLINE char* grpc_lb_v1_FallbackResponse_serialize(const grpc_lb_v1_FallbackResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msg_init, options, arena, &ptr, len); return ptr; } @@ -507,12 +607,12 @@ UPB_INLINE char* grpc_lb_v1_FallbackResponse_serialize_ex(const grpc_lb_v1_Fallb /* grpc.lb.v1.InitialLoadBalanceResponse */ UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceResponse_new(upb_Arena* arena) { - return (grpc_lb_v1_InitialLoadBalanceResponse*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena); + return (grpc_lb_v1_InitialLoadBalanceResponse*)_upb_Message_New(&grpc_lb_v1_InitialLoadBalanceResponse_msg_init, arena); } UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceResponse_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_InitialLoadBalanceResponse* ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -522,7 +622,7 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceR int options, upb_Arena* arena) { grpc_lb_v1_InitialLoadBalanceResponse* ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -530,35 +630,40 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceR } UPB_INLINE char* grpc_lb_v1_InitialLoadBalanceResponse_serialize(const grpc_lb_v1_InitialLoadBalanceResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msg_init, 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); -} -UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_clear_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_clear_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_mutable_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(msg, sub); } return sub; } @@ -566,12 +671,12 @@ UPB_INLINE struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceRespons /* grpc.lb.v1.ServerList */ UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_new(upb_Arena* arena) { - return (grpc_lb_v1_ServerList*)_upb_Message_New(&grpc_lb_v1_ServerList_msginit, arena); + return (grpc_lb_v1_ServerList*)_upb_Message_New(&grpc_lb_v1_ServerList_msg_init, arena); } UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_ServerList* ret = grpc_lb_v1_ServerList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_ServerList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -581,7 +686,7 @@ UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_parse_ex(const char* buf int options, upb_Arena* arena) { grpc_lb_v1_ServerList* ret = grpc_lb_v1_ServerList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_ServerList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -589,47 +694,72 @@ UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_parse_ex(const char* buf } UPB_INLINE char* grpc_lb_v1_ServerList_serialize(const grpc_lb_v1_ServerList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_ServerList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_ServerList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_ServerList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_ServerList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void grpc_lb_v1_ServerList_clear_servers(grpc_lb_v1_ServerList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_lb_v1_Server* const* grpc_lb_v1_ServerList_servers(const grpc_lb_v1_ServerList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lb_v1_Server* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool grpc_lb_v1_ServerList_has_servers(const grpc_lb_v1_ServerList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void grpc_lb_v1_ServerList_clear_servers(const grpc_lb_v1_ServerList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const grpc_lb_v1_Server* const* grpc_lb_v1_ServerList_servers(const grpc_lb_v1_ServerList* msg, size_t* len) { - return (const grpc_lb_v1_Server* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + grpc_lb_v1_ServerList_servers(msg, &size); + return size != 0; } -UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_mutable_servers(grpc_lb_v1_ServerList* msg, size_t* len) { - return (grpc_lb_v1_Server**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_mutable_servers(grpc_lb_v1_ServerList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lb_v1_Server**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_resize_servers(grpc_lb_v1_ServerList* msg, size_t len, upb_Arena* arena) { - return (grpc_lb_v1_Server**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_resize_servers(grpc_lb_v1_ServerList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lb_v1_Server**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lb_v1_Server* grpc_lb_v1_ServerList_add_servers(grpc_lb_v1_ServerList* msg, upb_Arena* arena) { - struct grpc_lb_v1_Server* sub = (struct grpc_lb_v1_Server*)_upb_Message_New(&grpc_lb_v1_Server_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lb_v1_Server* sub = (struct grpc_lb_v1_Server*)_upb_Message_New(&grpc_lb_v1_Server_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* grpc.lb.v1.Server */ UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_new(upb_Arena* arena) { - return (grpc_lb_v1_Server*)_upb_Message_New(&grpc_lb_v1_Server_msginit, arena); + return (grpc_lb_v1_Server*)_upb_Message_New(&grpc_lb_v1_Server_msg_init, arena); } UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lb_v1_Server* ret = grpc_lb_v1_Server_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_Server_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lb_v1_Server_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -639,7 +769,7 @@ UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_parse_ex(const char* buf, size_t int options, upb_Arena* arena) { grpc_lb_v1_Server* ret = grpc_lb_v1_Server_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lb_v1_Server_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lb_v1_Server_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -647,59 +777,83 @@ UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_parse_ex(const char* buf, size_t } UPB_INLINE char* grpc_lb_v1_Server_serialize(const grpc_lb_v1_Server* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_Server_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_Server_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lb_v1_Server_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lb_v1_Server_msg_init, 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); +UPB_INLINE void grpc_lb_v1_Server_clear_ip_address(grpc_lb_v1_Server* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lb_v1_Server_ip_address(const grpc_lb_v1_Server* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_Server_clear_port(const grpc_lb_v1_Server* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void grpc_lb_v1_Server_clear_port(grpc_lb_v1_Server* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_lb_v1_Server_port(const grpc_lb_v1_Server* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_Server_clear_load_balance_token(const grpc_lb_v1_Server* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_lb_v1_Server_clear_load_balance_token(grpc_lb_v1_Server* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lb_v1_Server_load_balance_token(const grpc_lb_v1_Server* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lb_v1_Server_clear_drop(const grpc_lb_v1_Server* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; +UPB_INLINE void grpc_lb_v1_Server_clear_drop(grpc_lb_v1_Server* msg) { + const upb_MiniTableField field = {4, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool grpc_lb_v1_Server_drop(const grpc_lb_v1_Server* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {4, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lb_v1_Server_set_ip_address(grpc_lb_v1_Server *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_Server_set_port(grpc_lb_v1_Server *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_Server_set_load_balance_token(grpc_lb_v1_Server *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lb_v1_Server_set_drop(grpc_lb_v1_Server *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {4, 4, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ */ 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 bf835ed6a3e..1137e825f73 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 @@ -7,57 +7,82 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/lookup/v1/rls.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupRequest_submsgs[1] = { - {.submsg = &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit}, +static const upb_MiniTableSub grpc_lookup_v1_RouteLookupRequest_submsgs[1] = { + {.submsg = &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msg_init}, }; -static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupRequest__fields[4] = { - {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_RouteLookupRequest__fields[4] = { + {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msginit = { +const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msg_init = { &grpc_lookup_v1_RouteLookupRequest_submsgs[0], &grpc_lookup_v1_RouteLookupRequest__fields[0], - UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00001a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000028, &upb_psv4_1bt}, + {0x002000003f000032, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit = { +const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msg_init = { NULL, &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupResponse__fields[2] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_RouteLookupResponse__fields[2] = { + {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msginit = { +const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msg_init = { NULL, &grpc_lookup_v1_RouteLookupResponse__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_pss_1bt}, + {0x001000003f00001a, &upb_prs_1bt}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &grpc_lookup_v1_RouteLookupRequest_msginit, - &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit, - &grpc_lookup_v1_RouteLookupResponse_msginit, + &grpc_lookup_v1_RouteLookupRequest_msg_init, + &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msg_init, + &grpc_lookup_v1_RouteLookupResponse_msg_init, }; -const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_lookup_v1_rls_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -66,5 +91,5 @@ const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 81d7a017ad1..43eb0594748 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 @@ -9,26 +9,28 @@ #ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_ #define SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_lookup_v1_RouteLookupRequest; -struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry; -struct grpc_lookup_v1_RouteLookupResponse; typedef struct grpc_lookup_v1_RouteLookupRequest grpc_lookup_v1_RouteLookupRequest; typedef struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry grpc_lookup_v1_RouteLookupRequest_KeyMapEntry; typedef struct grpc_lookup_v1_RouteLookupResponse grpc_lookup_v1_RouteLookupResponse; -extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msginit; -extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit; -extern const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msginit; +extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msg_init; +extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msg_init; +extern const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msg_init; typedef enum { grpc_lookup_v1_RouteLookupRequest_REASON_UNKNOWN = 0, @@ -41,12 +43,12 @@ typedef enum { /* grpc.lookup.v1.RouteLookupRequest */ UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_new(upb_Arena* arena) { - return (grpc_lookup_v1_RouteLookupRequest*)_upb_Message_New(&grpc_lookup_v1_RouteLookupRequest_msginit, arena); + return (grpc_lookup_v1_RouteLookupRequest*)_upb_Message_New(&grpc_lookup_v1_RouteLookupRequest_msg_init, arena); } UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_RouteLookupRequest* ret = grpc_lookup_v1_RouteLookupRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -56,7 +58,7 @@ UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_ int options, upb_Arena* arena) { grpc_lookup_v1_RouteLookupRequest* ret = grpc_lookup_v1_RouteLookupRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -64,67 +66,108 @@ UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_ } UPB_INLINE char* grpc_lookup_v1_RouteLookupRequest_serialize(const grpc_lookup_v1_RouteLookupRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msg_init, 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); +UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_target_type(grpc_lookup_v1_RouteLookupRequest* msg) { + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_target_type(const grpc_lookup_v1_RouteLookupRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_has_key_map(const grpc_lookup_v1_RouteLookupRequest* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_key_map(const grpc_lookup_v1_RouteLookupRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_key_map(grpc_lookup_v1_RouteLookupRequest* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t grpc_lookup_v1_RouteLookupRequest_key_map_size(const grpc_lookup_v1_RouteLookupRequest* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(12, 24)); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_get(const grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(12, 24), &key, 0, val, 0); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_next(const grpc_lookup_v1_RouteLookupRequest* msg, size_t* iter) { - return (const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_map_next(map, iter); } -UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_reason(const grpc_lookup_v1_RouteLookupRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_has_key_map(const grpc_lookup_v1_RouteLookupRequest* msg) { + return grpc_lookup_v1_RouteLookupRequest_key_map_size(msg) != 0; +} +UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_reason(grpc_lookup_v1_RouteLookupRequest* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t grpc_lookup_v1_RouteLookupRequest_reason(const grpc_lookup_v1_RouteLookupRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_stale_header_data(const grpc_lookup_v1_RouteLookupRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_stale_header_data(grpc_lookup_v1_RouteLookupRequest* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_stale_header_data(const grpc_lookup_v1_RouteLookupRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_target_type(grpc_lookup_v1_RouteLookupRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {3, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_key_map_clear(grpc_lookup_v1_RouteLookupRequest* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_key_map_clear(grpc_lookup_v1_RouteLookupRequest* msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 24)); } UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_set(grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(12, 24), &key, 0, &val, 0, a); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_delete(grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(12, 24), &key, 0); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_nextmutable(grpc_lookup_v1_RouteLookupRequest* msg, size_t* iter) { - return (grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_map_next(map, iter); } UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_reason(grpc_lookup_v1_RouteLookupRequest *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(4, 0), 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(grpc_lookup_v1_RouteLookupRequest *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lookup.v1.RouteLookupRequest.KeyMapEntry */ @@ -147,12 +190,12 @@ UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_set_value(grpc_loo /* grpc.lookup.v1.RouteLookupResponse */ UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_new(upb_Arena* arena) { - return (grpc_lookup_v1_RouteLookupResponse*)_upb_Message_New(&grpc_lookup_v1_RouteLookupResponse_msginit, arena); + return (grpc_lookup_v1_RouteLookupResponse*)_upb_Message_New(&grpc_lookup_v1_RouteLookupResponse_msg_init, arena); } UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_RouteLookupResponse* ret = grpc_lookup_v1_RouteLookupResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -162,7 +205,7 @@ UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupRespons int options, upb_Arena* arena) { grpc_lookup_v1_RouteLookupResponse* ret = grpc_lookup_v1_RouteLookupResponse_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -170,47 +213,82 @@ UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupRespons } UPB_INLINE char* grpc_lookup_v1_RouteLookupResponse_serialize(const grpc_lookup_v1_RouteLookupResponse* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msg_init, 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); +UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_header_data(grpc_lookup_v1_RouteLookupResponse* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupResponse_header_data(const grpc_lookup_v1_RouteLookupResponse* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_targets(const grpc_lookup_v1_RouteLookupResponse* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_targets(grpc_lookup_v1_RouteLookupResponse* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupResponse_targets(const grpc_lookup_v1_RouteLookupResponse* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupResponse_targets(const grpc_lookup_v1_RouteLookupResponse* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool grpc_lookup_v1_RouteLookupResponse_has_targets(const grpc_lookup_v1_RouteLookupResponse* msg) { + size_t size; + grpc_lookup_v1_RouteLookupResponse_targets(msg, &size); + return size != 0; } UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_set_header_data(grpc_lookup_v1_RouteLookupResponse *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_mutable_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_mutable_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_resize_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_resize_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_lookup_v1_RouteLookupResponse_add_targets(grpc_lookup_v1_RouteLookupResponse* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(0, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_lookup_v1_rls_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_ */ 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 161f0102a0b..2c067648571 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 @@ -7,162 +7,233 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "src/proto/grpc/lookup/v1/rls_config.upb.h" #include "google/protobuf/duration.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field grpc_lookup_v1_NameMatcher__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_NameMatcher__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(0, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_NameMatcher_msginit = { +const upb_MiniTable grpc_lookup_v1_NameMatcher_msg_init = { NULL, &grpc_lookup_v1_NameMatcher__fields[0], - UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_prs_1bt}, + {0x000000003f000018, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Sub grpc_lookup_v1_GrpcKeyBuilder_submsgs[4] = { - {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit}, - {.submsg = &grpc_lookup_v1_NameMatcher_msginit}, - {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit}, - {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit}, +static const upb_MiniTableSub grpc_lookup_v1_GrpcKeyBuilder_submsgs[4] = { + {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init}, + {.submsg = &grpc_lookup_v1_NameMatcher_msg_init}, + {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init}, + {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msg_init}, }; -static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_GrpcKeyBuilder__fields[4] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_msginit = { +const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_msg_init = { &grpc_lookup_v1_GrpcKeyBuilder_submsgs[0], &grpc_lookup_v1_GrpcKeyBuilder__fields[0], - UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x001800000102001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_Name__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_GrpcKeyBuilder_Name__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_Name_msginit = { +const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init = { NULL, &grpc_lookup_v1_GrpcKeyBuilder_Name__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields[3] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields[3] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit = { +const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init = { NULL, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000003f00001a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit = { +const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msg_init = { NULL, &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_lookup_v1_HttpKeyBuilder_submsgs[3] = { - {.submsg = &grpc_lookup_v1_NameMatcher_msginit}, - {.submsg = &grpc_lookup_v1_NameMatcher_msginit}, - {.submsg = &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit}, +static const upb_MiniTableSub grpc_lookup_v1_HttpKeyBuilder_submsgs[3] = { + {.submsg = &grpc_lookup_v1_NameMatcher_msg_init}, + {.submsg = &grpc_lookup_v1_NameMatcher_msg_init}, + {.submsg = &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msg_init}, }; -static const upb_MiniTable_Field grpc_lookup_v1_HttpKeyBuilder__fields[5] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_HttpKeyBuilder__fields[5] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_msginit = { +const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_msg_init = { &grpc_lookup_v1_HttpKeyBuilder_submsgs[0], &grpc_lookup_v1_HttpKeyBuilder__fields[0], - UPB_SIZE(24, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 40), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prs_1bt}, + {0x000800003f000012, &upb_prs_1bt}, + {0x001000003f00001a, &upb_prm_1bt_max64b}, + {0x001800003f010022, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit = { +const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msg_init = { NULL, &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupConfig_submsgs[5] = { - {.submsg = &grpc_lookup_v1_HttpKeyBuilder_msginit}, - {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub grpc_lookup_v1_RouteLookupConfig_submsgs[5] = { + {.submsg = &grpc_lookup_v1_HttpKeyBuilder_msg_init}, + {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupConfig__fields[9] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(24, 48), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 56), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(48, 88), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_RouteLookupConfig__fields[9] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(40, 64), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(48, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_RouteLookupConfig_msginit = { +const upb_MiniTable grpc_lookup_v1_RouteLookupConfig_msg_init = { &grpc_lookup_v1_RouteLookupConfig_submsgs[0], &grpc_lookup_v1_RouteLookupConfig__fields[0], - UPB_SIZE(56, 96), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(56, 96), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_max64b}, + {0x001000003f010012, &upb_prm_1bt_max64b}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x0028000001020022, &upb_psm_1bt_maxmaxb}, + {0x003000000203002a, &upb_psm_1bt_maxmaxb}, + {0x0038000003040032, &upb_psm_1bt_maxmaxb}, + {0x004000003f000038, &upb_psv8_1bt}, + {0x004800003f000042, &upb_prs_1bt}, + {0x005000003f00004a, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupClusterSpecifier_submsgs[1] = { - {.submsg = &grpc_lookup_v1_RouteLookupConfig_msginit}, +static const upb_MiniTableSub grpc_lookup_v1_RouteLookupClusterSpecifier_submsgs[1] = { + {.submsg = &grpc_lookup_v1_RouteLookupConfig_msg_init}, }; -static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupClusterSpecifier__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField grpc_lookup_v1_RouteLookupClusterSpecifier__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msginit = { +const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init = { &grpc_lookup_v1_RouteLookupClusterSpecifier_submsgs[0], &grpc_lookup_v1_RouteLookupClusterSpecifier__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max128b}, + }) }; static const upb_MiniTable *messages_layout[9] = { - &grpc_lookup_v1_NameMatcher_msginit, - &grpc_lookup_v1_GrpcKeyBuilder_msginit, - &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, - &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, - &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit, - &grpc_lookup_v1_HttpKeyBuilder_msginit, - &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit, - &grpc_lookup_v1_RouteLookupConfig_msginit, - &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, + &grpc_lookup_v1_NameMatcher_msg_init, + &grpc_lookup_v1_GrpcKeyBuilder_msg_init, + &grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, + &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, + &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msg_init, + &grpc_lookup_v1_HttpKeyBuilder_msg_init, + &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msg_init, + &grpc_lookup_v1_RouteLookupConfig_msg_init, + &grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init, }; -const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout = { +const upb_MiniTableFile src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -171,5 +242,5 @@ const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layo 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 bbb5cd85a7f..e07d3a0da02 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 @@ -9,26 +9,22 @@ #ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPB_H_ #define SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct grpc_lookup_v1_NameMatcher; -struct grpc_lookup_v1_GrpcKeyBuilder; -struct grpc_lookup_v1_GrpcKeyBuilder_Name; -struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys; -struct grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry; -struct grpc_lookup_v1_HttpKeyBuilder; -struct grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry; -struct grpc_lookup_v1_RouteLookupConfig; -struct grpc_lookup_v1_RouteLookupClusterSpecifier; typedef struct grpc_lookup_v1_NameMatcher grpc_lookup_v1_NameMatcher; typedef struct grpc_lookup_v1_GrpcKeyBuilder grpc_lookup_v1_GrpcKeyBuilder; typedef struct grpc_lookup_v1_GrpcKeyBuilder_Name grpc_lookup_v1_GrpcKeyBuilder_Name; @@ -38,29 +34,29 @@ typedef struct grpc_lookup_v1_HttpKeyBuilder grpc_lookup_v1_HttpKeyBuilder; typedef struct grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry; typedef struct grpc_lookup_v1_RouteLookupConfig grpc_lookup_v1_RouteLookupConfig; typedef struct grpc_lookup_v1_RouteLookupClusterSpecifier grpc_lookup_v1_RouteLookupClusterSpecifier; -extern const upb_MiniTable grpc_lookup_v1_NameMatcher_msginit; -extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_msginit; -extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_Name_msginit; -extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit; -extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit; -extern const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_msginit; -extern const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit; -extern const upb_MiniTable grpc_lookup_v1_RouteLookupConfig_msginit; -extern const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msginit; +extern const upb_MiniTable grpc_lookup_v1_NameMatcher_msg_init; +extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_msg_init; +extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init; +extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init; +extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msg_init; +extern const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_msg_init; +extern const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msg_init; +extern const upb_MiniTable grpc_lookup_v1_RouteLookupConfig_msg_init; +extern const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init; struct google_protobuf_Duration; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* grpc.lookup.v1.NameMatcher */ UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_new(upb_Arena* arena) { - return (grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena); + return (grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msg_init, arena); } UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_NameMatcher* ret = grpc_lookup_v1_NameMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_NameMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_NameMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -70,7 +66,7 @@ UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_parse_ex(const int options, upb_Arena* arena) { grpc_lookup_v1_NameMatcher* ret = grpc_lookup_v1_NameMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_NameMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_NameMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -78,59 +74,100 @@ UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_parse_ex(const } UPB_INLINE char* grpc_lookup_v1_NameMatcher_serialize(const grpc_lookup_v1_NameMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msg_init, 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); +UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_key(grpc_lookup_v1_NameMatcher* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_NameMatcher_key(const grpc_lookup_v1_NameMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_names(const grpc_lookup_v1_NameMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); +UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_names(grpc_lookup_v1_NameMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_lookup_v1_NameMatcher_names(const grpc_lookup_v1_NameMatcher* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView const* grpc_lookup_v1_NameMatcher_names(const grpc_lookup_v1_NameMatcher* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(0, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_required_match(const grpc_lookup_v1_NameMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool grpc_lookup_v1_NameMatcher_has_names(const grpc_lookup_v1_NameMatcher* msg) { + size_t size; + grpc_lookup_v1_NameMatcher_names(msg, &size); + return size != 0; +} +UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_required_match(grpc_lookup_v1_NameMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool grpc_lookup_v1_NameMatcher_required_match(const grpc_lookup_v1_NameMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lookup_v1_NameMatcher_set_key(grpc_lookup_v1_NameMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* grpc_lookup_v1_NameMatcher_mutable_names(grpc_lookup_v1_NameMatcher* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE upb_StringView* grpc_lookup_v1_NameMatcher_mutable_names(grpc_lookup_v1_NameMatcher* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(0, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_lookup_v1_NameMatcher_resize_names(grpc_lookup_v1_NameMatcher* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_lookup_v1_NameMatcher_resize_names(grpc_lookup_v1_NameMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(0, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_lookup_v1_NameMatcher_add_names(grpc_lookup_v1_NameMatcher* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(0, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void grpc_lookup_v1_NameMatcher_set_required_match(grpc_lookup_v1_NameMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 0), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lookup.v1.GrpcKeyBuilder */ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_new(upb_Arena* arena) { - return (grpc_lookup_v1_GrpcKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_msginit, arena); + return (grpc_lookup_v1_GrpcKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_msg_init, arena); } UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_GrpcKeyBuilder* ret = grpc_lookup_v1_GrpcKeyBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -140,7 +177,7 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_parse_ex int options, upb_Arena* arena) { grpc_lookup_v1_GrpcKeyBuilder* ret = grpc_lookup_v1_GrpcKeyBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -148,115 +185,193 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_parse_ex } UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_serialize(const grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_names(grpc_lookup_v1_GrpcKeyBuilder* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_Name* const* grpc_lookup_v1_GrpcKeyBuilder_names(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lookup_v1_GrpcKeyBuilder_Name* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + grpc_lookup_v1_GrpcKeyBuilder_names(msg, &size); + return size != 0; } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_names(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_headers(grpc_lookup_v1_GrpcKeyBuilder* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_Name* const* grpc_lookup_v1_GrpcKeyBuilder_names(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) { - return (const grpc_lookup_v1_GrpcKeyBuilder_Name* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_GrpcKeyBuilder_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + grpc_lookup_v1_GrpcKeyBuilder_headers(msg, &size); + return size != 0; } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_GrpcKeyBuilder_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) { - return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); -} -UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_extra_keys(grpc_lookup_v1_GrpcKeyBuilder* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*); + const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* default_val = NULL; + const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_constant_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); +UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_constant_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_constant_keys(grpc_lookup_v1_GrpcKeyBuilder* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t grpc_lookup_v1_GrpcKeyBuilder_constant_keys_size(const grpc_lookup_v1_GrpcKeyBuilder* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(16, 32)); + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_constant_keys_get(const grpc_lookup_v1_GrpcKeyBuilder* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(16, 32), &key, 0, val, 0); + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_GrpcKeyBuilder_constant_keys_next(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* iter) { - return (const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_constant_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) { + return grpc_lookup_v1_GrpcKeyBuilder_constant_keys_size(msg) != 0; } -UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name** grpc_lookup_v1_GrpcKeyBuilder_mutable_names(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) { - return (grpc_lookup_v1_GrpcKeyBuilder_Name**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name** grpc_lookup_v1_GrpcKeyBuilder_mutable_names(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lookup_v1_GrpcKeyBuilder_Name**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name** grpc_lookup_v1_GrpcKeyBuilder_resize_names(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (grpc_lookup_v1_GrpcKeyBuilder_Name**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name** grpc_lookup_v1_GrpcKeyBuilder_resize_names(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lookup_v1_GrpcKeyBuilder_Name**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_add_names(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena) { - struct grpc_lookup_v1_GrpcKeyBuilder_Name* sub = (struct grpc_lookup_v1_GrpcKeyBuilder_Name*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lookup_v1_GrpcKeyBuilder_Name* sub = (struct grpc_lookup_v1_GrpcKeyBuilder_Name*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_GrpcKeyBuilder_mutable_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) { - return (grpc_lookup_v1_NameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_GrpcKeyBuilder_mutable_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lookup_v1_NameMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_GrpcKeyBuilder_resize_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (grpc_lookup_v1_NameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_GrpcKeyBuilder_resize_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lookup_v1_NameMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lookup_v1_NameMatcher* grpc_lookup_v1_GrpcKeyBuilder_add_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena) { - struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_set_extra_keys(grpc_lookup_v1_GrpcKeyBuilder *msg, grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 24), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_mutable_extra_keys(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena) { struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* sub = (struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)grpc_lookup_v1_GrpcKeyBuilder_extra_keys(msg); if (sub == NULL) { - sub = (struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, arena); - if (!sub) return NULL; - grpc_lookup_v1_GrpcKeyBuilder_set_extra_keys(msg, sub); + sub = (struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, arena); + if (sub) grpc_lookup_v1_GrpcKeyBuilder_set_extra_keys(msg, sub); } return sub; } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_constant_keys_clear(grpc_lookup_v1_GrpcKeyBuilder* msg) { _upb_msg_map_clear(msg, UPB_SIZE(16, 32)); } +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_constant_keys_clear(grpc_lookup_v1_GrpcKeyBuilder* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_constant_keys_set(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(16, 32), &key, 0, &val, 0, a); + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_constant_keys_delete(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(16, 32), &key, 0); + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_GrpcKeyBuilder_constant_keys_nextmutable(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* iter) { - return (grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 0, 3, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry*)_upb_map_next(map, iter); } /* grpc.lookup.v1.GrpcKeyBuilder.Name */ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Name_new(upb_Arena* arena) { - return (grpc_lookup_v1_GrpcKeyBuilder_Name*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, arena); + return (grpc_lookup_v1_GrpcKeyBuilder_Name*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, arena); } UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Name_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_GrpcKeyBuilder_Name* ret = grpc_lookup_v1_GrpcKeyBuilder_Name_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -266,7 +381,7 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Nam int options, upb_Arena* arena) { grpc_lookup_v1_GrpcKeyBuilder_Name* ret = grpc_lookup_v1_GrpcKeyBuilder_Name_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -274,44 +389,56 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Nam } UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_Name_serialize(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msg_init, 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); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_clear_service(grpc_lookup_v1_GrpcKeyBuilder_Name* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_Name_service(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_clear_method(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_clear_method(grpc_lookup_v1_GrpcKeyBuilder_Name* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_Name_method(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_set_service(grpc_lookup_v1_GrpcKeyBuilder_Name *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_set_method(grpc_lookup_v1_GrpcKeyBuilder_Name *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lookup.v1.GrpcKeyBuilder.ExtraKeys */ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_new(upb_Arena* arena) { - return (grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, arena); + return (grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, arena); } UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* ret = grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -321,7 +448,7 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilde int options, upb_Arena* arena) { grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* ret = grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -329,42 +456,60 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilde } UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_serialize(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msg_init, 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); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_host(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_host(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_service(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_service(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_service(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_method(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_method(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_method(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_set_host(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_set_service(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_set_method(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lookup.v1.GrpcKeyBuilder.ConstantKeysEntry */ @@ -387,12 +532,12 @@ UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_set_value(grpc_l /* grpc.lookup.v1.HttpKeyBuilder */ UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_new(upb_Arena* arena) { - return (grpc_lookup_v1_HttpKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_HttpKeyBuilder_msginit, arena); + return (grpc_lookup_v1_HttpKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_HttpKeyBuilder_msg_init, arena); } UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_HttpKeyBuilder* ret = grpc_lookup_v1_HttpKeyBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_HttpKeyBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_HttpKeyBuilder_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -402,7 +547,7 @@ UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_parse_ex int options, upb_Arena* arena) { grpc_lookup_v1_HttpKeyBuilder* ret = grpc_lookup_v1_HttpKeyBuilder_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_HttpKeyBuilder_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_HttpKeyBuilder_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -410,112 +555,243 @@ UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_parse_ex } UPB_INLINE char* grpc_lookup_v1_HttpKeyBuilder_serialize(const grpc_lookup_v1_HttpKeyBuilder* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msg_init, 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)); +UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_lookup_v1_HttpKeyBuilder_host_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView const* grpc_lookup_v1_HttpKeyBuilder_host_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_path_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_host_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg) { + size_t size; + grpc_lookup_v1_HttpKeyBuilder_host_patterns(msg, &size); + return size != 0; } -UPB_INLINE upb_StringView const* grpc_lookup_v1_HttpKeyBuilder_path_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* grpc_lookup_v1_HttpKeyBuilder_path_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_path_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg) { + size_t size; + grpc_lookup_v1_HttpKeyBuilder_path_patterns(msg, &size); + return size != 0; +} +UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_HttpKeyBuilder_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + grpc_lookup_v1_HttpKeyBuilder_query_parameters(msg, &size); + return size != 0; } -UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_headers(grpc_lookup_v1_HttpKeyBuilder* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_HttpKeyBuilder_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_HttpKeyBuilder_headers(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_headers(const grpc_lookup_v1_HttpKeyBuilder* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); + size_t size; + grpc_lookup_v1_HttpKeyBuilder_headers(msg, &size); + return size != 0; } -UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_headers(const grpc_lookup_v1_HttpKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 24)); -} -UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_HttpKeyBuilder_headers(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); -} -UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_constant_keys(const grpc_lookup_v1_HttpKeyBuilder* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); -} -UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_constant_keys(const grpc_lookup_v1_HttpKeyBuilder* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 32)); +UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_constant_keys(grpc_lookup_v1_HttpKeyBuilder* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t grpc_lookup_v1_HttpKeyBuilder_constant_keys_size(const grpc_lookup_v1_HttpKeyBuilder* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(16, 32)); + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_constant_keys_get(const grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(16, 32), &key, 0, val, 0); + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_HttpKeyBuilder_constant_keys_next(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* iter) { - return (const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_constant_keys(const grpc_lookup_v1_HttpKeyBuilder* msg) { + return grpc_lookup_v1_HttpKeyBuilder_constant_keys_size(msg) != 0; } -UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_mutable_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_mutable_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_resize_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_resize_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_add_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_mutable_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_mutable_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_resize_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_resize_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_add_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_mutable_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (grpc_lookup_v1_NameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_mutable_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lookup_v1_NameMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_resize_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (grpc_lookup_v1_NameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_resize_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lookup_v1_NameMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lookup_v1_NameMatcher* grpc_lookup_v1_HttpKeyBuilder_add_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, upb_Arena* arena) { - struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_mutable_headers(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) { - return (grpc_lookup_v1_NameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); +UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_mutable_headers(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lookup_v1_NameMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_resize_headers(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) { - return (grpc_lookup_v1_NameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_resize_headers(grpc_lookup_v1_HttpKeyBuilder* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lookup_v1_NameMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lookup_v1_NameMatcher* grpc_lookup_v1_HttpKeyBuilder_add_headers(grpc_lookup_v1_HttpKeyBuilder* msg, upb_Arena* arena) { - struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {4, UPB_SIZE(12, 24), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_constant_keys_clear(grpc_lookup_v1_HttpKeyBuilder* msg) { _upb_msg_map_clear(msg, UPB_SIZE(16, 32)); } +UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_constant_keys_clear(grpc_lookup_v1_HttpKeyBuilder* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_constant_keys_set(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(16, 32), &key, 0, &val, 0, a); + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_constant_keys_delete(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(16, 32), &key, 0); + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_HttpKeyBuilder_constant_keys_nextmutable(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* iter) { - return (grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry*)_upb_map_next(map, iter); } /* grpc.lookup.v1.HttpKeyBuilder.ConstantKeysEntry */ @@ -538,12 +814,12 @@ UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_set_value(grpc_l /* grpc.lookup.v1.RouteLookupConfig */ UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_new(upb_Arena* arena) { - return (grpc_lookup_v1_RouteLookupConfig*)_upb_Message_New(&grpc_lookup_v1_RouteLookupConfig_msginit, arena); + return (grpc_lookup_v1_RouteLookupConfig*)_upb_Message_New(&grpc_lookup_v1_RouteLookupConfig_msg_init, arena); } UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_RouteLookupConfig* ret = grpc_lookup_v1_RouteLookupConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -553,7 +829,7 @@ UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_pa int options, upb_Arena* arena) { grpc_lookup_v1_RouteLookupConfig* ret = grpc_lookup_v1_RouteLookupConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -561,176 +837,288 @@ UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_pa } UPB_INLINE char* grpc_lookup_v1_RouteLookupConfig_serialize(const grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const grpc_lookup_v1_HttpKeyBuilder* const* grpc_lookup_v1_RouteLookupConfig_http_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lookup_v1_HttpKeyBuilder* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} 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)); + size_t size; + grpc_lookup_v1_RouteLookupConfig_http_keybuilders(msg, &size); + return size != 0; } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_http_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const grpc_lookup_v1_HttpKeyBuilder* const* grpc_lookup_v1_RouteLookupConfig_http_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) { - return (const grpc_lookup_v1_HttpKeyBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder* const* grpc_lookup_v1_RouteLookupConfig_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const grpc_lookup_v1_GrpcKeyBuilder* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); + size_t size; + grpc_lookup_v1_RouteLookupConfig_grpc_keybuilders(msg, &size); + return size != 0; } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder* const* grpc_lookup_v1_RouteLookupConfig_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) { - return (const grpc_lookup_v1_GrpcKeyBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); -} -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_lookup_service(const grpc_lookup_v1_RouteLookupConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_lookup_service(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupConfig_lookup_service(const grpc_lookup_v1_RouteLookupConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_lookup_service_timeout(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL; +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_max_age(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_stale_age(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_cache_size_bytes(const grpc_lookup_v1_RouteLookupConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), int64_t) = 0; +UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_cache_size_bytes(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 64), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t grpc_lookup_v1_RouteLookupConfig_cache_size_bytes(const grpc_lookup_v1_RouteLookupConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {7, UPB_SIZE(40, 64), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_valid_targets(const grpc_lookup_v1_RouteLookupConfig* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 64)); +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupConfig_valid_targets(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupConfig_valid_targets(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_default_target(const grpc_lookup_v1_RouteLookupConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_valid_targets(const grpc_lookup_v1_RouteLookupConfig* msg) { + size_t size; + grpc_lookup_v1_RouteLookupConfig_valid_targets(msg, &size); + return size != 0; +} +UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_default_target(grpc_lookup_v1_RouteLookupConfig* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(48, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupConfig_default_target(const grpc_lookup_v1_RouteLookupConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(48, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE grpc_lookup_v1_HttpKeyBuilder** grpc_lookup_v1_RouteLookupConfig_mutable_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) { - return (grpc_lookup_v1_HttpKeyBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE grpc_lookup_v1_HttpKeyBuilder** grpc_lookup_v1_RouteLookupConfig_mutable_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lookup_v1_HttpKeyBuilder**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lookup_v1_HttpKeyBuilder** grpc_lookup_v1_RouteLookupConfig_resize_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t len, upb_Arena* arena) { - return (grpc_lookup_v1_HttpKeyBuilder**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lookup_v1_HttpKeyBuilder** grpc_lookup_v1_RouteLookupConfig_resize_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lookup_v1_HttpKeyBuilder**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_RouteLookupConfig_add_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) { - struct grpc_lookup_v1_HttpKeyBuilder* sub = (struct grpc_lookup_v1_HttpKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_HttpKeyBuilder_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lookup_v1_HttpKeyBuilder* sub = (struct grpc_lookup_v1_HttpKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_HttpKeyBuilder_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder** grpc_lookup_v1_RouteLookupConfig_mutable_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) { - return (grpc_lookup_v1_GrpcKeyBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder** grpc_lookup_v1_RouteLookupConfig_mutable_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (grpc_lookup_v1_GrpcKeyBuilder**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder** grpc_lookup_v1_RouteLookupConfig_resize_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t len, upb_Arena* arena) { - return (grpc_lookup_v1_GrpcKeyBuilder**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena); +UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder** grpc_lookup_v1_RouteLookupConfig_resize_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (grpc_lookup_v1_GrpcKeyBuilder**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_RouteLookupConfig_add_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) { - struct grpc_lookup_v1_GrpcKeyBuilder* sub = (struct grpc_lookup_v1_GrpcKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct grpc_lookup_v1_GrpcKeyBuilder* sub = (struct grpc_lookup_v1_GrpcKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_lookup_service(grpc_lookup_v1_RouteLookupConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(28, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_lookup_service_timeout(grpc_lookup_v1_RouteLookupConfig *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_mutable_lookup_service_timeout(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lookup_v1_RouteLookupConfig_lookup_service_timeout(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - grpc_lookup_v1_RouteLookupConfig_set_lookup_service_timeout(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) grpc_lookup_v1_RouteLookupConfig_set_lookup_service_timeout(msg, sub); } return sub; } UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_max_age(grpc_lookup_v1_RouteLookupConfig *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 2, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_mutable_max_age(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lookup_v1_RouteLookupConfig_max_age(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - grpc_lookup_v1_RouteLookupConfig_set_max_age(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) grpc_lookup_v1_RouteLookupConfig_set_max_age(msg, sub); } return sub; } UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_stale_age(grpc_lookup_v1_RouteLookupConfig *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_mutable_stale_age(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lookup_v1_RouteLookupConfig_stale_age(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - grpc_lookup_v1_RouteLookupConfig_set_stale_age(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) grpc_lookup_v1_RouteLookupConfig_set_stale_age(msg, sub); } return sub; } UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_cache_size_bytes(grpc_lookup_v1_RouteLookupConfig *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 88), int64_t) = value; + const upb_MiniTableField field = {7, UPB_SIZE(40, 64), 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupConfig_mutable_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len); +UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupConfig_mutable_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupConfig_resize_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupConfig_resize_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_add_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_default_target(grpc_lookup_v1_RouteLookupConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = value; + const upb_MiniTableField field = {9, UPB_SIZE(48, 80), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* grpc.lookup.v1.RouteLookupClusterSpecifier */ UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLookupClusterSpecifier_new(upb_Arena* arena) { - return (grpc_lookup_v1_RouteLookupClusterSpecifier*)_upb_Message_New(&grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, arena); + return (grpc_lookup_v1_RouteLookupClusterSpecifier*)_upb_Message_New(&grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init, arena); } UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLookupClusterSpecifier_parse(const char* buf, size_t size, upb_Arena* arena) { grpc_lookup_v1_RouteLookupClusterSpecifier* ret = grpc_lookup_v1_RouteLookupClusterSpecifier_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -740,7 +1128,7 @@ UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLooku int options, upb_Arena* arena) { grpc_lookup_v1_RouteLookupClusterSpecifier* ret = grpc_lookup_v1_RouteLookupClusterSpecifier_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -748,45 +1136,50 @@ UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLooku } UPB_INLINE char* grpc_lookup_v1_RouteLookupClusterSpecifier_serialize(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msg_init, 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); -} -UPB_INLINE void grpc_lookup_v1_RouteLookupClusterSpecifier_clear_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void grpc_lookup_v1_RouteLookupClusterSpecifier_clear_route_lookup_config(grpc_lookup_v1_RouteLookupClusterSpecifier* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupClusterSpecifier_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const grpc_lookup_v1_RouteLookupConfig*); + const grpc_lookup_v1_RouteLookupConfig* default_val = NULL; + const grpc_lookup_v1_RouteLookupConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool grpc_lookup_v1_RouteLookupClusterSpecifier_has_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void grpc_lookup_v1_RouteLookupClusterSpecifier_set_route_lookup_config(grpc_lookup_v1_RouteLookupClusterSpecifier *msg, grpc_lookup_v1_RouteLookupConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), grpc_lookup_v1_RouteLookupConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupClusterSpecifier_mutable_route_lookup_config(grpc_lookup_v1_RouteLookupClusterSpecifier* msg, upb_Arena* arena) { struct grpc_lookup_v1_RouteLookupConfig* sub = (struct grpc_lookup_v1_RouteLookupConfig*)grpc_lookup_v1_RouteLookupClusterSpecifier_route_lookup_config(msg); if (sub == NULL) { - sub = (struct grpc_lookup_v1_RouteLookupConfig*)_upb_Message_New(&grpc_lookup_v1_RouteLookupConfig_msginit, arena); - if (!sub) return NULL; - grpc_lookup_v1_RouteLookupClusterSpecifier_set_route_lookup_config(msg, sub); + sub = (struct grpc_lookup_v1_RouteLookupConfig*)_upb_Message_New(&grpc_lookup_v1_RouteLookupConfig_msg_init, arena); + if (sub) grpc_lookup_v1_RouteLookupClusterSpecifier_set_route_lookup_config(msg, sub); } return sub; } -extern const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout; +extern const upb_MiniTableFile src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPB_H_ */ 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 85a0578e034..8613c106b4e 100644 --- a/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c @@ -7,89 +7,108 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "udpa/annotations/migrate.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field udpa_annotations_MigrateAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField udpa_annotations_MigrateAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit = { +const upb_MiniTable udpa_annotations_MigrateAnnotation_msg_init = { NULL, &udpa_annotations_MigrateAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field udpa_annotations_FieldMigrateAnnotation__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField udpa_annotations_FieldMigrateAnnotation__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit = { +const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msg_init = { NULL, &udpa_annotations_FieldMigrateAnnotation__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field udpa_annotations_FileMigrateAnnotation__fields[1] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField udpa_annotations_FileMigrateAnnotation__fields[1] = { + {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit = { +const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msg_init = { NULL, &udpa_annotations_FileMigrateAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &udpa_annotations_MigrateAnnotation_msginit, - &udpa_annotations_FieldMigrateAnnotation_msginit, - &udpa_annotations_FileMigrateAnnotation_msginit, + &udpa_annotations_MigrateAnnotation_msg_init, + &udpa_annotations_FieldMigrateAnnotation_msg_init, + &udpa_annotations_FileMigrateAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_EnumOptions_msginit; -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit; -extern const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit; -extern const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit; -const upb_MiniTable_Extension udpa_annotations_message_migrate_ext = { - {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, - {.submsg = &udpa_annotations_MigrateAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msg_init; +extern const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msg_init; +extern const upb_MiniTable udpa_annotations_MigrateAnnotation_msg_init; +const upb_MiniTableExtension udpa_annotations_message_migrate_ext = { + {171962766, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, + {.submsg = &udpa_annotations_MigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension udpa_annotations_field_migrate_ext = { - {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, - {.submsg = &udpa_annotations_FieldMigrateAnnotation_msginit}, +const upb_MiniTableExtension udpa_annotations_field_migrate_ext = { + {171962766, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, + {.submsg = &udpa_annotations_FieldMigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension udpa_annotations_enum_migrate_ext = { - {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_EnumOptions_msginit, - {.submsg = &udpa_annotations_MigrateAnnotation_msginit}, +const upb_MiniTableExtension udpa_annotations_enum_migrate_ext = { + {171962766, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_EnumOptions_msg_init, + {.submsg = &udpa_annotations_MigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension udpa_annotations_enum_value_migrate_ext = { - {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_EnumValueOptions_msginit, - {.submsg = &udpa_annotations_MigrateAnnotation_msginit}, +const upb_MiniTableExtension udpa_annotations_enum_value_migrate_ext = { + {171962766, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_EnumValueOptions_msg_init, + {.submsg = &udpa_annotations_MigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension udpa_annotations_file_migrate_ext = { - {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FileOptions_msginit, - {.submsg = &udpa_annotations_FileMigrateAnnotation_msginit}, +const upb_MiniTableExtension udpa_annotations_file_migrate_ext = { + {171962766, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FileOptions_msg_init, + {.submsg = &udpa_annotations_FileMigrateAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[5] = { +static const upb_MiniTableExtension *extensions_layout[5] = { &udpa_annotations_message_migrate_ext, &udpa_annotations_field_migrate_ext, &udpa_annotations_enum_migrate_ext, @@ -97,7 +116,7 @@ static const upb_MiniTable_Extension *extensions_layout[5] = { &udpa_annotations_file_migrate_ext, }; -const upb_MiniTable_File udpa_annotations_migrate_proto_upb_file_layout = { +const upb_MiniTableFile udpa_annotations_migrate_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -106,5 +125,5 @@ const upb_MiniTable_File udpa_annotations_migrate_proto_upb_file_layout = { 5, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1aa1bdbffe6..94edfd1eaa2 100644 --- a/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h @@ -9,53 +9,55 @@ #ifndef UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_ #define UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct udpa_annotations_MigrateAnnotation; -struct udpa_annotations_FieldMigrateAnnotation; -struct udpa_annotations_FileMigrateAnnotation; typedef struct udpa_annotations_MigrateAnnotation udpa_annotations_MigrateAnnotation; typedef struct udpa_annotations_FieldMigrateAnnotation udpa_annotations_FieldMigrateAnnotation; typedef struct udpa_annotations_FileMigrateAnnotation udpa_annotations_FileMigrateAnnotation; -extern const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit; -extern const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit; -extern const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit; -extern const upb_MiniTable_Extension udpa_annotations_message_migrate_ext; -extern const upb_MiniTable_Extension udpa_annotations_field_migrate_ext; -extern const upb_MiniTable_Extension udpa_annotations_enum_migrate_ext; -extern const upb_MiniTable_Extension udpa_annotations_enum_value_migrate_ext; -extern const upb_MiniTable_Extension udpa_annotations_file_migrate_ext; +extern const upb_MiniTable udpa_annotations_MigrateAnnotation_msg_init; +extern const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msg_init; +extern const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msg_init; +extern const upb_MiniTableExtension udpa_annotations_message_migrate_ext; +extern const upb_MiniTableExtension udpa_annotations_field_migrate_ext; +extern const upb_MiniTableExtension udpa_annotations_enum_migrate_ext; +extern const upb_MiniTableExtension udpa_annotations_enum_value_migrate_ext; +extern const upb_MiniTableExtension udpa_annotations_file_migrate_ext; struct google_protobuf_EnumOptions; struct google_protobuf_EnumValueOptions; struct google_protobuf_FieldOptions; struct google_protobuf_FileOptions; struct google_protobuf_MessageOptions; -extern const upb_MiniTable google_protobuf_EnumOptions_msginit; -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; +extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; /* udpa.annotations.MigrateAnnotation */ UPB_INLINE udpa_annotations_MigrateAnnotation* udpa_annotations_MigrateAnnotation_new(upb_Arena* arena) { - return (udpa_annotations_MigrateAnnotation*)_upb_Message_New(&udpa_annotations_MigrateAnnotation_msginit, arena); + return (udpa_annotations_MigrateAnnotation*)_upb_Message_New(&udpa_annotations_MigrateAnnotation_msg_init, arena); } UPB_INLINE udpa_annotations_MigrateAnnotation* udpa_annotations_MigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { udpa_annotations_MigrateAnnotation* ret = udpa_annotations_MigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -65,7 +67,7 @@ UPB_INLINE udpa_annotations_MigrateAnnotation* udpa_annotations_MigrateAnnotatio int options, upb_Arena* arena) { udpa_annotations_MigrateAnnotation* ret = udpa_annotations_MigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -73,35 +75,41 @@ UPB_INLINE udpa_annotations_MigrateAnnotation* udpa_annotations_MigrateAnnotatio } UPB_INLINE char* udpa_annotations_MigrateAnnotation_serialize(const udpa_annotations_MigrateAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msg_init, 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); +UPB_INLINE void udpa_annotations_MigrateAnnotation_clear_rename(udpa_annotations_MigrateAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView udpa_annotations_MigrateAnnotation_rename(const udpa_annotations_MigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void udpa_annotations_MigrateAnnotation_set_rename(udpa_annotations_MigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* udpa.annotations.FieldMigrateAnnotation */ UPB_INLINE udpa_annotations_FieldMigrateAnnotation* udpa_annotations_FieldMigrateAnnotation_new(upb_Arena* arena) { - return (udpa_annotations_FieldMigrateAnnotation*)_upb_Message_New(&udpa_annotations_FieldMigrateAnnotation_msginit, arena); + return (udpa_annotations_FieldMigrateAnnotation*)_upb_Message_New(&udpa_annotations_FieldMigrateAnnotation_msg_init, arena); } UPB_INLINE udpa_annotations_FieldMigrateAnnotation* udpa_annotations_FieldMigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { udpa_annotations_FieldMigrateAnnotation* ret = udpa_annotations_FieldMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -111,7 +119,7 @@ UPB_INLINE udpa_annotations_FieldMigrateAnnotation* udpa_annotations_FieldMigrat int options, upb_Arena* arena) { udpa_annotations_FieldMigrateAnnotation* ret = udpa_annotations_FieldMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -119,44 +127,56 @@ UPB_INLINE udpa_annotations_FieldMigrateAnnotation* udpa_annotations_FieldMigrat } UPB_INLINE char* udpa_annotations_FieldMigrateAnnotation_serialize(const udpa_annotations_FieldMigrateAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msg_init, 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); +UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_clear_rename(udpa_annotations_FieldMigrateAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView udpa_annotations_FieldMigrateAnnotation_rename(const udpa_annotations_FieldMigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_clear_oneof_promotion(const udpa_annotations_FieldMigrateAnnotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_clear_oneof_promotion(udpa_annotations_FieldMigrateAnnotation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView udpa_annotations_FieldMigrateAnnotation_oneof_promotion(const udpa_annotations_FieldMigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_rename(udpa_annotations_FieldMigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_oneof_promotion(udpa_annotations_FieldMigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* udpa.annotations.FileMigrateAnnotation */ UPB_INLINE udpa_annotations_FileMigrateAnnotation* udpa_annotations_FileMigrateAnnotation_new(upb_Arena* arena) { - return (udpa_annotations_FileMigrateAnnotation*)_upb_Message_New(&udpa_annotations_FileMigrateAnnotation_msginit, arena); + return (udpa_annotations_FileMigrateAnnotation*)_upb_Message_New(&udpa_annotations_FileMigrateAnnotation_msg_init, arena); } UPB_INLINE udpa_annotations_FileMigrateAnnotation* udpa_annotations_FileMigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { udpa_annotations_FileMigrateAnnotation* ret = udpa_annotations_FileMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -166,7 +186,7 @@ UPB_INLINE udpa_annotations_FileMigrateAnnotation* udpa_annotations_FileMigrateA int options, upb_Arena* arena) { udpa_annotations_FileMigrateAnnotation* ret = udpa_annotations_FileMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -174,117 +194,148 @@ UPB_INLINE udpa_annotations_FileMigrateAnnotation* udpa_annotations_FileMigrateA } UPB_INLINE char* udpa_annotations_FileMigrateAnnotation_serialize(const udpa_annotations_FileMigrateAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msg_init, 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); +UPB_INLINE void udpa_annotations_FileMigrateAnnotation_clear_move_to_package(udpa_annotations_FileMigrateAnnotation* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView udpa_annotations_FileMigrateAnnotation_move_to_package(const udpa_annotations_FileMigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void udpa_annotations_FileMigrateAnnotation_set_move_to_package(udpa_annotations_FileMigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool udpa_annotations_has_message_migrate(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_message_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_message_migrate_ext); } UPB_INLINE void udpa_annotations_clear_message_migrate(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_message_migrate_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_message_migrate_ext); } UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_message_migrate(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_message_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_message_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_MigrateAnnotation* default_val = NULL; + const udpa_annotations_MigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_message_migrate_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_message_migrate(struct google_protobuf_MessageOptions* msg, const udpa_annotations_MigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_message_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool udpa_annotations_has_field_migrate(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_field_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_field_migrate_ext); } UPB_INLINE void udpa_annotations_clear_field_migrate(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_field_migrate_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_field_migrate_ext); } UPB_INLINE const udpa_annotations_FieldMigrateAnnotation* udpa_annotations_field_migrate(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_field_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FieldMigrateAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_field_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_FieldMigrateAnnotation* default_val = NULL; + const udpa_annotations_FieldMigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_field_migrate_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FieldMigrateAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_field_migrate(struct google_protobuf_FieldOptions* msg, const udpa_annotations_FieldMigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_field_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool udpa_annotations_has_enum_migrate(const struct google_protobuf_EnumOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_enum_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_enum_migrate_ext); } UPB_INLINE void udpa_annotations_clear_enum_migrate(struct google_protobuf_EnumOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_enum_migrate_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_enum_migrate_ext); } UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_migrate(const struct google_protobuf_EnumOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_enum_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_enum_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_MigrateAnnotation* default_val = NULL; + const udpa_annotations_MigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_enum_migrate_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_enum_migrate(struct google_protobuf_EnumOptions* msg, const udpa_annotations_MigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_enum_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool udpa_annotations_has_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_enum_value_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_enum_value_migrate_ext); } UPB_INLINE void udpa_annotations_clear_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_enum_value_migrate_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_enum_value_migrate_ext); } UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_enum_value_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_enum_value_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_MigrateAnnotation* default_val = NULL; + const udpa_annotations_MigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void udpa_annotations_set_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg, const udpa_annotations_MigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_enum_value_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool udpa_annotations_has_file_migrate(const struct google_protobuf_FileOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_file_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_file_migrate_ext); } UPB_INLINE void udpa_annotations_clear_file_migrate(struct google_protobuf_FileOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_file_migrate_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_file_migrate_ext); } UPB_INLINE const udpa_annotations_FileMigrateAnnotation* udpa_annotations_file_migrate(const struct google_protobuf_FileOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_file_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FileMigrateAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_file_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_FileMigrateAnnotation* default_val = NULL; + const udpa_annotations_FileMigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_file_migrate_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FileMigrateAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_file_migrate(struct google_protobuf_FileOptions* msg, const udpa_annotations_FileMigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_file_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File udpa_annotations_migrate_proto_upb_file_layout; +extern const upb_MiniTableFile udpa_annotations_migrate_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_ */ 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 c8065152134..c829501d690 100644 --- a/src/core/ext/upb-generated/udpa/annotations/security.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/security.upb.c @@ -7,42 +7,51 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "udpa/annotations/security.upb.h" #include "udpa/annotations/status.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field udpa_annotations_FieldSecurityAnnotation__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField udpa_annotations_FieldSecurityAnnotation__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit = { +const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msg_init = { NULL, &udpa_annotations_FieldSecurityAnnotation__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &udpa_annotations_FieldSecurityAnnotation_msginit, + &udpa_annotations_FieldSecurityAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit; -const upb_MiniTable_Extension udpa_annotations_security_ext = { - {11122993, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, - {.submsg = &udpa_annotations_FieldSecurityAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msg_init; +const upb_MiniTableExtension udpa_annotations_security_ext = { + {11122993, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, + {.submsg = &udpa_annotations_FieldSecurityAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &udpa_annotations_security_ext, }; -const upb_MiniTable_File udpa_annotations_security_proto_upb_file_layout = { +const upb_MiniTableFile udpa_annotations_security_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -51,5 +60,5 @@ const upb_MiniTable_File udpa_annotations_security_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 9ada3c0a7a6..5b99c259fa8 100644 --- a/src/core/ext/upb-generated/udpa/annotations/security.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/security.upb.h @@ -9,35 +9,39 @@ #ifndef UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_ #define UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct udpa_annotations_FieldSecurityAnnotation; typedef struct udpa_annotations_FieldSecurityAnnotation udpa_annotations_FieldSecurityAnnotation; -extern const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit; -extern const upb_MiniTable_Extension udpa_annotations_security_ext; +extern const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msg_init; +extern const upb_MiniTableExtension udpa_annotations_security_ext; struct google_protobuf_FieldOptions; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; /* udpa.annotations.FieldSecurityAnnotation */ UPB_INLINE udpa_annotations_FieldSecurityAnnotation* udpa_annotations_FieldSecurityAnnotation_new(upb_Arena* arena) { - return (udpa_annotations_FieldSecurityAnnotation*)_upb_Message_New(&udpa_annotations_FieldSecurityAnnotation_msginit, arena); + return (udpa_annotations_FieldSecurityAnnotation*)_upb_Message_New(&udpa_annotations_FieldSecurityAnnotation_msg_init, arena); } UPB_INLINE udpa_annotations_FieldSecurityAnnotation* udpa_annotations_FieldSecurityAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { udpa_annotations_FieldSecurityAnnotation* ret = udpa_annotations_FieldSecurityAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +51,7 @@ UPB_INLINE udpa_annotations_FieldSecurityAnnotation* udpa_annotations_FieldSecur int options, upb_Arena* arena) { udpa_annotations_FieldSecurityAnnotation* ret = udpa_annotations_FieldSecurityAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,58 +59,75 @@ UPB_INLINE udpa_annotations_FieldSecurityAnnotation* udpa_annotations_FieldSecur } UPB_INLINE char* udpa_annotations_FieldSecurityAnnotation_serialize(const udpa_annotations_FieldSecurityAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msg_init, 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; +UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_clear_configure_for_untrusted_downstream(udpa_annotations_FieldSecurityAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool udpa_annotations_FieldSecurityAnnotation_configure_for_untrusted_downstream(const udpa_annotations_FieldSecurityAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(const udpa_annotations_FieldSecurityAnnotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(udpa_annotations_FieldSecurityAnnotation* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool udpa_annotations_FieldSecurityAnnotation_configure_for_untrusted_upstream(const udpa_annotations_FieldSecurityAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(udpa_annotations_FieldSecurityAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(udpa_annotations_FieldSecurityAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool udpa_annotations_has_security(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_security_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_security_ext); } UPB_INLINE void udpa_annotations_clear_security(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_security_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_security_ext); } UPB_INLINE const udpa_annotations_FieldSecurityAnnotation* udpa_annotations_security(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_security_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FieldSecurityAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_security_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_FieldSecurityAnnotation* default_val = NULL; + const udpa_annotations_FieldSecurityAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_security_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FieldSecurityAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_security(struct google_protobuf_FieldOptions* msg, const udpa_annotations_FieldSecurityAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_security_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File udpa_annotations_security_proto_upb_file_layout; +extern const upb_MiniTableFile udpa_annotations_security_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c b/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c index 146c5e6fa8d..23321d57b60 100644 --- a/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c @@ -7,25 +7,28 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "udpa/annotations/sensitive.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -const upb_MiniTable_Extension udpa_annotations_sensitive_ext = { - {76569463, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +const upb_MiniTableExtension udpa_annotations_sensitive_ext = { + {76569463, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, {.submsg = NULL}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &udpa_annotations_sensitive_ext, }; -const upb_MiniTable_File udpa_annotations_sensitive_proto_upb_file_layout = { +const upb_MiniTableFile udpa_annotations_sensitive_proto_upb_file_layout = { NULL, NULL, extensions_layout, @@ -34,5 +37,5 @@ const upb_MiniTable_File udpa_annotations_sensitive_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h b/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h index 187013e64ac..1694c048c63 100644 --- a/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h @@ -9,38 +9,55 @@ #ifndef UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_ #define UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -extern const upb_MiniTable_Extension udpa_annotations_sensitive_ext; +extern const upb_MiniTableExtension udpa_annotations_sensitive_ext; struct google_protobuf_FieldOptions; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; UPB_INLINE bool udpa_annotations_has_sensitive(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_sensitive_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_sensitive_ext); } UPB_INLINE void udpa_annotations_clear_sensitive(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_sensitive_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_sensitive_ext); } UPB_INLINE bool udpa_annotations_sensitive(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_sensitive_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &udpa_annotations_sensitive_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -extern const upb_MiniTable_File udpa_annotations_sensitive_proto_upb_file_layout; +UPB_INLINE void udpa_annotations_set_sensitive(struct google_protobuf_FieldOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_sensitive_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); +} +extern const upb_MiniTableFile udpa_annotations_sensitive_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/udpa/annotations/status.upb.c b/src/core/ext/upb-generated/udpa/annotations/status.upb.c index d09e49dd7f4..b1b8c2beeaf 100644 --- a/src/core/ext/upb-generated/udpa/annotations/status.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/status.upb.c @@ -7,41 +7,50 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "udpa/annotations/status.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field udpa_annotations_StatusAnnotation__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField udpa_annotations_StatusAnnotation__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable udpa_annotations_StatusAnnotation_msginit = { +const upb_MiniTable udpa_annotations_StatusAnnotation_msg_init = { NULL, &udpa_annotations_StatusAnnotation__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &udpa_annotations_StatusAnnotation_msginit, + &udpa_annotations_StatusAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable udpa_annotations_StatusAnnotation_msginit; -const upb_MiniTable_Extension udpa_annotations_file_status_ext = { - {222707719, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FileOptions_msginit, - {.submsg = &udpa_annotations_StatusAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable udpa_annotations_StatusAnnotation_msg_init; +const upb_MiniTableExtension udpa_annotations_file_status_ext = { + {222707719, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FileOptions_msg_init, + {.submsg = &udpa_annotations_StatusAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &udpa_annotations_file_status_ext, }; -const upb_MiniTable_File udpa_annotations_status_proto_upb_file_layout = { +const upb_MiniTableFile udpa_annotations_status_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -50,5 +59,5 @@ const upb_MiniTable_File udpa_annotations_status_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 8e4eeed1928..774d19a77b3 100644 --- a/src/core/ext/upb-generated/udpa/annotations/status.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/status.upb.h @@ -9,23 +9,27 @@ #ifndef UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_ #define UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct udpa_annotations_StatusAnnotation; typedef struct udpa_annotations_StatusAnnotation udpa_annotations_StatusAnnotation; -extern const upb_MiniTable udpa_annotations_StatusAnnotation_msginit; -extern const upb_MiniTable_Extension udpa_annotations_file_status_ext; +extern const upb_MiniTable udpa_annotations_StatusAnnotation_msg_init; +extern const upb_MiniTableExtension udpa_annotations_file_status_ext; struct google_protobuf_FileOptions; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; typedef enum { udpa_annotations_UNKNOWN = 0, @@ -39,12 +43,12 @@ typedef enum { /* udpa.annotations.StatusAnnotation */ UPB_INLINE udpa_annotations_StatusAnnotation* udpa_annotations_StatusAnnotation_new(upb_Arena* arena) { - return (udpa_annotations_StatusAnnotation*)_upb_Message_New(&udpa_annotations_StatusAnnotation_msginit, arena); + return (udpa_annotations_StatusAnnotation*)_upb_Message_New(&udpa_annotations_StatusAnnotation_msg_init, arena); } UPB_INLINE udpa_annotations_StatusAnnotation* udpa_annotations_StatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { udpa_annotations_StatusAnnotation* ret = udpa_annotations_StatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -54,7 +58,7 @@ UPB_INLINE udpa_annotations_StatusAnnotation* udpa_annotations_StatusAnnotation_ int options, upb_Arena* arena) { udpa_annotations_StatusAnnotation* ret = udpa_annotations_StatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -62,58 +66,75 @@ UPB_INLINE udpa_annotations_StatusAnnotation* udpa_annotations_StatusAnnotation_ } UPB_INLINE char* udpa_annotations_StatusAnnotation_serialize(const udpa_annotations_StatusAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_StatusAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_StatusAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_StatusAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_StatusAnnotation_msg_init, 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; +UPB_INLINE void udpa_annotations_StatusAnnotation_clear_work_in_progress(udpa_annotations_StatusAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool udpa_annotations_StatusAnnotation_work_in_progress(const udpa_annotations_StatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void udpa_annotations_StatusAnnotation_clear_package_version_status(const udpa_annotations_StatusAnnotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void udpa_annotations_StatusAnnotation_clear_package_version_status(udpa_annotations_StatusAnnotation* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t udpa_annotations_StatusAnnotation_package_version_status(const udpa_annotations_StatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void udpa_annotations_StatusAnnotation_set_work_in_progress(udpa_annotations_StatusAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void udpa_annotations_StatusAnnotation_set_package_version_status(udpa_annotations_StatusAnnotation *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool udpa_annotations_has_file_status(const struct google_protobuf_FileOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_file_status_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_file_status_ext); } UPB_INLINE void udpa_annotations_clear_file_status(struct google_protobuf_FileOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_file_status_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_file_status_ext); } UPB_INLINE const udpa_annotations_StatusAnnotation* udpa_annotations_file_status(const struct google_protobuf_FileOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_file_status_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_StatusAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_file_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_StatusAnnotation* default_val = NULL; + const udpa_annotations_StatusAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_file_status_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_StatusAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_file_status(struct google_protobuf_FileOptions* msg, const udpa_annotations_StatusAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_file_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File udpa_annotations_status_proto_upb_file_layout; +extern const upb_MiniTableFile udpa_annotations_status_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_ */ 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 a0db4c09806..dcc8e1f7380 100644 --- a/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c @@ -7,40 +7,47 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "udpa/annotations/versioning.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field udpa_annotations_VersioningAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField udpa_annotations_VersioningAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit = { +const upb_MiniTable udpa_annotations_VersioningAnnotation_msg_init = { NULL, &udpa_annotations_VersioningAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &udpa_annotations_VersioningAnnotation_msginit, + &udpa_annotations_VersioningAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit; -const upb_MiniTable_Extension udpa_annotations_versioning_ext = { - {7881811, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, - {.submsg = &udpa_annotations_VersioningAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable udpa_annotations_VersioningAnnotation_msg_init; +const upb_MiniTableExtension udpa_annotations_versioning_ext = { + {7881811, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, + {.submsg = &udpa_annotations_VersioningAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &udpa_annotations_versioning_ext, }; -const upb_MiniTable_File udpa_annotations_versioning_proto_upb_file_layout = { +const upb_MiniTableFile udpa_annotations_versioning_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -49,5 +56,5 @@ const upb_MiniTable_File udpa_annotations_versioning_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 ad96fcd758c..c1c254a6eb4 100644 --- a/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h @@ -9,35 +9,39 @@ #ifndef UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_ #define UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct udpa_annotations_VersioningAnnotation; typedef struct udpa_annotations_VersioningAnnotation udpa_annotations_VersioningAnnotation; -extern const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit; -extern const upb_MiniTable_Extension udpa_annotations_versioning_ext; +extern const upb_MiniTable udpa_annotations_VersioningAnnotation_msg_init; +extern const upb_MiniTableExtension udpa_annotations_versioning_ext; struct google_protobuf_MessageOptions; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; /* udpa.annotations.VersioningAnnotation */ UPB_INLINE udpa_annotations_VersioningAnnotation* udpa_annotations_VersioningAnnotation_new(upb_Arena* arena) { - return (udpa_annotations_VersioningAnnotation*)_upb_Message_New(&udpa_annotations_VersioningAnnotation_msginit, arena); + return (udpa_annotations_VersioningAnnotation*)_upb_Message_New(&udpa_annotations_VersioningAnnotation_msg_init, arena); } UPB_INLINE udpa_annotations_VersioningAnnotation* udpa_annotations_VersioningAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { udpa_annotations_VersioningAnnotation* ret = udpa_annotations_VersioningAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +51,7 @@ UPB_INLINE udpa_annotations_VersioningAnnotation* udpa_annotations_VersioningAnn int options, upb_Arena* arena) { udpa_annotations_VersioningAnnotation* ret = udpa_annotations_VersioningAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,49 +59,60 @@ UPB_INLINE udpa_annotations_VersioningAnnotation* udpa_annotations_VersioningAnn } UPB_INLINE char* udpa_annotations_VersioningAnnotation_serialize(const udpa_annotations_VersioningAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msg_init, 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); +UPB_INLINE void udpa_annotations_VersioningAnnotation_clear_previous_message_type(udpa_annotations_VersioningAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView udpa_annotations_VersioningAnnotation_previous_message_type(const udpa_annotations_VersioningAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void udpa_annotations_VersioningAnnotation_set_previous_message_type(udpa_annotations_VersioningAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool udpa_annotations_has_versioning(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &udpa_annotations_versioning_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &udpa_annotations_versioning_ext); } UPB_INLINE void udpa_annotations_clear_versioning(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &udpa_annotations_versioning_ext); + _upb_Message_ClearExtensionField(msg, &udpa_annotations_versioning_ext); } UPB_INLINE const udpa_annotations_VersioningAnnotation* udpa_annotations_versioning(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_versioning_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_VersioningAnnotation*); + const upb_MiniTableExtension* ext = &udpa_annotations_versioning_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const udpa_annotations_VersioningAnnotation* default_val = NULL; + const udpa_annotations_VersioningAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &udpa_annotations_versioning_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_VersioningAnnotation*) = ext; +UPB_INLINE void udpa_annotations_set_versioning(struct google_protobuf_MessageOptions* msg, const udpa_annotations_VersioningAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &udpa_annotations_versioning_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File udpa_annotations_versioning_proto_upb_file_layout; +extern const upb_MiniTableFile udpa_annotations_versioning_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/validate/validate.upb.c b/src/core/ext/upb-generated/validate/validate.upb.c index 9dc0a42392f..47d54a560eb 100644 --- a/src/core/ext/upb-generated/validate/validate.upb.c +++ b/src/core/ext/upb-generated/validate/validate.upb.c @@ -7,547 +7,937 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "validate/validate.upb.h" #include "google/protobuf/descriptor.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/timestamp.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub validate_FieldRules_submsgs[22] = { - {.submsg = &validate_FloatRules_msginit}, - {.submsg = &validate_DoubleRules_msginit}, - {.submsg = &validate_Int32Rules_msginit}, - {.submsg = &validate_Int64Rules_msginit}, - {.submsg = &validate_UInt32Rules_msginit}, - {.submsg = &validate_UInt64Rules_msginit}, - {.submsg = &validate_SInt32Rules_msginit}, - {.submsg = &validate_SInt64Rules_msginit}, - {.submsg = &validate_Fixed32Rules_msginit}, - {.submsg = &validate_Fixed64Rules_msginit}, - {.submsg = &validate_SFixed32Rules_msginit}, - {.submsg = &validate_SFixed64Rules_msginit}, - {.submsg = &validate_BoolRules_msginit}, - {.submsg = &validate_StringRules_msginit}, - {.submsg = &validate_BytesRules_msginit}, - {.submsg = &validate_EnumRules_msginit}, - {.submsg = &validate_MessageRules_msginit}, - {.submsg = &validate_RepeatedRules_msginit}, - {.submsg = &validate_MapRules_msginit}, - {.submsg = &validate_AnyRules_msginit}, - {.submsg = &validate_DurationRules_msginit}, - {.submsg = &validate_TimestampRules_msginit}, +static const upb_MiniTableSub validate_FieldRules_submsgs[22] = { + {.submsg = &validate_FloatRules_msg_init}, + {.submsg = &validate_DoubleRules_msg_init}, + {.submsg = &validate_Int32Rules_msg_init}, + {.submsg = &validate_Int64Rules_msg_init}, + {.submsg = &validate_UInt32Rules_msg_init}, + {.submsg = &validate_UInt64Rules_msg_init}, + {.submsg = &validate_SInt32Rules_msg_init}, + {.submsg = &validate_SInt64Rules_msg_init}, + {.submsg = &validate_Fixed32Rules_msg_init}, + {.submsg = &validate_Fixed64Rules_msg_init}, + {.submsg = &validate_SFixed32Rules_msg_init}, + {.submsg = &validate_SFixed64Rules_msg_init}, + {.submsg = &validate_BoolRules_msg_init}, + {.submsg = &validate_StringRules_msg_init}, + {.submsg = &validate_BytesRules_msg_init}, + {.submsg = &validate_EnumRules_msg_init}, + {.submsg = &validate_MessageRules_msg_init}, + {.submsg = &validate_RepeatedRules_msg_init}, + {.submsg = &validate_MapRules_msg_init}, + {.submsg = &validate_AnyRules_msg_init}, + {.submsg = &validate_DurationRules_msg_init}, + {.submsg = &validate_TimestampRules_msg_init}, }; -static const upb_MiniTable_Field validate_FieldRules__fields[22] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_FieldRules__fields[22] = { + {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(4, 8), 1, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_FieldRules_msginit = { +const upb_MiniTable validate_FieldRules_msg_init = { &validate_FieldRules_submsgs[0], &validate_FieldRules__fields[0], - UPB_SIZE(16, 24), 22, kUpb_ExtMode_NonExtendable, 22, 255, 0, + UPB_SIZE(16, 24), 22, kUpb_ExtMode_NonExtendable, 22, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000040100000a, &upb_pom_1bt_max64b}, + {0x0010000402010012, &upb_pom_1bt_max128b}, + {0x001000040302001a, &upb_pom_1bt_max64b}, + {0x0010000404030022, &upb_pom_1bt_max128b}, + {0x001000040504002a, &upb_pom_1bt_max64b}, + {0x0010000406050032, &upb_pom_1bt_max128b}, + {0x001000040706003a, &upb_pom_1bt_max64b}, + {0x0010000408070042, &upb_pom_1bt_max128b}, + {0x001000040908004a, &upb_pom_1bt_max64b}, + {0x001000040a090052, &upb_pom_1bt_max128b}, + {0x001000040b0a005a, &upb_pom_1bt_max64b}, + {0x001000040c0b0062, &upb_pom_1bt_max128b}, + {0x001000040d0c006a, &upb_pom_1bt_max64b}, + {0x001000040e0d0072, &upb_pom_1bt_max192b}, + {0x001000040f0e007a, &upb_pom_1bt_max192b}, + {0x00100004100f0182, &upb_pom_2bt_max64b}, + {0x000800000110018a, &upb_psm_2bt_max64b}, + {0x0010000412110192, &upb_pom_2bt_max64b}, + {0x001000041312019a, &upb_pom_2bt_max64b}, + {0x00100004141301a2, &upb_pom_2bt_max64b}, + {0x00100004151401aa, &upb_pom_2bt_max128b}, + {0x00100004161501b2, &upb_pom_2bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_FloatRules__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 2, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 2, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_FloatRules__fields[8] = { + {1, 4, 1, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_FloatRules_msginit = { +const upb_MiniTable validate_FloatRules_msg_init = { NULL, &validate_FloatRules__fields[0], - UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400000100000d, &upb_psf4_1bt}, + {0x0008000002000015, &upb_psf4_1bt}, + {0x000c00000300001d, &upb_psf4_1bt}, + {0x0010000004000025, &upb_psf4_1bt}, + {0x001400000500002d, &upb_psf4_1bt}, + {0x002000003f000035, &upb_prf4_1bt}, + {0x002800003f00003d, &upb_prf4_1bt}, + {0x0018000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_DoubleRules__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_DoubleRules__fields[8] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_DoubleRules_msginit = { +const upb_MiniTable validate_DoubleRules_msg_init = { NULL, &validate_DoubleRules__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000009, &upb_psf8_1bt}, + {0x0010000002000011, &upb_psf8_1bt}, + {0x0018000003000019, &upb_psf8_1bt}, + {0x0020000004000021, &upb_psf8_1bt}, + {0x0028000005000029, &upb_psf8_1bt}, + {0x003000003f000031, &upb_prf8_1bt}, + {0x003800003f000039, &upb_prf8_1bt}, + {0x0001000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_Int32Rules__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_Int32Rules__fields[8] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_Int32Rules_msginit = { +const upb_MiniTable validate_Int32Rules_msg_init = { NULL, &validate_Int32Rules__fields[0], - UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x000c000003000018, &upb_psv4_1bt}, + {0x0010000004000020, &upb_psv4_1bt}, + {0x0014000005000028, &upb_psv4_1bt}, + {0x002000003f000030, &upb_prv4_1bt}, + {0x002800003f000038, &upb_prv4_1bt}, + {0x0018000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_Int64Rules__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_Int64Rules__fields[8] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_Int64Rules_msginit = { +const upb_MiniTable validate_Int64Rules_msg_init = { NULL, &validate_Int64Rules__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_psv8_1bt}, + {0x0010000002000010, &upb_psv8_1bt}, + {0x0018000003000018, &upb_psv8_1bt}, + {0x0020000004000020, &upb_psv8_1bt}, + {0x0028000005000028, &upb_psv8_1bt}, + {0x003000003f000030, &upb_prv8_1bt}, + {0x003800003f000038, &upb_prv8_1bt}, + {0x0001000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_UInt32Rules__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_UInt32Rules__fields[8] = { + {1, 4, 1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_UInt32Rules_msginit = { +const upb_MiniTable validate_UInt32Rules_msg_init = { NULL, &validate_UInt32Rules__fields[0], - UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x000c000003000018, &upb_psv4_1bt}, + {0x0010000004000020, &upb_psv4_1bt}, + {0x0014000005000028, &upb_psv4_1bt}, + {0x002000003f000030, &upb_prv4_1bt}, + {0x002800003f000038, &upb_prv4_1bt}, + {0x0018000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_UInt64Rules__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_UInt64Rules__fields[8] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_UInt64Rules_msginit = { +const upb_MiniTable validate_UInt64Rules_msg_init = { NULL, &validate_UInt64Rules__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_psv8_1bt}, + {0x0010000002000010, &upb_psv8_1bt}, + {0x0018000003000018, &upb_psv8_1bt}, + {0x0020000004000020, &upb_psv8_1bt}, + {0x0028000005000028, &upb_psv8_1bt}, + {0x003000003f000030, &upb_prv8_1bt}, + {0x003800003f000038, &upb_prv8_1bt}, + {0x0001000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_SInt32Rules__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 17, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 17, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_SInt32Rules__fields[8] = { + {1, 4, 1, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_SInt32Rules_msginit = { +const upb_MiniTable validate_SInt32Rules_msg_init = { NULL, &validate_SInt32Rules__fields[0], - UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psz4_1bt}, + {0x0008000002000010, &upb_psz4_1bt}, + {0x000c000003000018, &upb_psz4_1bt}, + {0x0010000004000020, &upb_psz4_1bt}, + {0x0014000005000028, &upb_psz4_1bt}, + {0x002000003f000030, &upb_prz4_1bt}, + {0x002800003f000038, &upb_prz4_1bt}, + {0x0018000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_SInt64Rules__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 18, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 18, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_SInt64Rules__fields[8] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_SInt64Rules_msginit = { +const upb_MiniTable validate_SInt64Rules_msg_init = { NULL, &validate_SInt64Rules__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_psz8_1bt}, + {0x0010000002000010, &upb_psz8_1bt}, + {0x0018000003000018, &upb_psz8_1bt}, + {0x0020000004000020, &upb_psz8_1bt}, + {0x0028000005000028, &upb_psz8_1bt}, + {0x003000003f000030, &upb_prz8_1bt}, + {0x003800003f000038, &upb_prz8_1bt}, + {0x0001000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_Fixed32Rules__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 7, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 7, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_Fixed32Rules__fields[8] = { + {1, 4, 1, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_Fixed32Rules_msginit = { +const upb_MiniTable validate_Fixed32Rules_msg_init = { NULL, &validate_Fixed32Rules__fields[0], - UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400000100000d, &upb_psf4_1bt}, + {0x0008000002000015, &upb_psf4_1bt}, + {0x000c00000300001d, &upb_psf4_1bt}, + {0x0010000004000025, &upb_psf4_1bt}, + {0x001400000500002d, &upb_psf4_1bt}, + {0x002000003f000035, &upb_prf4_1bt}, + {0x002800003f00003d, &upb_prf4_1bt}, + {0x0018000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_Fixed64Rules__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 6, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 6, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_Fixed64Rules__fields[8] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_Fixed64Rules_msginit = { +const upb_MiniTable validate_Fixed64Rules_msg_init = { NULL, &validate_Fixed64Rules__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000009, &upb_psf8_1bt}, + {0x0010000002000011, &upb_psf8_1bt}, + {0x0018000003000019, &upb_psf8_1bt}, + {0x0020000004000021, &upb_psf8_1bt}, + {0x0028000005000029, &upb_psf8_1bt}, + {0x003000003f000031, &upb_prf8_1bt}, + {0x003800003f000039, &upb_prf8_1bt}, + {0x0001000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_SFixed32Rules__fields[8] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 15, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 15, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_SFixed32Rules__fields[8] = { + {1, 4, 1, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_SFixed32Rules_msginit = { +const upb_MiniTable validate_SFixed32Rules_msg_init = { NULL, &validate_SFixed32Rules__fields[0], - UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000400000100000d, &upb_psf4_1bt}, + {0x0008000002000015, &upb_psf4_1bt}, + {0x000c00000300001d, &upb_psf4_1bt}, + {0x0010000004000025, &upb_psf4_1bt}, + {0x001400000500002d, &upb_psf4_1bt}, + {0x002000003f000035, &upb_prf4_1bt}, + {0x002800003f00003d, &upb_prf4_1bt}, + {0x0018000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_SFixed64Rules__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 16, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 16, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_SFixed64Rules__fields[8] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_SFixed64Rules_msginit = { +const upb_MiniTable validate_SFixed64Rules_msg_init = { NULL, &validate_SFixed64Rules__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000009, &upb_psf8_1bt}, + {0x0010000002000011, &upb_psf8_1bt}, + {0x0018000003000019, &upb_psf8_1bt}, + {0x0020000004000021, &upb_psf8_1bt}, + {0x0028000005000029, &upb_psf8_1bt}, + {0x003000003f000031, &upb_prf8_1bt}, + {0x003800003f000039, &upb_prf8_1bt}, + {0x0001000006000040, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_BoolRules__fields[1] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_BoolRules__fields[1] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_BoolRules_msginit = { +const upb_MiniTable validate_BoolRules_msg_init = { NULL, &validate_BoolRules__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Sub validate_StringRules_submsgs[1] = { - {.subenum = &validate_KnownRegex_enuminit}, +static const upb_MiniTableSub validate_StringRules_submsgs[1] = { + {.subenum = &validate_KnownRegex_enum_init}, }; -static const upb_MiniTable_Field validate_StringRules__fields[26] = { - {1, UPB_SIZE(16, 16), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(72, 128), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(80, 136), UPB_SIZE(3, 3), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(88, 144), UPB_SIZE(4, 4), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(96, 152), UPB_SIZE(5, 5), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 32), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(32, 48), UPB_SIZE(7, 7), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(40, 64), UPB_SIZE(8, 8), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(48, 80), UPB_SIZE(9, 9), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(56, 96), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(60, 104), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {15, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {16, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {17, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {18, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(104, 160), UPB_SIZE(10, 10), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {20, UPB_SIZE(112, 168), UPB_SIZE(11, 11), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {21, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {22, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {23, UPB_SIZE(64, 112), UPB_SIZE(12, 12), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {24, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {25, UPB_SIZE(8, 8), UPB_SIZE(13, 13), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {26, UPB_SIZE(9, 9), UPB_SIZE(14, 14), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_StringRules__fields[26] = { + {1, UPB_SIZE(24, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, 48, 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, 56, 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, 64, 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(72, 80), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(80, 96), 8, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(88, 112), 9, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(4, 128), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(8, 136), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {15, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {16, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {18, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(96, 144), 10, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(104, 152), 11, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {22, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {23, UPB_SIZE(112, 160), 12, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {24, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {25, UPB_SIZE(16, 8), 13, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {26, UPB_SIZE(17, 9), 14, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_StringRules_msginit = { +const upb_MiniTable validate_StringRules_msg_init = { &validate_StringRules_submsgs[0], &validate_StringRules__fields[0], - UPB_SIZE(120, 176), 26, kUpb_ExtMode_NonExtendable, 26, 255, 0, + UPB_SIZE(120, 176), 26, kUpb_ExtMode_NonExtendable, 26, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psb_1bt}, + {0x0020000002000010, &upb_psv8_1bt}, + {0x0028000003000018, &upb_psv8_1bt}, + {0x0030000004000020, &upb_psv8_1bt}, + {0x0038000005000028, &upb_psv8_1bt}, + {0x0040000006000032, &upb_psb_1bt}, + {0x005000000700003a, &upb_psb_1bt}, + {0x0060000008000042, &upb_psb_1bt}, + {0x007000000900004a, &upb_psb_1bt}, + {0x008000003f000052, &upb_prb_1bt}, + {0x008800003f00005a, &upb_prb_1bt}, + {0x000c00040c000060, &upb_pob1_1bt}, + {0x000c00040d000068, &upb_pob1_1bt}, + {0x000c00040e000070, &upb_pob1_1bt}, + {0x000c00040f000078, &upb_pob1_1bt}, + {0x000c000410000180, &upb_pob1_2bt}, + {0x000c000411000188, &upb_pob1_2bt}, + {0x000c000412000190, &upb_pob1_2bt}, + {0x009000000a000198, &upb_psv8_2bt}, + {0x009800000b0001a0, &upb_psv8_2bt}, + {0x000c0004150001a8, &upb_pob1_2bt}, + {0x000c0004160001b0, &upb_pob1_2bt}, + {0x00a000000c0001ba, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000d0001c8, &upb_psb1_2bt}, + {0x000900000e0001d0, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_BytesRules__fields[14] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(64, 112), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(72, 120), UPB_SIZE(3, 3), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(20, 32), UPB_SIZE(4, 4), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(28, 48), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(36, 64), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(44, 80), UPB_SIZE(7, 7), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(56, 104), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {10, UPB_SIZE(2, 2), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(2, 2), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {12, UPB_SIZE(2, 2), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {13, UPB_SIZE(80, 128), UPB_SIZE(8, 8), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {14, UPB_SIZE(8, 8), UPB_SIZE(9, 9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_BytesRules__fields[14] = { + {1, UPB_SIZE(20, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, 48, 4, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(56, 64), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(64, 80), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(72, 96), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(4, 112), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(8, 120), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {12, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(80, 128), 8, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {14, UPB_SIZE(16, 8), 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_BytesRules_msginit = { +const upb_MiniTable validate_BytesRules_msg_init = { NULL, &validate_BytesRules__fields[0], - UPB_SIZE(88, 136), 14, kUpb_ExtMode_NonExtendable, 14, 255, 0, + UPB_SIZE(88, 136), 14, kUpb_ExtMode_NonExtendable, 14, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000000100000a, &upb_psb_1bt}, + {0x0020000002000010, &upb_psv8_1bt}, + {0x0028000003000018, &upb_psv8_1bt}, + {0x0030000004000022, &upb_psb_1bt}, + {0x004000000500002a, &upb_psb_1bt}, + {0x0050000006000032, &upb_psb_1bt}, + {0x006000000700003a, &upb_psb_1bt}, + {0x007000003f000042, &upb_prb_1bt}, + {0x007800003f00004a, &upb_prb_1bt}, + {0x000200040a000050, &upb_pob1_1bt}, + {0x000200040b000058, &upb_pob1_1bt}, + {0x000200040c000060, &upb_pob1_1bt}, + {0x0080000008000068, &upb_psv8_1bt}, + {0x0008000009000070, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_EnumRules__fields[4] = { - {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_EnumRules__fields[4] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_EnumRules_msginit = { +const upb_MiniTable validate_EnumRules_msg_init = { NULL, &validate_EnumRules__fields[0], - UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psb1_1bt}, + {0x001000003f000018, &upb_prv4_1bt}, + {0x001800003f000020, &upb_prv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_MessageRules__fields[2] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(2, 2), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_MessageRules__fields[2] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_MessageRules_msginit = { +const upb_MiniTable validate_MessageRules_msg_init = { NULL, &validate_MessageRules__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0002000002000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub validate_RepeatedRules_submsgs[1] = { - {.submsg = &validate_FieldRules_msginit}, +static const upb_MiniTableSub validate_RepeatedRules_submsgs[1] = { + {.submsg = &validate_FieldRules_msg_init}, }; -static const upb_MiniTable_Field validate_RepeatedRules__fields[5] = { - {1, UPB_SIZE(8, 16), UPB_SIZE(1, 1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(4, 4), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(2, 2), UPB_SIZE(5, 5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_RepeatedRules__fields[5] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 2), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_RepeatedRules_msginit = { +const upb_MiniTable validate_RepeatedRules_msg_init = { &validate_RepeatedRules_submsgs[0], &validate_RepeatedRules__fields[0], - UPB_SIZE(24, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + 32, 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_psv8_1bt}, + {0x0010000002000010, &upb_psv8_1bt}, + {0x0001000003000018, &upb_psb1_1bt}, + {0x0018000004000022, &upb_psm_1bt_max64b}, + {0x0002000005000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub validate_MapRules_submsgs[2] = { - {.submsg = &validate_FieldRules_msginit}, - {.submsg = &validate_FieldRules_msginit}, +static const upb_MiniTableSub validate_MapRules_submsgs[2] = { + {.submsg = &validate_FieldRules_msg_init}, + {.submsg = &validate_FieldRules_msg_init}, }; -static const upb_MiniTable_Field validate_MapRules__fields[6] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(4, 4), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 16), UPB_SIZE(5, 5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(2, 2), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_MapRules__fields[6] = { + {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 32), 5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_MapRules_msginit = { +const upb_MiniTable validate_MapRules_msg_init = { &validate_MapRules_submsgs[0], &validate_MapRules__fields[0], - UPB_SIZE(32, 40), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 40), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000001000008, &upb_psv8_1bt}, + {0x0010000002000010, &upb_psv8_1bt}, + {0x0001000003000018, &upb_psb1_1bt}, + {0x0018000004000022, &upb_psm_1bt_max64b}, + {0x002000000501002a, &upb_psm_1bt_max64b}, + {0x0002000006000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field validate_AnyRules__fields[3] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_AnyRules__fields[3] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_AnyRules_msginit = { +const upb_MiniTable validate_AnyRules_msg_init = { NULL, &validate_AnyRules__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x000800003f000012, &upb_prb_1bt}, + {0x001000003f00001a, &upb_prb_1bt}, + }) }; -static const upb_MiniTable_Sub validate_DurationRules_submsgs[7] = { - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub validate_DurationRules_submsgs[7] = { + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field validate_DurationRules__fields[8] = { - {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(2, 2), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 16), UPB_SIZE(3, 3), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 24), UPB_SIZE(4, 4), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(16, 32), UPB_SIZE(5, 5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(20, 40), UPB_SIZE(6, 6), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_DurationRules__fields[8] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 48), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_DurationRules_msginit = { +const upb_MiniTable validate_DurationRules_msg_init = { &validate_DurationRules_submsgs[0], &validate_DurationRules__fields[0], - UPB_SIZE(32, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(32, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0008000002000012, &upb_psm_1bt_maxmaxb}, + {0x001000000301001a, &upb_psm_1bt_maxmaxb}, + {0x0018000004020022, &upb_psm_1bt_maxmaxb}, + {0x002000000503002a, &upb_psm_1bt_maxmaxb}, + {0x0028000006040032, &upb_psm_1bt_maxmaxb}, + {0x003000003f05003a, &upb_prm_1bt_maxmaxb}, + {0x003800003f060042, &upb_prm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub validate_TimestampRules_submsgs[6] = { - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Timestamp_msginit}, - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub validate_TimestampRules_submsgs[6] = { + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Timestamp_msg_init}, + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field validate_TimestampRules__fields[9] = { - {1, UPB_SIZE(2, 2), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(3, 3), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(16, 24), UPB_SIZE(4, 4), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(20, 32), UPB_SIZE(5, 5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(24, 40), UPB_SIZE(6, 6), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(3, 3), UPB_SIZE(7, 7), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(4, 4), UPB_SIZE(8, 8), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {9, UPB_SIZE(28, 48), UPB_SIZE(9, 9), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField validate_TimestampRules__fields[9] = { + {1, 2, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 3), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(25, 4), 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 48), 9, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable validate_TimestampRules_msginit = { +const upb_MiniTable validate_TimestampRules_msg_init = { &validate_TimestampRules_submsgs[0], &validate_TimestampRules__fields[0], - UPB_SIZE(32, 56), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(32, 56), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0002000001000008, &upb_psb1_1bt}, + {0x0008000002000012, &upb_psm_1bt_maxmaxb}, + {0x001000000301001a, &upb_psm_1bt_maxmaxb}, + {0x0018000004020022, &upb_psm_1bt_maxmaxb}, + {0x002000000503002a, &upb_psm_1bt_maxmaxb}, + {0x0028000006040032, &upb_psm_1bt_maxmaxb}, + {0x0003000007000038, &upb_psb1_1bt}, + {0x0004000008000040, &upb_psb1_1bt}, + {0x003000000905004a, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[23] = { - &validate_FieldRules_msginit, - &validate_FloatRules_msginit, - &validate_DoubleRules_msginit, - &validate_Int32Rules_msginit, - &validate_Int64Rules_msginit, - &validate_UInt32Rules_msginit, - &validate_UInt64Rules_msginit, - &validate_SInt32Rules_msginit, - &validate_SInt64Rules_msginit, - &validate_Fixed32Rules_msginit, - &validate_Fixed64Rules_msginit, - &validate_SFixed32Rules_msginit, - &validate_SFixed64Rules_msginit, - &validate_BoolRules_msginit, - &validate_StringRules_msginit, - &validate_BytesRules_msginit, - &validate_EnumRules_msginit, - &validate_MessageRules_msginit, - &validate_RepeatedRules_msginit, - &validate_MapRules_msginit, - &validate_AnyRules_msginit, - &validate_DurationRules_msginit, - &validate_TimestampRules_msginit, + &validate_FieldRules_msg_init, + &validate_FloatRules_msg_init, + &validate_DoubleRules_msg_init, + &validate_Int32Rules_msg_init, + &validate_Int64Rules_msg_init, + &validate_UInt32Rules_msg_init, + &validate_UInt64Rules_msg_init, + &validate_SInt32Rules_msg_init, + &validate_SInt64Rules_msg_init, + &validate_Fixed32Rules_msg_init, + &validate_Fixed64Rules_msg_init, + &validate_SFixed32Rules_msg_init, + &validate_SFixed64Rules_msg_init, + &validate_BoolRules_msg_init, + &validate_StringRules_msg_init, + &validate_BytesRules_msg_init, + &validate_EnumRules_msg_init, + &validate_MessageRules_msg_init, + &validate_RepeatedRules_msg_init, + &validate_MapRules_msg_init, + &validate_AnyRules_msg_init, + &validate_DurationRules_msg_init, + &validate_TimestampRules_msg_init, }; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable google_protobuf_OneofOptions_msginit; -extern const upb_MiniTable validate_FieldRules_msginit; -const upb_MiniTable_Extension validate_disabled_ext = { - {1071, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable google_protobuf_OneofOptions_msg_init; +extern const upb_MiniTable validate_FieldRules_msg_init; +const upb_MiniTableExtension validate_disabled_ext = { + {1071, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, {.submsg = NULL}, }; -const upb_MiniTable_Extension validate_ignored_ext = { - {1072, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, +const upb_MiniTableExtension validate_ignored_ext = { + {1072, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, {.submsg = NULL}, }; -const upb_MiniTable_Extension validate_required_ext = { - {1071, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_OneofOptions_msginit, +const upb_MiniTableExtension validate_required_ext = { + {1071, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_OneofOptions_msg_init, {.submsg = NULL}, }; -const upb_MiniTable_Extension validate_rules_ext = { - {1071, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, - {.submsg = &validate_FieldRules_msginit}, +const upb_MiniTableExtension validate_rules_ext = { + {1071, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, + {.submsg = &validate_FieldRules_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[4] = { +static const upb_MiniTableExtension *extensions_layout[4] = { &validate_disabled_ext, &validate_ignored_ext, &validate_required_ext, &validate_rules_ext, }; -const upb_MiniTable_Enum validate_KnownRegex_enuminit = { - NULL, - 0x7ULL, +const upb_MiniTableEnum validate_KnownRegex_enum_init = { + 64, 0, + { + 0x7, + 0x0, + }, }; -static const upb_MiniTable_Enum *enums_layout[1] = { - &validate_KnownRegex_enuminit, +static const upb_MiniTableEnum *enums_layout[1] = { + &validate_KnownRegex_enum_init, }; -const upb_MiniTable_File validate_validate_proto_upb_file_layout = { +const upb_MiniTableFile validate_validate_proto_upb_file_layout = { messages_layout, enums_layout, extensions_layout, @@ -556,5 +946,5 @@ const upb_MiniTable_File validate_validate_proto_upb_file_layout = { 4, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/validate/validate.upb.h b/src/core/ext/upb-generated/validate/validate.upb.h index b78ce98bcc9..50d750a729a 100644 --- a/src/core/ext/upb-generated/validate/validate.upb.h +++ b/src/core/ext/upb-generated/validate/validate.upb.h @@ -9,40 +9,22 @@ #ifndef VALIDATE_VALIDATE_PROTO_UPB_H_ #define VALIDATE_VALIDATE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct validate_FieldRules; -struct validate_FloatRules; -struct validate_DoubleRules; -struct validate_Int32Rules; -struct validate_Int64Rules; -struct validate_UInt32Rules; -struct validate_UInt64Rules; -struct validate_SInt32Rules; -struct validate_SInt64Rules; -struct validate_Fixed32Rules; -struct validate_Fixed64Rules; -struct validate_SFixed32Rules; -struct validate_SFixed64Rules; -struct validate_BoolRules; -struct validate_StringRules; -struct validate_BytesRules; -struct validate_EnumRules; -struct validate_MessageRules; -struct validate_RepeatedRules; -struct validate_MapRules; -struct validate_AnyRules; -struct validate_DurationRules; -struct validate_TimestampRules; typedef struct validate_FieldRules validate_FieldRules; typedef struct validate_FloatRules validate_FloatRules; typedef struct validate_DoubleRules validate_DoubleRules; @@ -66,43 +48,43 @@ typedef struct validate_MapRules validate_MapRules; typedef struct validate_AnyRules validate_AnyRules; typedef struct validate_DurationRules validate_DurationRules; typedef struct validate_TimestampRules validate_TimestampRules; -extern const upb_MiniTable validate_FieldRules_msginit; -extern const upb_MiniTable validate_FloatRules_msginit; -extern const upb_MiniTable validate_DoubleRules_msginit; -extern const upb_MiniTable validate_Int32Rules_msginit; -extern const upb_MiniTable validate_Int64Rules_msginit; -extern const upb_MiniTable validate_UInt32Rules_msginit; -extern const upb_MiniTable validate_UInt64Rules_msginit; -extern const upb_MiniTable validate_SInt32Rules_msginit; -extern const upb_MiniTable validate_SInt64Rules_msginit; -extern const upb_MiniTable validate_Fixed32Rules_msginit; -extern const upb_MiniTable validate_Fixed64Rules_msginit; -extern const upb_MiniTable validate_SFixed32Rules_msginit; -extern const upb_MiniTable validate_SFixed64Rules_msginit; -extern const upb_MiniTable validate_BoolRules_msginit; -extern const upb_MiniTable validate_StringRules_msginit; -extern const upb_MiniTable validate_BytesRules_msginit; -extern const upb_MiniTable validate_EnumRules_msginit; -extern const upb_MiniTable validate_MessageRules_msginit; -extern const upb_MiniTable validate_RepeatedRules_msginit; -extern const upb_MiniTable validate_MapRules_msginit; -extern const upb_MiniTable validate_AnyRules_msginit; -extern const upb_MiniTable validate_DurationRules_msginit; -extern const upb_MiniTable validate_TimestampRules_msginit; -extern const upb_MiniTable_Extension validate_disabled_ext; -extern const upb_MiniTable_Extension validate_ignored_ext; -extern const upb_MiniTable_Extension validate_required_ext; -extern const upb_MiniTable_Extension validate_rules_ext; +extern const upb_MiniTable validate_FieldRules_msg_init; +extern const upb_MiniTable validate_FloatRules_msg_init; +extern const upb_MiniTable validate_DoubleRules_msg_init; +extern const upb_MiniTable validate_Int32Rules_msg_init; +extern const upb_MiniTable validate_Int64Rules_msg_init; +extern const upb_MiniTable validate_UInt32Rules_msg_init; +extern const upb_MiniTable validate_UInt64Rules_msg_init; +extern const upb_MiniTable validate_SInt32Rules_msg_init; +extern const upb_MiniTable validate_SInt64Rules_msg_init; +extern const upb_MiniTable validate_Fixed32Rules_msg_init; +extern const upb_MiniTable validate_Fixed64Rules_msg_init; +extern const upb_MiniTable validate_SFixed32Rules_msg_init; +extern const upb_MiniTable validate_SFixed64Rules_msg_init; +extern const upb_MiniTable validate_BoolRules_msg_init; +extern const upb_MiniTable validate_StringRules_msg_init; +extern const upb_MiniTable validate_BytesRules_msg_init; +extern const upb_MiniTable validate_EnumRules_msg_init; +extern const upb_MiniTable validate_MessageRules_msg_init; +extern const upb_MiniTable validate_RepeatedRules_msg_init; +extern const upb_MiniTable validate_MapRules_msg_init; +extern const upb_MiniTable validate_AnyRules_msg_init; +extern const upb_MiniTable validate_DurationRules_msg_init; +extern const upb_MiniTable validate_TimestampRules_msg_init; +extern const upb_MiniTableExtension validate_disabled_ext; +extern const upb_MiniTableExtension validate_ignored_ext; +extern const upb_MiniTableExtension validate_required_ext; +extern const upb_MiniTableExtension validate_rules_ext; struct google_protobuf_Duration; struct google_protobuf_FieldOptions; struct google_protobuf_MessageOptions; struct google_protobuf_OneofOptions; struct google_protobuf_Timestamp; -extern const upb_MiniTable google_protobuf_Duration_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable google_protobuf_OneofOptions_msginit; -extern const upb_MiniTable google_protobuf_Timestamp_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable google_protobuf_OneofOptions_msg_init; +extern const upb_MiniTable google_protobuf_Timestamp_msg_init; typedef enum { validate_UNKNOWN = 0, @@ -111,17 +93,17 @@ typedef enum { } validate_KnownRegex; -extern const upb_MiniTable_Enum validate_KnownRegex_enuminit; +extern const upb_MiniTableEnum validate_KnownRegex_enum_init; /* validate.FieldRules */ UPB_INLINE validate_FieldRules* validate_FieldRules_new(upb_Arena* arena) { - return (validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msginit, arena); + return (validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msg_init, arena); } UPB_INLINE validate_FieldRules* validate_FieldRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_FieldRules* ret = validate_FieldRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_FieldRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_FieldRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -131,7 +113,7 @@ UPB_INLINE validate_FieldRules* validate_FieldRules_parse_ex(const char* buf, si int options, upb_Arena* arena) { validate_FieldRules* ret = validate_FieldRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_FieldRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_FieldRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -139,13 +121,13 @@ UPB_INLINE validate_FieldRules* validate_FieldRules_parse_ex(const char* buf, si } UPB_INLINE char* validate_FieldRules_serialize(const validate_FieldRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_FieldRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_FieldRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_FieldRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_FieldRules_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -173,469 +155,601 @@ typedef enum { validate_FieldRules_type_NOT_SET = 0 } validate_FieldRules_type_oneofcases; UPB_INLINE validate_FieldRules_type_oneofcases validate_FieldRules_type_case(const validate_FieldRules* msg) { - return (validate_FieldRules_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (validate_FieldRules_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool validate_FieldRules_has_float(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void validate_FieldRules_clear_float(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_FloatRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_float(validate_FieldRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_FloatRules* validate_FieldRules_float(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_FloatRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL); + const validate_FloatRules* default_val = NULL; + const validate_FloatRules* ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_double(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool validate_FieldRules_has_float(const validate_FieldRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_double(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_DoubleRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_double(validate_FieldRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_DoubleRules* validate_FieldRules_double(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_DoubleRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const validate_DoubleRules* default_val = NULL; + const validate_DoubleRules* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_int32(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool validate_FieldRules_has_double(const validate_FieldRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_int32(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_Int32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_int32(validate_FieldRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_Int32Rules* validate_FieldRules_int32(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_Int32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const validate_Int32Rules* default_val = NULL; + const validate_Int32Rules* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_int64(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool validate_FieldRules_has_int32(const validate_FieldRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_int64(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_Int64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_int64(validate_FieldRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_Int64Rules* validate_FieldRules_int64(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_Int64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL); + const validate_Int64Rules* default_val = NULL; + const validate_Int64Rules* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_uint32(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool validate_FieldRules_has_int64(const validate_FieldRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_uint32(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_UInt32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_uint32(validate_FieldRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_UInt32Rules* validate_FieldRules_uint32(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_UInt32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL); + const validate_UInt32Rules* default_val = NULL; + const validate_UInt32Rules* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_uint64(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6; +UPB_INLINE bool validate_FieldRules_has_uint32(const validate_FieldRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_uint64(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_UInt64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_uint64(validate_FieldRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_UInt64Rules* validate_FieldRules_uint64(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_UInt64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 6, NULL); + const validate_UInt64Rules* default_val = NULL; + const validate_UInt64Rules* ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_sint32(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; +UPB_INLINE bool validate_FieldRules_has_uint64(const validate_FieldRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_sint32(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_SInt32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_sint32(validate_FieldRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_SInt32Rules* validate_FieldRules_sint32(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_SInt32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 7, NULL); + const validate_SInt32Rules* default_val = NULL; + const validate_SInt32Rules* ret; + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_sint64(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8; +UPB_INLINE bool validate_FieldRules_has_sint32(const validate_FieldRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_sint64(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_SInt64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_sint64(validate_FieldRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_SInt64Rules* validate_FieldRules_sint64(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_SInt64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 8, NULL); + const validate_SInt64Rules* default_val = NULL; + const validate_SInt64Rules* ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_fixed32(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 9; +UPB_INLINE bool validate_FieldRules_has_sint64(const validate_FieldRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_fixed32(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_Fixed32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_fixed32(validate_FieldRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_Fixed32Rules* validate_FieldRules_fixed32(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_Fixed32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 9, NULL); + const validate_Fixed32Rules* default_val = NULL; + const validate_Fixed32Rules* ret; + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_fixed64(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10; +UPB_INLINE bool validate_FieldRules_has_fixed32(const validate_FieldRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_fixed64(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_Fixed64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_fixed64(validate_FieldRules* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_Fixed64Rules* validate_FieldRules_fixed64(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_Fixed64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 10, NULL); + const validate_Fixed64Rules* default_val = NULL; + const validate_Fixed64Rules* ret; + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_sfixed32(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11; +UPB_INLINE bool validate_FieldRules_has_fixed64(const validate_FieldRules* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_sfixed32(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_SFixed32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_sfixed32(validate_FieldRules* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_SFixed32Rules* validate_FieldRules_sfixed32(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_SFixed32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 11, NULL); + const validate_SFixed32Rules* default_val = NULL; + const validate_SFixed32Rules* ret; + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_sfixed64(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12; +UPB_INLINE bool validate_FieldRules_has_sfixed32(const validate_FieldRules* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_sfixed64(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_SFixed64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_sfixed64(validate_FieldRules* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_SFixed64Rules* validate_FieldRules_sfixed64(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_SFixed64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 12, NULL); + const validate_SFixed64Rules* default_val = NULL; + const validate_SFixed64Rules* ret; + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_bool(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13; +UPB_INLINE bool validate_FieldRules_has_sfixed64(const validate_FieldRules* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_bool(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_BoolRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_bool(validate_FieldRules* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_BoolRules* validate_FieldRules_bool(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_BoolRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 13, NULL); + const validate_BoolRules* default_val = NULL; + const validate_BoolRules* ret; + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_string(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 14; +UPB_INLINE bool validate_FieldRules_has_bool(const validate_FieldRules* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_string(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_StringRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_string(validate_FieldRules* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_StringRules* validate_FieldRules_string(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_StringRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 14, NULL); + const validate_StringRules* default_val = NULL; + const validate_StringRules* ret; + const upb_MiniTableField field = {14, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_bytes(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 15; +UPB_INLINE bool validate_FieldRules_has_string(const validate_FieldRules* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_bytes(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_BytesRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_bytes(validate_FieldRules* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_BytesRules* validate_FieldRules_bytes(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_BytesRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 15, NULL); + const validate_BytesRules* default_val = NULL; + const validate_BytesRules* ret; + const upb_MiniTableField field = {15, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_enum(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 16; +UPB_INLINE bool validate_FieldRules_has_bytes(const validate_FieldRules* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_enum(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_EnumRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_enum(validate_FieldRules* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_EnumRules* validate_FieldRules_enum(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_EnumRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 16, NULL); + const validate_EnumRules* default_val = NULL; + const validate_EnumRules* ret; + const upb_MiniTableField field = {16, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_message(const validate_FieldRules* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool validate_FieldRules_has_enum(const validate_FieldRules* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_message(const validate_FieldRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void validate_FieldRules_clear_message(validate_FieldRules* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(4, 8), 1, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_MessageRules* validate_FieldRules_message(const validate_FieldRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const validate_MessageRules*); + const validate_MessageRules* default_val = NULL; + const validate_MessageRules* ret; + const upb_MiniTableField field = {17, UPB_SIZE(4, 8), 1, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_repeated(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 18; +UPB_INLINE bool validate_FieldRules_has_message(const validate_FieldRules* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(4, 8), 1, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_repeated(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_RepeatedRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_repeated(validate_FieldRules* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_RepeatedRules* validate_FieldRules_repeated(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_RepeatedRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 18, NULL); + const validate_RepeatedRules* default_val = NULL; + const validate_RepeatedRules* ret; + const upb_MiniTableField field = {18, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_map(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 19; +UPB_INLINE bool validate_FieldRules_has_repeated(const validate_FieldRules* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_map(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_MapRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_map(validate_FieldRules* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_MapRules* validate_FieldRules_map(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_MapRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 19, NULL); + const validate_MapRules* default_val = NULL; + const validate_MapRules* ret; + const upb_MiniTableField field = {19, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_any(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 20; +UPB_INLINE bool validate_FieldRules_has_map(const validate_FieldRules* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_any(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_AnyRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_any(validate_FieldRules* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_AnyRules* validate_FieldRules_any(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_AnyRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 20, NULL); + const validate_AnyRules* default_val = NULL; + const validate_AnyRules* ret; + const upb_MiniTableField field = {20, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_duration(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 21; +UPB_INLINE bool validate_FieldRules_has_any(const validate_FieldRules* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_duration(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_DurationRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_duration(validate_FieldRules* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_DurationRules* validate_FieldRules_duration(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_DurationRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 21, NULL); + const validate_DurationRules* default_val = NULL; + const validate_DurationRules* ret; + const upb_MiniTableField field = {21, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FieldRules_has_timestamp(const validate_FieldRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 22; +UPB_INLINE bool validate_FieldRules_has_duration(const validate_FieldRules* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FieldRules_clear_timestamp(const validate_FieldRules* msg) { - UPB_WRITE_ONEOF(msg, validate_TimestampRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET); +UPB_INLINE void validate_FieldRules_clear_timestamp(validate_FieldRules* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_TimestampRules* validate_FieldRules_timestamp(const validate_FieldRules* msg) { - return UPB_READ_ONEOF(msg, const validate_TimestampRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 22, NULL); + const validate_TimestampRules* default_val = NULL; + const validate_TimestampRules* ret; + const upb_MiniTableField field = {22, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_FieldRules_has_timestamp(const validate_FieldRules* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_FieldRules_set_float(validate_FieldRules *msg, validate_FloatRules* value) { - UPB_WRITE_ONEOF(msg, validate_FloatRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_FloatRules* validate_FieldRules_mutable_float(validate_FieldRules* msg, upb_Arena* arena) { struct validate_FloatRules* sub = (struct validate_FloatRules*)validate_FieldRules_float(msg); if (sub == NULL) { - sub = (struct validate_FloatRules*)_upb_Message_New(&validate_FloatRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_float(msg, sub); + sub = (struct validate_FloatRules*)_upb_Message_New(&validate_FloatRules_msg_init, arena); + if (sub) validate_FieldRules_set_float(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_double(validate_FieldRules *msg, validate_DoubleRules* value) { - UPB_WRITE_ONEOF(msg, validate_DoubleRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_DoubleRules* validate_FieldRules_mutable_double(validate_FieldRules* msg, upb_Arena* arena) { struct validate_DoubleRules* sub = (struct validate_DoubleRules*)validate_FieldRules_double(msg); if (sub == NULL) { - sub = (struct validate_DoubleRules*)_upb_Message_New(&validate_DoubleRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_double(msg, sub); + sub = (struct validate_DoubleRules*)_upb_Message_New(&validate_DoubleRules_msg_init, arena); + if (sub) validate_FieldRules_set_double(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_int32(validate_FieldRules *msg, validate_Int32Rules* value) { - UPB_WRITE_ONEOF(msg, validate_Int32Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_Int32Rules* validate_FieldRules_mutable_int32(validate_FieldRules* msg, upb_Arena* arena) { struct validate_Int32Rules* sub = (struct validate_Int32Rules*)validate_FieldRules_int32(msg); if (sub == NULL) { - sub = (struct validate_Int32Rules*)_upb_Message_New(&validate_Int32Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_int32(msg, sub); + sub = (struct validate_Int32Rules*)_upb_Message_New(&validate_Int32Rules_msg_init, arena); + if (sub) validate_FieldRules_set_int32(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_int64(validate_FieldRules *msg, validate_Int64Rules* value) { - UPB_WRITE_ONEOF(msg, validate_Int64Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_Int64Rules* validate_FieldRules_mutable_int64(validate_FieldRules* msg, upb_Arena* arena) { struct validate_Int64Rules* sub = (struct validate_Int64Rules*)validate_FieldRules_int64(msg); if (sub == NULL) { - sub = (struct validate_Int64Rules*)_upb_Message_New(&validate_Int64Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_int64(msg, sub); + sub = (struct validate_Int64Rules*)_upb_Message_New(&validate_Int64Rules_msg_init, arena); + if (sub) validate_FieldRules_set_int64(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_uint32(validate_FieldRules *msg, validate_UInt32Rules* value) { - UPB_WRITE_ONEOF(msg, validate_UInt32Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_UInt32Rules* validate_FieldRules_mutable_uint32(validate_FieldRules* msg, upb_Arena* arena) { struct validate_UInt32Rules* sub = (struct validate_UInt32Rules*)validate_FieldRules_uint32(msg); if (sub == NULL) { - sub = (struct validate_UInt32Rules*)_upb_Message_New(&validate_UInt32Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_uint32(msg, sub); + sub = (struct validate_UInt32Rules*)_upb_Message_New(&validate_UInt32Rules_msg_init, arena); + if (sub) validate_FieldRules_set_uint32(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_uint64(validate_FieldRules *msg, validate_UInt64Rules* value) { - UPB_WRITE_ONEOF(msg, validate_UInt64Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 6); + const upb_MiniTableField field = {6, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_UInt64Rules* validate_FieldRules_mutable_uint64(validate_FieldRules* msg, upb_Arena* arena) { struct validate_UInt64Rules* sub = (struct validate_UInt64Rules*)validate_FieldRules_uint64(msg); if (sub == NULL) { - sub = (struct validate_UInt64Rules*)_upb_Message_New(&validate_UInt64Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_uint64(msg, sub); + sub = (struct validate_UInt64Rules*)_upb_Message_New(&validate_UInt64Rules_msg_init, arena); + if (sub) validate_FieldRules_set_uint64(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_sint32(validate_FieldRules *msg, validate_SInt32Rules* value) { - UPB_WRITE_ONEOF(msg, validate_SInt32Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 6, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_SInt32Rules* validate_FieldRules_mutable_sint32(validate_FieldRules* msg, upb_Arena* arena) { struct validate_SInt32Rules* sub = (struct validate_SInt32Rules*)validate_FieldRules_sint32(msg); if (sub == NULL) { - sub = (struct validate_SInt32Rules*)_upb_Message_New(&validate_SInt32Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_sint32(msg, sub); + sub = (struct validate_SInt32Rules*)_upb_Message_New(&validate_SInt32Rules_msg_init, arena); + if (sub) validate_FieldRules_set_sint32(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_sint64(validate_FieldRules *msg, validate_SInt64Rules* value) { - UPB_WRITE_ONEOF(msg, validate_SInt64Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 8); + const upb_MiniTableField field = {8, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 7, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_SInt64Rules* validate_FieldRules_mutable_sint64(validate_FieldRules* msg, upb_Arena* arena) { struct validate_SInt64Rules* sub = (struct validate_SInt64Rules*)validate_FieldRules_sint64(msg); if (sub == NULL) { - sub = (struct validate_SInt64Rules*)_upb_Message_New(&validate_SInt64Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_sint64(msg, sub); + sub = (struct validate_SInt64Rules*)_upb_Message_New(&validate_SInt64Rules_msg_init, arena); + if (sub) validate_FieldRules_set_sint64(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_fixed32(validate_FieldRules *msg, validate_Fixed32Rules* value) { - UPB_WRITE_ONEOF(msg, validate_Fixed32Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 9); + const upb_MiniTableField field = {9, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 8, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_Fixed32Rules* validate_FieldRules_mutable_fixed32(validate_FieldRules* msg, upb_Arena* arena) { struct validate_Fixed32Rules* sub = (struct validate_Fixed32Rules*)validate_FieldRules_fixed32(msg); if (sub == NULL) { - sub = (struct validate_Fixed32Rules*)_upb_Message_New(&validate_Fixed32Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_fixed32(msg, sub); + sub = (struct validate_Fixed32Rules*)_upb_Message_New(&validate_Fixed32Rules_msg_init, arena); + if (sub) validate_FieldRules_set_fixed32(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_fixed64(validate_FieldRules *msg, validate_Fixed64Rules* value) { - UPB_WRITE_ONEOF(msg, validate_Fixed64Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 10); + const upb_MiniTableField field = {10, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 9, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_Fixed64Rules* validate_FieldRules_mutable_fixed64(validate_FieldRules* msg, upb_Arena* arena) { struct validate_Fixed64Rules* sub = (struct validate_Fixed64Rules*)validate_FieldRules_fixed64(msg); if (sub == NULL) { - sub = (struct validate_Fixed64Rules*)_upb_Message_New(&validate_Fixed64Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_fixed64(msg, sub); + sub = (struct validate_Fixed64Rules*)_upb_Message_New(&validate_Fixed64Rules_msg_init, arena); + if (sub) validate_FieldRules_set_fixed64(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_sfixed32(validate_FieldRules *msg, validate_SFixed32Rules* value) { - UPB_WRITE_ONEOF(msg, validate_SFixed32Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 11); + const upb_MiniTableField field = {11, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 10, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_SFixed32Rules* validate_FieldRules_mutable_sfixed32(validate_FieldRules* msg, upb_Arena* arena) { struct validate_SFixed32Rules* sub = (struct validate_SFixed32Rules*)validate_FieldRules_sfixed32(msg); if (sub == NULL) { - sub = (struct validate_SFixed32Rules*)_upb_Message_New(&validate_SFixed32Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_sfixed32(msg, sub); + sub = (struct validate_SFixed32Rules*)_upb_Message_New(&validate_SFixed32Rules_msg_init, arena); + if (sub) validate_FieldRules_set_sfixed32(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_sfixed64(validate_FieldRules *msg, validate_SFixed64Rules* value) { - UPB_WRITE_ONEOF(msg, validate_SFixed64Rules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 12); + const upb_MiniTableField field = {12, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 11, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_SFixed64Rules* validate_FieldRules_mutable_sfixed64(validate_FieldRules* msg, upb_Arena* arena) { struct validate_SFixed64Rules* sub = (struct validate_SFixed64Rules*)validate_FieldRules_sfixed64(msg); if (sub == NULL) { - sub = (struct validate_SFixed64Rules*)_upb_Message_New(&validate_SFixed64Rules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_sfixed64(msg, sub); + sub = (struct validate_SFixed64Rules*)_upb_Message_New(&validate_SFixed64Rules_msg_init, arena); + if (sub) validate_FieldRules_set_sfixed64(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_bool(validate_FieldRules *msg, validate_BoolRules* value) { - UPB_WRITE_ONEOF(msg, validate_BoolRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 13); + const upb_MiniTableField field = {13, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 12, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_BoolRules* validate_FieldRules_mutable_bool(validate_FieldRules* msg, upb_Arena* arena) { struct validate_BoolRules* sub = (struct validate_BoolRules*)validate_FieldRules_bool(msg); if (sub == NULL) { - sub = (struct validate_BoolRules*)_upb_Message_New(&validate_BoolRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_bool(msg, sub); + sub = (struct validate_BoolRules*)_upb_Message_New(&validate_BoolRules_msg_init, arena); + if (sub) validate_FieldRules_set_bool(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_string(validate_FieldRules *msg, validate_StringRules* value) { - UPB_WRITE_ONEOF(msg, validate_StringRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 14); + const upb_MiniTableField field = {14, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 13, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_StringRules* validate_FieldRules_mutable_string(validate_FieldRules* msg, upb_Arena* arena) { struct validate_StringRules* sub = (struct validate_StringRules*)validate_FieldRules_string(msg); if (sub == NULL) { - sub = (struct validate_StringRules*)_upb_Message_New(&validate_StringRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_string(msg, sub); + sub = (struct validate_StringRules*)_upb_Message_New(&validate_StringRules_msg_init, arena); + if (sub) validate_FieldRules_set_string(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_bytes(validate_FieldRules *msg, validate_BytesRules* value) { - UPB_WRITE_ONEOF(msg, validate_BytesRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 15); + const upb_MiniTableField field = {15, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 14, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_BytesRules* validate_FieldRules_mutable_bytes(validate_FieldRules* msg, upb_Arena* arena) { struct validate_BytesRules* sub = (struct validate_BytesRules*)validate_FieldRules_bytes(msg); if (sub == NULL) { - sub = (struct validate_BytesRules*)_upb_Message_New(&validate_BytesRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_bytes(msg, sub); + sub = (struct validate_BytesRules*)_upb_Message_New(&validate_BytesRules_msg_init, arena); + if (sub) validate_FieldRules_set_bytes(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_enum(validate_FieldRules *msg, validate_EnumRules* value) { - UPB_WRITE_ONEOF(msg, validate_EnumRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 16); + const upb_MiniTableField field = {16, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 15, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_EnumRules* validate_FieldRules_mutable_enum(validate_FieldRules* msg, upb_Arena* arena) { struct validate_EnumRules* sub = (struct validate_EnumRules*)validate_FieldRules_enum(msg); if (sub == NULL) { - sub = (struct validate_EnumRules*)_upb_Message_New(&validate_EnumRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_enum(msg, sub); + sub = (struct validate_EnumRules*)_upb_Message_New(&validate_EnumRules_msg_init, arena); + if (sub) validate_FieldRules_set_enum(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_message(validate_FieldRules *msg, validate_MessageRules* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), validate_MessageRules*) = value; + const upb_MiniTableField field = {17, UPB_SIZE(4, 8), 1, 16, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_MessageRules* validate_FieldRules_mutable_message(validate_FieldRules* msg, upb_Arena* arena) { struct validate_MessageRules* sub = (struct validate_MessageRules*)validate_FieldRules_message(msg); if (sub == NULL) { - sub = (struct validate_MessageRules*)_upb_Message_New(&validate_MessageRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_message(msg, sub); + sub = (struct validate_MessageRules*)_upb_Message_New(&validate_MessageRules_msg_init, arena); + if (sub) validate_FieldRules_set_message(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_repeated(validate_FieldRules *msg, validate_RepeatedRules* value) { - UPB_WRITE_ONEOF(msg, validate_RepeatedRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 18); + const upb_MiniTableField field = {18, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 17, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_RepeatedRules* validate_FieldRules_mutable_repeated(validate_FieldRules* msg, upb_Arena* arena) { struct validate_RepeatedRules* sub = (struct validate_RepeatedRules*)validate_FieldRules_repeated(msg); if (sub == NULL) { - sub = (struct validate_RepeatedRules*)_upb_Message_New(&validate_RepeatedRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_repeated(msg, sub); + sub = (struct validate_RepeatedRules*)_upb_Message_New(&validate_RepeatedRules_msg_init, arena); + if (sub) validate_FieldRules_set_repeated(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_map(validate_FieldRules *msg, validate_MapRules* value) { - UPB_WRITE_ONEOF(msg, validate_MapRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 19); + const upb_MiniTableField field = {19, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 18, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_MapRules* validate_FieldRules_mutable_map(validate_FieldRules* msg, upb_Arena* arena) { struct validate_MapRules* sub = (struct validate_MapRules*)validate_FieldRules_map(msg); if (sub == NULL) { - sub = (struct validate_MapRules*)_upb_Message_New(&validate_MapRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_map(msg, sub); + sub = (struct validate_MapRules*)_upb_Message_New(&validate_MapRules_msg_init, arena); + if (sub) validate_FieldRules_set_map(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_any(validate_FieldRules *msg, validate_AnyRules* value) { - UPB_WRITE_ONEOF(msg, validate_AnyRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 20); + const upb_MiniTableField field = {20, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 19, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_AnyRules* validate_FieldRules_mutable_any(validate_FieldRules* msg, upb_Arena* arena) { struct validate_AnyRules* sub = (struct validate_AnyRules*)validate_FieldRules_any(msg); if (sub == NULL) { - sub = (struct validate_AnyRules*)_upb_Message_New(&validate_AnyRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_any(msg, sub); + sub = (struct validate_AnyRules*)_upb_Message_New(&validate_AnyRules_msg_init, arena); + if (sub) validate_FieldRules_set_any(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_duration(validate_FieldRules *msg, validate_DurationRules* value) { - UPB_WRITE_ONEOF(msg, validate_DurationRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 21); + const upb_MiniTableField field = {21, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 20, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_DurationRules* validate_FieldRules_mutable_duration(validate_FieldRules* msg, upb_Arena* arena) { struct validate_DurationRules* sub = (struct validate_DurationRules*)validate_FieldRules_duration(msg); if (sub == NULL) { - sub = (struct validate_DurationRules*)_upb_Message_New(&validate_DurationRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_duration(msg, sub); + sub = (struct validate_DurationRules*)_upb_Message_New(&validate_DurationRules_msg_init, arena); + if (sub) validate_FieldRules_set_duration(msg, sub); } return sub; } UPB_INLINE void validate_FieldRules_set_timestamp(validate_FieldRules *msg, validate_TimestampRules* value) { - UPB_WRITE_ONEOF(msg, validate_TimestampRules*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 22); + const upb_MiniTableField field = {22, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 21, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_TimestampRules* validate_FieldRules_mutable_timestamp(validate_FieldRules* msg, upb_Arena* arena) { struct validate_TimestampRules* sub = (struct validate_TimestampRules*)validate_FieldRules_timestamp(msg); if (sub == NULL) { - sub = (struct validate_TimestampRules*)_upb_Message_New(&validate_TimestampRules_msginit, arena); - if (!sub) return NULL; - validate_FieldRules_set_timestamp(msg, sub); + sub = (struct validate_TimestampRules*)_upb_Message_New(&validate_TimestampRules_msg_init, arena); + if (sub) validate_FieldRules_set_timestamp(msg, sub); } return sub; } @@ -643,12 +757,12 @@ UPB_INLINE struct validate_TimestampRules* validate_FieldRules_mutable_timestamp /* validate.FloatRules */ UPB_INLINE validate_FloatRules* validate_FloatRules_new(upb_Arena* arena) { - return (validate_FloatRules*)_upb_Message_New(&validate_FloatRules_msginit, arena); + return (validate_FloatRules*)_upb_Message_New(&validate_FloatRules_msg_init, arena); } UPB_INLINE validate_FloatRules* validate_FloatRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_FloatRules* ret = validate_FloatRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_FloatRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_FloatRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -658,7 +772,7 @@ UPB_INLINE validate_FloatRules* validate_FloatRules_parse_ex(const char* buf, si int options, upb_Arena* arena) { validate_FloatRules* ret = validate_FloatRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_FloatRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_FloatRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -666,140 +780,228 @@ UPB_INLINE validate_FloatRules* validate_FloatRules_parse_ex(const char* buf, si } UPB_INLINE char* validate_FloatRules_serialize(const validate_FloatRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_FloatRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_FloatRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_FloatRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_FloatRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_FloatRules_has_const(const validate_FloatRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_FloatRules_clear_const(const validate_FloatRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_FloatRules_clear_const(validate_FloatRules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE float validate_FloatRules_const(const validate_FloatRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float); + float default_val = 0; + float ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FloatRules_has_lt(const validate_FloatRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_FloatRules_has_const(const validate_FloatRules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FloatRules_clear_lt(const validate_FloatRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_FloatRules_clear_lt(validate_FloatRules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE float validate_FloatRules_lt(const validate_FloatRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float); + float default_val = 0; + float ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FloatRules_has_lte(const validate_FloatRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_FloatRules_has_lt(const validate_FloatRules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FloatRules_clear_lte(const validate_FloatRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_FloatRules_clear_lte(validate_FloatRules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE float validate_FloatRules_lte(const validate_FloatRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float); + float default_val = 0; + float ret; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FloatRules_has_gt(const validate_FloatRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_FloatRules_has_lte(const validate_FloatRules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FloatRules_clear_gt(const validate_FloatRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_FloatRules_clear_gt(validate_FloatRules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE float validate_FloatRules_gt(const validate_FloatRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float); + float default_val = 0; + float ret; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_FloatRules_has_gte(const validate_FloatRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_FloatRules_has_gt(const validate_FloatRules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_FloatRules_clear_gte(const validate_FloatRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_FloatRules_clear_gte(validate_FloatRules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE float validate_FloatRules_gte(const validate_FloatRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float); + float default_val = 0; + float ret; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_FloatRules_clear_in(const validate_FloatRules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 32)); +UPB_INLINE bool validate_FloatRules_has_gte(const validate_FloatRules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE float const* validate_FloatRules_in(const validate_FloatRules* msg, size_t* len) { - return (float const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE void validate_FloatRules_clear_in(validate_FloatRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_FloatRules_clear_not_in(const validate_FloatRules* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 40)); +UPB_INLINE float const* validate_FloatRules_in(const validate_FloatRules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (float const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE float const* validate_FloatRules_not_in(const validate_FloatRules* msg, size_t* len) { - return (float const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE bool validate_FloatRules_has_in(const validate_FloatRules* msg) { + size_t size; + validate_FloatRules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_FloatRules_has_ignore_empty(const validate_FloatRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_FloatRules_clear_not_in(validate_FloatRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_FloatRules_clear_ignore_empty(const validate_FloatRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE float const* validate_FloatRules_not_in(const validate_FloatRules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (float const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_FloatRules_has_not_in(const validate_FloatRules* msg) { + size_t size; + validate_FloatRules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_FloatRules_clear_ignore_empty(validate_FloatRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_FloatRules_ignore_empty(const validate_FloatRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_FloatRules_has_ignore_empty(const validate_FloatRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_FloatRules_set_const(validate_FloatRules *msg, float value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_FloatRules_set_lt(validate_FloatRules *msg, float value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_FloatRules_set_lte(validate_FloatRules *msg, float value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float) = value; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_FloatRules_set_gt(validate_FloatRules *msg, float value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float) = value; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_FloatRules_set_gte(validate_FloatRules *msg, float value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float) = value; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE float* validate_FloatRules_mutable_in(validate_FloatRules* msg, size_t* len) { - return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE float* validate_FloatRules_mutable_in(validate_FloatRules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (float*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE float* validate_FloatRules_resize_in(validate_FloatRules* msg, size_t len, upb_Arena* arena) { - return (float*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena); +UPB_INLINE float* validate_FloatRules_resize_in(validate_FloatRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (float*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_FloatRules_add_in(validate_FloatRules* msg, float val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE float* validate_FloatRules_mutable_not_in(validate_FloatRules* msg, size_t* len) { - return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE float* validate_FloatRules_mutable_not_in(validate_FloatRules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (float*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE float* validate_FloatRules_resize_not_in(validate_FloatRules* msg, size_t len, upb_Arena* arena) { - return (float*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena); +UPB_INLINE float* validate_FloatRules_resize_not_in(validate_FloatRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (float*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_FloatRules_add_not_in(validate_FloatRules* msg, float val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 2, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_FloatRules_set_ignore_empty(validate_FloatRules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.DoubleRules */ UPB_INLINE validate_DoubleRules* validate_DoubleRules_new(upb_Arena* arena) { - return (validate_DoubleRules*)_upb_Message_New(&validate_DoubleRules_msginit, arena); + return (validate_DoubleRules*)_upb_Message_New(&validate_DoubleRules_msg_init, arena); } UPB_INLINE validate_DoubleRules* validate_DoubleRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_DoubleRules* ret = validate_DoubleRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_DoubleRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_DoubleRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -809,7 +1011,7 @@ UPB_INLINE validate_DoubleRules* validate_DoubleRules_parse_ex(const char* buf, int options, upb_Arena* arena) { validate_DoubleRules* ret = validate_DoubleRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_DoubleRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_DoubleRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -817,140 +1019,228 @@ UPB_INLINE validate_DoubleRules* validate_DoubleRules_parse_ex(const char* buf, } UPB_INLINE char* validate_DoubleRules_serialize(const validate_DoubleRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_DoubleRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_DoubleRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_DoubleRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_DoubleRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_DoubleRules_has_const(const validate_DoubleRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_DoubleRules_clear_const(const validate_DoubleRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_DoubleRules_clear_const(validate_DoubleRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double validate_DoubleRules_const(const validate_DoubleRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DoubleRules_has_lt(const validate_DoubleRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_DoubleRules_has_const(const validate_DoubleRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DoubleRules_clear_lt(const validate_DoubleRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_DoubleRules_clear_lt(validate_DoubleRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double validate_DoubleRules_lt(const validate_DoubleRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DoubleRules_has_lte(const validate_DoubleRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_DoubleRules_has_lt(const validate_DoubleRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DoubleRules_clear_lte(const validate_DoubleRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), double) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_DoubleRules_clear_lte(validate_DoubleRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double validate_DoubleRules_lte(const validate_DoubleRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DoubleRules_has_gt(const validate_DoubleRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_DoubleRules_has_lte(const validate_DoubleRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DoubleRules_clear_gt(const validate_DoubleRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_DoubleRules_clear_gt(validate_DoubleRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double validate_DoubleRules_gt(const validate_DoubleRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DoubleRules_has_gte(const validate_DoubleRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_DoubleRules_has_gt(const validate_DoubleRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DoubleRules_clear_gte(const validate_DoubleRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_DoubleRules_clear_gte(validate_DoubleRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double validate_DoubleRules_gte(const validate_DoubleRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_DoubleRules_clear_in(const validate_DoubleRules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_DoubleRules_has_gte(const validate_DoubleRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE double const* validate_DoubleRules_in(const validate_DoubleRules* msg, size_t* len) { - return (double const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_DoubleRules_clear_in(validate_DoubleRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_DoubleRules_clear_not_in(const validate_DoubleRules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE double const* validate_DoubleRules_in(const validate_DoubleRules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (double const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE double const* validate_DoubleRules_not_in(const validate_DoubleRules* msg, size_t* len) { - return (double const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_DoubleRules_has_in(const validate_DoubleRules* msg) { + size_t size; + validate_DoubleRules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_DoubleRules_has_ignore_empty(const validate_DoubleRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_DoubleRules_clear_not_in(validate_DoubleRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_DoubleRules_clear_ignore_empty(const validate_DoubleRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE double const* validate_DoubleRules_not_in(const validate_DoubleRules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (double const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_DoubleRules_has_not_in(const validate_DoubleRules* msg) { + size_t size; + validate_DoubleRules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_DoubleRules_clear_ignore_empty(validate_DoubleRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_DoubleRules_ignore_empty(const validate_DoubleRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_DoubleRules_has_ignore_empty(const validate_DoubleRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_DoubleRules_set_const(validate_DoubleRules *msg, double value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_DoubleRules_set_lt(validate_DoubleRules *msg, double value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_DoubleRules_set_lte(validate_DoubleRules *msg, double value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), double) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_DoubleRules_set_gt(validate_DoubleRules *msg, double value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_DoubleRules_set_gte(validate_DoubleRules *msg, double value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double) = value; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE double* validate_DoubleRules_mutable_in(validate_DoubleRules* msg, size_t* len) { - return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE double* validate_DoubleRules_mutable_in(validate_DoubleRules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (double*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE double* validate_DoubleRules_resize_in(validate_DoubleRules* msg, size_t len, upb_Arena* arena) { - return (double*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena); +UPB_INLINE double* validate_DoubleRules_resize_in(validate_DoubleRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (double*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_DoubleRules_add_in(validate_DoubleRules* msg, double val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE double* validate_DoubleRules_mutable_not_in(validate_DoubleRules* msg, size_t* len) { - return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE double* validate_DoubleRules_mutable_not_in(validate_DoubleRules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (double*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE double* validate_DoubleRules_resize_not_in(validate_DoubleRules* msg, size_t len, upb_Arena* arena) { - return (double*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE double* validate_DoubleRules_resize_not_in(validate_DoubleRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (double*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_DoubleRules_add_not_in(validate_DoubleRules* msg, double val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 1, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_DoubleRules_set_ignore_empty(validate_DoubleRules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.Int32Rules */ UPB_INLINE validate_Int32Rules* validate_Int32Rules_new(upb_Arena* arena) { - return (validate_Int32Rules*)_upb_Message_New(&validate_Int32Rules_msginit, arena); + return (validate_Int32Rules*)_upb_Message_New(&validate_Int32Rules_msg_init, arena); } UPB_INLINE validate_Int32Rules* validate_Int32Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_Int32Rules* ret = validate_Int32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Int32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_Int32Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -960,7 +1250,7 @@ UPB_INLINE validate_Int32Rules* validate_Int32Rules_parse_ex(const char* buf, si int options, upb_Arena* arena) { validate_Int32Rules* ret = validate_Int32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Int32Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_Int32Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -968,140 +1258,228 @@ UPB_INLINE validate_Int32Rules* validate_Int32Rules_parse_ex(const char* buf, si } UPB_INLINE char* validate_Int32Rules_serialize(const validate_Int32Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_Int32Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Int32Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_Int32Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Int32Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_Int32Rules_has_const(const validate_Int32Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_Int32Rules_clear_const(const validate_Int32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_Int32Rules_clear_const(validate_Int32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_Int32Rules_const(const validate_Int32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int32Rules_has_lt(const validate_Int32Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_Int32Rules_has_const(const validate_Int32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int32Rules_clear_lt(const validate_Int32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_Int32Rules_clear_lt(validate_Int32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_Int32Rules_lt(const validate_Int32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int32Rules_has_lte(const validate_Int32Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_Int32Rules_has_lt(const validate_Int32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int32Rules_clear_lte(const validate_Int32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_Int32Rules_clear_lte(validate_Int32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_Int32Rules_lte(const validate_Int32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int32Rules_has_gt(const validate_Int32Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_Int32Rules_has_lte(const validate_Int32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int32Rules_clear_gt(const validate_Int32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_Int32Rules_clear_gt(validate_Int32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_Int32Rules_gt(const validate_Int32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int32Rules_has_gte(const validate_Int32Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_Int32Rules_has_gt(const validate_Int32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int32Rules_clear_gte(const validate_Int32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_Int32Rules_clear_gte(validate_Int32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_Int32Rules_gte(const validate_Int32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_Int32Rules_clear_in(const validate_Int32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 32)); +UPB_INLINE bool validate_Int32Rules_has_gte(const validate_Int32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* validate_Int32Rules_in(const validate_Int32Rules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE void validate_Int32Rules_clear_in(validate_Int32Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int32Rules_clear_not_in(const validate_Int32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 40)); +UPB_INLINE int32_t const* validate_Int32Rules_in(const validate_Int32Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t const* validate_Int32Rules_not_in(const validate_Int32Rules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE bool validate_Int32Rules_has_in(const validate_Int32Rules* msg) { + size_t size; + validate_Int32Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_Int32Rules_has_ignore_empty(const validate_Int32Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_Int32Rules_clear_not_in(validate_Int32Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int32Rules_clear_ignore_empty(const validate_Int32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE int32_t const* validate_Int32Rules_not_in(const validate_Int32Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_Int32Rules_has_not_in(const validate_Int32Rules* msg) { + size_t size; + validate_Int32Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_Int32Rules_clear_ignore_empty(validate_Int32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_Int32Rules_ignore_empty(const validate_Int32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_Int32Rules_has_ignore_empty(const validate_Int32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_Int32Rules_set_const(validate_Int32Rules *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int32Rules_set_lt(validate_Int32Rules *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int32Rules_set_lte(validate_Int32Rules *msg, int32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int32Rules_set_gt(validate_Int32Rules *msg, int32_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int32Rules_set_gte(validate_Int32Rules *msg, int32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* validate_Int32Rules_mutable_in(validate_Int32Rules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE int32_t* validate_Int32Rules_mutable_in(validate_Int32Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_Int32Rules_resize_in(validate_Int32Rules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena); +UPB_INLINE int32_t* validate_Int32Rules_resize_in(validate_Int32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Int32Rules_add_in(validate_Int32Rules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* validate_Int32Rules_mutable_not_in(validate_Int32Rules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE int32_t* validate_Int32Rules_mutable_not_in(validate_Int32Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_Int32Rules_resize_not_in(validate_Int32Rules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena); +UPB_INLINE int32_t* validate_Int32Rules_resize_not_in(validate_Int32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Int32Rules_add_not_in(validate_Int32Rules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_Int32Rules_set_ignore_empty(validate_Int32Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.Int64Rules */ UPB_INLINE validate_Int64Rules* validate_Int64Rules_new(upb_Arena* arena) { - return (validate_Int64Rules*)_upb_Message_New(&validate_Int64Rules_msginit, arena); + return (validate_Int64Rules*)_upb_Message_New(&validate_Int64Rules_msg_init, arena); } UPB_INLINE validate_Int64Rules* validate_Int64Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_Int64Rules* ret = validate_Int64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Int64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_Int64Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1111,7 +1489,7 @@ UPB_INLINE validate_Int64Rules* validate_Int64Rules_parse_ex(const char* buf, si int options, upb_Arena* arena) { validate_Int64Rules* ret = validate_Int64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Int64Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_Int64Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1119,140 +1497,228 @@ UPB_INLINE validate_Int64Rules* validate_Int64Rules_parse_ex(const char* buf, si } UPB_INLINE char* validate_Int64Rules_serialize(const validate_Int64Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_Int64Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Int64Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_Int64Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Int64Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_Int64Rules_has_const(const validate_Int64Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_Int64Rules_clear_const(const validate_Int64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_Int64Rules_clear_const(validate_Int64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_Int64Rules_const(const validate_Int64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int64Rules_has_lt(const validate_Int64Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_Int64Rules_has_const(const validate_Int64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int64Rules_clear_lt(const validate_Int64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_Int64Rules_clear_lt(validate_Int64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_Int64Rules_lt(const validate_Int64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int64Rules_has_lte(const validate_Int64Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_Int64Rules_has_lt(const validate_Int64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int64Rules_clear_lte(const validate_Int64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_Int64Rules_clear_lte(validate_Int64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_Int64Rules_lte(const validate_Int64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int64Rules_has_gt(const validate_Int64Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_Int64Rules_has_lte(const validate_Int64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int64Rules_clear_gt(const validate_Int64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_Int64Rules_clear_gt(validate_Int64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_Int64Rules_gt(const validate_Int64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Int64Rules_has_gte(const validate_Int64Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_Int64Rules_has_gt(const validate_Int64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int64Rules_clear_gte(const validate_Int64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_Int64Rules_clear_gte(validate_Int64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_Int64Rules_gte(const validate_Int64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_Int64Rules_clear_in(const validate_Int64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_Int64Rules_has_gte(const validate_Int64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int64_t const* validate_Int64Rules_in(const validate_Int64Rules* msg, size_t* len) { - return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_Int64Rules_clear_in(validate_Int64Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int64Rules_clear_not_in(const validate_Int64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE int64_t const* validate_Int64Rules_in(const validate_Int64Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t const* validate_Int64Rules_not_in(const validate_Int64Rules* msg, size_t* len) { - return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_Int64Rules_has_in(const validate_Int64Rules* msg) { + size_t size; + validate_Int64Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_Int64Rules_has_ignore_empty(const validate_Int64Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_Int64Rules_clear_not_in(validate_Int64Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Int64Rules_clear_ignore_empty(const validate_Int64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE int64_t const* validate_Int64Rules_not_in(const validate_Int64Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_Int64Rules_has_not_in(const validate_Int64Rules* msg) { + size_t size; + validate_Int64Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_Int64Rules_clear_ignore_empty(validate_Int64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_Int64Rules_ignore_empty(const validate_Int64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_Int64Rules_has_ignore_empty(const validate_Int64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_Int64Rules_set_const(validate_Int64Rules *msg, int64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int64Rules_set_lt(validate_Int64Rules *msg, int64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int64Rules_set_lte(validate_Int64Rules *msg, int64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int64Rules_set_gt(validate_Int64Rules *msg, int64_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Int64Rules_set_gte(validate_Int64Rules *msg, int64_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int64_t* validate_Int64Rules_mutable_in(validate_Int64Rules* msg, size_t* len) { - return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int64_t* validate_Int64Rules_mutable_in(validate_Int64Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t* validate_Int64Rules_resize_in(validate_Int64Rules* msg, size_t len, upb_Arena* arena) { - return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena); +UPB_INLINE int64_t* validate_Int64Rules_resize_in(validate_Int64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Int64Rules_add_in(validate_Int64Rules* msg, int64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int64_t* validate_Int64Rules_mutable_not_in(validate_Int64Rules* msg, size_t* len) { - return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE int64_t* validate_Int64Rules_mutable_not_in(validate_Int64Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t* validate_Int64Rules_resize_not_in(validate_Int64Rules* msg, size_t len, upb_Arena* arena) { - return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE int64_t* validate_Int64Rules_resize_not_in(validate_Int64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Int64Rules_add_not_in(validate_Int64Rules* msg, int64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 3, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_Int64Rules_set_ignore_empty(validate_Int64Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.UInt32Rules */ UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_new(upb_Arena* arena) { - return (validate_UInt32Rules*)_upb_Message_New(&validate_UInt32Rules_msginit, arena); + return (validate_UInt32Rules*)_upb_Message_New(&validate_UInt32Rules_msg_init, arena); } UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_UInt32Rules* ret = validate_UInt32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_UInt32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_UInt32Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1262,7 +1728,7 @@ UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_parse_ex(const char* buf, int options, upb_Arena* arena) { validate_UInt32Rules* ret = validate_UInt32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_UInt32Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_UInt32Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1270,140 +1736,228 @@ UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_parse_ex(const char* buf, } UPB_INLINE char* validate_UInt32Rules_serialize(const validate_UInt32Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_UInt32Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_UInt32Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_UInt32Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_UInt32Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_UInt32Rules_has_const(const validate_UInt32Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_UInt32Rules_clear_const(const validate_UInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_UInt32Rules_clear_const(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_UInt32Rules_const(const validate_UInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt32Rules_has_lt(const validate_UInt32Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_UInt32Rules_has_const(const validate_UInt32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt32Rules_clear_lt(const validate_UInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_UInt32Rules_clear_lt(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_UInt32Rules_lt(const validate_UInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt32Rules_has_lte(const validate_UInt32Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_UInt32Rules_has_lt(const validate_UInt32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt32Rules_clear_lte(const validate_UInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_UInt32Rules_clear_lte(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_UInt32Rules_lte(const validate_UInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt32Rules_has_gt(const validate_UInt32Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_UInt32Rules_has_lte(const validate_UInt32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt32Rules_clear_gt(const validate_UInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_UInt32Rules_clear_gt(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_UInt32Rules_gt(const validate_UInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt32Rules_has_gte(const validate_UInt32Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_UInt32Rules_has_gt(const validate_UInt32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt32Rules_clear_gte(const validate_UInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_UInt32Rules_clear_gte(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_UInt32Rules_gte(const validate_UInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_UInt32Rules_clear_in(const validate_UInt32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 32)); +UPB_INLINE bool validate_UInt32Rules_has_gte(const validate_UInt32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE uint32_t const* validate_UInt32Rules_in(const validate_UInt32Rules* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE void validate_UInt32Rules_clear_in(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt32Rules_clear_not_in(const validate_UInt32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 40)); +UPB_INLINE uint32_t const* validate_UInt32Rules_in(const validate_UInt32Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t const* validate_UInt32Rules_not_in(const validate_UInt32Rules* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE bool validate_UInt32Rules_has_in(const validate_UInt32Rules* msg) { + size_t size; + validate_UInt32Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_UInt32Rules_has_ignore_empty(const validate_UInt32Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_UInt32Rules_clear_not_in(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt32Rules_clear_ignore_empty(const validate_UInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE uint32_t const* validate_UInt32Rules_not_in(const validate_UInt32Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_UInt32Rules_has_not_in(const validate_UInt32Rules* msg) { + size_t size; + validate_UInt32Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_UInt32Rules_clear_ignore_empty(validate_UInt32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_UInt32Rules_ignore_empty(const validate_UInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_UInt32Rules_has_ignore_empty(const validate_UInt32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_UInt32Rules_set_const(validate_UInt32Rules *msg, uint32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt32Rules_set_lt(validate_UInt32Rules *msg, uint32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt32Rules_set_lte(validate_UInt32Rules *msg, uint32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt32Rules_set_gt(validate_UInt32Rules *msg, uint32_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt32Rules_set_gte(validate_UInt32Rules *msg, uint32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE uint32_t* validate_UInt32Rules_mutable_in(validate_UInt32Rules* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE uint32_t* validate_UInt32Rules_mutable_in(validate_UInt32Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* validate_UInt32Rules_resize_in(validate_UInt32Rules* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena); +UPB_INLINE uint32_t* validate_UInt32Rules_resize_in(validate_UInt32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_UInt32Rules_add_in(validate_UInt32Rules* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE uint32_t* validate_UInt32Rules_mutable_not_in(validate_UInt32Rules* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE uint32_t* validate_UInt32Rules_mutable_not_in(validate_UInt32Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* validate_UInt32Rules_resize_not_in(validate_UInt32Rules* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena); +UPB_INLINE uint32_t* validate_UInt32Rules_resize_not_in(validate_UInt32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_UInt32Rules_add_not_in(validate_UInt32Rules* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 13, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_UInt32Rules_set_ignore_empty(validate_UInt32Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.UInt64Rules */ UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_new(upb_Arena* arena) { - return (validate_UInt64Rules*)_upb_Message_New(&validate_UInt64Rules_msginit, arena); + return (validate_UInt64Rules*)_upb_Message_New(&validate_UInt64Rules_msg_init, arena); } UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_UInt64Rules* ret = validate_UInt64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_UInt64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_UInt64Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1413,7 +1967,7 @@ UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_parse_ex(const char* buf, int options, upb_Arena* arena) { validate_UInt64Rules* ret = validate_UInt64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_UInt64Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_UInt64Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1421,140 +1975,228 @@ UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_parse_ex(const char* buf, } UPB_INLINE char* validate_UInt64Rules_serialize(const validate_UInt64Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_UInt64Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_UInt64Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_UInt64Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_UInt64Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_UInt64Rules_has_const(const validate_UInt64Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_UInt64Rules_clear_const(const validate_UInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_UInt64Rules_clear_const(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_UInt64Rules_const(const validate_UInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt64Rules_has_lt(const validate_UInt64Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_UInt64Rules_has_const(const validate_UInt64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt64Rules_clear_lt(const validate_UInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_UInt64Rules_clear_lt(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_UInt64Rules_lt(const validate_UInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt64Rules_has_lte(const validate_UInt64Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_UInt64Rules_has_lt(const validate_UInt64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt64Rules_clear_lte(const validate_UInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_UInt64Rules_clear_lte(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_UInt64Rules_lte(const validate_UInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt64Rules_has_gt(const validate_UInt64Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_UInt64Rules_has_lte(const validate_UInt64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt64Rules_clear_gt(const validate_UInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_UInt64Rules_clear_gt(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_UInt64Rules_gt(const validate_UInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_UInt64Rules_has_gte(const validate_UInt64Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_UInt64Rules_has_gt(const validate_UInt64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt64Rules_clear_gte(const validate_UInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_UInt64Rules_clear_gte(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_UInt64Rules_gte(const validate_UInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_UInt64Rules_clear_in(const validate_UInt64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_UInt64Rules_has_gte(const validate_UInt64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE uint64_t const* validate_UInt64Rules_in(const validate_UInt64Rules* msg, size_t* len) { - return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_UInt64Rules_clear_in(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt64Rules_clear_not_in(const validate_UInt64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE uint64_t const* validate_UInt64Rules_in(const validate_UInt64Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint64_t const* validate_UInt64Rules_not_in(const validate_UInt64Rules* msg, size_t* len) { - return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_UInt64Rules_has_in(const validate_UInt64Rules* msg) { + size_t size; + validate_UInt64Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_UInt64Rules_has_ignore_empty(const validate_UInt64Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_UInt64Rules_clear_not_in(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_UInt64Rules_clear_ignore_empty(const validate_UInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE uint64_t const* validate_UInt64Rules_not_in(const validate_UInt64Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_UInt64Rules_has_not_in(const validate_UInt64Rules* msg) { + size_t size; + validate_UInt64Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_UInt64Rules_clear_ignore_empty(validate_UInt64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_UInt64Rules_ignore_empty(const validate_UInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_UInt64Rules_has_ignore_empty(const validate_UInt64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_UInt64Rules_set_const(validate_UInt64Rules *msg, uint64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt64Rules_set_lt(validate_UInt64Rules *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt64Rules_set_lte(validate_UInt64Rules *msg, uint64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt64Rules_set_gt(validate_UInt64Rules *msg, uint64_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_UInt64Rules_set_gte(validate_UInt64Rules *msg, uint64_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE uint64_t* validate_UInt64Rules_mutable_in(validate_UInt64Rules* msg, size_t* len) { - return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE uint64_t* validate_UInt64Rules_mutable_in(validate_UInt64Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint64_t* validate_UInt64Rules_resize_in(validate_UInt64Rules* msg, size_t len, upb_Arena* arena) { - return (uint64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena); +UPB_INLINE uint64_t* validate_UInt64Rules_resize_in(validate_UInt64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_UInt64Rules_add_in(validate_UInt64Rules* msg, uint64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE uint64_t* validate_UInt64Rules_mutable_not_in(validate_UInt64Rules* msg, size_t* len) { - return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE uint64_t* validate_UInt64Rules_mutable_not_in(validate_UInt64Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint64_t* validate_UInt64Rules_resize_not_in(validate_UInt64Rules* msg, size_t len, upb_Arena* arena) { - return (uint64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE uint64_t* validate_UInt64Rules_resize_not_in(validate_UInt64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_UInt64Rules_add_not_in(validate_UInt64Rules* msg, uint64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 4, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_UInt64Rules_set_ignore_empty(validate_UInt64Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.SInt32Rules */ UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_new(upb_Arena* arena) { - return (validate_SInt32Rules*)_upb_Message_New(&validate_SInt32Rules_msginit, arena); + return (validate_SInt32Rules*)_upb_Message_New(&validate_SInt32Rules_msg_init, arena); } UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_SInt32Rules* ret = validate_SInt32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SInt32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_SInt32Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1564,7 +2206,7 @@ UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_parse_ex(const char* buf, int options, upb_Arena* arena) { validate_SInt32Rules* ret = validate_SInt32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SInt32Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_SInt32Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1572,140 +2214,228 @@ UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_parse_ex(const char* buf, } UPB_INLINE char* validate_SInt32Rules_serialize(const validate_SInt32Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_SInt32Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SInt32Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_SInt32Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SInt32Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_SInt32Rules_has_const(const validate_SInt32Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_SInt32Rules_clear_const(const validate_SInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_SInt32Rules_clear_const(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SInt32Rules_const(const validate_SInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt32Rules_has_lt(const validate_SInt32Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_SInt32Rules_has_const(const validate_SInt32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt32Rules_clear_lt(const validate_SInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_SInt32Rules_clear_lt(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SInt32Rules_lt(const validate_SInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt32Rules_has_lte(const validate_SInt32Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_SInt32Rules_has_lt(const validate_SInt32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt32Rules_clear_lte(const validate_SInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_SInt32Rules_clear_lte(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SInt32Rules_lte(const validate_SInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt32Rules_has_gt(const validate_SInt32Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_SInt32Rules_has_lte(const validate_SInt32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt32Rules_clear_gt(const validate_SInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_SInt32Rules_clear_gt(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SInt32Rules_gt(const validate_SInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt32Rules_has_gte(const validate_SInt32Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_SInt32Rules_has_gt(const validate_SInt32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt32Rules_clear_gte(const validate_SInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_SInt32Rules_clear_gte(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SInt32Rules_gte(const validate_SInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_SInt32Rules_clear_in(const validate_SInt32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 32)); +UPB_INLINE bool validate_SInt32Rules_has_gte(const validate_SInt32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* validate_SInt32Rules_in(const validate_SInt32Rules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE void validate_SInt32Rules_clear_in(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt32Rules_clear_not_in(const validate_SInt32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 40)); +UPB_INLINE int32_t const* validate_SInt32Rules_in(const validate_SInt32Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t const* validate_SInt32Rules_not_in(const validate_SInt32Rules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE bool validate_SInt32Rules_has_in(const validate_SInt32Rules* msg) { + size_t size; + validate_SInt32Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_SInt32Rules_has_ignore_empty(const validate_SInt32Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_SInt32Rules_clear_not_in(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt32Rules_clear_ignore_empty(const validate_SInt32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE int32_t const* validate_SInt32Rules_not_in(const validate_SInt32Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_SInt32Rules_has_not_in(const validate_SInt32Rules* msg) { + size_t size; + validate_SInt32Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_SInt32Rules_clear_ignore_empty(validate_SInt32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_SInt32Rules_ignore_empty(const validate_SInt32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_SInt32Rules_has_ignore_empty(const validate_SInt32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_SInt32Rules_set_const(validate_SInt32Rules *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt32Rules_set_lt(validate_SInt32Rules *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt32Rules_set_lte(validate_SInt32Rules *msg, int32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt32Rules_set_gt(validate_SInt32Rules *msg, int32_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt32Rules_set_gte(validate_SInt32Rules *msg, int32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* validate_SInt32Rules_mutable_in(validate_SInt32Rules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE int32_t* validate_SInt32Rules_mutable_in(validate_SInt32Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_SInt32Rules_resize_in(validate_SInt32Rules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena); +UPB_INLINE int32_t* validate_SInt32Rules_resize_in(validate_SInt32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SInt32Rules_add_in(validate_SInt32Rules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* validate_SInt32Rules_mutable_not_in(validate_SInt32Rules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE int32_t* validate_SInt32Rules_mutable_not_in(validate_SInt32Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_SInt32Rules_resize_not_in(validate_SInt32Rules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena); +UPB_INLINE int32_t* validate_SInt32Rules_resize_not_in(validate_SInt32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SInt32Rules_add_not_in(validate_SInt32Rules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 17, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_SInt32Rules_set_ignore_empty(validate_SInt32Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.SInt64Rules */ UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_new(upb_Arena* arena) { - return (validate_SInt64Rules*)_upb_Message_New(&validate_SInt64Rules_msginit, arena); + return (validate_SInt64Rules*)_upb_Message_New(&validate_SInt64Rules_msg_init, arena); } UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_SInt64Rules* ret = validate_SInt64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SInt64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_SInt64Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1715,7 +2445,7 @@ UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_parse_ex(const char* buf, int options, upb_Arena* arena) { validate_SInt64Rules* ret = validate_SInt64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SInt64Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_SInt64Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1723,140 +2453,228 @@ UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_parse_ex(const char* buf, } UPB_INLINE char* validate_SInt64Rules_serialize(const validate_SInt64Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_SInt64Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SInt64Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_SInt64Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SInt64Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_SInt64Rules_has_const(const validate_SInt64Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_SInt64Rules_clear_const(const validate_SInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_SInt64Rules_clear_const(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SInt64Rules_const(const validate_SInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt64Rules_has_lt(const validate_SInt64Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_SInt64Rules_has_const(const validate_SInt64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt64Rules_clear_lt(const validate_SInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_SInt64Rules_clear_lt(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SInt64Rules_lt(const validate_SInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt64Rules_has_lte(const validate_SInt64Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_SInt64Rules_has_lt(const validate_SInt64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt64Rules_clear_lte(const validate_SInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_SInt64Rules_clear_lte(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SInt64Rules_lte(const validate_SInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt64Rules_has_gt(const validate_SInt64Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_SInt64Rules_has_lte(const validate_SInt64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt64Rules_clear_gt(const validate_SInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_SInt64Rules_clear_gt(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SInt64Rules_gt(const validate_SInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SInt64Rules_has_gte(const validate_SInt64Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_SInt64Rules_has_gt(const validate_SInt64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt64Rules_clear_gte(const validate_SInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_SInt64Rules_clear_gte(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SInt64Rules_gte(const validate_SInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_SInt64Rules_clear_in(const validate_SInt64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_SInt64Rules_has_gte(const validate_SInt64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int64_t const* validate_SInt64Rules_in(const validate_SInt64Rules* msg, size_t* len) { - return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_SInt64Rules_clear_in(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt64Rules_clear_not_in(const validate_SInt64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE int64_t const* validate_SInt64Rules_in(const validate_SInt64Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t const* validate_SInt64Rules_not_in(const validate_SInt64Rules* msg, size_t* len) { - return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_SInt64Rules_has_in(const validate_SInt64Rules* msg) { + size_t size; + validate_SInt64Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_SInt64Rules_has_ignore_empty(const validate_SInt64Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_SInt64Rules_clear_not_in(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SInt64Rules_clear_ignore_empty(const validate_SInt64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE int64_t const* validate_SInt64Rules_not_in(const validate_SInt64Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_SInt64Rules_has_not_in(const validate_SInt64Rules* msg) { + size_t size; + validate_SInt64Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_SInt64Rules_clear_ignore_empty(validate_SInt64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_SInt64Rules_ignore_empty(const validate_SInt64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_SInt64Rules_has_ignore_empty(const validate_SInt64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_SInt64Rules_set_const(validate_SInt64Rules *msg, int64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt64Rules_set_lt(validate_SInt64Rules *msg, int64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt64Rules_set_lte(validate_SInt64Rules *msg, int64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt64Rules_set_gt(validate_SInt64Rules *msg, int64_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SInt64Rules_set_gte(validate_SInt64Rules *msg, int64_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int64_t* validate_SInt64Rules_mutable_in(validate_SInt64Rules* msg, size_t* len) { - return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int64_t* validate_SInt64Rules_mutable_in(validate_SInt64Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t* validate_SInt64Rules_resize_in(validate_SInt64Rules* msg, size_t len, upb_Arena* arena) { - return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena); +UPB_INLINE int64_t* validate_SInt64Rules_resize_in(validate_SInt64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SInt64Rules_add_in(validate_SInt64Rules* msg, int64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int64_t* validate_SInt64Rules_mutable_not_in(validate_SInt64Rules* msg, size_t* len) { - return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE int64_t* validate_SInt64Rules_mutable_not_in(validate_SInt64Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t* validate_SInt64Rules_resize_not_in(validate_SInt64Rules* msg, size_t len, upb_Arena* arena) { - return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE int64_t* validate_SInt64Rules_resize_not_in(validate_SInt64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SInt64Rules_add_not_in(validate_SInt64Rules* msg, int64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 18, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_SInt64Rules_set_ignore_empty(validate_SInt64Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.Fixed32Rules */ UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_new(upb_Arena* arena) { - return (validate_Fixed32Rules*)_upb_Message_New(&validate_Fixed32Rules_msginit, arena); + return (validate_Fixed32Rules*)_upb_Message_New(&validate_Fixed32Rules_msg_init, arena); } UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_Fixed32Rules* ret = validate_Fixed32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Fixed32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_Fixed32Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -1866,7 +2684,7 @@ UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_parse_ex(const char* buf int options, upb_Arena* arena) { validate_Fixed32Rules* ret = validate_Fixed32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Fixed32Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_Fixed32Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -1874,140 +2692,228 @@ UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_parse_ex(const char* buf } UPB_INLINE char* validate_Fixed32Rules_serialize(const validate_Fixed32Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_Fixed32Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Fixed32Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_Fixed32Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Fixed32Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_Fixed32Rules_has_const(const validate_Fixed32Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_Fixed32Rules_clear_const(const validate_Fixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_Fixed32Rules_clear_const(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_Fixed32Rules_const(const validate_Fixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed32Rules_has_lt(const validate_Fixed32Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_Fixed32Rules_has_const(const validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed32Rules_clear_lt(const validate_Fixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_Fixed32Rules_clear_lt(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_Fixed32Rules_lt(const validate_Fixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed32Rules_has_lte(const validate_Fixed32Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_Fixed32Rules_has_lt(const validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed32Rules_clear_lte(const validate_Fixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_Fixed32Rules_clear_lte(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_Fixed32Rules_lte(const validate_Fixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed32Rules_has_gt(const validate_Fixed32Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_Fixed32Rules_has_lte(const validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed32Rules_clear_gt(const validate_Fixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_Fixed32Rules_clear_gt(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_Fixed32Rules_gt(const validate_Fixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed32Rules_has_gte(const validate_Fixed32Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_Fixed32Rules_has_gt(const validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed32Rules_clear_gte(const validate_Fixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_Fixed32Rules_clear_gte(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint32_t validate_Fixed32Rules_gte(const validate_Fixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); + uint32_t default_val = (uint32_t)0u; + uint32_t ret; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_Fixed32Rules_clear_in(const validate_Fixed32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 32)); +UPB_INLINE bool validate_Fixed32Rules_has_gte(const validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE uint32_t const* validate_Fixed32Rules_in(const validate_Fixed32Rules* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE void validate_Fixed32Rules_clear_in(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed32Rules_clear_not_in(const validate_Fixed32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 40)); +UPB_INLINE uint32_t const* validate_Fixed32Rules_in(const validate_Fixed32Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t const* validate_Fixed32Rules_not_in(const validate_Fixed32Rules* msg, size_t* len) { - return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE bool validate_Fixed32Rules_has_in(const validate_Fixed32Rules* msg) { + size_t size; + validate_Fixed32Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_Fixed32Rules_has_ignore_empty(const validate_Fixed32Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_Fixed32Rules_clear_not_in(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed32Rules_clear_ignore_empty(const validate_Fixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE uint32_t const* validate_Fixed32Rules_not_in(const validate_Fixed32Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_Fixed32Rules_has_not_in(const validate_Fixed32Rules* msg) { + size_t size; + validate_Fixed32Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_Fixed32Rules_clear_ignore_empty(validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_Fixed32Rules_ignore_empty(const validate_Fixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_Fixed32Rules_has_ignore_empty(const validate_Fixed32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_Fixed32Rules_set_const(validate_Fixed32Rules *msg, uint32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed32Rules_set_lt(validate_Fixed32Rules *msg, uint32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed32Rules_set_lte(validate_Fixed32Rules *msg, uint32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed32Rules_set_gt(validate_Fixed32Rules *msg, uint32_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed32Rules_set_gte(validate_Fixed32Rules *msg, uint32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_in(validate_Fixed32Rules* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_in(validate_Fixed32Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* validate_Fixed32Rules_resize_in(validate_Fixed32Rules* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena); +UPB_INLINE uint32_t* validate_Fixed32Rules_resize_in(validate_Fixed32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Fixed32Rules_add_in(validate_Fixed32Rules* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_not_in(validate_Fixed32Rules* msg, size_t* len) { - return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_not_in(validate_Fixed32Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint32_t* validate_Fixed32Rules_resize_not_in(validate_Fixed32Rules* msg, size_t len, upb_Arena* arena) { - return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena); +UPB_INLINE uint32_t* validate_Fixed32Rules_resize_not_in(validate_Fixed32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Fixed32Rules_add_not_in(validate_Fixed32Rules* msg, uint32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 7, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_Fixed32Rules_set_ignore_empty(validate_Fixed32Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.Fixed64Rules */ UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_new(upb_Arena* arena) { - return (validate_Fixed64Rules*)_upb_Message_New(&validate_Fixed64Rules_msginit, arena); + return (validate_Fixed64Rules*)_upb_Message_New(&validate_Fixed64Rules_msg_init, arena); } UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_Fixed64Rules* ret = validate_Fixed64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Fixed64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_Fixed64Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2017,7 +2923,7 @@ UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_parse_ex(const char* buf int options, upb_Arena* arena) { validate_Fixed64Rules* ret = validate_Fixed64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_Fixed64Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_Fixed64Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2025,140 +2931,228 @@ UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_parse_ex(const char* buf } UPB_INLINE char* validate_Fixed64Rules_serialize(const validate_Fixed64Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_Fixed64Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Fixed64Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_Fixed64Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_Fixed64Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_Fixed64Rules_has_const(const validate_Fixed64Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_Fixed64Rules_clear_const(const validate_Fixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_Fixed64Rules_clear_const(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_Fixed64Rules_const(const validate_Fixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed64Rules_has_lt(const validate_Fixed64Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_Fixed64Rules_has_const(const validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed64Rules_clear_lt(const validate_Fixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_Fixed64Rules_clear_lt(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_Fixed64Rules_lt(const validate_Fixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed64Rules_has_lte(const validate_Fixed64Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_Fixed64Rules_has_lt(const validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed64Rules_clear_lte(const validate_Fixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_Fixed64Rules_clear_lte(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_Fixed64Rules_lte(const validate_Fixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed64Rules_has_gt(const validate_Fixed64Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_Fixed64Rules_has_lte(const validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed64Rules_clear_gt(const validate_Fixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_Fixed64Rules_clear_gt(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_Fixed64Rules_gt(const validate_Fixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_Fixed64Rules_has_gte(const validate_Fixed64Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_Fixed64Rules_has_gt(const validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed64Rules_clear_gte(const validate_Fixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_Fixed64Rules_clear_gte(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_Fixed64Rules_gte(const validate_Fixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_Fixed64Rules_clear_in(const validate_Fixed64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_Fixed64Rules_has_gte(const validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE uint64_t const* validate_Fixed64Rules_in(const validate_Fixed64Rules* msg, size_t* len) { - return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_Fixed64Rules_clear_in(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed64Rules_clear_not_in(const validate_Fixed64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE uint64_t const* validate_Fixed64Rules_in(const validate_Fixed64Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint64_t const* validate_Fixed64Rules_not_in(const validate_Fixed64Rules* msg, size_t* len) { - return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_Fixed64Rules_has_in(const validate_Fixed64Rules* msg) { + size_t size; + validate_Fixed64Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_Fixed64Rules_has_ignore_empty(const validate_Fixed64Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_Fixed64Rules_clear_not_in(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_Fixed64Rules_clear_ignore_empty(const validate_Fixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE uint64_t const* validate_Fixed64Rules_not_in(const validate_Fixed64Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_Fixed64Rules_has_not_in(const validate_Fixed64Rules* msg) { + size_t size; + validate_Fixed64Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_Fixed64Rules_clear_ignore_empty(validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_Fixed64Rules_ignore_empty(const validate_Fixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_Fixed64Rules_has_ignore_empty(const validate_Fixed64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_Fixed64Rules_set_const(validate_Fixed64Rules *msg, uint64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed64Rules_set_lt(validate_Fixed64Rules *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed64Rules_set_lte(validate_Fixed64Rules *msg, uint64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed64Rules_set_gt(validate_Fixed64Rules *msg, uint64_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_Fixed64Rules_set_gte(validate_Fixed64Rules *msg, uint64_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_in(validate_Fixed64Rules* msg, size_t* len) { - return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_in(validate_Fixed64Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint64_t* validate_Fixed64Rules_resize_in(validate_Fixed64Rules* msg, size_t len, upb_Arena* arena) { - return (uint64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena); +UPB_INLINE uint64_t* validate_Fixed64Rules_resize_in(validate_Fixed64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Fixed64Rules_add_in(validate_Fixed64Rules* msg, uint64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_not_in(validate_Fixed64Rules* msg, size_t* len) { - return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_not_in(validate_Fixed64Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (uint64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE uint64_t* validate_Fixed64Rules_resize_not_in(validate_Fixed64Rules* msg, size_t len, upb_Arena* arena) { - return (uint64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE uint64_t* validate_Fixed64Rules_resize_not_in(validate_Fixed64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (uint64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_Fixed64Rules_add_not_in(validate_Fixed64Rules* msg, uint64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 6, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_Fixed64Rules_set_ignore_empty(validate_Fixed64Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.SFixed32Rules */ UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_new(upb_Arena* arena) { - return (validate_SFixed32Rules*)_upb_Message_New(&validate_SFixed32Rules_msginit, arena); + return (validate_SFixed32Rules*)_upb_Message_New(&validate_SFixed32Rules_msg_init, arena); } UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_SFixed32Rules* ret = validate_SFixed32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SFixed32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_SFixed32Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2168,7 +3162,7 @@ UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_parse_ex(const char* b int options, upb_Arena* arena) { validate_SFixed32Rules* ret = validate_SFixed32Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SFixed32Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_SFixed32Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2176,140 +3170,228 @@ UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_parse_ex(const char* b } UPB_INLINE char* validate_SFixed32Rules_serialize(const validate_SFixed32Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_SFixed32Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SFixed32Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_SFixed32Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SFixed32Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_SFixed32Rules_has_const(const validate_SFixed32Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_SFixed32Rules_clear_const(const validate_SFixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_SFixed32Rules_clear_const(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SFixed32Rules_const(const validate_SFixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed32Rules_has_lt(const validate_SFixed32Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_SFixed32Rules_has_const(const validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed32Rules_clear_lt(const validate_SFixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_SFixed32Rules_clear_lt(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SFixed32Rules_lt(const validate_SFixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed32Rules_has_lte(const validate_SFixed32Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_SFixed32Rules_has_lt(const validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed32Rules_clear_lte(const validate_SFixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_SFixed32Rules_clear_lte(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SFixed32Rules_lte(const validate_SFixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed32Rules_has_gt(const validate_SFixed32Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_SFixed32Rules_has_lte(const validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed32Rules_clear_gt(const validate_SFixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_SFixed32Rules_clear_gt(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SFixed32Rules_gt(const validate_SFixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed32Rules_has_gte(const validate_SFixed32Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_SFixed32Rules_has_gt(const validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed32Rules_clear_gte(const validate_SFixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_SFixed32Rules_clear_gte(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_SFixed32Rules_gte(const validate_SFixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_SFixed32Rules_clear_in(const validate_SFixed32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 32)); +UPB_INLINE bool validate_SFixed32Rules_has_gte(const validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* validate_SFixed32Rules_in(const validate_SFixed32Rules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE void validate_SFixed32Rules_clear_in(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed32Rules_clear_not_in(const validate_SFixed32Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 40)); +UPB_INLINE int32_t const* validate_SFixed32Rules_in(const validate_SFixed32Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t const* validate_SFixed32Rules_not_in(const validate_SFixed32Rules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE bool validate_SFixed32Rules_has_in(const validate_SFixed32Rules* msg) { + size_t size; + validate_SFixed32Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_SFixed32Rules_has_ignore_empty(const validate_SFixed32Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_SFixed32Rules_clear_not_in(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed32Rules_clear_ignore_empty(const validate_SFixed32Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE int32_t const* validate_SFixed32Rules_not_in(const validate_SFixed32Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_SFixed32Rules_has_not_in(const validate_SFixed32Rules* msg) { + size_t size; + validate_SFixed32Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_SFixed32Rules_clear_ignore_empty(validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_SFixed32Rules_ignore_empty(const validate_SFixed32Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_SFixed32Rules_has_ignore_empty(const validate_SFixed32Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_SFixed32Rules_set_const(validate_SFixed32Rules *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed32Rules_set_lt(validate_SFixed32Rules *msg, int32_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed32Rules_set_lte(validate_SFixed32Rules *msg, int32_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; + const upb_MiniTableField field = {3, 12, 3, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed32Rules_set_gt(validate_SFixed32Rules *msg, int32_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + const upb_MiniTableField field = {4, 16, 4, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed32Rules_set_gte(validate_SFixed32Rules *msg, int32_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value; + const upb_MiniTableField field = {5, 20, 5, kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* validate_SFixed32Rules_mutable_in(validate_SFixed32Rules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +UPB_INLINE int32_t* validate_SFixed32Rules_mutable_in(validate_SFixed32Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_SFixed32Rules_resize_in(validate_SFixed32Rules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena); +UPB_INLINE int32_t* validate_SFixed32Rules_resize_in(validate_SFixed32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SFixed32Rules_add_in(validate_SFixed32Rules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(24, 32), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* validate_SFixed32Rules_mutable_not_in(validate_SFixed32Rules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len); +UPB_INLINE int32_t* validate_SFixed32Rules_mutable_not_in(validate_SFixed32Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_SFixed32Rules_resize_not_in(validate_SFixed32Rules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena); +UPB_INLINE int32_t* validate_SFixed32Rules_resize_not_in(validate_SFixed32Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SFixed32Rules_add_not_in(validate_SFixed32Rules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(28, 40), 0, kUpb_NoSub, 15, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_SFixed32Rules_set_ignore_empty(validate_SFixed32Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(32, 24), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.SFixed64Rules */ UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_new(upb_Arena* arena) { - return (validate_SFixed64Rules*)_upb_Message_New(&validate_SFixed64Rules_msginit, arena); + return (validate_SFixed64Rules*)_upb_Message_New(&validate_SFixed64Rules_msg_init, arena); } UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_SFixed64Rules* ret = validate_SFixed64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SFixed64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_SFixed64Rules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2319,7 +3401,7 @@ UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_parse_ex(const char* b int options, upb_Arena* arena) { validate_SFixed64Rules* ret = validate_SFixed64Rules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_SFixed64Rules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_SFixed64Rules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2327,140 +3409,228 @@ UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_parse_ex(const char* b } UPB_INLINE char* validate_SFixed64Rules_serialize(const validate_SFixed64Rules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_SFixed64Rules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SFixed64Rules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_SFixed64Rules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_SFixed64Rules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_SFixed64Rules_has_const(const validate_SFixed64Rules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_SFixed64Rules_clear_const(const validate_SFixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_SFixed64Rules_clear_const(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SFixed64Rules_const(const validate_SFixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed64Rules_has_lt(const validate_SFixed64Rules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_SFixed64Rules_has_const(const validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed64Rules_clear_lt(const validate_SFixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_SFixed64Rules_clear_lt(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SFixed64Rules_lt(const validate_SFixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed64Rules_has_lte(const validate_SFixed64Rules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_SFixed64Rules_has_lt(const validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed64Rules_clear_lte(const validate_SFixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_SFixed64Rules_clear_lte(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SFixed64Rules_lte(const validate_SFixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed64Rules_has_gt(const validate_SFixed64Rules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_SFixed64Rules_has_lte(const validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed64Rules_clear_gt(const validate_SFixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_SFixed64Rules_clear_gt(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SFixed64Rules_gt(const validate_SFixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_SFixed64Rules_has_gte(const validate_SFixed64Rules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_SFixed64Rules_has_gt(const validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed64Rules_clear_gte(const validate_SFixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_SFixed64Rules_clear_gte(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t validate_SFixed64Rules_gte(const validate_SFixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_SFixed64Rules_clear_in(const validate_SFixed64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_SFixed64Rules_has_gte(const validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int64_t const* validate_SFixed64Rules_in(const validate_SFixed64Rules* msg, size_t* len) { - return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_SFixed64Rules_clear_in(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed64Rules_clear_not_in(const validate_SFixed64Rules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE int64_t const* validate_SFixed64Rules_in(const validate_SFixed64Rules* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t const* validate_SFixed64Rules_not_in(const validate_SFixed64Rules* msg, size_t* len) { - return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_SFixed64Rules_has_in(const validate_SFixed64Rules* msg) { + size_t size; + validate_SFixed64Rules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_SFixed64Rules_has_ignore_empty(const validate_SFixed64Rules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE void validate_SFixed64Rules_clear_not_in(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_SFixed64Rules_clear_ignore_empty(const validate_SFixed64Rules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE int64_t const* validate_SFixed64Rules_not_in(const validate_SFixed64Rules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_SFixed64Rules_has_not_in(const validate_SFixed64Rules* msg) { + size_t size; + validate_SFixed64Rules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_SFixed64Rules_clear_ignore_empty(validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_SFixed64Rules_ignore_empty(const validate_SFixed64Rules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_SFixed64Rules_has_ignore_empty(const validate_SFixed64Rules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_SFixed64Rules_set_const(validate_SFixed64Rules *msg, int64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed64Rules_set_lt(validate_SFixed64Rules *msg, int64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed64Rules_set_lte(validate_SFixed64Rules *msg, int64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 24), 3, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed64Rules_set_gt(validate_SFixed64Rules *msg, int64_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = value; + const upb_MiniTableField field = {4, UPB_SIZE(40, 32), 4, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_SFixed64Rules_set_gte(validate_SFixed64Rules *msg, int64_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = value; + const upb_MiniTableField field = {5, UPB_SIZE(48, 40), 5, kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int64_t* validate_SFixed64Rules_mutable_in(validate_SFixed64Rules* msg, size_t* len) { - return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE int64_t* validate_SFixed64Rules_mutable_in(validate_SFixed64Rules* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t* validate_SFixed64Rules_resize_in(validate_SFixed64Rules* msg, size_t len, upb_Arena* arena) { - return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena); +UPB_INLINE int64_t* validate_SFixed64Rules_resize_in(validate_SFixed64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SFixed64Rules_add_in(validate_SFixed64Rules* msg, int64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena); + upb_MiniTableField field = {6, UPB_SIZE(4, 48), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int64_t* validate_SFixed64Rules_mutable_not_in(validate_SFixed64Rules* msg, size_t* len) { - return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE int64_t* validate_SFixed64Rules_mutable_not_in(validate_SFixed64Rules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int64_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int64_t* validate_SFixed64Rules_resize_not_in(validate_SFixed64Rules* msg, size_t len, upb_Arena* arena) { - return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena); +UPB_INLINE int64_t* validate_SFixed64Rules_resize_not_in(validate_SFixed64Rules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int64_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_SFixed64Rules_add_not_in(validate_SFixed64Rules* msg, int64_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena); + upb_MiniTableField field = {7, UPB_SIZE(8, 56), 0, kUpb_NoSub, 16, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_SFixed64Rules_set_ignore_empty(validate_SFixed64Rules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(12, 1), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.BoolRules */ UPB_INLINE validate_BoolRules* validate_BoolRules_new(upb_Arena* arena) { - return (validate_BoolRules*)_upb_Message_New(&validate_BoolRules_msginit, arena); + return (validate_BoolRules*)_upb_Message_New(&validate_BoolRules_msg_init, arena); } UPB_INLINE validate_BoolRules* validate_BoolRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_BoolRules* ret = validate_BoolRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_BoolRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_BoolRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2470,7 +3640,7 @@ UPB_INLINE validate_BoolRules* validate_BoolRules_parse_ex(const char* buf, size int options, upb_Arena* arena) { validate_BoolRules* ret = validate_BoolRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_BoolRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_BoolRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2478,40 +3648,45 @@ UPB_INLINE validate_BoolRules* validate_BoolRules_parse_ex(const char* buf, size } UPB_INLINE char* validate_BoolRules_serialize(const validate_BoolRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_BoolRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_BoolRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_BoolRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_BoolRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_BoolRules_has_const(const validate_BoolRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_BoolRules_clear_const(const validate_BoolRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_BoolRules_clear_const(validate_BoolRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_BoolRules_const(const validate_BoolRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_BoolRules_has_const(const validate_BoolRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_BoolRules_set_const(validate_BoolRules *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.StringRules */ UPB_INLINE validate_StringRules* validate_StringRules_new(upb_Arena* arena) { - return (validate_StringRules*)_upb_Message_New(&validate_StringRules_msginit, arena); + return (validate_StringRules*)_upb_Message_New(&validate_StringRules_msg_init, arena); } UPB_INLINE validate_StringRules* validate_StringRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_StringRules* ret = validate_StringRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_StringRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_StringRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2521,7 +3696,7 @@ UPB_INLINE validate_StringRules* validate_StringRules_parse_ex(const char* buf, int options, upb_Arena* arena) { validate_StringRules* ret = validate_StringRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_StringRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_StringRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2529,13 +3704,13 @@ UPB_INLINE validate_StringRules* validate_StringRules_parse_ex(const char* buf, } UPB_INLINE char* validate_StringRules_serialize(const validate_StringRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_StringRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_StringRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_StringRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_StringRules_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2552,365 +3727,564 @@ typedef enum { validate_StringRules_well_known_NOT_SET = 0 } validate_StringRules_well_known_oneofcases; UPB_INLINE validate_StringRules_well_known_oneofcases validate_StringRules_well_known_case(const validate_StringRules* msg) { - return (validate_StringRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {12, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (validate_StringRules_well_known_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool validate_StringRules_has_const(const validate_StringRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_StringRules_clear_const(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void validate_StringRules_clear_const(validate_StringRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_StringRules_const(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(24, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_min_len(const validate_StringRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_StringRules_has_const(const validate_StringRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(24, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_min_len(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 128), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_StringRules_clear_min_len(validate_StringRules* msg) { + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_StringRules_min_len(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_max_len(const validate_StringRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_StringRules_has_min_len(const validate_StringRules* msg) { + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_max_len(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 136), uint64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_StringRules_clear_max_len(validate_StringRules* msg) { + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_StringRules_max_len(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_min_bytes(const validate_StringRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_StringRules_has_max_len(const validate_StringRules* msg) { + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_min_bytes(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(88, 144), uint64_t) = 0; - _upb_clearhas(msg, 4); +UPB_INLINE void validate_StringRules_clear_min_bytes(validate_StringRules* msg) { + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_StringRules_min_bytes(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_max_bytes(const validate_StringRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_StringRules_has_min_bytes(const validate_StringRules* msg) { + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_max_bytes(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(96, 152), uint64_t) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_StringRules_clear_max_bytes(validate_StringRules* msg) { + const upb_MiniTableField field = {5, 56, 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_StringRules_max_bytes(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(96, 152), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {5, 56, 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_pattern(const validate_StringRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool validate_StringRules_has_max_bytes(const validate_StringRules* msg) { + const upb_MiniTableField field = {5, 56, 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_pattern(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 6); +UPB_INLINE void validate_StringRules_clear_pattern(validate_StringRules* msg) { + const upb_MiniTableField field = {6, 64, 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_StringRules_pattern(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, 64, 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_prefix(const validate_StringRules* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool validate_StringRules_has_pattern(const validate_StringRules* msg) { + const upb_MiniTableField field = {6, 64, 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_prefix(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 7); +UPB_INLINE void validate_StringRules_clear_prefix(validate_StringRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(72, 80), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_StringRules_prefix(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(72, 80), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_suffix(const validate_StringRules* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool validate_StringRules_has_prefix(const validate_StringRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(72, 80), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_suffix(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 8); +UPB_INLINE void validate_StringRules_clear_suffix(validate_StringRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(80, 96), 8, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_StringRules_suffix(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(80, 96), 8, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_contains(const validate_StringRules* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool validate_StringRules_has_suffix(const validate_StringRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(80, 96), 8, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_contains(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 9); +UPB_INLINE void validate_StringRules_clear_contains(validate_StringRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(88, 112), 9, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_StringRules_contains(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {9, UPB_SIZE(88, 112), 9, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_StringRules_clear_in(const validate_StringRules* msg) { - _upb_array_detach(msg, UPB_SIZE(56, 96)); +UPB_INLINE bool validate_StringRules_has_contains(const validate_StringRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(88, 112), 9, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* validate_StringRules_in(const validate_StringRules* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(56, 96), len); +UPB_INLINE void validate_StringRules_clear_in(validate_StringRules* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 128), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_not_in(const validate_StringRules* msg) { - _upb_array_detach(msg, UPB_SIZE(60, 104)); +UPB_INLINE upb_StringView const* validate_StringRules_in(const validate_StringRules* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(4, 128), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* validate_StringRules_not_in(const validate_StringRules* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(60, 104), len); +UPB_INLINE bool validate_StringRules_has_in(const validate_StringRules* msg) { + size_t size; + validate_StringRules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_StringRules_has_email(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12; +UPB_INLINE void validate_StringRules_clear_not_in(validate_StringRules* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(8, 136), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_email(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE upb_StringView const* validate_StringRules_not_in(const validate_StringRules* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(8, 136), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_StringRules_has_not_in(const validate_StringRules* msg) { + size_t size; + validate_StringRules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_StringRules_clear_email(validate_StringRules* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_email(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 12, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {12, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_hostname(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13; +UPB_INLINE bool validate_StringRules_has_email(const validate_StringRules* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_hostname(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_hostname(validate_StringRules* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_hostname(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 13, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {13, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_ip(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 14; +UPB_INLINE bool validate_StringRules_has_hostname(const validate_StringRules* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_ip(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_ip(validate_StringRules* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_ip(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 14, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {14, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_ipv4(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 15; +UPB_INLINE bool validate_StringRules_has_ip(const validate_StringRules* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_ipv4(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_ipv4(validate_StringRules* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_ipv4(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 15, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {15, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_ipv6(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 16; +UPB_INLINE bool validate_StringRules_has_ipv4(const validate_StringRules* msg) { + const upb_MiniTableField field = {15, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_ipv6(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_ipv6(validate_StringRules* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_ipv6(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 16, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_uri(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 17; +UPB_INLINE bool validate_StringRules_has_ipv6(const validate_StringRules* msg) { + const upb_MiniTableField field = {16, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_uri(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_uri(validate_StringRules* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_uri(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 17, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {17, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_uri_ref(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 18; +UPB_INLINE bool validate_StringRules_has_uri(const validate_StringRules* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_uri_ref(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_uri_ref(validate_StringRules* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_uri_ref(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 18, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {18, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_len(const validate_StringRules* msg) { - return _upb_hasbit(msg, 10); +UPB_INLINE bool validate_StringRules_has_uri_ref(const validate_StringRules* msg) { + const upb_MiniTableField field = {18, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_len(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(104, 160), uint64_t) = 0; - _upb_clearhas(msg, 10); +UPB_INLINE void validate_StringRules_clear_len(validate_StringRules* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(96, 144), 10, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_StringRules_len(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(104, 160), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {19, UPB_SIZE(96, 144), 10, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_len_bytes(const validate_StringRules* msg) { - return _upb_hasbit(msg, 11); +UPB_INLINE bool validate_StringRules_has_len(const validate_StringRules* msg) { + const upb_MiniTableField field = {19, UPB_SIZE(96, 144), 10, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_len_bytes(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(112, 168), uint64_t) = 0; - _upb_clearhas(msg, 11); +UPB_INLINE void validate_StringRules_clear_len_bytes(validate_StringRules* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(104, 152), 11, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_StringRules_len_bytes(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(112, 168), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {20, UPB_SIZE(104, 152), 11, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_address(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 21; +UPB_INLINE bool validate_StringRules_has_len_bytes(const validate_StringRules* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(104, 152), 11, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_address(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_address(validate_StringRules* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_address(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 21, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {21, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_uuid(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 22; +UPB_INLINE bool validate_StringRules_has_address(const validate_StringRules* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_uuid(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_uuid(validate_StringRules* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_uuid(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 22, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {22, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_not_contains(const validate_StringRules* msg) { - return _upb_hasbit(msg, 12); +UPB_INLINE bool validate_StringRules_has_uuid(const validate_StringRules* msg) { + const upb_MiniTableField field = {22, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_not_contains(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 12); +UPB_INLINE void validate_StringRules_clear_not_contains(validate_StringRules* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(112, 160), 12, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_StringRules_not_contains(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {23, UPB_SIZE(112, 160), 12, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_well_known_regex(const validate_StringRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 24; +UPB_INLINE bool validate_StringRules_has_not_contains(const validate_StringRules* msg) { + const upb_MiniTableField field = {23, UPB_SIZE(112, 160), 12, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_well_known_regex(const validate_StringRules* msg) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET); +UPB_INLINE void validate_StringRules_clear_well_known_regex(validate_StringRules* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_StringRules_well_known_regex(const validate_StringRules* msg) { - return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 24, 0); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {24, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules* msg) { - return _upb_hasbit(msg, 13); +UPB_INLINE bool validate_StringRules_has_well_known_regex(const validate_StringRules* msg) { + const upb_MiniTableField field = {24, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_strict(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; - _upb_clearhas(msg, 13); +UPB_INLINE void validate_StringRules_clear_strict(validate_StringRules* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(16, 8), 13, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_strict(const validate_StringRules* msg) { - return validate_StringRules_has_strict(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) : true; + bool default_val = true; + bool ret; + const upb_MiniTableField field = {25, UPB_SIZE(16, 8), 13, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_StringRules_has_ignore_empty(const validate_StringRules* msg) { - return _upb_hasbit(msg, 14); +UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules* msg) { + const upb_MiniTableField field = {25, UPB_SIZE(16, 8), 13, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_StringRules_clear_ignore_empty(const validate_StringRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0; - _upb_clearhas(msg, 14); +UPB_INLINE void validate_StringRules_clear_ignore_empty(validate_StringRules* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(17, 9), 14, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_StringRules_ignore_empty(const validate_StringRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {26, UPB_SIZE(17, 9), 14, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_StringRules_has_ignore_empty(const validate_StringRules* msg) { + const upb_MiniTableField field = {26, UPB_SIZE(17, 9), 14, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_StringRules_set_const(validate_StringRules *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(24, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_min_len(validate_StringRules *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(72, 128), uint64_t) = value; + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_max_len(validate_StringRules *msg, uint64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(80, 136), uint64_t) = value; + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_min_bytes(validate_StringRules *msg, uint64_t value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(88, 144), uint64_t) = value; + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_max_bytes(validate_StringRules *msg, uint64_t value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(96, 152), uint64_t) = value; + const upb_MiniTableField field = {5, 56, 5, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_pattern(validate_StringRules *msg, upb_StringView value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = value; + const upb_MiniTableField field = {6, 64, 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_prefix(validate_StringRules *msg, upb_StringView value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(72, 80), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_suffix(validate_StringRules *msg, upb_StringView value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(40, 64), upb_StringView) = value; + const upb_MiniTableField field = {8, UPB_SIZE(80, 96), 8, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_contains(validate_StringRules *msg, upb_StringView value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(48, 80), upb_StringView) = value; + const upb_MiniTableField field = {9, UPB_SIZE(88, 112), 9, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* validate_StringRules_mutable_in(validate_StringRules* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 96), len); +UPB_INLINE upb_StringView* validate_StringRules_mutable_in(validate_StringRules* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(4, 128), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* validate_StringRules_resize_in(validate_StringRules* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 96), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* validate_StringRules_resize_in(validate_StringRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(4, 128), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_StringRules_add_in(validate_StringRules* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 96), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {10, UPB_SIZE(4, 128), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* validate_StringRules_mutable_not_in(validate_StringRules* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 104), len); +UPB_INLINE upb_StringView* validate_StringRules_mutable_not_in(validate_StringRules* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(8, 136), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* validate_StringRules_resize_not_in(validate_StringRules* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(60, 104), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* validate_StringRules_resize_not_in(validate_StringRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(8, 136), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_StringRules_add_not_in(validate_StringRules* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 104), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {11, UPB_SIZE(8, 136), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_StringRules_set_email(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 12); + const upb_MiniTableField field = {12, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_hostname(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 13); + const upb_MiniTableField field = {13, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_ip(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 14); + const upb_MiniTableField field = {14, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_ipv4(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 15); + const upb_MiniTableField field = {15, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_ipv6(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 16); + const upb_MiniTableField field = {16, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_uri(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 17); + const upb_MiniTableField field = {17, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_uri_ref(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 18); + const upb_MiniTableField field = {18, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_len(validate_StringRules *msg, uint64_t value) { - _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(104, 160), uint64_t) = value; + const upb_MiniTableField field = {19, UPB_SIZE(96, 144), 10, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_len_bytes(validate_StringRules *msg, uint64_t value) { - _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(112, 168), uint64_t) = value; + const upb_MiniTableField field = {20, UPB_SIZE(104, 152), 11, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_address(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 21); + const upb_MiniTableField field = {21, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_uuid(validate_StringRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 22); + const upb_MiniTableField field = {22, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_not_contains(validate_StringRules *msg, upb_StringView value) { - _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(64, 112), upb_StringView) = value; + const upb_MiniTableField field = {23, UPB_SIZE(112, 160), 12, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_well_known_regex(validate_StringRules *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 24); + const upb_MiniTableField field = {24, UPB_SIZE(20, 12), UPB_SIZE(-13, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_strict(validate_StringRules *msg, bool value) { - _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {25, UPB_SIZE(16, 8), 13, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_StringRules_set_ignore_empty(validate_StringRules *msg, bool value) { - _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; + const upb_MiniTableField field = {26, UPB_SIZE(17, 9), 14, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.BytesRules */ UPB_INLINE validate_BytesRules* validate_BytesRules_new(upb_Arena* arena) { - return (validate_BytesRules*)_upb_Message_New(&validate_BytesRules_msginit, arena); + return (validate_BytesRules*)_upb_Message_New(&validate_BytesRules_msg_init, arena); } UPB_INLINE validate_BytesRules* validate_BytesRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_BytesRules* ret = validate_BytesRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_BytesRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_BytesRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -2920,7 +4294,7 @@ UPB_INLINE validate_BytesRules* validate_BytesRules_parse_ex(const char* buf, si int options, upb_Arena* arena) { validate_BytesRules* ret = validate_BytesRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_BytesRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_BytesRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -2928,13 +4302,13 @@ UPB_INLINE validate_BytesRules* validate_BytesRules_parse_ex(const char* buf, si } UPB_INLINE char* validate_BytesRules_serialize(const validate_BytesRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_BytesRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_BytesRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_BytesRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_BytesRules_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -2944,211 +4318,336 @@ typedef enum { validate_BytesRules_well_known_NOT_SET = 0 } validate_BytesRules_well_known_oneofcases; UPB_INLINE validate_BytesRules_well_known_oneofcases validate_BytesRules_well_known_case(const validate_BytesRules* msg) { - return (validate_BytesRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {10, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return (validate_BytesRules_well_known_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool validate_BytesRules_has_const(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_BytesRules_clear_const(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 1); +UPB_INLINE void validate_BytesRules_clear_const(validate_BytesRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_BytesRules_const(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_min_len(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_BytesRules_has_const(const validate_BytesRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_min_len(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(64, 112), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_BytesRules_clear_min_len(validate_BytesRules* msg) { + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_BytesRules_min_len(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_max_len(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_BytesRules_has_min_len(const validate_BytesRules* msg) { + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_max_len(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(72, 120), uint64_t) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_BytesRules_clear_max_len(validate_BytesRules* msg) { + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_BytesRules_max_len(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(72, 120), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_pattern(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_BytesRules_has_max_len(const validate_BytesRules* msg) { + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_pattern(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 4); +UPB_INLINE void validate_BytesRules_clear_pattern(validate_BytesRules* msg) { + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_BytesRules_pattern(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_prefix(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_BytesRules_has_pattern(const validate_BytesRules* msg) { + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_prefix(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 5); +UPB_INLINE void validate_BytesRules_clear_prefix(validate_BytesRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(56, 64), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_BytesRules_prefix(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {5, UPB_SIZE(56, 64), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_suffix(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool validate_BytesRules_has_prefix(const validate_BytesRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(56, 64), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_suffix(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 6); +UPB_INLINE void validate_BytesRules_clear_suffix(validate_BytesRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(64, 80), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_BytesRules_suffix(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(64, 80), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_contains(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool validate_BytesRules_has_suffix(const validate_BytesRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(64, 80), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_contains(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, 7); +UPB_INLINE void validate_BytesRules_clear_contains(validate_BytesRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(72, 96), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView validate_BytesRules_contains(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(72, 96), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_BytesRules_clear_in(const validate_BytesRules* msg) { - _upb_array_detach(msg, UPB_SIZE(52, 96)); +UPB_INLINE bool validate_BytesRules_has_contains(const validate_BytesRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(72, 96), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* validate_BytesRules_in(const validate_BytesRules* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE void validate_BytesRules_clear_in(validate_BytesRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 112), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_not_in(const validate_BytesRules* msg) { - _upb_array_detach(msg, UPB_SIZE(56, 104)); +UPB_INLINE upb_StringView const* validate_BytesRules_in(const validate_BytesRules* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(4, 112), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* validate_BytesRules_not_in(const validate_BytesRules* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(56, 104), len); +UPB_INLINE bool validate_BytesRules_has_in(const validate_BytesRules* msg) { + size_t size; + validate_BytesRules_in(msg, &size); + return size != 0; } -UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10; +UPB_INLINE void validate_BytesRules_clear_not_in(validate_BytesRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(8, 120), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_ip(const validate_BytesRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), 0, UPB_SIZE(4, 4), validate_BytesRules_well_known_NOT_SET); +UPB_INLINE upb_StringView const* validate_BytesRules_not_in(const validate_BytesRules* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(8, 120), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_BytesRules_has_not_in(const validate_BytesRules* msg) { + size_t size; + validate_BytesRules_not_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_BytesRules_clear_ip(validate_BytesRules* msg) { + const upb_MiniTableField field = {10, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_BytesRules_ip(const validate_BytesRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(2, 2), UPB_SIZE(4, 4), 10, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {10, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11; +UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules* msg) { + const upb_MiniTableField field = {10, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_ipv4(const validate_BytesRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), 0, UPB_SIZE(4, 4), validate_BytesRules_well_known_NOT_SET); +UPB_INLINE void validate_BytesRules_clear_ipv4(validate_BytesRules* msg) { + const upb_MiniTableField field = {11, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_BytesRules_ipv4(const validate_BytesRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(2, 2), UPB_SIZE(4, 4), 11, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {11, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12; +UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules* msg) { + const upb_MiniTableField field = {11, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_ipv6(const validate_BytesRules* msg) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), 0, UPB_SIZE(4, 4), validate_BytesRules_well_known_NOT_SET); +UPB_INLINE void validate_BytesRules_clear_ipv6(validate_BytesRules* msg) { + const upb_MiniTableField field = {12, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_BytesRules_ipv6(const validate_BytesRules* msg) { - return UPB_READ_ONEOF(msg, bool, UPB_SIZE(2, 2), UPB_SIZE(4, 4), 12, false); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {12, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_len(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules* msg) { + const upb_MiniTableField field = {12, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_len(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(80, 128), uint64_t) = 0; - _upb_clearhas(msg, 8); +UPB_INLINE void validate_BytesRules_clear_len(validate_BytesRules* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(80, 128), 8, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_BytesRules_len(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {13, UPB_SIZE(80, 128), 8, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_BytesRules_has_ignore_empty(const validate_BytesRules* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool validate_BytesRules_has_len(const validate_BytesRules* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(80, 128), 8, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_BytesRules_clear_ignore_empty(const validate_BytesRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; - _upb_clearhas(msg, 9); +UPB_INLINE void validate_BytesRules_clear_ignore_empty(validate_BytesRules* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(16, 8), 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_BytesRules_ignore_empty(const validate_BytesRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {14, UPB_SIZE(16, 8), 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_BytesRules_has_ignore_empty(const validate_BytesRules* msg) { + const upb_MiniTableField field = {14, UPB_SIZE(16, 8), 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_BytesRules_set_const(validate_BytesRules *msg, upb_StringView value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value; + const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_min_len(validate_BytesRules *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(64, 112), uint64_t) = value; + const upb_MiniTableField field = {2, 32, 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_max_len(validate_BytesRules *msg, uint64_t value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(72, 120), uint64_t) = value; + const upb_MiniTableField field = {3, 40, 3, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_pattern(validate_BytesRules *msg, upb_StringView value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value; + const upb_MiniTableField field = {4, 48, 4, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_prefix(validate_BytesRules *msg, upb_StringView value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value; + const upb_MiniTableField field = {5, UPB_SIZE(56, 64), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_suffix(validate_BytesRules *msg, upb_StringView value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value; + const upb_MiniTableField field = {6, UPB_SIZE(64, 80), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_contains(validate_BytesRules *msg, upb_StringView value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = value; + const upb_MiniTableField field = {7, UPB_SIZE(72, 96), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* validate_BytesRules_mutable_in(validate_BytesRules* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len); +UPB_INLINE upb_StringView* validate_BytesRules_mutable_in(validate_BytesRules* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(4, 112), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* validate_BytesRules_resize_in(validate_BytesRules* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* validate_BytesRules_resize_in(validate_BytesRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(4, 112), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_BytesRules_add_in(validate_BytesRules* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {8, UPB_SIZE(4, 112), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* validate_BytesRules_mutable_not_in(validate_BytesRules* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 104), len); +UPB_INLINE upb_StringView* validate_BytesRules_mutable_not_in(validate_BytesRules* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(8, 120), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* validate_BytesRules_resize_not_in(validate_BytesRules* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 104), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* validate_BytesRules_resize_not_in(validate_BytesRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(8, 120), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_BytesRules_add_not_in(validate_BytesRules* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 104), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {9, UPB_SIZE(8, 120), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void validate_BytesRules_set_ip(validate_BytesRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), value, UPB_SIZE(4, 4), 10); + const upb_MiniTableField field = {10, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_ipv4(validate_BytesRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), value, UPB_SIZE(4, 4), 11); + const upb_MiniTableField field = {11, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_ipv6(validate_BytesRules *msg, bool value) { - UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), value, UPB_SIZE(4, 4), 12); + const upb_MiniTableField field = {12, 2, UPB_SIZE(-13, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_len(validate_BytesRules *msg, uint64_t value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(80, 128), uint64_t) = value; + const upb_MiniTableField field = {13, UPB_SIZE(80, 128), 8, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_BytesRules_set_ignore_empty(validate_BytesRules *msg, bool value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {14, UPB_SIZE(16, 8), 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.EnumRules */ UPB_INLINE validate_EnumRules* validate_EnumRules_new(upb_Arena* arena) { - return (validate_EnumRules*)_upb_Message_New(&validate_EnumRules_msginit, arena); + return (validate_EnumRules*)_upb_Message_New(&validate_EnumRules_msg_init, arena); } UPB_INLINE validate_EnumRules* validate_EnumRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_EnumRules* ret = validate_EnumRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_EnumRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_EnumRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3158,7 +4657,7 @@ UPB_INLINE validate_EnumRules* validate_EnumRules_parse_ex(const char* buf, size int options, upb_Arena* arena) { validate_EnumRules* ret = validate_EnumRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_EnumRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_EnumRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3166,84 +4665,152 @@ UPB_INLINE validate_EnumRules* validate_EnumRules_parse_ex(const char* buf, size } UPB_INLINE char* validate_EnumRules_serialize(const validate_EnumRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_EnumRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_EnumRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_EnumRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_EnumRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_EnumRules_has_const(const validate_EnumRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_EnumRules_clear_const(const validate_EnumRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_EnumRules_clear_const(validate_EnumRules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t validate_EnumRules_const(const validate_EnumRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_EnumRules_has_defined_only(const validate_EnumRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_EnumRules_has_const(const validate_EnumRules* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_EnumRules_clear_defined_only(const validate_EnumRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_EnumRules_clear_defined_only(validate_EnumRules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_EnumRules_defined_only(const validate_EnumRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_EnumRules_clear_in(const validate_EnumRules* msg) { - _upb_array_detach(msg, UPB_SIZE(12, 16)); +UPB_INLINE bool validate_EnumRules_has_defined_only(const validate_EnumRules* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE int32_t const* validate_EnumRules_in(const validate_EnumRules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE void validate_EnumRules_clear_in(validate_EnumRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_EnumRules_clear_not_in(const validate_EnumRules* msg) { - _upb_array_detach(msg, UPB_SIZE(16, 24)); +UPB_INLINE int32_t const* validate_EnumRules_in(const validate_EnumRules* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t const* validate_EnumRules_not_in(const validate_EnumRules* msg, size_t* len) { - return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE bool validate_EnumRules_has_in(const validate_EnumRules* msg) { + size_t size; + validate_EnumRules_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_EnumRules_clear_not_in(validate_EnumRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* validate_EnumRules_not_in(const validate_EnumRules* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_EnumRules_has_not_in(const validate_EnumRules* msg) { + size_t size; + validate_EnumRules_not_in(msg, &size); + return size != 0; } UPB_INLINE void validate_EnumRules_set_const(validate_EnumRules *msg, int32_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_EnumRules_set_defined_only(validate_EnumRules *msg, bool value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE int32_t* validate_EnumRules_mutable_in(validate_EnumRules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); +UPB_INLINE int32_t* validate_EnumRules_mutable_in(validate_EnumRules* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_EnumRules_resize_in(validate_EnumRules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, 2, arena); +UPB_INLINE int32_t* validate_EnumRules_resize_in(validate_EnumRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_EnumRules_add_in(validate_EnumRules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), 2, &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE int32_t* validate_EnumRules_mutable_not_in(validate_EnumRules* msg, size_t* len) { - return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len); +UPB_INLINE int32_t* validate_EnumRules_mutable_not_in(validate_EnumRules* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE int32_t* validate_EnumRules_resize_not_in(validate_EnumRules* msg, size_t len, upb_Arena* arena) { - return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, 2, arena); +UPB_INLINE int32_t* validate_EnumRules_resize_not_in(validate_EnumRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_EnumRules_add_not_in(validate_EnumRules* msg, int32_t val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), 2, &val, arena); + upb_MiniTableField field = {4, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* validate.MessageRules */ UPB_INLINE validate_MessageRules* validate_MessageRules_new(upb_Arena* arena) { - return (validate_MessageRules*)_upb_Message_New(&validate_MessageRules_msginit, arena); + return (validate_MessageRules*)_upb_Message_New(&validate_MessageRules_msg_init, arena); } UPB_INLINE validate_MessageRules* validate_MessageRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_MessageRules* ret = validate_MessageRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_MessageRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_MessageRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3253,7 +4820,7 @@ UPB_INLINE validate_MessageRules* validate_MessageRules_parse_ex(const char* buf int options, upb_Arena* arena) { validate_MessageRules* ret = validate_MessageRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_MessageRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_MessageRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3261,54 +4828,64 @@ UPB_INLINE validate_MessageRules* validate_MessageRules_parse_ex(const char* buf } UPB_INLINE char* validate_MessageRules_serialize(const validate_MessageRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_MessageRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_MessageRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_MessageRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_MessageRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_MessageRules_has_skip(const validate_MessageRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_MessageRules_clear_skip(const validate_MessageRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_MessageRules_clear_skip(validate_MessageRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_MessageRules_skip(const validate_MessageRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_MessageRules_has_required(const validate_MessageRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_MessageRules_has_skip(const validate_MessageRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_MessageRules_clear_required(const validate_MessageRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_MessageRules_clear_required(validate_MessageRules* msg) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_MessageRules_required(const validate_MessageRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_MessageRules_has_required(const validate_MessageRules* msg) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_MessageRules_set_skip(validate_MessageRules *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_MessageRules_set_required(validate_MessageRules *msg, bool value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.RepeatedRules */ UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_new(upb_Arena* arena) { - return (validate_RepeatedRules*)_upb_Message_New(&validate_RepeatedRules_msginit, arena); + return (validate_RepeatedRules*)_upb_Message_New(&validate_RepeatedRules_msg_init, arena); } UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_RepeatedRules* ret = validate_RepeatedRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_RepeatedRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_RepeatedRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3318,7 +4895,7 @@ UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_parse_ex(const char* b int options, upb_Arena* arena) { validate_RepeatedRules* ret = validate_RepeatedRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_RepeatedRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_RepeatedRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3326,104 +4903,129 @@ UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_parse_ex(const char* b } UPB_INLINE char* validate_RepeatedRules_serialize(const validate_RepeatedRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_RepeatedRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_RepeatedRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_RepeatedRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_RepeatedRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_RepeatedRules_has_min_items(const validate_RepeatedRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_RepeatedRules_clear_min_items(const validate_RepeatedRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_RepeatedRules_clear_min_items(validate_RepeatedRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_RepeatedRules_min_items(const validate_RepeatedRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_RepeatedRules_has_max_items(const validate_RepeatedRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_RepeatedRules_has_min_items(const validate_RepeatedRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_RepeatedRules_clear_max_items(const validate_RepeatedRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_RepeatedRules_clear_max_items(validate_RepeatedRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_RepeatedRules_max_items(const validate_RepeatedRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_RepeatedRules_has_unique(const validate_RepeatedRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_RepeatedRules_has_max_items(const validate_RepeatedRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_RepeatedRules_clear_unique(const validate_RepeatedRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_RepeatedRules_clear_unique(validate_RepeatedRules* msg) { + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_RepeatedRules_unique(const validate_RepeatedRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_RepeatedRules_has_items(const validate_RepeatedRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_RepeatedRules_has_unique(const validate_RepeatedRules* msg) { + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_RepeatedRules_clear_items(const validate_RepeatedRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void validate_RepeatedRules_clear_items(validate_RepeatedRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_FieldRules* validate_RepeatedRules_items(const validate_RepeatedRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const validate_FieldRules*); + const validate_FieldRules* default_val = NULL; + const validate_FieldRules* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_RepeatedRules_has_ignore_empty(const validate_RepeatedRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_RepeatedRules_has_items(const validate_RepeatedRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_RepeatedRules_clear_ignore_empty(const validate_RepeatedRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 5); +UPB_INLINE void validate_RepeatedRules_clear_ignore_empty(validate_RepeatedRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 2), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_RepeatedRules_ignore_empty(const validate_RepeatedRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 2), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_RepeatedRules_has_ignore_empty(const validate_RepeatedRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 2), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_RepeatedRules_set_min_items(validate_RepeatedRules *msg, uint64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_RepeatedRules_set_max_items(validate_RepeatedRules *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_RepeatedRules_set_unique(validate_RepeatedRules *msg, bool value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_RepeatedRules_set_items(validate_RepeatedRules *msg, validate_FieldRules* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), validate_FieldRules*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_FieldRules* validate_RepeatedRules_mutable_items(validate_RepeatedRules* msg, upb_Arena* arena) { struct validate_FieldRules* sub = (struct validate_FieldRules*)validate_RepeatedRules_items(msg); if (sub == NULL) { - sub = (struct validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msginit, arena); - if (!sub) return NULL; - validate_RepeatedRules_set_items(msg, sub); + sub = (struct validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msg_init, arena); + if (sub) validate_RepeatedRules_set_items(msg, sub); } return sub; } UPB_INLINE void validate_RepeatedRules_set_ignore_empty(validate_RepeatedRules *msg, bool value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 2), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.MapRules */ UPB_INLINE validate_MapRules* validate_MapRules_new(upb_Arena* arena) { - return (validate_MapRules*)_upb_Message_New(&validate_MapRules_msginit, arena); + return (validate_MapRules*)_upb_Message_New(&validate_MapRules_msg_init, arena); } UPB_INLINE validate_MapRules* validate_MapRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_MapRules* ret = validate_MapRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_MapRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_MapRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3433,7 +5035,7 @@ UPB_INLINE validate_MapRules* validate_MapRules_parse_ex(const char* buf, size_t int options, upb_Arena* arena) { validate_MapRules* ret = validate_MapRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_MapRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_MapRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3441,126 +5043,156 @@ UPB_INLINE validate_MapRules* validate_MapRules_parse_ex(const char* buf, size_t } UPB_INLINE char* validate_MapRules_serialize(const validate_MapRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_MapRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_MapRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_MapRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_MapRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_MapRules_has_min_pairs(const validate_MapRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_MapRules_clear_min_pairs(const validate_MapRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_MapRules_clear_min_pairs(validate_MapRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_MapRules_min_pairs(const validate_MapRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_MapRules_has_max_pairs(const validate_MapRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_MapRules_has_min_pairs(const validate_MapRules* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_MapRules_clear_max_pairs(const validate_MapRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0; - _upb_clearhas(msg, 2); +UPB_INLINE void validate_MapRules_clear_max_pairs(validate_MapRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t validate_MapRules_max_pairs(const validate_MapRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_MapRules_has_no_sparse(const validate_MapRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_MapRules_has_max_pairs(const validate_MapRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_MapRules_clear_no_sparse(const validate_MapRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 3); +UPB_INLINE void validate_MapRules_clear_no_sparse(validate_MapRules* msg) { + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_MapRules_no_sparse(const validate_MapRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_MapRules_has_keys(const validate_MapRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_MapRules_has_no_sparse(const validate_MapRules* msg) { + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_MapRules_clear_keys(const validate_MapRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void validate_MapRules_clear_keys(validate_MapRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_FieldRules* validate_MapRules_keys(const validate_MapRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const validate_FieldRules*); + const validate_FieldRules* default_val = NULL; + const validate_FieldRules* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_MapRules_has_values(const validate_MapRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_MapRules_has_keys(const validate_MapRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_MapRules_clear_values(const validate_MapRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void validate_MapRules_clear_values(validate_MapRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const validate_FieldRules* validate_MapRules_values(const validate_MapRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const validate_FieldRules*); + const validate_FieldRules* default_val = NULL; + const validate_FieldRules* ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_MapRules_has_ignore_empty(const validate_MapRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool validate_MapRules_has_values(const validate_MapRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_MapRules_clear_ignore_empty(const validate_MapRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 6); +UPB_INLINE void validate_MapRules_clear_ignore_empty(validate_MapRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_MapRules_ignore_empty(const validate_MapRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(12, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_MapRules_has_ignore_empty(const validate_MapRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_MapRules_set_min_pairs(validate_MapRules *msg, uint64_t value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 1, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_MapRules_set_max_pairs(validate_MapRules *msg, uint64_t value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 16), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_MapRules_set_no_sparse(validate_MapRules *msg, bool value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, 1, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_MapRules_set_keys(validate_MapRules *msg, validate_FieldRules* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), validate_FieldRules*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 24), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_keys(validate_MapRules* msg, upb_Arena* arena) { struct validate_FieldRules* sub = (struct validate_FieldRules*)validate_MapRules_keys(msg); if (sub == NULL) { - sub = (struct validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msginit, arena); - if (!sub) return NULL; - validate_MapRules_set_keys(msg, sub); + sub = (struct validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msg_init, arena); + if (sub) validate_MapRules_set_keys(msg, sub); } return sub; } UPB_INLINE void validate_MapRules_set_values(validate_MapRules *msg, validate_FieldRules* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), validate_FieldRules*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(8, 32), 5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_values(validate_MapRules* msg, upb_Arena* arena) { struct validate_FieldRules* sub = (struct validate_FieldRules*)validate_MapRules_values(msg); if (sub == NULL) { - sub = (struct validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msginit, arena); - if (!sub) return NULL; - validate_MapRules_set_values(msg, sub); + sub = (struct validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msg_init, arena); + if (sub) validate_MapRules_set_values(msg, sub); } return sub; } UPB_INLINE void validate_MapRules_set_ignore_empty(validate_MapRules *msg, bool value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {6, UPB_SIZE(12, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* validate.AnyRules */ UPB_INLINE validate_AnyRules* validate_AnyRules_new(upb_Arena* arena) { - return (validate_AnyRules*)_upb_Message_New(&validate_AnyRules_msginit, arena); + return (validate_AnyRules*)_upb_Message_New(&validate_AnyRules_msg_init, arena); } UPB_INLINE validate_AnyRules* validate_AnyRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_AnyRules* ret = validate_AnyRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_AnyRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_AnyRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3570,7 +5202,7 @@ UPB_INLINE validate_AnyRules* validate_AnyRules_parse_ex(const char* buf, size_t int options, upb_Arena* arena) { validate_AnyRules* ret = validate_AnyRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_AnyRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_AnyRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3578,70 +5210,133 @@ UPB_INLINE validate_AnyRules* validate_AnyRules_parse_ex(const char* buf, size_t } UPB_INLINE char* validate_AnyRules_serialize(const validate_AnyRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_AnyRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_AnyRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_AnyRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_AnyRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_AnyRules_has_required(const validate_AnyRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_AnyRules_clear_required(const validate_AnyRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_AnyRules_clear_required(validate_AnyRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_AnyRules_required(const validate_AnyRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void validate_AnyRules_clear_in(const validate_AnyRules* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool validate_AnyRules_has_required(const validate_AnyRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* validate_AnyRules_in(const validate_AnyRules* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE void validate_AnyRules_clear_in(validate_AnyRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE void validate_AnyRules_clear_not_in(const validate_AnyRules* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE upb_StringView const* validate_AnyRules_in(const validate_AnyRules* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView const* validate_AnyRules_not_in(const validate_AnyRules* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE bool validate_AnyRules_has_in(const validate_AnyRules* msg) { + size_t size; + validate_AnyRules_in(msg, &size); + return size != 0; +} +UPB_INLINE void validate_AnyRules_clear_not_in(validate_AnyRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* validate_AnyRules_not_in(const validate_AnyRules* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool validate_AnyRules_has_not_in(const validate_AnyRules* msg) { + size_t size; + validate_AnyRules_not_in(msg, &size); + return size != 0; } UPB_INLINE void validate_AnyRules_set_required(validate_AnyRules *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -UPB_INLINE upb_StringView* validate_AnyRules_mutable_in(validate_AnyRules* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE upb_StringView* validate_AnyRules_mutable_in(validate_AnyRules* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* validate_AnyRules_resize_in(validate_AnyRules* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* validate_AnyRules_resize_in(validate_AnyRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_AnyRules_add_in(validate_AnyRules* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -UPB_INLINE upb_StringView* validate_AnyRules_mutable_not_in(validate_AnyRules* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView* validate_AnyRules_mutable_not_in(validate_AnyRules* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* validate_AnyRules_resize_not_in(validate_AnyRules* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* validate_AnyRules_resize_not_in(validate_AnyRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool validate_AnyRules_add_not_in(validate_AnyRules* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {3, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } /* validate.DurationRules */ UPB_INLINE validate_DurationRules* validate_DurationRules_new(upb_Arena* arena) { - return (validate_DurationRules*)_upb_Message_New(&validate_DurationRules_msginit, arena); + return (validate_DurationRules*)_upb_Message_New(&validate_DurationRules_msg_init, arena); } UPB_INLINE validate_DurationRules* validate_DurationRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_DurationRules* ret = validate_DurationRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_DurationRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_DurationRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3651,7 +5346,7 @@ UPB_INLINE validate_DurationRules* validate_DurationRules_parse_ex(const char* b int options, upb_Arena* arena) { validate_DurationRules* ret = validate_DurationRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_DurationRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_DurationRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3659,192 +5354,272 @@ UPB_INLINE validate_DurationRules* validate_DurationRules_parse_ex(const char* b } UPB_INLINE char* validate_DurationRules_serialize(const validate_DurationRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_DurationRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_DurationRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_DurationRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_DurationRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_DurationRules_has_required(const validate_DurationRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_DurationRules_clear_required(const validate_DurationRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_DurationRules_clear_required(validate_DurationRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_DurationRules_required(const validate_DurationRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DurationRules_has_const(const validate_DurationRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_DurationRules_has_required(const validate_DurationRules* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DurationRules_clear_const(const validate_DurationRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void validate_DurationRules_clear_const(validate_DurationRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_const(const validate_DurationRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DurationRules_has_lt(const validate_DurationRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_DurationRules_has_const(const validate_DurationRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DurationRules_clear_lt(const validate_DurationRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void validate_DurationRules_clear_lt(validate_DurationRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_lt(const validate_DurationRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DurationRules_has_lte(const validate_DurationRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_DurationRules_has_lt(const validate_DurationRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DurationRules_clear_lte(const validate_DurationRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void validate_DurationRules_clear_lte(validate_DurationRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_lte(const validate_DurationRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DurationRules_has_gt(const validate_DurationRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_DurationRules_has_lte(const validate_DurationRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DurationRules_clear_gt(const validate_DurationRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void validate_DurationRules_clear_gt(validate_DurationRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_gt(const validate_DurationRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_DurationRules_has_gte(const validate_DurationRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool validate_DurationRules_has_gt(const validate_DurationRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_DurationRules_clear_gte(const validate_DurationRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void validate_DurationRules_clear_gte(validate_DurationRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_gte(const validate_DurationRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_DurationRules_has_gte(const validate_DurationRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void validate_DurationRules_clear_in(validate_DurationRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 48), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_Duration* const* validate_DurationRules_in(const validate_DurationRules* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 48), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Duration* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool validate_DurationRules_has_in(const validate_DurationRules* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); + size_t size; + validate_DurationRules_in(msg, &size); + return size != 0; } -UPB_INLINE void validate_DurationRules_clear_in(const validate_DurationRules* msg) { - _upb_array_detach(msg, UPB_SIZE(24, 48)); +UPB_INLINE void validate_DurationRules_clear_not_in(validate_DurationRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE const struct google_protobuf_Duration* const* validate_DurationRules_in(const validate_DurationRules* msg, size_t* len) { - return (const struct google_protobuf_Duration* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE const struct google_protobuf_Duration* const* validate_DurationRules_not_in(const validate_DurationRules* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_Duration* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool validate_DurationRules_has_not_in(const validate_DurationRules* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE void validate_DurationRules_clear_not_in(const validate_DurationRules* msg) { - _upb_array_detach(msg, UPB_SIZE(28, 56)); -} -UPB_INLINE const struct google_protobuf_Duration* const* validate_DurationRules_not_in(const validate_DurationRules* msg, size_t* len) { - return (const struct google_protobuf_Duration* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); + size_t size; + validate_DurationRules_not_in(msg, &size); + return size != 0; } UPB_INLINE void validate_DurationRules_set_required(validate_DurationRules *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_DurationRules_set_const(validate_DurationRules *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_const(validate_DurationRules* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_const(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - validate_DurationRules_set_const(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) validate_DurationRules_set_const(msg, sub); } return sub; } UPB_INLINE void validate_DurationRules_set_lt(validate_DurationRules *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_lt(validate_DurationRules* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_lt(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - validate_DurationRules_set_lt(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) validate_DurationRules_set_lt(msg, sub); } return sub; } UPB_INLINE void validate_DurationRules_set_lte(validate_DurationRules *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_lte(validate_DurationRules* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_lte(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - validate_DurationRules_set_lte(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) validate_DurationRules_set_lte(msg, sub); } return sub; } UPB_INLINE void validate_DurationRules_set_gt(validate_DurationRules *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_gt(validate_DurationRules* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_gt(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - validate_DurationRules_set_gt(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) validate_DurationRules_set_gt(msg, sub); } return sub; } UPB_INLINE void validate_DurationRules_set_gte(validate_DurationRules *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_gte(validate_DurationRules* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_gte(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - validate_DurationRules_set_gte(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) validate_DurationRules_set_gte(msg, sub); } return sub; } -UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_in(validate_DurationRules* msg, size_t* len) { - return (struct google_protobuf_Duration**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); +UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_in(validate_DurationRules* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(24, 48), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Duration**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_resize_in(validate_DurationRules* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Duration**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_resize_in(validate_DurationRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(24, 48), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Duration**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_add_in(validate_DurationRules* msg, upb_Arena* arena) { - struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {7, UPB_SIZE(24, 48), 0, 5, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_not_in(validate_DurationRules* msg, size_t* len) { - return (struct google_protobuf_Duration**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); +UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_not_in(validate_DurationRules* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_Duration**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_resize_not_in(validate_DurationRules* msg, size_t len, upb_Arena* arena) { - return (struct google_protobuf_Duration**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_resize_not_in(validate_DurationRules* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct google_protobuf_Duration**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_add_not_in(validate_DurationRules* msg, upb_Arena* arena) { - struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {8, UPB_SIZE(28, 56), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* validate.TimestampRules */ UPB_INLINE validate_TimestampRules* validate_TimestampRules_new(upb_Arena* arena) { - return (validate_TimestampRules*)_upb_Message_New(&validate_TimestampRules_msginit, arena); + return (validate_TimestampRules*)_upb_Message_New(&validate_TimestampRules_msg_init, arena); } UPB_INLINE validate_TimestampRules* validate_TimestampRules_parse(const char* buf, size_t size, upb_Arena* arena) { validate_TimestampRules* ret = validate_TimestampRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_TimestampRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &validate_TimestampRules_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -3854,7 +5629,7 @@ UPB_INLINE validate_TimestampRules* validate_TimestampRules_parse_ex(const char* int options, upb_Arena* arena) { validate_TimestampRules* ret = validate_TimestampRules_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &validate_TimestampRules_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &validate_TimestampRules_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -3862,244 +5637,330 @@ UPB_INLINE validate_TimestampRules* validate_TimestampRules_parse_ex(const char* } UPB_INLINE char* validate_TimestampRules_serialize(const validate_TimestampRules* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &validate_TimestampRules_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &validate_TimestampRules_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &validate_TimestampRules_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &validate_TimestampRules_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool validate_TimestampRules_has_required(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void validate_TimestampRules_clear_required(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0; - _upb_clearhas(msg, 1); +UPB_INLINE void validate_TimestampRules_clear_required(validate_TimestampRules* msg) { + const upb_MiniTableField field = {1, 2, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_TimestampRules_required(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 2, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_const(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool validate_TimestampRules_has_required(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {1, 2, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_const(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void validate_TimestampRules_clear_const(validate_TimestampRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_const(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_lt(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 3); +UPB_INLINE bool validate_TimestampRules_has_const(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_lt(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL; +UPB_INLINE void validate_TimestampRules_clear_lt(validate_TimestampRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_lt(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_lte(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 4); +UPB_INLINE bool validate_TimestampRules_has_lt(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_lte(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL; +UPB_INLINE void validate_TimestampRules_clear_lte(validate_TimestampRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_lte(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_gt(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 5); +UPB_INLINE bool validate_TimestampRules_has_lte(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_gt(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL; +UPB_INLINE void validate_TimestampRules_clear_gt(validate_TimestampRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_gt(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_gte(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 6); +UPB_INLINE bool validate_TimestampRules_has_gt(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_gte(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL; +UPB_INLINE void validate_TimestampRules_clear_gte(validate_TimestampRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_gte(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*); + const struct google_protobuf_Timestamp* default_val = NULL; + const struct google_protobuf_Timestamp* ret; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_lt_now(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 7); +UPB_INLINE bool validate_TimestampRules_has_gte(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_lt_now(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0; - _upb_clearhas(msg, 7); +UPB_INLINE void validate_TimestampRules_clear_lt_now(validate_TimestampRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 3), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_TimestampRules_lt_now(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 3), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_gt_now(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 8); +UPB_INLINE bool validate_TimestampRules_has_lt_now(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 3), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_gt_now(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0; - _upb_clearhas(msg, 8); +UPB_INLINE void validate_TimestampRules_clear_gt_now(validate_TimestampRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(25, 4), 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool validate_TimestampRules_gt_now(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {8, UPB_SIZE(25, 4), 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool validate_TimestampRules_has_within(const validate_TimestampRules* msg) { - return _upb_hasbit(msg, 9); +UPB_INLINE bool validate_TimestampRules_has_gt_now(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(25, 4), 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void validate_TimestampRules_clear_within(const validate_TimestampRules* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL; +UPB_INLINE void validate_TimestampRules_clear_within(validate_TimestampRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 9, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* validate_TimestampRules_within(const validate_TimestampRules* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 9, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool validate_TimestampRules_has_within(const validate_TimestampRules* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 9, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void validate_TimestampRules_set_required(validate_TimestampRules *msg, bool value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value; + const upb_MiniTableField field = {1, 2, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_TimestampRules_set_const(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_const(validate_TimestampRules* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_const(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - validate_TimestampRules_set_const(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) validate_TimestampRules_set_const(msg, sub); } return sub; } UPB_INLINE void validate_TimestampRules_set_lt(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 3, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_lt(validate_TimestampRules* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_lt(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - validate_TimestampRules_set_lt(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) validate_TimestampRules_set_lt(msg, sub); } return sub; } UPB_INLINE void validate_TimestampRules_set_lte(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(12, 24), 4, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_lte(validate_TimestampRules* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_lte(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - validate_TimestampRules_set_lte(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) validate_TimestampRules_set_lte(msg, sub); } return sub; } UPB_INLINE void validate_TimestampRules_set_gt(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {5, UPB_SIZE(16, 32), 5, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_gt(validate_TimestampRules* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_gt(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - validate_TimestampRules_set_gt(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) validate_TimestampRules_set_gt(msg, sub); } return sub; } UPB_INLINE void validate_TimestampRules_set_gte(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) { - _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Timestamp*) = value; + const upb_MiniTableField field = {6, UPB_SIZE(20, 40), 6, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_gte(validate_TimestampRules* msg, upb_Arena* arena) { struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_gte(msg); if (sub == NULL) { - sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena); - if (!sub) return NULL; - validate_TimestampRules_set_gte(msg, sub); + sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msg_init, arena); + if (sub) validate_TimestampRules_set_gte(msg, sub); } return sub; } UPB_INLINE void validate_TimestampRules_set_lt_now(validate_TimestampRules *msg, bool value) { - _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value; + const upb_MiniTableField field = {7, UPB_SIZE(24, 3), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_TimestampRules_set_gt_now(validate_TimestampRules *msg, bool value) { - _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value; + const upb_MiniTableField field = {8, UPB_SIZE(25, 4), 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void validate_TimestampRules_set_within(validate_TimestampRules *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {9, UPB_SIZE(28, 48), 9, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* validate_TimestampRules_mutable_within(validate_TimestampRules* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_TimestampRules_within(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - validate_TimestampRules_set_within(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) validate_TimestampRules_set_within(msg, sub); } return sub; } UPB_INLINE bool validate_has_disabled(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &validate_disabled_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &validate_disabled_ext); } UPB_INLINE void validate_clear_disabled(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &validate_disabled_ext); + _upb_Message_ClearExtensionField(msg, &validate_disabled_ext); } UPB_INLINE bool validate_disabled(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_disabled_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &validate_disabled_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; +} +UPB_INLINE void validate_set_disabled(struct google_protobuf_MessageOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &validate_disabled_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool validate_has_ignored(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &validate_ignored_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &validate_ignored_ext); } UPB_INLINE void validate_clear_ignored(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &validate_ignored_ext); + _upb_Message_ClearExtensionField(msg, &validate_ignored_ext); } UPB_INLINE bool validate_ignored(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_ignored_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &validate_ignored_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; +} +UPB_INLINE void validate_set_ignored(struct google_protobuf_MessageOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &validate_ignored_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool validate_has_required(const struct google_protobuf_OneofOptions* msg) { - return _upb_Message_Getext(msg, &validate_required_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &validate_required_ext); } UPB_INLINE void validate_clear_required(struct google_protobuf_OneofOptions* msg) { - _upb_Message_Clearext(msg, &validate_required_ext); + _upb_Message_ClearExtensionField(msg, &validate_required_ext); } UPB_INLINE bool validate_required(const struct google_protobuf_OneofOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_required_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &validate_required_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; +} +UPB_INLINE void validate_set_required(struct google_protobuf_OneofOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &validate_required_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool validate_has_rules(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &validate_rules_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &validate_rules_ext); } UPB_INLINE void validate_clear_rules(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &validate_rules_ext); + _upb_Message_ClearExtensionField(msg, &validate_rules_ext); } UPB_INLINE const validate_FieldRules* validate_rules(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_rules_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const validate_FieldRules*); + const upb_MiniTableExtension* ext = &validate_rules_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const validate_FieldRules* default_val = NULL; + const validate_FieldRules* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_GetOrCreateExtension(msg, &validate_rules_ext, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, const validate_FieldRules*) = ext; +UPB_INLINE void validate_set_rules(struct google_protobuf_FieldOptions* msg, const validate_FieldRules* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &validate_rules_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File validate_validate_proto_upb_file_layout; +extern const upb_MiniTableFile validate_validate_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* VALIDATE_VALIDATE_PROTO_UPB_H_ */ 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 cdc3dcf3c64..08d7983d5fe 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 @@ -7,89 +7,108 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/annotations/v3/migrate.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field xds_annotations_v3_MigrateAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_MigrateAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msg_init = { NULL, &xds_annotations_v3_MigrateAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; -static const upb_MiniTable_Field xds_annotations_v3_FieldMigrateAnnotation__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_FieldMigrateAnnotation__fields[2] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msg_init = { NULL, &xds_annotations_v3_FieldMigrateAnnotation__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + {0x001000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field xds_annotations_v3_FileMigrateAnnotation__fields[1] = { - {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_FileMigrateAnnotation__fields[1] = { + {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msg_init = { NULL, &xds_annotations_v3_FileMigrateAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &xds_annotations_v3_MigrateAnnotation_msginit, - &xds_annotations_v3_FieldMigrateAnnotation_msginit, - &xds_annotations_v3_FileMigrateAnnotation_msginit, + &xds_annotations_v3_MigrateAnnotation_msg_init, + &xds_annotations_v3_FieldMigrateAnnotation_msg_init, + &xds_annotations_v3_FileMigrateAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_EnumOptions_msginit; -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msginit; -const upb_MiniTable_Extension xds_annotations_v3_message_migrate_ext = { - {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, - {.submsg = &xds_annotations_v3_MigrateAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msg_init; +const upb_MiniTableExtension xds_annotations_v3_message_migrate_ext = { + {112948430, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, + {.submsg = &xds_annotations_v3_MigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension xds_annotations_v3_field_migrate_ext = { - {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, - {.submsg = &xds_annotations_v3_FieldMigrateAnnotation_msginit}, +const upb_MiniTableExtension xds_annotations_v3_field_migrate_ext = { + {112948430, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, + {.submsg = &xds_annotations_v3_FieldMigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension xds_annotations_v3_enum_migrate_ext = { - {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_EnumOptions_msginit, - {.submsg = &xds_annotations_v3_MigrateAnnotation_msginit}, +const upb_MiniTableExtension xds_annotations_v3_enum_migrate_ext = { + {112948430, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_EnumOptions_msg_init, + {.submsg = &xds_annotations_v3_MigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension xds_annotations_v3_enum_value_migrate_ext = { - {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_EnumValueOptions_msginit, - {.submsg = &xds_annotations_v3_MigrateAnnotation_msginit}, +const upb_MiniTableExtension xds_annotations_v3_enum_value_migrate_ext = { + {112948430, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_EnumValueOptions_msg_init, + {.submsg = &xds_annotations_v3_MigrateAnnotation_msg_init}, }; -const upb_MiniTable_Extension xds_annotations_v3_file_migrate_ext = { - {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FileOptions_msginit, - {.submsg = &xds_annotations_v3_FileMigrateAnnotation_msginit}, +const upb_MiniTableExtension xds_annotations_v3_file_migrate_ext = { + {112948430, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FileOptions_msg_init, + {.submsg = &xds_annotations_v3_FileMigrateAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[5] = { +static const upb_MiniTableExtension *extensions_layout[5] = { &xds_annotations_v3_message_migrate_ext, &xds_annotations_v3_field_migrate_ext, &xds_annotations_v3_enum_migrate_ext, @@ -97,7 +116,7 @@ static const upb_MiniTable_Extension *extensions_layout[5] = { &xds_annotations_v3_file_migrate_ext, }; -const upb_MiniTable_File xds_annotations_v3_migrate_proto_upb_file_layout = { +const upb_MiniTableFile xds_annotations_v3_migrate_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -106,5 +125,5 @@ const upb_MiniTable_File xds_annotations_v3_migrate_proto_upb_file_layout = { 5, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 0ad7b304ad3..e49b2ea30f5 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 @@ -9,53 +9,55 @@ #ifndef XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPB_H_ #define XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_annotations_v3_MigrateAnnotation; -struct xds_annotations_v3_FieldMigrateAnnotation; -struct xds_annotations_v3_FileMigrateAnnotation; typedef struct xds_annotations_v3_MigrateAnnotation xds_annotations_v3_MigrateAnnotation; typedef struct xds_annotations_v3_FieldMigrateAnnotation xds_annotations_v3_FieldMigrateAnnotation; typedef struct xds_annotations_v3_FileMigrateAnnotation xds_annotations_v3_FileMigrateAnnotation; -extern const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msginit; -extern const upb_MiniTable_Extension xds_annotations_v3_message_migrate_ext; -extern const upb_MiniTable_Extension xds_annotations_v3_field_migrate_ext; -extern const upb_MiniTable_Extension xds_annotations_v3_enum_migrate_ext; -extern const upb_MiniTable_Extension xds_annotations_v3_enum_value_migrate_ext; -extern const upb_MiniTable_Extension xds_annotations_v3_file_migrate_ext; +extern const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msg_init; +extern const upb_MiniTableExtension xds_annotations_v3_message_migrate_ext; +extern const upb_MiniTableExtension xds_annotations_v3_field_migrate_ext; +extern const upb_MiniTableExtension xds_annotations_v3_enum_migrate_ext; +extern const upb_MiniTableExtension xds_annotations_v3_enum_value_migrate_ext; +extern const upb_MiniTableExtension xds_annotations_v3_file_migrate_ext; struct google_protobuf_EnumOptions; struct google_protobuf_EnumValueOptions; struct google_protobuf_FieldOptions; struct google_protobuf_FileOptions; struct google_protobuf_MessageOptions; -extern const upb_MiniTable google_protobuf_EnumOptions_msginit; -extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; +extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; /* xds.annotations.v3.MigrateAnnotation */ UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_MigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_MigrateAnnotation_msginit, arena); + return (xds_annotations_v3_MigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_MigrateAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_MigrateAnnotation* ret = xds_annotations_v3_MigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_MigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_MigrateAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -65,7 +67,7 @@ UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnot int options, upb_Arena* arena) { xds_annotations_v3_MigrateAnnotation* ret = xds_annotations_v3_MigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_MigrateAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_MigrateAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -73,35 +75,41 @@ UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnot } UPB_INLINE char* xds_annotations_v3_MigrateAnnotation_serialize(const xds_annotations_v3_MigrateAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msg_init, 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); +UPB_INLINE void xds_annotations_v3_MigrateAnnotation_clear_rename(xds_annotations_v3_MigrateAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_annotations_v3_MigrateAnnotation_rename(const xds_annotations_v3_MigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_MigrateAnnotation_set_rename(xds_annotations_v3_MigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.annotations.v3.FieldMigrateAnnotation */ UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMigrateAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_FieldMigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldMigrateAnnotation_msginit, arena); + return (xds_annotations_v3_FieldMigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldMigrateAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_FieldMigrateAnnotation* ret = xds_annotations_v3_FieldMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldMigrateAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -111,7 +119,7 @@ UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMi int options, upb_Arena* arena) { xds_annotations_v3_FieldMigrateAnnotation* ret = xds_annotations_v3_FieldMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldMigrateAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldMigrateAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -119,44 +127,56 @@ UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMi } UPB_INLINE char* xds_annotations_v3_FieldMigrateAnnotation_serialize(const xds_annotations_v3_FieldMigrateAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msg_init, 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); +UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_clear_rename(xds_annotations_v3_FieldMigrateAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_annotations_v3_FieldMigrateAnnotation_rename(const xds_annotations_v3_FieldMigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_clear_oneof_promotion(const xds_annotations_v3_FieldMigrateAnnotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_clear_oneof_promotion(xds_annotations_v3_FieldMigrateAnnotation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_annotations_v3_FieldMigrateAnnotation_oneof_promotion(const xds_annotations_v3_FieldMigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_set_rename(xds_annotations_v3_FieldMigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_set_oneof_promotion(xds_annotations_v3_FieldMigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.annotations.v3.FileMigrateAnnotation */ UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigrateAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_FileMigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_FileMigrateAnnotation_msginit, arena); + return (xds_annotations_v3_FileMigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_FileMigrateAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_FileMigrateAnnotation* ret = xds_annotations_v3_FileMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileMigrateAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -166,7 +186,7 @@ UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigr int options, upb_Arena* arena) { xds_annotations_v3_FileMigrateAnnotation* ret = xds_annotations_v3_FileMigrateAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileMigrateAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileMigrateAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -174,117 +194,148 @@ UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigr } UPB_INLINE char* xds_annotations_v3_FileMigrateAnnotation_serialize(const xds_annotations_v3_FileMigrateAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msg_init, 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); +UPB_INLINE void xds_annotations_v3_FileMigrateAnnotation_clear_move_to_package(xds_annotations_v3_FileMigrateAnnotation* msg) { + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_annotations_v3_FileMigrateAnnotation_move_to_package(const xds_annotations_v3_FileMigrateAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_FileMigrateAnnotation_set_move_to_package(xds_annotations_v3_FileMigrateAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {2, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool xds_annotations_v3_has_message_migrate(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_message_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_message_migrate_ext); } UPB_INLINE void xds_annotations_v3_clear_message_migrate(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_message_migrate_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_message_migrate_ext); } UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_message_migrate(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_message_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MigrateAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_message_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_MigrateAnnotation* default_val = NULL; + const xds_annotations_v3_MigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_message_migrate(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_MigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_message_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool xds_annotations_v3_has_field_migrate(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_field_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_field_migrate_ext); } UPB_INLINE void xds_annotations_v3_clear_field_migrate(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_field_migrate_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_field_migrate_ext); } UPB_INLINE const xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_field_migrate(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_field_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldMigrateAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_field_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_FieldMigrateAnnotation* default_val = NULL; + const xds_annotations_v3_FieldMigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_field_migrate(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldMigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_field_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool xds_annotations_v3_has_enum_migrate(const struct google_protobuf_EnumOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_enum_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_enum_migrate_ext); } UPB_INLINE void xds_annotations_v3_clear_enum_migrate(struct google_protobuf_EnumOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_enum_migrate_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_enum_migrate_ext); } UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_enum_migrate(const struct google_protobuf_EnumOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_enum_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MigrateAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_enum_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_MigrateAnnotation* default_val = NULL; + const xds_annotations_v3_MigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_enum_migrate(struct google_protobuf_EnumOptions* msg, const xds_annotations_v3_MigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_enum_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool xds_annotations_v3_has_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_enum_value_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_enum_value_migrate_ext); } UPB_INLINE void xds_annotations_v3_clear_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_enum_value_migrate_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_enum_value_migrate_ext); } UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_enum_value_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MigrateAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_enum_value_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_MigrateAnnotation* default_val = NULL; + const xds_annotations_v3_MigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg, const xds_annotations_v3_MigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_enum_value_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool xds_annotations_v3_has_file_migrate(const struct google_protobuf_FileOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_file_migrate_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_file_migrate_ext); } UPB_INLINE void xds_annotations_v3_clear_file_migrate(struct google_protobuf_FileOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_file_migrate_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_file_migrate_ext); } UPB_INLINE const xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_file_migrate(const struct google_protobuf_FileOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_file_migrate_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FileMigrateAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_file_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_FileMigrateAnnotation* default_val = NULL; + const xds_annotations_v3_FileMigrateAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_file_migrate(struct google_protobuf_FileOptions* msg, const xds_annotations_v3_FileMigrateAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_file_migrate_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File xds_annotations_v3_migrate_proto_upb_file_layout; +extern const upb_MiniTableFile xds_annotations_v3_migrate_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPB_H_ */ 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 3ffb371b3d2..9335e95f9d8 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 @@ -7,42 +7,51 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/annotations/v3/security.upb.h" #include "xds/annotations/v3/status.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field xds_annotations_v3_FieldSecurityAnnotation__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_FieldSecurityAnnotation__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msg_init = { NULL, &xds_annotations_v3_FieldSecurityAnnotation__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000100003f000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_annotations_v3_FieldSecurityAnnotation_msginit, + &xds_annotations_v3_FieldSecurityAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msginit; -const upb_MiniTable_Extension xds_annotations_v3_security_ext = { - {99044135, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, - {.submsg = &xds_annotations_v3_FieldSecurityAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msg_init; +const upb_MiniTableExtension xds_annotations_v3_security_ext = { + {99044135, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, + {.submsg = &xds_annotations_v3_FieldSecurityAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &xds_annotations_v3_security_ext, }; -const upb_MiniTable_File xds_annotations_v3_security_proto_upb_file_layout = { +const upb_MiniTableFile xds_annotations_v3_security_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -51,5 +60,5 @@ const upb_MiniTable_File xds_annotations_v3_security_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 80046ff5cc8..33bb8d383da 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 @@ -9,35 +9,39 @@ #ifndef XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_ #define XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_annotations_v3_FieldSecurityAnnotation; typedef struct xds_annotations_v3_FieldSecurityAnnotation xds_annotations_v3_FieldSecurityAnnotation; -extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msginit; -extern const upb_MiniTable_Extension xds_annotations_v3_security_ext; +extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msg_init; +extern const upb_MiniTableExtension xds_annotations_v3_security_ext; struct google_protobuf_FieldOptions; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; /* xds.annotations.v3.FieldSecurityAnnotation */ UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_FieldSecurityAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldSecurityAnnotation_msginit, arena); + return (xds_annotations_v3_FieldSecurityAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldSecurityAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_FieldSecurityAnnotation* ret = xds_annotations_v3_FieldSecurityAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +51,7 @@ UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldS int options, upb_Arena* arena) { xds_annotations_v3_FieldSecurityAnnotation* ret = xds_annotations_v3_FieldSecurityAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,58 +59,75 @@ UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldS } UPB_INLINE char* xds_annotations_v3_FieldSecurityAnnotation_serialize(const xds_annotations_v3_FieldSecurityAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, 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; +UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_downstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation* msg) { + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_upstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool xds_annotations_v3_has_security(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_security_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_security_ext); } UPB_INLINE void xds_annotations_v3_clear_security(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_security_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_security_ext); } UPB_INLINE const xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_security(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_security_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldSecurityAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_security_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_FieldSecurityAnnotation* default_val = NULL; + const xds_annotations_v3_FieldSecurityAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_security(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldSecurityAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_security_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File xds_annotations_v3_security_proto_upb_file_layout; +extern const upb_MiniTableFile xds_annotations_v3_security_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c b/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c index 792bbd4fbf1..f62be0c4c00 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +++ b/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c @@ -7,25 +7,28 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/annotations/v3/sensitive.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -const upb_MiniTable_Extension xds_annotations_v3_sensitive_ext = { - {61008053, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +const upb_MiniTableExtension xds_annotations_v3_sensitive_ext = { + {61008053, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, {.submsg = NULL}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &xds_annotations_v3_sensitive_ext, }; -const upb_MiniTable_File xds_annotations_v3_sensitive_proto_upb_file_layout = { +const upb_MiniTableFile xds_annotations_v3_sensitive_proto_upb_file_layout = { NULL, NULL, extensions_layout, @@ -34,5 +37,5 @@ const upb_MiniTable_File xds_annotations_v3_sensitive_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h b/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h index 696ee5eb89d..ad4fad6c50b 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +++ b/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h @@ -9,38 +9,55 @@ #ifndef XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPB_H_ #define XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -extern const upb_MiniTable_Extension xds_annotations_v3_sensitive_ext; +extern const upb_MiniTableExtension xds_annotations_v3_sensitive_ext; struct google_protobuf_FieldOptions; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; UPB_INLINE bool xds_annotations_v3_has_sensitive(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_sensitive_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_sensitive_ext); } UPB_INLINE void xds_annotations_v3_clear_sensitive(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_sensitive_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_sensitive_ext); } UPB_INLINE bool xds_annotations_v3_sensitive(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_sensitive_ext); - return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; + const upb_MiniTableExtension* ext = &xds_annotations_v3_sensitive_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool default_val = false; + bool ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -extern const upb_MiniTable_File xds_annotations_v3_sensitive_proto_upb_file_layout; +UPB_INLINE void xds_annotations_v3_set_sensitive(struct google_protobuf_FieldOptions* msg, bool val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_sensitive_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_1Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); +} +extern const upb_MiniTableFile xds_annotations_v3_sensitive_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPB_H_ */ 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 fea67a994c0..ecef921b807 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 @@ -7,92 +7,113 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/annotations/v3/status.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field xds_annotations_v3_FileStatusAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_FileStatusAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msg_init = { NULL, &xds_annotations_v3_FileStatusAnnotation__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Field xds_annotations_v3_MessageStatusAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_MessageStatusAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msg_init = { NULL, &xds_annotations_v3_MessageStatusAnnotation__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Field xds_annotations_v3_FieldStatusAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_FieldStatusAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msg_init = { NULL, &xds_annotations_v3_FieldStatusAnnotation__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + }) }; -static const upb_MiniTable_Field xds_annotations_v3_StatusAnnotation__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_StatusAnnotation__fields[2] = { + {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_StatusAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_StatusAnnotation_msg_init = { NULL, &xds_annotations_v3_StatusAnnotation__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psb1_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[4] = { - &xds_annotations_v3_FileStatusAnnotation_msginit, - &xds_annotations_v3_MessageStatusAnnotation_msginit, - &xds_annotations_v3_FieldStatusAnnotation_msginit, - &xds_annotations_v3_StatusAnnotation_msginit, + &xds_annotations_v3_FileStatusAnnotation_msg_init, + &xds_annotations_v3_MessageStatusAnnotation_msg_init, + &xds_annotations_v3_FieldStatusAnnotation_msg_init, + &xds_annotations_v3_StatusAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msginit; -const upb_MiniTable_Extension xds_annotations_v3_file_status_ext = { - {226829418, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FileOptions_msginit, - {.submsg = &xds_annotations_v3_FileStatusAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msg_init; +const upb_MiniTableExtension xds_annotations_v3_file_status_ext = { + {226829418, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FileOptions_msg_init, + {.submsg = &xds_annotations_v3_FileStatusAnnotation_msg_init}, }; -const upb_MiniTable_Extension xds_annotations_v3_message_status_ext = { - {226829418, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, - {.submsg = &xds_annotations_v3_MessageStatusAnnotation_msginit}, +const upb_MiniTableExtension xds_annotations_v3_message_status_ext = { + {226829418, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, + {.submsg = &xds_annotations_v3_MessageStatusAnnotation_msg_init}, }; -const upb_MiniTable_Extension xds_annotations_v3_field_status_ext = { - {226829418, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_FieldOptions_msginit, - {.submsg = &xds_annotations_v3_FieldStatusAnnotation_msginit}, +const upb_MiniTableExtension xds_annotations_v3_field_status_ext = { + {226829418, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_FieldOptions_msg_init, + {.submsg = &xds_annotations_v3_FieldStatusAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[3] = { +static const upb_MiniTableExtension *extensions_layout[3] = { &xds_annotations_v3_file_status_ext, &xds_annotations_v3_message_status_ext, &xds_annotations_v3_field_status_ext, }; -const upb_MiniTable_File xds_annotations_v3_status_proto_upb_file_layout = { +const upb_MiniTableFile xds_annotations_v3_status_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -101,5 +122,5 @@ const upb_MiniTable_File xds_annotations_v3_status_proto_upb_file_layout = { 3, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 42d2584e936..e162a56045d 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 @@ -9,38 +9,39 @@ #ifndef XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_ #define XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_annotations_v3_FileStatusAnnotation; -struct xds_annotations_v3_MessageStatusAnnotation; -struct xds_annotations_v3_FieldStatusAnnotation; -struct xds_annotations_v3_StatusAnnotation; typedef struct xds_annotations_v3_FileStatusAnnotation xds_annotations_v3_FileStatusAnnotation; typedef struct xds_annotations_v3_MessageStatusAnnotation xds_annotations_v3_MessageStatusAnnotation; typedef struct xds_annotations_v3_FieldStatusAnnotation xds_annotations_v3_FieldStatusAnnotation; typedef struct xds_annotations_v3_StatusAnnotation xds_annotations_v3_StatusAnnotation; -extern const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msginit; -extern const upb_MiniTable xds_annotations_v3_StatusAnnotation_msginit; -extern const upb_MiniTable_Extension xds_annotations_v3_file_status_ext; -extern const upb_MiniTable_Extension xds_annotations_v3_message_status_ext; -extern const upb_MiniTable_Extension xds_annotations_v3_field_status_ext; +extern const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msg_init; +extern const upb_MiniTable xds_annotations_v3_StatusAnnotation_msg_init; +extern const upb_MiniTableExtension xds_annotations_v3_file_status_ext; +extern const upb_MiniTableExtension xds_annotations_v3_message_status_ext; +extern const upb_MiniTableExtension xds_annotations_v3_field_status_ext; struct google_protobuf_FieldOptions; struct google_protobuf_FileOptions; struct google_protobuf_MessageOptions; -extern const upb_MiniTable google_protobuf_FieldOptions_msginit; -extern const upb_MiniTable google_protobuf_FileOptions_msginit; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; typedef enum { xds_annotations_v3_UNKNOWN = 0, @@ -54,12 +55,12 @@ typedef enum { /* xds.annotations.v3.FileStatusAnnotation */ UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatusAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_FileStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_FileStatusAnnotation_msginit, arena); + return (xds_annotations_v3_FileStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_FileStatusAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_FileStatusAnnotation* ret = xds_annotations_v3_FileStatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -69,7 +70,7 @@ UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatu int options, upb_Arena* arena) { xds_annotations_v3_FileStatusAnnotation* ret = xds_annotations_v3_FileStatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -77,35 +78,41 @@ UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatu } UPB_INLINE char* xds_annotations_v3_FileStatusAnnotation_serialize(const xds_annotations_v3_FileStatusAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msg_init, 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; +UPB_INLINE void xds_annotations_v3_FileStatusAnnotation_clear_work_in_progress(xds_annotations_v3_FileStatusAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_annotations_v3_FileStatusAnnotation_work_in_progress(const xds_annotations_v3_FileStatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_FileStatusAnnotation_set_work_in_progress(xds_annotations_v3_FileStatusAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.annotations.v3.MessageStatusAnnotation */ UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_MessageStatusAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_MessageStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_MessageStatusAnnotation_msginit, arena); + return (xds_annotations_v3_MessageStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_MessageStatusAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_MessageStatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_MessageStatusAnnotation* ret = xds_annotations_v3_MessageStatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -115,7 +122,7 @@ UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_Messag int options, upb_Arena* arena) { xds_annotations_v3_MessageStatusAnnotation* ret = xds_annotations_v3_MessageStatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -123,35 +130,41 @@ UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_Messag } UPB_INLINE char* xds_annotations_v3_MessageStatusAnnotation_serialize(const xds_annotations_v3_MessageStatusAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msg_init, 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; +UPB_INLINE void xds_annotations_v3_MessageStatusAnnotation_clear_work_in_progress(xds_annotations_v3_MessageStatusAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_annotations_v3_MessageStatusAnnotation_work_in_progress(const xds_annotations_v3_MessageStatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_MessageStatusAnnotation_set_work_in_progress(xds_annotations_v3_MessageStatusAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.annotations.v3.FieldStatusAnnotation */ UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldStatusAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_FieldStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldStatusAnnotation_msginit, arena); + return (xds_annotations_v3_FieldStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldStatusAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldStatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_FieldStatusAnnotation* ret = xds_annotations_v3_FieldStatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -161,7 +174,7 @@ UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldSta int options, upb_Arena* arena) { xds_annotations_v3_FieldStatusAnnotation* ret = xds_annotations_v3_FieldStatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -169,35 +182,41 @@ UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldSta } UPB_INLINE char* xds_annotations_v3_FieldStatusAnnotation_serialize(const xds_annotations_v3_FieldStatusAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msg_init, 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; +UPB_INLINE void xds_annotations_v3_FieldStatusAnnotation_clear_work_in_progress(xds_annotations_v3_FieldStatusAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_annotations_v3_FieldStatusAnnotation_work_in_progress(const xds_annotations_v3_FieldStatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_FieldStatusAnnotation_set_work_in_progress(xds_annotations_v3_FieldStatusAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.annotations.v3.StatusAnnotation */ UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_StatusAnnotation*)_upb_Message_New(&xds_annotations_v3_StatusAnnotation_msginit, arena); + return (xds_annotations_v3_StatusAnnotation*)_upb_Message_New(&xds_annotations_v3_StatusAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_StatusAnnotation* ret = xds_annotations_v3_StatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -207,7 +226,7 @@ UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotat int options, upb_Arena* arena) { xds_annotations_v3_StatusAnnotation* ret = xds_annotations_v3_StatusAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -215,92 +234,119 @@ UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotat } UPB_INLINE char* xds_annotations_v3_StatusAnnotation_serialize(const xds_annotations_v3_StatusAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msg_init, 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; +UPB_INLINE void xds_annotations_v3_StatusAnnotation_clear_work_in_progress(xds_annotations_v3_StatusAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_annotations_v3_StatusAnnotation_work_in_progress(const xds_annotations_v3_StatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_annotations_v3_StatusAnnotation_clear_package_version_status(const xds_annotations_v3_StatusAnnotation* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void xds_annotations_v3_StatusAnnotation_clear_package_version_status(xds_annotations_v3_StatusAnnotation* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t xds_annotations_v3_StatusAnnotation_package_version_status(const xds_annotations_v3_StatusAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_StatusAnnotation_set_work_in_progress(xds_annotations_v3_StatusAnnotation *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_annotations_v3_StatusAnnotation_set_package_version_status(xds_annotations_v3_StatusAnnotation *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool xds_annotations_v3_has_file_status(const struct google_protobuf_FileOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_file_status_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_file_status_ext); } UPB_INLINE void xds_annotations_v3_clear_file_status(struct google_protobuf_FileOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_file_status_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_file_status_ext); } UPB_INLINE const xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_file_status(const struct google_protobuf_FileOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_file_status_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FileStatusAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_file_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_FileStatusAnnotation* default_val = NULL; + const xds_annotations_v3_FileStatusAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_file_status(struct google_protobuf_FileOptions* msg, const xds_annotations_v3_FileStatusAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_file_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool xds_annotations_v3_has_message_status(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_message_status_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_message_status_ext); } UPB_INLINE void xds_annotations_v3_clear_message_status(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_message_status_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_message_status_ext); } UPB_INLINE const xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_message_status(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_message_status_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MessageStatusAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_message_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_MessageStatusAnnotation* default_val = NULL; + const xds_annotations_v3_MessageStatusAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_message_status(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_MessageStatusAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_message_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } UPB_INLINE bool xds_annotations_v3_has_field_status(const struct google_protobuf_FieldOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_field_status_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_field_status_ext); } UPB_INLINE void xds_annotations_v3_clear_field_status(struct google_protobuf_FieldOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_field_status_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_field_status_ext); } UPB_INLINE const xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_field_status(const struct google_protobuf_FieldOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_field_status_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldStatusAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_field_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_FieldStatusAnnotation* default_val = NULL; + const xds_annotations_v3_FieldStatusAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_field_status(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldStatusAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_field_status_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File xds_annotations_v3_status_proto_upb_file_layout; +extern const upb_MiniTableFile xds_annotations_v3_status_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_ */ 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 d347b400a35..a826e9038d8 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 @@ -7,40 +7,47 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/annotations/v3/versioning.upb.h" #include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field xds_annotations_v3_VersioningAnnotation__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_annotations_v3_VersioningAnnotation__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit = { +const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msg_init = { NULL, &xds_annotations_v3_VersioningAnnotation__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_annotations_v3_VersioningAnnotation_msginit, + &xds_annotations_v3_VersioningAnnotation_msg_init, }; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; -extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit; -const upb_MiniTable_Extension xds_annotations_v3_versioning_ext = { - {92389011, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - &google_protobuf_MessageOptions_msginit, - {.submsg = &xds_annotations_v3_VersioningAnnotation_msginit}, +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msg_init; +const upb_MiniTableExtension xds_annotations_v3_versioning_ext = { + {92389011, 0, 0, 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + &google_protobuf_MessageOptions_msg_init, + {.submsg = &xds_annotations_v3_VersioningAnnotation_msg_init}, }; -static const upb_MiniTable_Extension *extensions_layout[1] = { +static const upb_MiniTableExtension *extensions_layout[1] = { &xds_annotations_v3_versioning_ext, }; -const upb_MiniTable_File xds_annotations_v3_versioning_proto_upb_file_layout = { +const upb_MiniTableFile xds_annotations_v3_versioning_proto_upb_file_layout = { messages_layout, NULL, extensions_layout, @@ -49,5 +56,5 @@ const upb_MiniTable_File xds_annotations_v3_versioning_proto_upb_file_layout = { 1, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b8d1c25b510..954e27da2c8 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 @@ -9,35 +9,39 @@ #ifndef XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ #define XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_annotations_v3_VersioningAnnotation; typedef struct xds_annotations_v3_VersioningAnnotation xds_annotations_v3_VersioningAnnotation; -extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit; -extern const upb_MiniTable_Extension xds_annotations_v3_versioning_ext; +extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msg_init; +extern const upb_MiniTableExtension xds_annotations_v3_versioning_ext; struct google_protobuf_MessageOptions; -extern const upb_MiniTable google_protobuf_MessageOptions_msginit; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; /* xds.annotations.v3.VersioningAnnotation */ UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_new(upb_Arena* arena) { - return (xds_annotations_v3_VersioningAnnotation*)_upb_Message_New(&xds_annotations_v3_VersioningAnnotation_msginit, arena); + return (xds_annotations_v3_VersioningAnnotation*)_upb_Message_New(&xds_annotations_v3_VersioningAnnotation_msg_init, arena); } UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +51,7 @@ UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_Versionin int options, upb_Arena* arena) { xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,49 +59,60 @@ UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_Versionin } UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize(const xds_annotations_v3_VersioningAnnotation* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msg_init, 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); +UPB_INLINE void xds_annotations_v3_VersioningAnnotation_clear_previous_message_type(xds_annotations_v3_VersioningAnnotation* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_annotations_v3_VersioningAnnotation_previous_message_type(const xds_annotations_v3_VersioningAnnotation* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_annotations_v3_VersioningAnnotation_set_previous_message_type(xds_annotations_v3_VersioningAnnotation *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE bool xds_annotations_v3_has_versioning(const struct google_protobuf_MessageOptions* msg) { - return _upb_Message_Getext(msg, &xds_annotations_v3_versioning_ext) != NULL; + return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_versioning_ext); } UPB_INLINE void xds_annotations_v3_clear_versioning(struct google_protobuf_MessageOptions* msg) { - _upb_Message_Clearext(msg, &xds_annotations_v3_versioning_ext); + _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_versioning_ext); } UPB_INLINE const xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_versioning(const struct google_protobuf_MessageOptions* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_versioning_ext); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_VersioningAnnotation*); + const upb_MiniTableExtension* ext = &xds_annotations_v3_versioning_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + const xds_annotations_v3_VersioningAnnotation* default_val = NULL; + const xds_annotations_v3_VersioningAnnotation* ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } -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_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; +UPB_INLINE void xds_annotations_v3_set_versioning(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_VersioningAnnotation* val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &xds_annotations_v3_versioning_ext; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); } -extern const upb_MiniTable_File xds_annotations_v3_versioning_proto_upb_file_layout; +extern const upb_MiniTableFile xds_annotations_v3_versioning_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ */ 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 9b028c0b67d..d5524665b0a 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 @@ -7,28 +7,35 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/authority.upb.h" #include "xds/annotations/v3/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field xds_core_v3_Authority__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_Authority__fields[1] = { + {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_Authority_msginit = { +const upb_MiniTable xds_core_v3_Authority_msg_init = { NULL, &xds_core_v3_Authority__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_pss_1bt}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_core_v3_Authority_msginit, + &xds_core_v3_Authority_msg_init, }; -const upb_MiniTable_File xds_core_v3_authority_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_authority_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -37,5 +44,5 @@ const upb_MiniTable_File xds_core_v3_authority_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 fb13422e2ea..2f88e445d70 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 @@ -9,32 +9,36 @@ #ifndef XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_ #define XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_Authority; typedef struct xds_core_v3_Authority xds_core_v3_Authority; -extern const upb_MiniTable xds_core_v3_Authority_msginit; +extern const upb_MiniTable xds_core_v3_Authority_msg_init; /* xds.core.v3.Authority */ UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_new(upb_Arena* arena) { - return (xds_core_v3_Authority*)_upb_Message_New(&xds_core_v3_Authority_msginit, arena); + return (xds_core_v3_Authority*)_upb_Message_New(&xds_core_v3_Authority_msg_init, arena); } UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_Authority* ret = xds_core_v3_Authority_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_Authority_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_Authority_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_parse_ex(const char* buf int options, upb_Arena* arena) { xds_core_v3_Authority* ret = xds_core_v3_Authority_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_Authority_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_Authority_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,32 +56,38 @@ UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_parse_ex(const char* buf } UPB_INLINE char* xds_core_v3_Authority_serialize(const xds_core_v3_Authority* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_Authority_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_Authority_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_Authority_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_Authority_msg_init, 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); +UPB_INLINE void xds_core_v3_Authority_clear_name(xds_core_v3_Authority* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_Authority_name(const xds_core_v3_Authority* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_core_v3_Authority_set_name(xds_core_v3_Authority *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File xds_core_v3_authority_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_authority_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c b/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c index e9d08d6ec8f..e8ce262c376 100644 --- a/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c @@ -7,34 +7,43 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/cidr.upb.h" #include "xds/annotations/v3/status.upb.h" #include "google/protobuf/wrappers.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_CidrRange_submsgs[1] = { - {.submsg = &google_protobuf_UInt32Value_msginit}, +static const upb_MiniTableSub xds_core_v3_CidrRange_submsgs[1] = { + {.submsg = &google_protobuf_UInt32Value_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_CidrRange__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_CidrRange__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_CidrRange_msginit = { +const upb_MiniTable xds_core_v3_CidrRange_msg_init = { &xds_core_v3_CidrRange_submsgs[0], &xds_core_v3_CidrRange__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_core_v3_CidrRange_msginit, + &xds_core_v3_CidrRange_msg_init, }; -const upb_MiniTable_File xds_core_v3_cidr_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_cidr_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -43,5 +52,5 @@ const upb_MiniTable_File xds_core_v3_cidr_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h b/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h index 10945ce76d3..36e9be83097 100644 --- a/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h @@ -9,34 +9,38 @@ #ifndef XDS_CORE_V3_CIDR_PROTO_UPB_H_ #define XDS_CORE_V3_CIDR_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_CidrRange; typedef struct xds_core_v3_CidrRange xds_core_v3_CidrRange; -extern const upb_MiniTable xds_core_v3_CidrRange_msginit; +extern const upb_MiniTable xds_core_v3_CidrRange_msg_init; struct google_protobuf_UInt32Value; -extern const upb_MiniTable google_protobuf_UInt32Value_msginit; +extern const upb_MiniTable google_protobuf_UInt32Value_msg_init; /* xds.core.v3.CidrRange */ UPB_INLINE xds_core_v3_CidrRange* xds_core_v3_CidrRange_new(upb_Arena* arena) { - return (xds_core_v3_CidrRange*)_upb_Message_New(&xds_core_v3_CidrRange_msginit, arena); + return (xds_core_v3_CidrRange*)_upb_Message_New(&xds_core_v3_CidrRange_msg_init, arena); } UPB_INLINE xds_core_v3_CidrRange* xds_core_v3_CidrRange_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_CidrRange* ret = xds_core_v3_CidrRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_CidrRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_CidrRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE xds_core_v3_CidrRange* xds_core_v3_CidrRange_parse_ex(const char* buf int options, upb_Arena* arena) { xds_core_v3_CidrRange* ret = xds_core_v3_CidrRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_CidrRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_CidrRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE xds_core_v3_CidrRange* xds_core_v3_CidrRange_parse_ex(const char* buf } UPB_INLINE char* xds_core_v3_CidrRange_serialize(const xds_core_v3_CidrRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_CidrRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_CidrRange_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_core_v3_CidrRange_serialize_ex(const xds_core_v3_CidrRange* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_CidrRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_CidrRange_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void xds_core_v3_CidrRange_clear_address_prefix(const xds_core_v3_CidrRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_CidrRange_clear_address_prefix(xds_core_v3_CidrRange* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_CidrRange_address_prefix(const xds_core_v3_CidrRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_CidrRange_has_prefix_len(const xds_core_v3_CidrRange* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_core_v3_CidrRange_clear_prefix_len(const xds_core_v3_CidrRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void xds_core_v3_CidrRange_clear_prefix_len(xds_core_v3_CidrRange* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_UInt32Value* xds_core_v3_CidrRange_prefix_len(const xds_core_v3_CidrRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); + const struct google_protobuf_UInt32Value* default_val = NULL; + const struct google_protobuf_UInt32Value* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_CidrRange_has_prefix_len(const xds_core_v3_CidrRange* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_CidrRange_set_address_prefix(xds_core_v3_CidrRange *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_CidrRange_set_prefix_len(xds_core_v3_CidrRange *msg, struct google_protobuf_UInt32Value* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_UInt32Value* xds_core_v3_CidrRange_mutable_prefix_len(xds_core_v3_CidrRange* msg, upb_Arena* arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)xds_core_v3_CidrRange_prefix_len(msg); if (sub == NULL) { - sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena); - if (!sub) return NULL; - xds_core_v3_CidrRange_set_prefix_len(msg, sub); + sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena); + if (sub) xds_core_v3_CidrRange_set_prefix_len(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_core_v3_cidr_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_cidr_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_CIDR_PROTO_UPB_H_ */ 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 8d7f42ff348..c3098c926f0 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 @@ -7,53 +7,68 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/collection_entry.upb.h" #include "google/protobuf/any.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/core/v3/resource_locator.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_CollectionEntry_submsgs[2] = { - {.submsg = &xds_core_v3_ResourceLocator_msginit}, - {.submsg = &xds_core_v3_CollectionEntry_InlineEntry_msginit}, +static const upb_MiniTableSub xds_core_v3_CollectionEntry_submsgs[2] = { + {.submsg = &xds_core_v3_ResourceLocator_msg_init}, + {.submsg = &xds_core_v3_CollectionEntry_InlineEntry_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_CollectionEntry__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_CollectionEntry__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_CollectionEntry_msginit = { +const upb_MiniTable xds_core_v3_CollectionEntry_msg_init = { &xds_core_v3_CollectionEntry_submsgs[0], &xds_core_v3_CollectionEntry__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_CollectionEntry_InlineEntry__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_CollectionEntry_InlineEntry__fields[3] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msginit = { +const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msg_init = { &xds_core_v3_CollectionEntry_InlineEntry_submsgs[0], &xds_core_v3_CollectionEntry_InlineEntry__fields[0], - UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800000100001a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_core_v3_CollectionEntry_msginit, - &xds_core_v3_CollectionEntry_InlineEntry_msginit, + &xds_core_v3_CollectionEntry_msg_init, + &xds_core_v3_CollectionEntry_InlineEntry_msg_init, }; -const upb_MiniTable_File xds_core_v3_collection_entry_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_collection_entry_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -62,5 +77,5 @@ const upb_MiniTable_File xds_core_v3_collection_entry_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 11826a18ec9..96f2218e2bd 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 @@ -9,39 +9,42 @@ #ifndef XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_ #define XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_CollectionEntry; -struct xds_core_v3_CollectionEntry_InlineEntry; typedef struct xds_core_v3_CollectionEntry xds_core_v3_CollectionEntry; typedef struct xds_core_v3_CollectionEntry_InlineEntry xds_core_v3_CollectionEntry_InlineEntry; -extern const upb_MiniTable xds_core_v3_CollectionEntry_msginit; -extern const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msginit; +extern const upb_MiniTable xds_core_v3_CollectionEntry_msg_init; +extern const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msg_init; struct google_protobuf_Any; struct xds_core_v3_ResourceLocator; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable xds_core_v3_ResourceLocator_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable xds_core_v3_ResourceLocator_msg_init; /* xds.core.v3.CollectionEntry */ UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_new(upb_Arena* arena) { - return (xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msginit, arena); + return (xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msg_init, arena); } UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_CollectionEntry* ret = xds_core_v3_CollectionEntry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -51,7 +54,7 @@ UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse_ex(con int options, upb_Arena* arena) { xds_core_v3_CollectionEntry* ret = xds_core_v3_CollectionEntry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -59,13 +62,13 @@ UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse_ex(con } UPB_INLINE char* xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -74,48 +77,61 @@ typedef enum { xds_core_v3_CollectionEntry_resource_specifier_NOT_SET = 0 } xds_core_v3_CollectionEntry_resource_specifier_oneofcases; UPB_INLINE xds_core_v3_CollectionEntry_resource_specifier_oneofcases xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry* msg) { - return (xds_core_v3_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_core_v3_CollectionEntry_resource_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void xds_core_v3_CollectionEntry_clear_locator(const xds_core_v3_CollectionEntry* msg) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_core_v3_CollectionEntry_resource_specifier_NOT_SET); +UPB_INLINE void xds_core_v3_CollectionEntry_clear_locator(xds_core_v3_CollectionEntry* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry* msg) { - return UPB_READ_ONEOF(msg, const struct xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const struct xds_core_v3_ResourceLocator* default_val = NULL; + const struct xds_core_v3_ResourceLocator* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_core_v3_CollectionEntry_clear_inline_entry(const xds_core_v3_CollectionEntry* msg) { - UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_core_v3_CollectionEntry_resource_specifier_NOT_SET); +UPB_INLINE void xds_core_v3_CollectionEntry_clear_inline_entry(xds_core_v3_CollectionEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry* msg) { - return UPB_READ_ONEOF(msg, const xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const xds_core_v3_CollectionEntry_InlineEntry* default_val = NULL; + const xds_core_v3_CollectionEntry_InlineEntry* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry *msg, struct xds_core_v3_ResourceLocator* value) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry* msg, upb_Arena* arena) { struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_CollectionEntry_locator(msg); if (sub == NULL) { - sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msginit, arena); - if (!sub) return NULL; - xds_core_v3_CollectionEntry_set_locator(msg, sub); + sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msg_init, arena); + if (sub) xds_core_v3_CollectionEntry_set_locator(msg, sub); } return sub; } UPB_INLINE void xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry *msg, xds_core_v3_CollectionEntry_InlineEntry* value) { - UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry* msg, upb_Arena* arena) { struct xds_core_v3_CollectionEntry_InlineEntry* sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)xds_core_v3_CollectionEntry_inline_entry(msg); if (sub == NULL) { - sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena); - if (!sub) return NULL; - xds_core_v3_CollectionEntry_set_inline_entry(msg, sub); + sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msg_init, arena); + if (sub) xds_core_v3_CollectionEntry_set_inline_entry(msg, sub); } return sub; } @@ -123,12 +139,12 @@ UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_Collectio /* xds.core.v3.CollectionEntry.InlineEntry */ UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_new(upb_Arena* arena) { - return (xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena); + return (xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msg_init, arena); } UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_CollectionEntry_InlineEntry* ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -138,7 +154,7 @@ UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_ int options, upb_Arena* arena) { xds_core_v3_CollectionEntry_InlineEntry* ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -146,63 +162,80 @@ UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_ } UPB_INLINE char* xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, 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); +UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_name(xds_core_v3_CollectionEntry_InlineEntry* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_version(const xds_core_v3_CollectionEntry_InlineEntry* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_version(xds_core_v3_CollectionEntry_InlineEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL; +UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_resource(xds_core_v3_CollectionEntry_InlineEntry* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_CollectionEntry_InlineEntry_resource(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - xds_core_v3_CollectionEntry_InlineEntry_set_resource(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) xds_core_v3_CollectionEntry_InlineEntry_set_resource(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_core_v3_collection_entry_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_collection_entry_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_ */ 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 495138875d2..1a101141c1d 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 @@ -7,43 +7,52 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/context_params.upb.h" #include "xds/annotations/v3/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_ContextParams_submsgs[1] = { - {.submsg = &xds_core_v3_ContextParams_ParamsEntry_msginit}, +static const upb_MiniTableSub xds_core_v3_ContextParams_submsgs[1] = { + {.submsg = &xds_core_v3_ContextParams_ParamsEntry_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_ContextParams__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_ContextParams__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_ContextParams_msginit = { +const upb_MiniTable xds_core_v3_ContextParams_msg_init = { &xds_core_v3_ContextParams_submsgs[0], &xds_core_v3_ContextParams__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Field xds_core_v3_ContextParams_ParamsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_ContextParams_ParamsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_ContextParams_ParamsEntry_msginit = { +const upb_MiniTable xds_core_v3_ContextParams_ParamsEntry_msg_init = { NULL, &xds_core_v3_ContextParams_ParamsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_core_v3_ContextParams_msginit, - &xds_core_v3_ContextParams_ParamsEntry_msginit, + &xds_core_v3_ContextParams_msg_init, + &xds_core_v3_ContextParams_ParamsEntry_msg_init, }; -const upb_MiniTable_File xds_core_v3_context_params_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_context_params_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -52,5 +61,5 @@ const upb_MiniTable_File xds_core_v3_context_params_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 a83b9b37040..fc96402683c 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 @@ -9,35 +9,38 @@ #ifndef XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_ #define XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_ContextParams; -struct xds_core_v3_ContextParams_ParamsEntry; typedef struct xds_core_v3_ContextParams xds_core_v3_ContextParams; typedef struct xds_core_v3_ContextParams_ParamsEntry xds_core_v3_ContextParams_ParamsEntry; -extern const upb_MiniTable xds_core_v3_ContextParams_msginit; -extern const upb_MiniTable xds_core_v3_ContextParams_ParamsEntry_msginit; +extern const upb_MiniTable xds_core_v3_ContextParams_msg_init; +extern const upb_MiniTable xds_core_v3_ContextParams_ParamsEntry_msg_init; /* xds.core.v3.ContextParams */ UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_new(upb_Arena* arena) { - return (xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msginit, arena); + return (xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msg_init, arena); } UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_ContextParams* ret = xds_core_v3_ContextParams_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_ContextParams_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +50,7 @@ UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_parse_ex(const c int options, upb_Arena* arena) { xds_core_v3_ContextParams* ret = xds_core_v3_ContextParams_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_ContextParams_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,40 +58,63 @@ UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_parse_ex(const c } UPB_INLINE char* xds_core_v3_ContextParams_serialize(const xds_core_v3_ContextParams* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ContextParams_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ContextParams_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ContextParams_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ContextParams_msg_init, 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)); -} -UPB_INLINE void xds_core_v3_ContextParams_clear_params(const xds_core_v3_ContextParams* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void xds_core_v3_ContextParams_clear_params(xds_core_v3_ContextParams* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t xds_core_v3_ContextParams_params_size(const xds_core_v3_ContextParams* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool xds_core_v3_ContextParams_params_get(const xds_core_v3_ContextParams* msg, upb_StringView key, upb_StringView* val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, 0); } UPB_INLINE const xds_core_v3_ContextParams_ParamsEntry* xds_core_v3_ContextParams_params_next(const xds_core_v3_ContextParams* msg, size_t* iter) { - return (const xds_core_v3_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const xds_core_v3_ContextParams_ParamsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool xds_core_v3_ContextParams_has_params(const xds_core_v3_ContextParams* msg) { + return xds_core_v3_ContextParams_params_size(msg) != 0; } -UPB_INLINE void xds_core_v3_ContextParams_params_clear(xds_core_v3_ContextParams* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } +UPB_INLINE void xds_core_v3_ContextParams_params_clear(xds_core_v3_ContextParams* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool xds_core_v3_ContextParams_params_set(xds_core_v3_ContextParams* msg, upb_StringView key, upb_StringView val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, 0, a); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a); + return _upb_Map_Insert(map, &key, 0, &val, 0, a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool xds_core_v3_ContextParams_params_delete(xds_core_v3_ContextParams* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE xds_core_v3_ContextParams_ParamsEntry* xds_core_v3_ContextParams_params_nextmutable(xds_core_v3_ContextParams* msg, size_t* iter) { - return (xds_core_v3_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (xds_core_v3_ContextParams_ParamsEntry*)_upb_map_next(map, iter); } /* xds.core.v3.ContextParams.ParamsEntry */ @@ -108,12 +134,12 @@ UPB_INLINE void xds_core_v3_ContextParams_ParamsEntry_set_value(xds_core_v3_Cont _upb_msg_map_set_value(msg, &value, 0); } -extern const upb_MiniTable_File xds_core_v3_context_params_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_context_params_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_ */ 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 550d2066ddb..f2be657fa25 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 @@ -7,33 +7,42 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/extension.upb.h" #include "validate/validate.upb.h" #include "google/protobuf/any.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_TypedExtensionConfig_submsgs[1] = { - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub xds_core_v3_TypedExtensionConfig_submsgs[1] = { + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_TypedExtensionConfig__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_TypedExtensionConfig__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_TypedExtensionConfig_msginit = { +const upb_MiniTable xds_core_v3_TypedExtensionConfig_msg_init = { &xds_core_v3_TypedExtensionConfig_submsgs[0], &xds_core_v3_TypedExtensionConfig__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_core_v3_TypedExtensionConfig_msginit, + &xds_core_v3_TypedExtensionConfig_msg_init, }; -const upb_MiniTable_File xds_core_v3_extension_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_extension_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +51,5 @@ const upb_MiniTable_File xds_core_v3_extension_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b7fb888d954..d9b49e92da2 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 @@ -9,34 +9,38 @@ #ifndef XDS_CORE_V3_EXTENSION_PROTO_UPB_H_ #define XDS_CORE_V3_EXTENSION_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_TypedExtensionConfig; typedef struct xds_core_v3_TypedExtensionConfig xds_core_v3_TypedExtensionConfig; -extern const upb_MiniTable xds_core_v3_TypedExtensionConfig_msginit; +extern const upb_MiniTable xds_core_v3_TypedExtensionConfig_msg_init; struct google_protobuf_Any; -extern const upb_MiniTable google_protobuf_Any_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; /* xds.core.v3.TypedExtensionConfig */ UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_new(upb_Arena* arena) { - return (xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena); + return (xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msg_init, arena); } UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_TypedExtensionConfig* ret = xds_core_v3_TypedExtensionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_TypedExtensionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_TypedExtensionConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_pa int options, upb_Arena* arena) { xds_core_v3_TypedExtensionConfig* ret = xds_core_v3_TypedExtensionConfig_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_TypedExtensionConfig_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_TypedExtensionConfig_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_pa } UPB_INLINE char* xds_core_v3_TypedExtensionConfig_serialize(const xds_core_v3_TypedExtensionConfig* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msg_init, 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); +UPB_INLINE void xds_core_v3_TypedExtensionConfig_clear_name(xds_core_v3_TypedExtensionConfig* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_TypedExtensionConfig_name(const xds_core_v3_TypedExtensionConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_TypedExtensionConfig_has_typed_config(const xds_core_v3_TypedExtensionConfig* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_core_v3_TypedExtensionConfig_clear_typed_config(const xds_core_v3_TypedExtensionConfig* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void xds_core_v3_TypedExtensionConfig_clear_typed_config(xds_core_v3_TypedExtensionConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* xds_core_v3_TypedExtensionConfig_typed_config(const xds_core_v3_TypedExtensionConfig* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_TypedExtensionConfig_has_typed_config(const xds_core_v3_TypedExtensionConfig* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_TypedExtensionConfig_set_name(xds_core_v3_TypedExtensionConfig *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_TypedExtensionConfig_set_typed_config(xds_core_v3_TypedExtensionConfig *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* xds_core_v3_TypedExtensionConfig_mutable_typed_config(xds_core_v3_TypedExtensionConfig* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_TypedExtensionConfig_typed_config(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - xds_core_v3_TypedExtensionConfig_set_typed_config(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) xds_core_v3_TypedExtensionConfig_set_typed_config(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_core_v3_extension_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_extension_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_EXTENSION_PROTO_UPB_H_ */ 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 e91f025858f..6e844b77383 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 @@ -7,36 +7,45 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/resource.upb.h" #include "google/protobuf/any.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/core/v3/resource_name.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_Resource_submsgs[2] = { - {.submsg = &xds_core_v3_ResourceName_msginit}, - {.submsg = &google_protobuf_Any_msginit}, +static const upb_MiniTableSub xds_core_v3_Resource_submsgs[2] = { + {.submsg = &xds_core_v3_ResourceName_msg_init}, + {.submsg = &google_protobuf_Any_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_Resource__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_Resource__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_Resource_msginit = { +const upb_MiniTable xds_core_v3_Resource_msg_init = { &xds_core_v3_Resource_submsgs[0], &xds_core_v3_Resource__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_pss_1bt}, + {0x002000000201001a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_core_v3_Resource_msginit, + &xds_core_v3_Resource_msg_init, }; -const upb_MiniTable_File xds_core_v3_resource_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_resource_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -45,5 +54,5 @@ const upb_MiniTable_File xds_core_v3_resource_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 8dc3fad3793..235778576e1 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 @@ -9,36 +9,40 @@ #ifndef XDS_CORE_V3_RESOURCE_PROTO_UPB_H_ #define XDS_CORE_V3_RESOURCE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_Resource; typedef struct xds_core_v3_Resource xds_core_v3_Resource; -extern const upb_MiniTable xds_core_v3_Resource_msginit; +extern const upb_MiniTable xds_core_v3_Resource_msg_init; struct google_protobuf_Any; struct xds_core_v3_ResourceName; -extern const upb_MiniTable google_protobuf_Any_msginit; -extern const upb_MiniTable xds_core_v3_ResourceName_msginit; +extern const upb_MiniTable google_protobuf_Any_msg_init; +extern const upb_MiniTable xds_core_v3_ResourceName_msg_init; /* xds.core.v3.Resource */ UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_new(upb_Arena* arena) { - return (xds_core_v3_Resource*)_upb_Message_New(&xds_core_v3_Resource_msginit, arena); + return (xds_core_v3_Resource*)_upb_Message_New(&xds_core_v3_Resource_msg_init, arena); } UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_Resource* ret = xds_core_v3_Resource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_Resource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_Resource_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -48,7 +52,7 @@ UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_parse_ex(const char* buf, int options, upb_Arena* arena) { xds_core_v3_Resource* ret = xds_core_v3_Resource_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_Resource_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_Resource_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -56,76 +60,92 @@ UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_parse_ex(const char* buf, } UPB_INLINE char* xds_core_v3_Resource_serialize(const xds_core_v3_Resource* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_Resource_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_Resource_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_Resource_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_Resource_msg_init, 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); -} -UPB_INLINE void xds_core_v3_Resource_clear_name(const xds_core_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_core_v3_Resource_clear_name(xds_core_v3_Resource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_ResourceName* xds_core_v3_Resource_name(const xds_core_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_core_v3_ResourceName*); + const struct xds_core_v3_ResourceName* default_val = NULL; + const struct xds_core_v3_ResourceName* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_Resource_clear_version(const xds_core_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool xds_core_v3_Resource_has_name(const xds_core_v3_Resource* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void xds_core_v3_Resource_clear_version(xds_core_v3_Resource* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_Resource_version(const xds_core_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_Resource_has_resource(const xds_core_v3_Resource* msg) { - return _upb_hasbit(msg, 2); -} -UPB_INLINE void xds_core_v3_Resource_clear_resource(const xds_core_v3_Resource* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL; +UPB_INLINE void xds_core_v3_Resource_clear_resource(xds_core_v3_Resource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Any* xds_core_v3_Resource_resource(const xds_core_v3_Resource* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); + const struct google_protobuf_Any* default_val = NULL; + const struct google_protobuf_Any* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_Resource_has_resource(const xds_core_v3_Resource* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_Resource_set_name(xds_core_v3_Resource *msg, struct xds_core_v3_ResourceName* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct xds_core_v3_ResourceName*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_ResourceName* xds_core_v3_Resource_mutable_name(xds_core_v3_Resource* msg, upb_Arena* arena) { struct xds_core_v3_ResourceName* sub = (struct xds_core_v3_ResourceName*)xds_core_v3_Resource_name(msg); if (sub == NULL) { - sub = (struct xds_core_v3_ResourceName*)_upb_Message_New(&xds_core_v3_ResourceName_msginit, arena); - if (!sub) return NULL; - xds_core_v3_Resource_set_name(msg, sub); + sub = (struct xds_core_v3_ResourceName*)_upb_Message_New(&xds_core_v3_ResourceName_msg_init, arena); + if (sub) xds_core_v3_Resource_set_name(msg, sub); } return sub; } UPB_INLINE void xds_core_v3_Resource_set_version(xds_core_v3_Resource *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_Resource_set_resource(xds_core_v3_Resource *msg, struct google_protobuf_Any* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Any* xds_core_v3_Resource_mutable_resource(xds_core_v3_Resource* msg, upb_Arena* arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_Resource_resource(msg); if (sub == NULL) { - sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); - if (!sub) return NULL; - xds_core_v3_Resource_set_resource(msg, sub); + sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena); + if (sub) xds_core_v3_Resource_set_resource(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_core_v3_resource_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_resource_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_RESOURCE_PROTO_UPB_H_ */ 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 6dd053694c4..3a6dd6beae4 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 @@ -7,55 +7,74 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/resource_locator.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/core/v3/context_params.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_ResourceLocator_submsgs[2] = { - {.submsg = &xds_core_v3_ContextParams_msginit}, - {.submsg = &xds_core_v3_ResourceLocator_Directive_msginit}, +static const upb_MiniTableSub xds_core_v3_ResourceLocator_submsgs[2] = { + {.submsg = &xds_core_v3_ContextParams_msg_init}, + {.submsg = &xds_core_v3_ResourceLocator_Directive_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_ResourceLocator__fields[6] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(36, 64), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_ResourceLocator__fields[6] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 64), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_ResourceLocator_msginit = { +const upb_MiniTable xds_core_v3_ResourceLocator_msg_init = { &xds_core_v3_ResourceLocator_submsgs[0], &xds_core_v3_ResourceLocator__fields[0], - UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000800003f000012, &upb_pss_1bt}, + {0x001800003f00001a, &upb_pss_1bt}, + {0x002800003f000022, &upb_pss_1bt}, + {0x004000040500002a, &upb_pom_1bt_maxmaxb}, + {0x003800003f010032, &upb_prm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_core_v3_ResourceLocator_Directive_submsgs[1] = { - {.submsg = &xds_core_v3_ResourceLocator_msginit}, +static const upb_MiniTableSub xds_core_v3_ResourceLocator_Directive_submsgs[1] = { + {.submsg = &xds_core_v3_ResourceLocator_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_ResourceLocator_Directive__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_ResourceLocator_Directive__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_ResourceLocator_Directive_msginit = { +const upb_MiniTable xds_core_v3_ResourceLocator_Directive_msg_init = { &xds_core_v3_ResourceLocator_Directive_submsgs[0], &xds_core_v3_ResourceLocator_Directive__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max128b}, + {0x0008000002000012, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_core_v3_ResourceLocator_msginit, - &xds_core_v3_ResourceLocator_Directive_msginit, + &xds_core_v3_ResourceLocator_msg_init, + &xds_core_v3_ResourceLocator_Directive_msg_init, }; -const upb_MiniTable_File xds_core_v3_resource_locator_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_resource_locator_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -64,5 +83,5 @@ const upb_MiniTable_File xds_core_v3_resource_locator_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 12be688fd8b..22b330da312 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 @@ -9,25 +9,28 @@ #ifndef XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_ #define XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_ResourceLocator; -struct xds_core_v3_ResourceLocator_Directive; typedef struct xds_core_v3_ResourceLocator xds_core_v3_ResourceLocator; typedef struct xds_core_v3_ResourceLocator_Directive xds_core_v3_ResourceLocator_Directive; -extern const upb_MiniTable xds_core_v3_ResourceLocator_msginit; -extern const upb_MiniTable xds_core_v3_ResourceLocator_Directive_msginit; +extern const upb_MiniTable xds_core_v3_ResourceLocator_msg_init; +extern const upb_MiniTable xds_core_v3_ResourceLocator_Directive_msg_init; struct xds_core_v3_ContextParams; -extern const upb_MiniTable xds_core_v3_ContextParams_msginit; +extern const upb_MiniTable xds_core_v3_ContextParams_msg_init; typedef enum { xds_core_v3_ResourceLocator_XDSTP = 0, @@ -40,12 +43,12 @@ typedef enum { /* xds.core.v3.ResourceLocator */ UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_new(upb_Arena* arena) { - return (xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msginit, arena); + return (xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msg_init, arena); } UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_ResourceLocator* ret = xds_core_v3_ResourceLocator_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -55,7 +58,7 @@ UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_parse_ex(con int options, upb_Arena* arena) { xds_core_v3_ResourceLocator* ret = xds_core_v3_ResourceLocator_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -63,13 +66,13 @@ UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_parse_ex(con } UPB_INLINE char* xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -77,97 +80,153 @@ typedef enum { xds_core_v3_ResourceLocator_context_param_specifier_NOT_SET = 0 } xds_core_v3_ResourceLocator_context_param_specifier_oneofcases; UPB_INLINE xds_core_v3_ResourceLocator_context_param_specifier_oneofcases xds_core_v3_ResourceLocator_context_param_specifier_case(const xds_core_v3_ResourceLocator* msg) { - return (xds_core_v3_ResourceLocator_context_param_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_core_v3_ResourceLocator_context_param_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE void xds_core_v3_ResourceLocator_clear_scheme(const xds_core_v3_ResourceLocator* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void xds_core_v3_ResourceLocator_clear_scheme(xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t xds_core_v3_ResourceLocator_scheme(const xds_core_v3_ResourceLocator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_ResourceLocator_clear_id(const xds_core_v3_ResourceLocator* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_ResourceLocator_clear_id(xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_ResourceLocator_clear_authority(const xds_core_v3_ResourceLocator* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_ResourceLocator_clear_authority(xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_ResourceLocator_clear_resource_type(const xds_core_v3_ResourceLocator* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_ResourceLocator_clear_resource_type(xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; -} -UPB_INLINE void xds_core_v3_ResourceLocator_clear_exact_context(const xds_core_v3_ResourceLocator* msg) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(36, 64), 0, UPB_SIZE(4, 4), xds_core_v3_ResourceLocator_context_param_specifier_NOT_SET); +UPB_INLINE void xds_core_v3_ResourceLocator_clear_exact_context(xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_exact_context(const xds_core_v3_ResourceLocator* msg) { - return UPB_READ_ONEOF(msg, const struct xds_core_v3_ContextParams*, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 5, NULL); + const struct xds_core_v3_ContextParams* default_val = NULL; + const struct xds_core_v3_ContextParams* ret; + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void xds_core_v3_ResourceLocator_clear_directives(xds_core_v3_ResourceLocator* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_core_v3_ResourceLocator_Directive* const* xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_core_v3_ResourceLocator_Directive* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } UPB_INLINE bool xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); -} -UPB_INLINE void xds_core_v3_ResourceLocator_clear_directives(const xds_core_v3_ResourceLocator* msg) { - _upb_array_detach(msg, UPB_SIZE(32, 56)); -} -UPB_INLINE const xds_core_v3_ResourceLocator_Directive* const* xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator* msg, size_t* len) { - return (const xds_core_v3_ResourceLocator_Directive* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); + size_t size; + xds_core_v3_ResourceLocator_directives(msg, &size); + return size != 0; } UPB_INLINE void xds_core_v3_ResourceLocator_set_scheme(xds_core_v3_ResourceLocator *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceLocator_set_authority(xds_core_v3_ResourceLocator *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value; + const upb_MiniTableField field = {3, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceLocator_set_resource_type(xds_core_v3_ResourceLocator *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value; + const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceLocator_set_exact_context(xds_core_v3_ResourceLocator *msg, struct xds_core_v3_ContextParams* value) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(36, 64), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, UPB_SIZE(12, 64), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_mutable_exact_context(xds_core_v3_ResourceLocator* msg, upb_Arena* arena) { struct xds_core_v3_ContextParams* sub = (struct xds_core_v3_ContextParams*)xds_core_v3_ResourceLocator_exact_context(msg); if (sub == NULL) { - sub = (struct xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msginit, arena); - if (!sub) return NULL; - xds_core_v3_ResourceLocator_set_exact_context(msg, sub); + sub = (struct xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msg_init, arena); + if (sub) xds_core_v3_ResourceLocator_set_exact_context(msg, sub); } return sub; } -UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator* msg, size_t* len) { - return (xds_core_v3_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len); +UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_core_v3_ResourceLocator_Directive**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator* msg, size_t len, upb_Arena* arena) { - return (xds_core_v3_ResourceLocator_Directive**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_core_v3_ResourceLocator_Directive**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_add_directives(xds_core_v3_ResourceLocator* msg, upb_Arena* arena) { - struct xds_core_v3_ResourceLocator_Directive* sub = (struct xds_core_v3_ResourceLocator_Directive*)_upb_Message_New(&xds_core_v3_ResourceLocator_Directive_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {6, UPB_SIZE(8, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_core_v3_ResourceLocator_Directive* sub = (struct xds_core_v3_ResourceLocator_Directive*)_upb_Message_New(&xds_core_v3_ResourceLocator_Directive_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.core.v3.ResourceLocator.Directive */ UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Directive_new(upb_Arena* arena) { - return (xds_core_v3_ResourceLocator_Directive*)_upb_Message_New(&xds_core_v3_ResourceLocator_Directive_msginit, arena); + return (xds_core_v3_ResourceLocator_Directive*)_upb_Message_New(&xds_core_v3_ResourceLocator_Directive_msg_init, arena); } UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Directive_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_ResourceLocator_Directive* ret = xds_core_v3_ResourceLocator_Directive_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -177,7 +236,7 @@ UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Di int options, upb_Arena* arena) { xds_core_v3_ResourceLocator_Directive* ret = xds_core_v3_ResourceLocator_Directive_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -185,13 +244,13 @@ UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Di } UPB_INLINE char* xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -200,49 +259,63 @@ typedef enum { xds_core_v3_ResourceLocator_Directive_directive_NOT_SET = 0 } xds_core_v3_ResourceLocator_Directive_directive_oneofcases; UPB_INLINE xds_core_v3_ResourceLocator_Directive_directive_oneofcases xds_core_v3_ResourceLocator_Directive_directive_case(const xds_core_v3_ResourceLocator_Directive* msg) { - return (xds_core_v3_ResourceLocator_Directive_directive_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_core_v3_ResourceLocator_Directive_directive_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void xds_core_v3_ResourceLocator_Directive_clear_alt(const xds_core_v3_ResourceLocator_Directive* msg) { - UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_core_v3_ResourceLocator_Directive_directive_NOT_SET); +UPB_INLINE void xds_core_v3_ResourceLocator_Directive_clear_alt(xds_core_v3_ResourceLocator_Directive* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_alt(const xds_core_v3_ResourceLocator_Directive* msg) { - return UPB_READ_ONEOF(msg, const xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const xds_core_v3_ResourceLocator* default_val = NULL; + const xds_core_v3_ResourceLocator* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_core_v3_ResourceLocator_Directive_clear_entry(const xds_core_v3_ResourceLocator_Directive* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), xds_core_v3_ResourceLocator_Directive_directive_NOT_SET); +UPB_INLINE void xds_core_v3_ResourceLocator_Directive_clear_entry(xds_core_v3_ResourceLocator_Directive* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_ResourceLocator_Directive* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_alt(xds_core_v3_ResourceLocator_Directive *msg, xds_core_v3_ResourceLocator* value) { - UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_mutable_alt(xds_core_v3_ResourceLocator_Directive* msg, upb_Arena* arena) { struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_ResourceLocator_Directive_alt(msg); if (sub == NULL) { - sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msginit, arena); - if (!sub) return NULL; - xds_core_v3_ResourceLocator_Directive_set_alt(msg, sub); + sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msg_init, arena); + if (sub) xds_core_v3_ResourceLocator_Directive_set_alt(msg, sub); } return sub; } UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_ResourceLocator_Directive *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File xds_core_v3_resource_locator_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_resource_locator_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_ */ 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 c8f89b2272c..127a561d626 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 @@ -7,36 +7,49 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/core/v3/resource_name.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/core/v3/context_params.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_core_v3_ResourceName_submsgs[1] = { - {.submsg = &xds_core_v3_ContextParams_msginit}, +static const upb_MiniTableSub xds_core_v3_ResourceName_submsgs[1] = { + {.submsg = &xds_core_v3_ContextParams_msg_init}, }; -static const upb_MiniTable_Field xds_core_v3_ResourceName__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(28, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_core_v3_ResourceName__fields[4] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_core_v3_ResourceName_msginit = { +const upb_MiniTable xds_core_v3_ResourceName_msg_init = { &xds_core_v3_ResourceName_submsgs[0], &xds_core_v3_ResourceName__fields[0], - UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x001800003f000012, &upb_pss_1bt}, + {0x002800003f00001a, &upb_pss_1bt}, + {0x0038000001000022, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_core_v3_ResourceName_msginit, + &xds_core_v3_ResourceName_msg_init, }; -const upb_MiniTable_File xds_core_v3_resource_name_proto_upb_file_layout = { +const upb_MiniTableFile xds_core_v3_resource_name_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -45,5 +58,5 @@ const upb_MiniTable_File xds_core_v3_resource_name_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 340567cb4c2..6eab7abed9b 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 @@ -9,34 +9,38 @@ #ifndef XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_ #define XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_core_v3_ResourceName; typedef struct xds_core_v3_ResourceName xds_core_v3_ResourceName; -extern const upb_MiniTable xds_core_v3_ResourceName_msginit; +extern const upb_MiniTable xds_core_v3_ResourceName_msg_init; struct xds_core_v3_ContextParams; -extern const upb_MiniTable xds_core_v3_ContextParams_msginit; +extern const upb_MiniTable xds_core_v3_ContextParams_msg_init; /* xds.core.v3.ResourceName */ UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_new(upb_Arena* arena) { - return (xds_core_v3_ResourceName*)_upb_Message_New(&xds_core_v3_ResourceName_msginit, arena); + return (xds_core_v3_ResourceName*)_upb_Message_New(&xds_core_v3_ResourceName_msg_init, arena); } UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_parse(const char* buf, size_t size, upb_Arena* arena) { xds_core_v3_ResourceName* ret = xds_core_v3_ResourceName_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceName_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_parse_ex(const cha int options, upb_Arena* arena) { xds_core_v3_ResourceName* ret = xds_core_v3_ResourceName_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceName_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,72 +58,95 @@ UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_parse_ex(const cha } UPB_INLINE char* xds_core_v3_ResourceName_serialize(const xds_core_v3_ResourceName* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ResourceName_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ResourceName_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_core_v3_ResourceName_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_core_v3_ResourceName_msg_init, 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); +UPB_INLINE void xds_core_v3_ResourceName_clear_id(xds_core_v3_ResourceName* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceName_id(const xds_core_v3_ResourceName* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_ResourceName_clear_authority(const xds_core_v3_ResourceName* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_ResourceName_clear_authority(xds_core_v3_ResourceName* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceName_authority(const xds_core_v3_ResourceName* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_core_v3_ResourceName_clear_resource_type(const xds_core_v3_ResourceName* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE void xds_core_v3_ResourceName_clear_resource_type(xds_core_v3_ResourceName* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_core_v3_ResourceName_resource_type(const xds_core_v3_ResourceName* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_core_v3_ResourceName_has_context(const xds_core_v3_ResourceName* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_core_v3_ResourceName_clear_context(const xds_core_v3_ResourceName* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL; +UPB_INLINE void xds_core_v3_ResourceName_clear_context(xds_core_v3_ResourceName* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_context(const xds_core_v3_ResourceName* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct xds_core_v3_ContextParams*); + const struct xds_core_v3_ContextParams* default_val = NULL; + const struct xds_core_v3_ContextParams* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_core_v3_ResourceName_has_context(const xds_core_v3_ResourceName* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_core_v3_ResourceName_set_id(xds_core_v3_ResourceName *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceName_set_authority(xds_core_v3_ResourceName *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value; + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceName_set_resource_type(xds_core_v3_ResourceName *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value; + const upb_MiniTableField field = {3, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_core_v3_ResourceName_set_context(xds_core_v3_ResourceName *msg, struct xds_core_v3_ContextParams* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct xds_core_v3_ContextParams*) = value; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_mutable_context(xds_core_v3_ResourceName* msg, upb_Arena* arena) { struct xds_core_v3_ContextParams* sub = (struct xds_core_v3_ContextParams*)xds_core_v3_ResourceName_context(msg); if (sub == NULL) { - sub = (struct xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msginit, arena); - if (!sub) return NULL; - xds_core_v3_ResourceName_set_context(msg, sub); + sub = (struct xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msg_init, arena); + if (sub) xds_core_v3_ResourceName_set_context(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_core_v3_resource_name_proto_upb_file_layout; +extern const upb_MiniTableFile xds_core_v3_resource_name_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c b/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c index 3c77cc75ca1..8f4c5ba32f8 100644 --- a/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +++ b/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c @@ -7,76 +7,107 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/data/orca/v3/orca_load_report.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_data_orca_v3_OrcaLoadReport_submsgs[3] = { - {.submsg = &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit}, - {.submsg = &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit}, - {.submsg = &xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msginit}, +static const upb_MiniTableSub xds_data_orca_v3_OrcaLoadReport_submsgs[3] = { + {.submsg = &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msg_init}, + {.submsg = &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msg_init}, + {.submsg = &xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msg_init}, }; -static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport__fields[8] = { - {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(40, 48), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(48, 56), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_data_orca_v3_OrcaLoadReport__fields[8] = { + {1, UPB_SIZE(16, 0), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(24, 8), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 40, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {7, 48, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msginit = { +const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msg_init = { &xds_data_orca_v3_OrcaLoadReport_submsgs[0], &xds_data_orca_v3_OrcaLoadReport__fields[0], - UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + {0x000800003f000011, &upb_psf8_1bt}, + {0x001000003f000018, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002800003f000031, &upb_psf8_1bt}, + {0x003000003f000039, &upb_psf8_1bt}, + }) }; -static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit = { +const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msg_init = { NULL, &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000011, &upb_psf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit = { +const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msg_init = { NULL, &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000011, &upb_psf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msginit = { +const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msg_init = { NULL, &xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x001800003f000011, &upb_psf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[4] = { - &xds_data_orca_v3_OrcaLoadReport_msginit, - &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit, - &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit, - &xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msginit, + &xds_data_orca_v3_OrcaLoadReport_msg_init, + &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msg_init, + &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msg_init, + &xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msg_init, }; -const upb_MiniTable_File xds_data_orca_v3_orca_load_report_proto_upb_file_layout = { +const upb_MiniTableFile xds_data_orca_v3_orca_load_report_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -85,5 +116,5 @@ const upb_MiniTable_File xds_data_orca_v3_orca_load_report_proto_upb_file_layout 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 fcca0b4871c..677f14635c0 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 @@ -9,41 +9,42 @@ #ifndef XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_ #define XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_data_orca_v3_OrcaLoadReport; -struct xds_data_orca_v3_OrcaLoadReport_RequestCostEntry; -struct xds_data_orca_v3_OrcaLoadReport_UtilizationEntry; -struct xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry; typedef struct xds_data_orca_v3_OrcaLoadReport xds_data_orca_v3_OrcaLoadReport; typedef struct xds_data_orca_v3_OrcaLoadReport_RequestCostEntry xds_data_orca_v3_OrcaLoadReport_RequestCostEntry; typedef struct xds_data_orca_v3_OrcaLoadReport_UtilizationEntry xds_data_orca_v3_OrcaLoadReport_UtilizationEntry; typedef struct xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry; -extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msginit; -extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit; -extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit; -extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msginit; +extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msg_init; +extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msg_init; +extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msg_init; +extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_msg_init; /* xds.data.orca.v3.OrcaLoadReport */ UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_new(upb_Arena* arena) { - return (xds_data_orca_v3_OrcaLoadReport*)_upb_Message_New(&xds_data_orca_v3_OrcaLoadReport_msginit, arena); + return (xds_data_orca_v3_OrcaLoadReport*)_upb_Message_New(&xds_data_orca_v3_OrcaLoadReport_msg_init, arena); } UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_parse(const char* buf, size_t size, upb_Arena* arena) { xds_data_orca_v3_OrcaLoadReport* ret = xds_data_orca_v3_OrcaLoadReport_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +54,7 @@ UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_pars int options, upb_Arena* arena) { xds_data_orca_v3_OrcaLoadReport* ret = xds_data_orca_v3_OrcaLoadReport_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,135 +62,234 @@ UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_pars } UPB_INLINE char* xds_data_orca_v3_OrcaLoadReport_serialize(const xds_data_orca_v3_OrcaLoadReport* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msg_init, 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(16, 24), double) = 0; +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_cpu_utilization(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(16, 0), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_cpu_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, UPB_SIZE(16, 0), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_mem_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double) = 0; +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_mem_utilization(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(24, 8), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_mem_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, UPB_SIZE(24, 8), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_rps(const xds_data_orca_v3_OrcaLoadReport* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0; +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_rps(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE uint64_t xds_data_orca_v3_OrcaLoadReport_rps(const xds_data_orca_v3_OrcaLoadReport* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t); + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_request_cost(const xds_data_orca_v3_OrcaLoadReport* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_request_cost(const xds_data_orca_v3_OrcaLoadReport* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_request_cost(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_request_cost_size(const xds_data_orca_v3_OrcaLoadReport* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_get(const xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double* val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* xds_data_orca_v3_OrcaLoadReport_request_cost_next(const xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) { - return (const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_map_next(map, iter); } -UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); +UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_request_cost(const xds_data_orca_v3_OrcaLoadReport* msg) { + return xds_data_orca_v3_OrcaLoadReport_request_cost_size(msg) != 0; } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_utilization(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_utilization_size(const xds_data_orca_v3_OrcaLoadReport* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(4, 8)); + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_get(const xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double* val) { - return _upb_msg_map_get(msg, UPB_SIZE(4, 8), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* xds_data_orca_v3_OrcaLoadReport_utilization_next(const xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) { - return (const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_map_next(map, iter); } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_rps_fractional(const xds_data_orca_v3_OrcaLoadReport* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double) = 0; +UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) { + return xds_data_orca_v3_OrcaLoadReport_utilization_size(msg) != 0; +} +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_rps_fractional(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {6, 40, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_rps_fractional(const xds_data_orca_v3_OrcaLoadReport* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {6, 40, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_eps(const xds_data_orca_v3_OrcaLoadReport* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double) = 0; +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_eps(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {7, 48, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_eps(const xds_data_orca_v3_OrcaLoadReport* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {7, 48, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_named_metrics(const xds_data_orca_v3_OrcaLoadReport* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_named_metrics(const xds_data_orca_v3_OrcaLoadReport* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_named_metrics(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_named_metrics_size(const xds_data_orca_v3_OrcaLoadReport* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(8, 16)); + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_named_metrics_get(const xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double* val) { - return _upb_msg_map_get(msg, UPB_SIZE(8, 16), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry* xds_data_orca_v3_OrcaLoadReport_named_metrics_next(const xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) { - return (const xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_named_metrics(const xds_data_orca_v3_OrcaLoadReport* msg) { + return xds_data_orca_v3_OrcaLoadReport_named_metrics_size(msg) != 0; } UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_cpu_utilization(xds_data_orca_v3_OrcaLoadReport *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = value; + const upb_MiniTableField field = {1, UPB_SIZE(16, 0), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_mem_utilization(xds_data_orca_v3_OrcaLoadReport *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double) = value; + const upb_MiniTableField field = {2, UPB_SIZE(24, 8), 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_rps(xds_data_orca_v3_OrcaLoadReport *msg, uint64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = value; + const upb_MiniTableField field = {3, UPB_SIZE(32, 16), 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_request_cost_clear(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_request_cost_clear(xds_data_orca_v3_OrcaLoadReport* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_set(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_delete(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* xds_data_orca_v3_OrcaLoadReport_request_cost_nextmutable(xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) { - return (xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {4, UPB_SIZE(0, 24), 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_map_next(map, iter); +} +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_utilization_clear(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_utilization_clear(xds_data_orca_v3_OrcaLoadReport* msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_set(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_delete(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(4, 8), &key, 0); + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* xds_data_orca_v3_OrcaLoadReport_utilization_nextmutable(xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) { - return (xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); + const upb_MiniTableField field = {5, UPB_SIZE(4, 32), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_map_next(map, iter); } UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_rps_fractional(xds_data_orca_v3_OrcaLoadReport *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double) = value; + const upb_MiniTableField field = {6, 40, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_eps(xds_data_orca_v3_OrcaLoadReport *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double) = value; + const upb_MiniTableField field = {7, 48, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_named_metrics_clear(xds_data_orca_v3_OrcaLoadReport* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); } -UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_named_metrics_clear(xds_data_orca_v3_OrcaLoadReport* msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 16)); } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_named_metrics_set(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(8, 16), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_named_metrics_delete(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(8, 16), &key, 0); + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry* xds_data_orca_v3_OrcaLoadReport_named_metrics_nextmutable(xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) { - return (xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); + const upb_MiniTableField field = {8, UPB_SIZE(8, 56), 0, 2, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry*)_upb_map_next(map, iter); } /* xds.data.orca.v3.OrcaLoadReport.RequestCostEntry */ @@ -243,12 +343,12 @@ UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_NamedMetricsEntry_set_value(xds_ _upb_msg_map_set_value(msg, &value, sizeof(double)); } -extern const upb_MiniTable_File xds_data_orca_v3_orca_load_report_proto_upb_file_layout; +extern const upb_MiniTableFile xds_data_orca_v3_orca_load_report_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_ */ 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 324cb968fd6..482cb6c17e2 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 @@ -7,33 +7,42 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/service/orca/v3/orca.upb.h" #include "xds/data/orca/v3/orca_load_report.upb.h" #include "google/protobuf/duration.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_service_orca_v3_OrcaLoadReportRequest_submsgs[1] = { - {.submsg = &google_protobuf_Duration_msginit}, +static const upb_MiniTableSub xds_service_orca_v3_OrcaLoadReportRequest_submsgs[1] = { + {.submsg = &google_protobuf_Duration_msg_init}, }; -static const upb_MiniTable_Field xds_service_orca_v3_OrcaLoadReportRequest__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_service_orca_v3_OrcaLoadReportRequest__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msginit = { +const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msg_init = { &xds_service_orca_v3_OrcaLoadReportRequest_submsgs[0], &xds_service_orca_v3_OrcaLoadReportRequest__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x001000003f000012, &upb_prs_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_service_orca_v3_OrcaLoadReportRequest_msginit, + &xds_service_orca_v3_OrcaLoadReportRequest_msg_init, }; -const upb_MiniTable_File xds_service_orca_v3_orca_proto_upb_file_layout = { +const upb_MiniTableFile xds_service_orca_v3_orca_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +51,5 @@ const upb_MiniTable_File xds_service_orca_v3_orca_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 a974b62b3c6..e7ffbfdbeca 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 @@ -9,34 +9,38 @@ #ifndef XDS_SERVICE_ORCA_V3_ORCA_PROTO_UPB_H_ #define XDS_SERVICE_ORCA_V3_ORCA_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_service_orca_v3_OrcaLoadReportRequest; typedef struct xds_service_orca_v3_OrcaLoadReportRequest xds_service_orca_v3_OrcaLoadReportRequest; -extern const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msginit; +extern const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msg_init; struct google_protobuf_Duration; -extern const upb_MiniTable google_protobuf_Duration_msginit; +extern const upb_MiniTable google_protobuf_Duration_msg_init; /* xds.service.orca.v3.OrcaLoadReportRequest */ UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLoadReportRequest_new(upb_Arena* arena) { - return (xds_service_orca_v3_OrcaLoadReportRequest*)_upb_Message_New(&xds_service_orca_v3_OrcaLoadReportRequest_msginit, arena); + return (xds_service_orca_v3_OrcaLoadReportRequest*)_upb_Message_New(&xds_service_orca_v3_OrcaLoadReportRequest_msg_init, arena); } UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLoadReportRequest_parse(const char* buf, size_t size, upb_Arena* arena) { xds_service_orca_v3_OrcaLoadReportRequest* ret = xds_service_orca_v3_OrcaLoadReportRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_service_orca_v3_OrcaLoadReportRequest_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLo int options, upb_Arena* arena) { xds_service_orca_v3_OrcaLoadReportRequest* ret = xds_service_orca_v3_OrcaLoadReportRequest_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_service_orca_v3_OrcaLoadReportRequest_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,60 +58,94 @@ UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLo } UPB_INLINE char* xds_service_orca_v3_OrcaLoadReportRequest_serialize(const xds_service_orca_v3_OrcaLoadReportRequest* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msg_init, 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); -} -UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_clear_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_clear_report_interval(xds_service_orca_v3_OrcaLoadReportRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Duration* xds_service_orca_v3_OrcaLoadReportRequest_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); + const struct google_protobuf_Duration* default_val = NULL; + const struct google_protobuf_Duration* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_clear_request_cost_names(const xds_service_orca_v3_OrcaLoadReportRequest* msg) { - _upb_array_detach(msg, UPB_SIZE(8, 16)); +UPB_INLINE bool xds_service_orca_v3_OrcaLoadReportRequest_has_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* xds_service_orca_v3_OrcaLoadReportRequest_request_cost_names(const xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_clear_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* xds_service_orca_v3_OrcaLoadReportRequest_request_cost_names(const xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool xds_service_orca_v3_OrcaLoadReportRequest_has_request_cost_names(const xds_service_orca_v3_OrcaLoadReportRequest* msg) { + size_t size; + xds_service_orca_v3_OrcaLoadReportRequest_request_cost_names(msg, &size); + return size != 0; } UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_set_report_interval(xds_service_orca_v3_OrcaLoadReportRequest *msg, struct google_protobuf_Duration* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Duration* xds_service_orca_v3_OrcaLoadReportRequest_mutable_report_interval(xds_service_orca_v3_OrcaLoadReportRequest* msg, upb_Arena* arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)xds_service_orca_v3_OrcaLoadReportRequest_report_interval(msg); if (sub == NULL) { - sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena); - if (!sub) return NULL; - xds_service_orca_v3_OrcaLoadReportRequest_set_report_interval(msg, sub); + sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msg_init, arena); + if (sub) xds_service_orca_v3_OrcaLoadReportRequest_set_report_interval(msg, sub); } return sub; } -UPB_INLINE upb_StringView* xds_service_orca_v3_OrcaLoadReportRequest_mutable_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len); +UPB_INLINE upb_StringView* xds_service_orca_v3_OrcaLoadReportRequest_mutable_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* xds_service_orca_v3_OrcaLoadReportRequest_resize_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* xds_service_orca_v3_OrcaLoadReportRequest_resize_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool xds_service_orca_v3_OrcaLoadReportRequest_add_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } -extern const upb_MiniTable_File xds_service_orca_v3_orca_proto_upb_file_layout; +extern const upb_MiniTableFile xds_service_orca_v3_orca_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_SERVICE_ORCA_V3_ORCA_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c index f3cf9732e08..327e3349d2c 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c @@ -7,33 +7,40 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/cel.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/type/v3/cel.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_CelMatcher_submsgs[1] = { - {.submsg = &xds_type_v3_CelExpression_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_CelMatcher_submsgs[1] = { + {.submsg = &xds_type_v3_CelExpression_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_CelMatcher__fields[1] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_CelMatcher__fields[1] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_CelMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_CelMatcher_msg_init = { &xds_type_matcher_v3_CelMatcher_submsgs[0], &xds_type_matcher_v3_CelMatcher__fields[0], - UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_type_matcher_v3_CelMatcher_msginit, + &xds_type_matcher_v3_CelMatcher_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_cel_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_cel_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -42,5 +49,5 @@ const upb_MiniTable_File xds_type_matcher_v3_cel_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h index 8ee68722592..6e7a352572a 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h @@ -9,34 +9,38 @@ #ifndef XDS_TYPE_MATCHER_V3_CEL_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_CEL_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_CelMatcher; typedef struct xds_type_matcher_v3_CelMatcher xds_type_matcher_v3_CelMatcher; -extern const upb_MiniTable xds_type_matcher_v3_CelMatcher_msginit; +extern const upb_MiniTable xds_type_matcher_v3_CelMatcher_msg_init; struct xds_type_v3_CelExpression; -extern const upb_MiniTable xds_type_v3_CelExpression_msginit; +extern const upb_MiniTable xds_type_v3_CelExpression_msg_init; /* xds.type.matcher.v3.CelMatcher */ UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_CelMatcher*)_upb_Message_New(&xds_type_matcher_v3_CelMatcher_msginit, arena); + return (xds_type_matcher_v3_CelMatcher*)_upb_Message_New(&xds_type_matcher_v3_CelMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_CelMatcher* ret = xds_type_matcher_v3_CelMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_CelMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_CelMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_parse_ int options, upb_Arena* arena) { xds_type_matcher_v3_CelMatcher* ret = xds_type_matcher_v3_CelMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_CelMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_CelMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,45 +58,50 @@ UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_parse_ } UPB_INLINE char* xds_type_matcher_v3_CelMatcher_serialize(const xds_type_matcher_v3_CelMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_CelMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_CelMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_CelMatcher_serialize_ex(const xds_type_matcher_v3_CelMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_CelMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_CelMatcher_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool xds_type_matcher_v3_CelMatcher_has_expr_match(const xds_type_matcher_v3_CelMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_CelMatcher_clear_expr_match(const xds_type_matcher_v3_CelMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_CelMatcher_clear_expr_match(xds_type_matcher_v3_CelMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_v3_CelExpression* xds_type_matcher_v3_CelMatcher_expr_match(const xds_type_matcher_v3_CelMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_type_v3_CelExpression*); + const struct xds_type_v3_CelExpression* default_val = NULL; + const struct xds_type_v3_CelExpression* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_CelMatcher_has_expr_match(const xds_type_matcher_v3_CelMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_CelMatcher_set_expr_match(xds_type_matcher_v3_CelMatcher *msg, struct xds_type_v3_CelExpression* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct xds_type_v3_CelExpression*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_v3_CelExpression* xds_type_matcher_v3_CelMatcher_mutable_expr_match(xds_type_matcher_v3_CelMatcher* msg, upb_Arena* arena) { struct xds_type_v3_CelExpression* sub = (struct xds_type_v3_CelExpression*)xds_type_matcher_v3_CelMatcher_expr_match(msg); if (sub == NULL) { - sub = (struct xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_CelMatcher_set_expr_match(msg, sub); + sub = (struct xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msg_init, arena); + if (sub) xds_type_matcher_v3_CelMatcher_set_expr_match(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_type_matcher_v3_cel_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_cel_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_CEL_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c index 50f4e3dd588..9f3d2854377 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c @@ -7,49 +7,62 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/domain.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/type/matcher/v3/matcher.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_ServerNameMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_ServerNameMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_ServerNameMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_ServerNameMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_msg_init = { &xds_type_matcher_v3_ServerNameMatcher_submsgs[0], &xds_type_matcher_v3_ServerNameMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_ServerNameMatcher_DomainMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_ServerNameMatcher_DomainMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init = { &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_submsgs[0], &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prs_1bt}, + {0x0010000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_type_matcher_v3_ServerNameMatcher_msginit, - &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, + &xds_type_matcher_v3_ServerNameMatcher_msg_init, + &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_domain_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_domain_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -58,5 +71,5 @@ const upb_MiniTable_File xds_type_matcher_v3_domain_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h index 6d335866d64..95b454ece84 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h @@ -9,37 +9,40 @@ #ifndef XDS_TYPE_MATCHER_V3_DOMAIN_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_DOMAIN_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_ServerNameMatcher; -struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher; typedef struct xds_type_matcher_v3_ServerNameMatcher xds_type_matcher_v3_ServerNameMatcher; typedef struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher xds_type_matcher_v3_ServerNameMatcher_DomainMatcher; -extern const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit; +extern const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init; struct xds_type_matcher_v3_Matcher_OnMatch; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msg_init; /* xds.type.matcher.v3.ServerNameMatcher */ UPB_INLINE xds_type_matcher_v3_ServerNameMatcher* xds_type_matcher_v3_ServerNameMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_ServerNameMatcher*)_upb_Message_New(&xds_type_matcher_v3_ServerNameMatcher_msginit, arena); + return (xds_type_matcher_v3_ServerNameMatcher*)_upb_Message_New(&xds_type_matcher_v3_ServerNameMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_ServerNameMatcher* xds_type_matcher_v3_ServerNameMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_ServerNameMatcher* ret = xds_type_matcher_v3_ServerNameMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE xds_type_matcher_v3_ServerNameMatcher* xds_type_matcher_v3_ServerName int options, upb_Arena* arena) { xds_type_matcher_v3_ServerNameMatcher* ret = xds_type_matcher_v3_ServerNameMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,47 +60,72 @@ UPB_INLINE xds_type_matcher_v3_ServerNameMatcher* xds_type_matcher_v3_ServerName } UPB_INLINE char* xds_type_matcher_v3_ServerNameMatcher_serialize(const xds_type_matcher_v3_ServerNameMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_ServerNameMatcher_serialize_ex(const xds_type_matcher_v3_ServerNameMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_clear_domain_matchers(xds_type_matcher_v3_ServerNameMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* const* xds_type_matcher_v3_ServerNameMatcher_domain_matchers(const xds_type_matcher_v3_ServerNameMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_ServerNameMatcher_has_domain_matchers(const xds_type_matcher_v3_ServerNameMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_clear_domain_matchers(const xds_type_matcher_v3_ServerNameMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* const* xds_type_matcher_v3_ServerNameMatcher_domain_matchers(const xds_type_matcher_v3_ServerNameMatcher* msg, size_t* len) { - return (const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_ServerNameMatcher_domain_matchers(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher** xds_type_matcher_v3_ServerNameMatcher_mutable_domain_matchers(xds_type_matcher_v3_ServerNameMatcher* msg, size_t* len) { - return (xds_type_matcher_v3_ServerNameMatcher_DomainMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher** xds_type_matcher_v3_ServerNameMatcher_mutable_domain_matchers(xds_type_matcher_v3_ServerNameMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_ServerNameMatcher_DomainMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher** xds_type_matcher_v3_ServerNameMatcher_resize_domain_matchers(xds_type_matcher_v3_ServerNameMatcher* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_ServerNameMatcher_DomainMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher** xds_type_matcher_v3_ServerNameMatcher_resize_domain_matchers(xds_type_matcher_v3_ServerNameMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_ServerNameMatcher_DomainMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* xds_type_matcher_v3_ServerNameMatcher_add_domain_matchers(xds_type_matcher_v3_ServerNameMatcher* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* sub = (struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher*)_upb_Message_New(&xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* sub = (struct xds_type_matcher_v3_ServerNameMatcher_DomainMatcher*)_upb_Message_New(&xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.ServerNameMatcher.DomainMatcher */ UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_ServerNameMatcher_DomainMatcher*)_upb_Message_New(&xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, arena); + return (xds_type_matcher_v3_ServerNameMatcher_DomainMatcher*)_upb_Message_New(&xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* ret = xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -107,7 +135,7 @@ UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* xds_type_matcher int options, upb_Arena* arena) { xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* ret = xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -115,60 +143,94 @@ UPB_INLINE xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* xds_type_matcher } UPB_INLINE char* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_serialize(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_serialize_ex(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_clear_domains(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); +UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_clear_domains(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView const* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_domains(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, size_t* len) { - return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE upb_StringView const* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_domains(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE bool xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_has_on_match(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_has_domains(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { + size_t size; + xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_domains(msg, &size); + return size != 0; } -UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_clear_on_match(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_clear_on_match(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_on_match(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct xds_type_matcher_v3_Matcher_OnMatch*); + const struct xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const struct xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_has_on_match(const xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE upb_StringView* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_mutable_domains(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, size_t* len) { - return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE upb_StringView* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_mutable_domains(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE upb_StringView* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_resize_domains(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, size_t len, upb_Arena* arena) { - return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena); +UPB_INLINE upb_StringView* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_resize_domains(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE bool xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_add_domains(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, upb_StringView val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &val, arena); + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } UPB_INLINE void xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_set_on_match(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher *msg, struct xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_mutable_on_match(xds_type_matcher_v3_ServerNameMatcher_DomainMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_on_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_set_on_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_ServerNameMatcher_DomainMatcher_set_on_match(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_type_matcher_v3_domain_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_domain_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_DOMAIN_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c index a0529f1841b..1c604978d86 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c @@ -7,23 +7,26 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/http_inputs.upb.h" #include "xds/annotations/v3/status.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -const upb_MiniTable xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit = { +const upb_MiniTable xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[1] = { - &xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit, + &xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_http_inputs_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_http_inputs_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -32,5 +35,5 @@ const upb_MiniTable_File xds_type_matcher_v3_http_inputs_proto_upb_file_layout = 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h index b7a1174a36a..3ee702a4d70 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h @@ -9,32 +9,36 @@ #ifndef XDS_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_HttpAttributesCelMatchInput; typedef struct xds_type_matcher_v3_HttpAttributesCelMatchInput xds_type_matcher_v3_HttpAttributesCelMatchInput; -extern const upb_MiniTable xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit; +extern const upb_MiniTable xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init; /* xds.type.matcher.v3.HttpAttributesCelMatchInput */ UPB_INLINE xds_type_matcher_v3_HttpAttributesCelMatchInput* xds_type_matcher_v3_HttpAttributesCelMatchInput_new(upb_Arena* arena) { - return (xds_type_matcher_v3_HttpAttributesCelMatchInput*)_upb_Message_New(&xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit, arena); + return (xds_type_matcher_v3_HttpAttributesCelMatchInput*)_upb_Message_New(&xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_HttpAttributesCelMatchInput* xds_type_matcher_v3_HttpAttributesCelMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_HttpAttributesCelMatchInput* ret = xds_type_matcher_v3_HttpAttributesCelMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -44,7 +48,7 @@ UPB_INLINE xds_type_matcher_v3_HttpAttributesCelMatchInput* xds_type_matcher_v3_ int options, upb_Arena* arena) { xds_type_matcher_v3_HttpAttributesCelMatchInput* ret = xds_type_matcher_v3_HttpAttributesCelMatchInput_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -52,23 +56,23 @@ UPB_INLINE xds_type_matcher_v3_HttpAttributesCelMatchInput* xds_type_matcher_v3_ } UPB_INLINE char* xds_type_matcher_v3_HttpAttributesCelMatchInput_serialize(const xds_type_matcher_v3_HttpAttributesCelMatchInput* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_HttpAttributesCelMatchInput_serialize_ex(const xds_type_matcher_v3_HttpAttributesCelMatchInput* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_HttpAttributesCelMatchInput_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File xds_type_matcher_v3_http_inputs_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_http_inputs_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c index 62a73daae7a..8488174497a 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c @@ -7,52 +7,65 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/ip.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/core/v3/cidr.upb.h" #include "xds/type/matcher/v3/matcher.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_IPMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_IPMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_IPMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_IPMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_IPMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_IPMatcher_msg_init = { &xds_type_matcher_v3_IPMatcher_submsgs[0], &xds_type_matcher_v3_IPMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_IPMatcher_IPRangeMatcher_submsgs[2] = { - {.submsg = &xds_core_v3_CidrRange_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_IPMatcher_IPRangeMatcher_submsgs[2] = { + {.submsg = &xds_core_v3_CidrRange_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_IPMatcher_IPRangeMatcher__fields[3] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_IPMatcher_IPRangeMatcher__fields[3] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init = { &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_submsgs[0], &xds_type_matcher_v3_IPMatcher_IPRangeMatcher__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_maxmaxb}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x000100003f000018, &upb_psb1_1bt}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_type_matcher_v3_IPMatcher_msginit, - &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, + &xds_type_matcher_v3_IPMatcher_msg_init, + &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_ip_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_ip_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -61,5 +74,5 @@ const upb_MiniTable_File xds_type_matcher_v3_ip_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h index d6df6847eb5..19ea013b2dd 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h @@ -9,39 +9,42 @@ #ifndef XDS_TYPE_MATCHER_V3_IP_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_IP_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_IPMatcher; -struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher; typedef struct xds_type_matcher_v3_IPMatcher xds_type_matcher_v3_IPMatcher; typedef struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher xds_type_matcher_v3_IPMatcher_IPRangeMatcher; -extern const upb_MiniTable xds_type_matcher_v3_IPMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit; +extern const upb_MiniTable xds_type_matcher_v3_IPMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init; struct xds_core_v3_CidrRange; struct xds_type_matcher_v3_Matcher_OnMatch; -extern const upb_MiniTable xds_core_v3_CidrRange_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit; +extern const upb_MiniTable xds_core_v3_CidrRange_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msg_init; /* xds.type.matcher.v3.IPMatcher */ UPB_INLINE xds_type_matcher_v3_IPMatcher* xds_type_matcher_v3_IPMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_IPMatcher*)_upb_Message_New(&xds_type_matcher_v3_IPMatcher_msginit, arena); + return (xds_type_matcher_v3_IPMatcher*)_upb_Message_New(&xds_type_matcher_v3_IPMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_IPMatcher* xds_type_matcher_v3_IPMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_IPMatcher* ret = xds_type_matcher_v3_IPMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -51,7 +54,7 @@ UPB_INLINE xds_type_matcher_v3_IPMatcher* xds_type_matcher_v3_IPMatcher_parse_ex int options, upb_Arena* arena) { xds_type_matcher_v3_IPMatcher* ret = xds_type_matcher_v3_IPMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -59,47 +62,72 @@ UPB_INLINE xds_type_matcher_v3_IPMatcher* xds_type_matcher_v3_IPMatcher_parse_ex } UPB_INLINE char* xds_type_matcher_v3_IPMatcher_serialize(const xds_type_matcher_v3_IPMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_IPMatcher_serialize_ex(const xds_type_matcher_v3_IPMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_IPMatcher_clear_range_matchers(xds_type_matcher_v3_IPMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* const* xds_type_matcher_v3_IPMatcher_range_matchers(const xds_type_matcher_v3_IPMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_IPMatcher_has_range_matchers(const xds_type_matcher_v3_IPMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_IPMatcher_clear_range_matchers(const xds_type_matcher_v3_IPMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* const* xds_type_matcher_v3_IPMatcher_range_matchers(const xds_type_matcher_v3_IPMatcher* msg, size_t* len) { - return (const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_IPMatcher_range_matchers(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher** xds_type_matcher_v3_IPMatcher_mutable_range_matchers(xds_type_matcher_v3_IPMatcher* msg, size_t* len) { - return (xds_type_matcher_v3_IPMatcher_IPRangeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher** xds_type_matcher_v3_IPMatcher_mutable_range_matchers(xds_type_matcher_v3_IPMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_IPMatcher_IPRangeMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher** xds_type_matcher_v3_IPMatcher_resize_range_matchers(xds_type_matcher_v3_IPMatcher* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_IPMatcher_IPRangeMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher** xds_type_matcher_v3_IPMatcher_resize_range_matchers(xds_type_matcher_v3_IPMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_IPMatcher_IPRangeMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher* xds_type_matcher_v3_IPMatcher_add_range_matchers(xds_type_matcher_v3_IPMatcher* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher* sub = (struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher* sub = (struct xds_type_matcher_v3_IPMatcher_IPRangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.IPMatcher.IPRangeMatcher */ UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_IPMatcher_IPRangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, arena); + return (xds_type_matcher_v3_IPMatcher_IPRangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_IPMatcher_IPRangeMatcher* ret = xds_type_matcher_v3_IPMatcher_IPRangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -109,7 +137,7 @@ UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher* xds_type_matcher_v3_IPM int options, upb_Arena* arena) { xds_type_matcher_v3_IPMatcher_IPRangeMatcher* ret = xds_type_matcher_v3_IPMatcher_IPRangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -117,75 +145,111 @@ UPB_INLINE xds_type_matcher_v3_IPMatcher_IPRangeMatcher* xds_type_matcher_v3_IPM } UPB_INLINE char* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_serialize(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_serialize_ex(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_IPMatcher_IPRangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_clear_ranges(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct xds_core_v3_CidrRange* const* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_ranges(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct xds_core_v3_CidrRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_IPMatcher_IPRangeMatcher_has_ranges(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + xds_type_matcher_v3_IPMatcher_IPRangeMatcher_ranges(msg, &size); + return size != 0; } -UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_clear_ranges(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct xds_core_v3_CidrRange* const* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_ranges(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, size_t* len) { - return (const struct xds_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool xds_type_matcher_v3_IPMatcher_IPRangeMatcher_has_on_match(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_clear_on_match(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_clear_on_match(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_on_match(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct xds_type_matcher_v3_Matcher_OnMatch*); + const struct xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const struct xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_clear_exclusive(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0; +UPB_INLINE bool xds_type_matcher_v3_IPMatcher_IPRangeMatcher_has_on_match(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_clear_exclusive(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_type_matcher_v3_IPMatcher_IPRangeMatcher_exclusive(const xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE struct xds_core_v3_CidrRange** xds_type_matcher_v3_IPMatcher_IPRangeMatcher_mutable_ranges(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, size_t* len) { - return (struct xds_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct xds_core_v3_CidrRange** xds_type_matcher_v3_IPMatcher_IPRangeMatcher_mutable_ranges(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct xds_core_v3_CidrRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct xds_core_v3_CidrRange** xds_type_matcher_v3_IPMatcher_IPRangeMatcher_resize_ranges(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, size_t len, upb_Arena* arena) { - return (struct xds_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct xds_core_v3_CidrRange** xds_type_matcher_v3_IPMatcher_IPRangeMatcher_resize_ranges(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct xds_core_v3_CidrRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_core_v3_CidrRange* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_add_ranges(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, upb_Arena* arena) { - struct xds_core_v3_CidrRange* sub = (struct xds_core_v3_CidrRange*)_upb_Message_New(&xds_core_v3_CidrRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_core_v3_CidrRange* sub = (struct xds_core_v3_CidrRange*)_upb_Message_New(&xds_core_v3_CidrRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_set_on_match(xds_type_matcher_v3_IPMatcher_IPRangeMatcher *msg, struct xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_IPMatcher_IPRangeMatcher_mutable_on_match(xds_type_matcher_v3_IPMatcher_IPRangeMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_IPMatcher_IPRangeMatcher_on_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_IPMatcher_IPRangeMatcher_set_on_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_IPMatcher_IPRangeMatcher_set_on_match(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_IPMatcher_IPRangeMatcher_set_exclusive(xds_type_matcher_v3_IPMatcher_IPRangeMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value; + const upb_MiniTableField field = {3, UPB_SIZE(12, 1), 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File xds_type_matcher_v3_ip_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_ip_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_IP_PROTO_UPB_H_ */ 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 202d77e5b3e..bc00bd1fa33 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 @@ -7,194 +7,255 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/matcher.upb.h" #include "xds/annotations/v3/status.upb.h" #include "xds/core/v3/extension.upb.h" #include "xds/type/matcher/v3/string.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_submsgs[3] = { - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_submsgs[3] = { + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher__fields[3] = { - {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher__fields[3] = { + {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_msg_init = { &xds_type_matcher_v3_Matcher_submsgs[0], &xds_type_matcher_v3_Matcher__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000040100000a, &upb_pom_1bt_max64b}, + {0x0010000402010012, &upb_pom_1bt_max64b}, + {0x000800000102001a, &upb_psm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_OnMatch_submsgs[2] = { - {.submsg = &xds_type_matcher_v3_Matcher_msginit}, - {.submsg = &xds_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_OnMatch_submsgs[2] = { + {.submsg = &xds_type_matcher_v3_Matcher_msg_init}, + {.submsg = &xds_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_OnMatch__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_OnMatch__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msg_init = { &xds_type_matcher_v3_Matcher_OnMatch_submsgs[0], &xds_type_matcher_v3_Matcher_OnMatch__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherList_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_msg_init = { &xds_type_matcher_v3_Matcher_MatcherList_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = { - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = { + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predicate__fields[4] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherList_Predicate__fields[4] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init = { &xds_type_matcher_v3_Matcher_MatcherList_Predicate_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherList_Predicate__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_max64b}, + {0x0008000002010012, &upb_pom_1bt_max64b}, + {0x000800000302001a, &upb_pom_1bt_max64b}, + {0x0008000004030022, &upb_pom_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = { - {.submsg = &xds_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &xds_type_matcher_v3_StringMatcher_msginit}, - {.submsg = &xds_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = { + {.submsg = &xds_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &xds_type_matcher_v3_StringMatcher_msg_init}, + {.submsg = &xds_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[3] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[3] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init = { &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000402010012, &upb_pom_1bt_maxmaxb}, + {0x001000040302001a, &upb_pom_1bt_maxmaxb}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init = { &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = { - {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = { + {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init = { &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_submsgs[4] = { - {.submsg = &xds_core_v3_TypedExtensionConfig_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit}, - {.submsg = &xds_core_v3_TypedExtensionConfig_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherTree_submsgs[4] = { + {.submsg = &xds_core_v3_TypedExtensionConfig_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init}, + {.submsg = &xds_core_v3_TypedExtensionConfig_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree__fields[4] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherTree__fields[4] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_msg_init = { &xds_type_matcher_v3_Matcher_MatcherTree_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherTree__fields[0], - UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_maxmaxb}, + {0x0010000402010012, &upb_pom_1bt_max64b}, + {0x001000040302001a, &upb_pom_1bt_max64b}, + {0x0010000404030022, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree_MatchMap__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherTree_MatchMap__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init = { &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(255), 0, }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[2] = { + {1, 8, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit = { +const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init = { &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[0], &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_psb_1bt}, + {0x0018000001000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[10] = { - &xds_type_matcher_v3_Matcher_msginit, - &xds_type_matcher_v3_Matcher_OnMatch_msginit, - &xds_type_matcher_v3_Matcher_MatcherList_msginit, - &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, - &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, - &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, - &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, - &xds_type_matcher_v3_Matcher_MatcherTree_msginit, - &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, - &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit, + &xds_type_matcher_v3_Matcher_msg_init, + &xds_type_matcher_v3_Matcher_OnMatch_msg_init, + &xds_type_matcher_v3_Matcher_MatcherList_msg_init, + &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, + &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, + &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, + &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, + &xds_type_matcher_v3_Matcher_MatcherTree_msg_init, + &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, + &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_matcher_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_matcher_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -203,5 +264,5 @@ const upb_MiniTable_File xds_type_matcher_v3_matcher_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 b1d36c0075f..2fec438be64 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 @@ -9,27 +9,22 @@ #ifndef XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_Matcher; -struct xds_type_matcher_v3_Matcher_OnMatch; -struct xds_type_matcher_v3_Matcher_MatcherList; -struct xds_type_matcher_v3_Matcher_MatcherList_Predicate; -struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate; -struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList; -struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher; -struct xds_type_matcher_v3_Matcher_MatcherTree; -struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap; -struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry; typedef struct xds_type_matcher_v3_Matcher xds_type_matcher_v3_Matcher; typedef struct xds_type_matcher_v3_Matcher_OnMatch xds_type_matcher_v3_Matcher_OnMatch; typedef struct xds_type_matcher_v3_Matcher_MatcherList xds_type_matcher_v3_Matcher_MatcherList; @@ -40,32 +35,32 @@ typedef struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher xds_type_mat typedef struct xds_type_matcher_v3_Matcher_MatcherTree xds_type_matcher_v3_Matcher_MatcherTree; typedef struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap xds_type_matcher_v3_Matcher_MatcherTree_MatchMap; typedef struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msg_init; struct xds_core_v3_TypedExtensionConfig; struct xds_type_matcher_v3_StringMatcher; -extern const upb_MiniTable xds_core_v3_TypedExtensionConfig_msginit; -extern const upb_MiniTable xds_type_matcher_v3_StringMatcher_msginit; +extern const upb_MiniTable xds_core_v3_TypedExtensionConfig_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_StringMatcher_msg_init; /* xds.type.matcher.v3.Matcher */ UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena); + return (xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher* ret = xds_type_matcher_v3_Matcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -75,7 +70,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_parse_ex(con int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher* ret = xds_type_matcher_v3_Matcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -83,13 +78,13 @@ UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_parse_ex(con } UPB_INLINE char* xds_type_matcher_v3_Matcher_serialize(const xds_type_matcher_v3_Matcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -98,70 +93,88 @@ typedef enum { xds_type_matcher_v3_Matcher_matcher_type_NOT_SET = 0 } xds_type_matcher_v3_Matcher_matcher_type_oneofcases; UPB_INLINE xds_type_matcher_v3_Matcher_matcher_type_oneofcases xds_type_matcher_v3_Matcher_matcher_type_case(const xds_type_matcher_v3_Matcher* msg) { - return (xds_type_matcher_v3_Matcher_matcher_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_matcher_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_Matcher_has_matcher_list(const xds_type_matcher_v3_Matcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void xds_type_matcher_v3_Matcher_clear_matcher_list(const xds_type_matcher_v3_Matcher* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_matcher_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_clear_matcher_list(xds_type_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_matcher_list(const xds_type_matcher_v3_Matcher* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL); + const xds_type_matcher_v3_Matcher_MatcherList* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherList* ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_has_matcher_tree(const xds_type_matcher_v3_Matcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool xds_type_matcher_v3_Matcher_has_matcher_list(const xds_type_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_clear_matcher_tree(const xds_type_matcher_v3_Matcher* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_matcher_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_clear_matcher_tree(xds_type_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_matcher_tree(const xds_type_matcher_v3_Matcher* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const xds_type_matcher_v3_Matcher_MatcherTree* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherTree* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_has_on_no_match(const xds_type_matcher_v3_Matcher* msg) { - return _upb_hasbit(msg, 1); +UPB_INLINE bool xds_type_matcher_v3_Matcher_has_matcher_tree(const xds_type_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_clear_on_no_match(const xds_type_matcher_v3_Matcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Matcher_clear_on_no_match(xds_type_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_on_no_match(const xds_type_matcher_v3_Matcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const xds_type_matcher_v3_Matcher_OnMatch*); + const xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_has_on_no_match(const xds_type_matcher_v3_Matcher* msg) { + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_Matcher_set_matcher_list(xds_type_matcher_v3_Matcher *msg, xds_type_matcher_v3_Matcher_MatcherList* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, UPB_SIZE(12, 16), -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_mutable_matcher_list(xds_type_matcher_v3_Matcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherList* sub = (struct xds_type_matcher_v3_Matcher_MatcherList*)xds_type_matcher_v3_Matcher_matcher_list(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_set_matcher_list(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_set_matcher_list(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_set_matcher_tree(xds_type_matcher_v3_Matcher *msg, xds_type_matcher_v3_Matcher_MatcherTree* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), -5, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_mutable_matcher_tree(xds_type_matcher_v3_Matcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherTree* sub = (struct xds_type_matcher_v3_Matcher_MatcherTree*)xds_type_matcher_v3_Matcher_matcher_tree(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_set_matcher_tree(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_set_matcher_tree(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_set_on_no_match(xds_type_matcher_v3_Matcher *msg, xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {3, 8, 1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_mutable_on_no_match(xds_type_matcher_v3_Matcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_Matcher_on_no_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_set_on_no_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_set_on_no_match(msg, sub); } return sub; } @@ -169,12 +182,12 @@ UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Match /* xds.type.matcher.v3.Matcher.OnMatch */ UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMatch_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); + return (xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMatch_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_OnMatch* ret = xds_type_matcher_v3_Matcher_OnMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_OnMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_OnMatch_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -184,7 +197,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMa int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_OnMatch* ret = xds_type_matcher_v3_Matcher_OnMatch_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_OnMatch_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_OnMatch_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -192,13 +205,13 @@ UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMa } UPB_INLINE char* xds_type_matcher_v3_Matcher_OnMatch_serialize(const xds_type_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -207,48 +220,61 @@ typedef enum { xds_type_matcher_v3_Matcher_OnMatch_on_match_NOT_SET = 0 } xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases; UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases xds_type_matcher_v3_Matcher_OnMatch_on_match_case(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - return (xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_Matcher_OnMatch_has_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_clear_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_OnMatch_on_match_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_clear_matcher(xds_type_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_OnMatch_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const xds_type_matcher_v3_Matcher* default_val = NULL; + const xds_type_matcher_v3_Matcher* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_OnMatch_has_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool xds_type_matcher_v3_Matcher_OnMatch_has_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_clear_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_OnMatch_on_match_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_clear_action(xds_type_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_OnMatch_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) { - return UPB_READ_ONEOF(msg, const struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct xds_core_v3_TypedExtensionConfig* default_val = NULL; + const struct xds_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_OnMatch_has_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_set_matcher(xds_type_matcher_v3_Matcher_OnMatch *msg, xds_type_matcher_v3_Matcher* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_OnMatch_mutable_matcher(xds_type_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)xds_type_matcher_v3_Matcher_OnMatch_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_OnMatch_set_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_OnMatch_set_matcher(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_set_action(xds_type_matcher_v3_Matcher_OnMatch *msg, struct xds_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_OnMatch_mutable_action(xds_type_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) { struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_OnMatch_action(msg); if (sub == NULL) { - sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_OnMatch_set_action(msg, sub); + sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_OnMatch_set_action(msg, sub); } return sub; } @@ -256,12 +282,12 @@ UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_ /* xds.type.matcher.v3.Matcher.MatcherList */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_MatcherList_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_MatcherList_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList* ret = xds_type_matcher_v3_Matcher_MatcherList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -271,7 +297,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_ int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList* ret = xds_type_matcher_v3_Matcher_MatcherList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -279,47 +305,72 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_ } UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_serialize(const xds_type_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_clear_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* const* xds_type_matcher_v3_Matcher_MatcherList_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_has_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_clear_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* const* xds_type_matcher_v3_Matcher_MatcherList_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg, size_t* len) { - return (const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_Matcher_MatcherList_matchers(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher** xds_type_matcher_v3_Matcher_MatcherList_mutable_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, size_t* len) { - return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher** xds_type_matcher_v3_Matcher_MatcherList_mutable_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher** xds_type_matcher_v3_Matcher_MatcherList_resize_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher** xds_type_matcher_v3_Matcher_MatcherList_resize_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_add_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.Matcher.MatcherList.Predicate */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_Predicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -329,7 +380,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_Predicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -337,13 +388,13 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v } 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -354,90 +405,115 @@ typedef enum { xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET = 0 } xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases; UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_case(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_single_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_or_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_and_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL); + const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret; + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_not_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL); + const xds_type_matcher_v3_Matcher_MatcherList_Predicate* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherList_Predicate* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_single_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_or_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3); + const upb_MiniTableField field = {3, UPB_SIZE(4, 8), -1, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_and_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4); + const upb_MiniTableField field = {4, UPB_SIZE(4, 8), -1, 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_not_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(msg, sub); } return sub; } @@ -445,12 +521,12 @@ UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_ma /* xds.type.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -460,7 +536,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xd int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -468,13 +544,13 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xd } 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -483,70 +559,88 @@ typedef enum { xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET = 0 } xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases; UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_case(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_input(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct xds_core_v3_TypedExtensionConfig*); + const struct xds_core_v3_TypedExtensionConfig* default_val = NULL; + const struct xds_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_value_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return UPB_READ_ONEOF(msg, const struct xds_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const struct xds_type_matcher_v3_StringMatcher* default_val = NULL; + const struct xds_type_matcher_v3_StringMatcher* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_custom_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { - return UPB_READ_ONEOF(msg, const struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const struct xds_core_v3_TypedExtensionConfig* default_val = NULL; + const struct xds_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct xds_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct xds_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_input(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) { struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(msg); if (sub == NULL) { - sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(msg, sub); + sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct xds_type_matcher_v3_StringMatcher* value) { - UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_value_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) { struct xds_type_matcher_v3_StringMatcher* sub = (struct xds_type_matcher_v3_StringMatcher*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(msg, sub); + sub = (struct xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct xds_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_custom_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) { struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(msg); if (sub == NULL) { - sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(msg, sub); + sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(msg, sub); } return sub; } @@ -554,12 +648,12 @@ UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_ /* xds.type.matcher.v3.Matcher.MatcherList.Predicate.PredicateList */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -569,7 +663,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_ int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -577,47 +671,72 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_ } 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_clear_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* const* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_Matcher_MatcherList_Predicate* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_has_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_clear_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* const* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) { - return (const xds_type_matcher_v3_Matcher_MatcherList_Predicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate** xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_mutable_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate** xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_mutable_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate** xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_resize_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList_Predicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate** xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_resize_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_MatcherList_Predicate**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_add_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.Matcher.MatcherList.FieldMatcher */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -627,7 +746,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matche int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -635,57 +754,67 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matche } 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msg_init, 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); -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_predicate(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_predicate(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const xds_type_matcher_v3_Matcher_MatcherList_Predicate*); + const xds_type_matcher_v3_Matcher_MatcherList_Predicate* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherList_Predicate* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_has_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_has_predicate(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_on_match(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const xds_type_matcher_v3_Matcher_OnMatch*); + const xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_has_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), xds_type_matcher_v3_Matcher_MatcherList_Predicate*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_predicate(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_on_match(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(msg, sub); } return sub; } @@ -693,12 +822,12 @@ UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Match /* xds.type.matcher.v3.Matcher.MatcherTree */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_MatcherTree_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_MatcherTree_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherTree* ret = xds_type_matcher_v3_Matcher_MatcherTree_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -708,7 +837,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_ int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherTree* ret = xds_type_matcher_v3_Matcher_MatcherTree_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -716,13 +845,13 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_ } UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherTree_serialize(const xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -732,91 +861,115 @@ typedef enum { xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET = 0 } xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases; UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases xds_type_matcher_v3_Matcher_MatcherTree_tree_type_case(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return (xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_input(xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct xds_core_v3_TypedExtensionConfig*); + const struct xds_core_v3_TypedExtensionConfig* default_val = NULL; + const struct xds_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_exact_match_map(xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL); + const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_prefix_match_map(xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL); + const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* default_val = NULL; + const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4; +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_custom_match(xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { - return UPB_READ_ONEOF(msg, const struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL); + const struct xds_core_v3_TypedExtensionConfig* default_val = NULL; + const struct xds_core_v3_TypedExtensionConfig* ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_input(xds_type_matcher_v3_Matcher_MatcherTree *msg, struct xds_core_v3_TypedExtensionConfig* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct xds_core_v3_TypedExtensionConfig*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_mutable_input(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherTree_input(msg); if (sub == NULL) { - sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherTree_set_input(msg, sub); + sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherTree_set_input(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_exact_match_map(xds_type_matcher_v3_Matcher_MatcherTree *msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_mutable_exact_match_map(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)xds_type_matcher_v3_Matcher_MatcherTree_exact_match_map(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherTree_set_exact_match_map(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherTree_set_exact_match_map(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(xds_type_matcher_v3_Matcher_MatcherTree *msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_mutable_prefix_match_map(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)xds_type_matcher_v3_Matcher_MatcherTree_prefix_match_map(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_custom_match(xds_type_matcher_v3_Matcher_MatcherTree *msg, struct xds_core_v3_TypedExtensionConfig* value) { - UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4); + const upb_MiniTableField field = {4, UPB_SIZE(12, 16), UPB_SIZE(-9, -5), 3, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_mutable_custom_match(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) { struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherTree_custom_match(msg); if (sub == NULL) { - sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Matcher_MatcherTree_set_custom_match(msg, sub); + sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msg_init, arena); + if (sub) xds_type_matcher_v3_Matcher_MatcherTree_set_custom_match(msg, sub); } return sub; } @@ -824,12 +977,12 @@ UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_ /* xds.type.matcher.v3.Matcher.MatcherTree.MatchMap */ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena); + return (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* ret = xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -839,7 +992,7 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3 int options, upb_Arena* arena) { xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* ret = xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -847,40 +1000,63 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3 } 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msg_init, 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)); -} -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_clear_map(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_clear_map(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE size_t xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { - return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_get(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, xds_type_matcher_v3_Matcher_OnMatch** val) { - return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, 0, val, sizeof(*val)); } UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_next(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) { - return (const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_map_next(map, iter); +} +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_has_map(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { + return xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(msg) != 0; } -UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_clear(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); } +UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_clear(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); +} UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_set(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, xds_type_matcher_v3_Matcher_OnMatch* val, upb_Arena* a) { - return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, sizeof(val), a); + return _upb_Map_Insert(map, &key, 0, &val, sizeof(val), a) != + kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_delete(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key) { - return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, 0, NULL); } UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_nextmutable(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) { - return (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_map_next(map, iter); } /* xds.type.matcher.v3.Matcher.MatcherTree.MatchMap.MapEntry */ @@ -890,25 +1066,26 @@ UPB_INLINE upb_StringView xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEn _upb_msg_map_key(msg, &ret, 0); return ret; } -UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_has_value(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); -} UPB_INLINE const xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_value(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) { xds_type_matcher_v3_Matcher_OnMatch* ret; _upb_msg_map_value(msg, &ret, sizeof(ret)); return ret; } +UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_has_value(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_set_value(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry *msg, xds_type_matcher_v3_Matcher_OnMatch* value) { _upb_msg_map_set_value(msg, &value, sizeof(xds_type_matcher_v3_Matcher_OnMatch*)); } -extern const upb_MiniTable_File xds_type_matcher_v3_matcher_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_matcher_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c index 46956b8c5a4..2fe66f7d2a3 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c @@ -7,114 +7,147 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/range.upb.h" #include "xds/type/v3/range.upb.h" #include "xds/type/matcher/v3/matcher.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_Int64RangeMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Int64RangeMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Int64RangeMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Int64RangeMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_msg_init = { &xds_type_matcher_v3_Int64RangeMatcher_submsgs[0], &xds_type_matcher_v3_Int64RangeMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_submsgs[2] = { - {.submsg = &xds_type_v3_Int64Range_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_submsgs[2] = { + {.submsg = &xds_type_v3_Int64Range_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init = { &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_submsgs[0], &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_maxmaxb}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Int32RangeMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Int32RangeMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Int32RangeMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Int32RangeMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_msg_init = { &xds_type_matcher_v3_Int32RangeMatcher_submsgs[0], &xds_type_matcher_v3_Int32RangeMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_submsgs[2] = { - {.submsg = &xds_type_v3_Int32Range_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_submsgs[2] = { + {.submsg = &xds_type_v3_Int32Range_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init = { &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_submsgs[0], &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_maxmaxb}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_DoubleRangeMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_DoubleRangeMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_DoubleRangeMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_DoubleRangeMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_msg_init = { &xds_type_matcher_v3_DoubleRangeMatcher_submsgs[0], &xds_type_matcher_v3_DoubleRangeMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_submsgs[2] = { - {.submsg = &xds_type_v3_DoubleRange_msginit}, - {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_submsgs[2] = { + {.submsg = &xds_type_v3_DoubleRange_msg_init}, + {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher__fields[2] = { + {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init = { &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_submsgs[0], &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_prm_1bt_maxmaxb}, + {0x0010000001010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[6] = { - &xds_type_matcher_v3_Int64RangeMatcher_msginit, - &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, - &xds_type_matcher_v3_Int32RangeMatcher_msginit, - &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, - &xds_type_matcher_v3_DoubleRangeMatcher_msginit, - &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, + &xds_type_matcher_v3_Int64RangeMatcher_msg_init, + &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, + &xds_type_matcher_v3_Int32RangeMatcher_msg_init, + &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, + &xds_type_matcher_v3_DoubleRangeMatcher_msg_init, + &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_range_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_range_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -123,5 +156,5 @@ const upb_MiniTable_File xds_type_matcher_v3_range_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h index 4b160e8ded3..c467047a0af 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h @@ -9,55 +9,54 @@ #ifndef XDS_TYPE_MATCHER_V3_RANGE_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_RANGE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_Int64RangeMatcher; -struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher; -struct xds_type_matcher_v3_Int32RangeMatcher; -struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher; -struct xds_type_matcher_v3_DoubleRangeMatcher; -struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher; typedef struct xds_type_matcher_v3_Int64RangeMatcher xds_type_matcher_v3_Int64RangeMatcher; typedef struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher; typedef struct xds_type_matcher_v3_Int32RangeMatcher xds_type_matcher_v3_Int32RangeMatcher; typedef struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher; typedef struct xds_type_matcher_v3_DoubleRangeMatcher xds_type_matcher_v3_DoubleRangeMatcher; typedef struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher; -extern const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit; +extern const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init; struct xds_type_matcher_v3_Matcher_OnMatch; struct xds_type_v3_DoubleRange; struct xds_type_v3_Int32Range; struct xds_type_v3_Int64Range; -extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit; -extern const upb_MiniTable xds_type_v3_DoubleRange_msginit; -extern const upb_MiniTable xds_type_v3_Int32Range_msginit; -extern const upb_MiniTable xds_type_v3_Int64Range_msginit; +extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msg_init; +extern const upb_MiniTable xds_type_v3_DoubleRange_msg_init; +extern const upb_MiniTable xds_type_v3_Int32Range_msg_init; +extern const upb_MiniTable xds_type_v3_Int64Range_msg_init; /* xds.type.matcher.v3.Int64RangeMatcher */ UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher* xds_type_matcher_v3_Int64RangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Int64RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int64RangeMatcher_msginit, arena); + return (xds_type_matcher_v3_Int64RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int64RangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher* xds_type_matcher_v3_Int64RangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Int64RangeMatcher* ret = xds_type_matcher_v3_Int64RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -67,7 +66,7 @@ UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher* xds_type_matcher_v3_Int64Range int options, upb_Arena* arena) { xds_type_matcher_v3_Int64RangeMatcher* ret = xds_type_matcher_v3_Int64RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -75,47 +74,72 @@ UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher* xds_type_matcher_v3_Int64Range } UPB_INLINE char* xds_type_matcher_v3_Int64RangeMatcher_serialize(const xds_type_matcher_v3_Int64RangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_Int64RangeMatcher_serialize_ex(const xds_type_matcher_v3_Int64RangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_clear_range_matchers(xds_type_matcher_v3_Int64RangeMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* const* xds_type_matcher_v3_Int64RangeMatcher_range_matchers(const xds_type_matcher_v3_Int64RangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_Int64RangeMatcher_has_range_matchers(const xds_type_matcher_v3_Int64RangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_clear_range_matchers(const xds_type_matcher_v3_Int64RangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* const* xds_type_matcher_v3_Int64RangeMatcher_range_matchers(const xds_type_matcher_v3_Int64RangeMatcher* msg, size_t* len) { - return (const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_Int64RangeMatcher_range_matchers(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int64RangeMatcher_mutable_range_matchers(xds_type_matcher_v3_Int64RangeMatcher* msg, size_t* len) { - return (xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int64RangeMatcher_mutable_range_matchers(xds_type_matcher_v3_Int64RangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int64RangeMatcher_resize_range_matchers(xds_type_matcher_v3_Int64RangeMatcher* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int64RangeMatcher_resize_range_matchers(xds_type_matcher_v3_Int64RangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* xds_type_matcher_v3_Int64RangeMatcher_add_range_matchers(xds_type_matcher_v3_Int64RangeMatcher* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* sub = (struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* sub = (struct xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher */ UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, arena); + return (xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* ret = xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -125,7 +149,7 @@ UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* xds_type_matcher_ int options, upb_Arena* arena) { xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* ret = xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -133,56 +157,86 @@ UPB_INLINE xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* xds_type_matcher_ } UPB_INLINE char* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_serialize(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_serialize_ex(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_clear_ranges(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct xds_type_v3_Int64Range* const* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_ranges(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct xds_type_v3_Int64Range* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_has_ranges(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_ranges(msg, &size); + return size != 0; } -UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_clear_ranges(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct xds_type_v3_Int64Range* const* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_ranges(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, size_t* len) { - return (const struct xds_type_v3_Int64Range* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_has_on_match(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_clear_on_match(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_clear_on_match(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_on_match(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct xds_type_matcher_v3_Matcher_OnMatch*); + const struct xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const struct xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_has_on_match(const xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE struct xds_type_v3_Int64Range** xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_mutable_ranges(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, size_t* len) { - return (struct xds_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct xds_type_v3_Int64Range** xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_mutable_ranges(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct xds_type_v3_Int64Range**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct xds_type_v3_Int64Range** xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_resize_ranges(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, size_t len, upb_Arena* arena) { - return (struct xds_type_v3_Int64Range**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct xds_type_v3_Int64Range** xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_resize_ranges(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct xds_type_v3_Int64Range**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_v3_Int64Range* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_add_ranges(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, upb_Arena* arena) { - struct xds_type_v3_Int64Range* sub = (struct xds_type_v3_Int64Range*)_upb_Message_New(&xds_type_v3_Int64Range_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_v3_Int64Range* sub = (struct xds_type_v3_Int64Range*)_upb_Message_New(&xds_type_v3_Int64Range_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_set_on_match(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher *msg, struct xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_mutable_on_match(xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_on_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_set_on_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_Int64RangeMatcher_RangeMatcher_set_on_match(msg, sub); } return sub; } @@ -190,12 +244,12 @@ UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Int64 /* xds.type.matcher.v3.Int32RangeMatcher */ UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher* xds_type_matcher_v3_Int32RangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Int32RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int32RangeMatcher_msginit, arena); + return (xds_type_matcher_v3_Int32RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int32RangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher* xds_type_matcher_v3_Int32RangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Int32RangeMatcher* ret = xds_type_matcher_v3_Int32RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -205,7 +259,7 @@ UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher* xds_type_matcher_v3_Int32Range int options, upb_Arena* arena) { xds_type_matcher_v3_Int32RangeMatcher* ret = xds_type_matcher_v3_Int32RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -213,47 +267,72 @@ UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher* xds_type_matcher_v3_Int32Range } UPB_INLINE char* xds_type_matcher_v3_Int32RangeMatcher_serialize(const xds_type_matcher_v3_Int32RangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_Int32RangeMatcher_serialize_ex(const xds_type_matcher_v3_Int32RangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_clear_range_matchers(xds_type_matcher_v3_Int32RangeMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* const* xds_type_matcher_v3_Int32RangeMatcher_range_matchers(const xds_type_matcher_v3_Int32RangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_Int32RangeMatcher_has_range_matchers(const xds_type_matcher_v3_Int32RangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_clear_range_matchers(const xds_type_matcher_v3_Int32RangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* const* xds_type_matcher_v3_Int32RangeMatcher_range_matchers(const xds_type_matcher_v3_Int32RangeMatcher* msg, size_t* len) { - return (const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_Int32RangeMatcher_range_matchers(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int32RangeMatcher_mutable_range_matchers(xds_type_matcher_v3_Int32RangeMatcher* msg, size_t* len) { - return (xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int32RangeMatcher_mutable_range_matchers(xds_type_matcher_v3_Int32RangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int32RangeMatcher_resize_range_matchers(xds_type_matcher_v3_Int32RangeMatcher* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher** xds_type_matcher_v3_Int32RangeMatcher_resize_range_matchers(xds_type_matcher_v3_Int32RangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* xds_type_matcher_v3_Int32RangeMatcher_add_range_matchers(xds_type_matcher_v3_Int32RangeMatcher* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* sub = (struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* sub = (struct xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher */ UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, arena); + return (xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* ret = xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -263,7 +342,7 @@ UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* xds_type_matcher_ int options, upb_Arena* arena) { xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* ret = xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -271,56 +350,86 @@ UPB_INLINE xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* xds_type_matcher_ } UPB_INLINE char* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_serialize(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_serialize_ex(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_clear_ranges(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct xds_type_v3_Int32Range* const* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_ranges(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct xds_type_v3_Int32Range* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_has_ranges(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_ranges(msg, &size); + return size != 0; } -UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_clear_ranges(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct xds_type_v3_Int32Range* const* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_ranges(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, size_t* len) { - return (const struct xds_type_v3_Int32Range* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_has_on_match(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_clear_on_match(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_clear_on_match(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_on_match(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct xds_type_matcher_v3_Matcher_OnMatch*); + const struct xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const struct xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_has_on_match(const xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE struct xds_type_v3_Int32Range** xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_mutable_ranges(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, size_t* len) { - return (struct xds_type_v3_Int32Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct xds_type_v3_Int32Range** xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_mutable_ranges(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct xds_type_v3_Int32Range**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct xds_type_v3_Int32Range** xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_resize_ranges(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, size_t len, upb_Arena* arena) { - return (struct xds_type_v3_Int32Range**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct xds_type_v3_Int32Range** xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_resize_ranges(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct xds_type_v3_Int32Range**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_v3_Int32Range* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_add_ranges(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, upb_Arena* arena) { - struct xds_type_v3_Int32Range* sub = (struct xds_type_v3_Int32Range*)_upb_Message_New(&xds_type_v3_Int32Range_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_v3_Int32Range* sub = (struct xds_type_v3_Int32Range*)_upb_Message_New(&xds_type_v3_Int32Range_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_set_on_match(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher *msg, struct xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_mutable_on_match(xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_on_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_set_on_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_Int32RangeMatcher_RangeMatcher_set_on_match(msg, sub); } return sub; } @@ -328,12 +437,12 @@ UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Int32 /* xds.type.matcher.v3.DoubleRangeMatcher */ UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher* xds_type_matcher_v3_DoubleRangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_DoubleRangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_DoubleRangeMatcher_msginit, arena); + return (xds_type_matcher_v3_DoubleRangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_DoubleRangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher* xds_type_matcher_v3_DoubleRangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_DoubleRangeMatcher* ret = xds_type_matcher_v3_DoubleRangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -343,7 +452,7 @@ UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher* xds_type_matcher_v3_DoubleRan int options, upb_Arena* arena) { xds_type_matcher_v3_DoubleRangeMatcher* ret = xds_type_matcher_v3_DoubleRangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -351,47 +460,72 @@ UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher* xds_type_matcher_v3_DoubleRan } UPB_INLINE char* xds_type_matcher_v3_DoubleRangeMatcher_serialize(const xds_type_matcher_v3_DoubleRangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_DoubleRangeMatcher_serialize_ex(const xds_type_matcher_v3_DoubleRangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_clear_range_matchers(xds_type_matcher_v3_DoubleRangeMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* const* xds_type_matcher_v3_DoubleRangeMatcher_range_matchers(const xds_type_matcher_v3_DoubleRangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_DoubleRangeMatcher_has_range_matchers(const xds_type_matcher_v3_DoubleRangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_clear_range_matchers(const xds_type_matcher_v3_DoubleRangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* const* xds_type_matcher_v3_DoubleRangeMatcher_range_matchers(const xds_type_matcher_v3_DoubleRangeMatcher* msg, size_t* len) { - return (const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_DoubleRangeMatcher_range_matchers(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher** xds_type_matcher_v3_DoubleRangeMatcher_mutable_range_matchers(xds_type_matcher_v3_DoubleRangeMatcher* msg, size_t* len) { - return (xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher** xds_type_matcher_v3_DoubleRangeMatcher_mutable_range_matchers(xds_type_matcher_v3_DoubleRangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher** xds_type_matcher_v3_DoubleRangeMatcher_resize_range_matchers(xds_type_matcher_v3_DoubleRangeMatcher* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher** xds_type_matcher_v3_DoubleRangeMatcher_resize_range_matchers(xds_type_matcher_v3_DoubleRangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* xds_type_matcher_v3_DoubleRangeMatcher_add_range_matchers(xds_type_matcher_v3_DoubleRangeMatcher* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* sub = (struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* sub = (struct xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } /* xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher */ UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, arena); + return (xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher*)_upb_Message_New(&xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* ret = xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -401,7 +535,7 @@ UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* xds_type_matcher int options, upb_Arena* arena) { xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* ret = xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -409,66 +543,96 @@ UPB_INLINE xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* xds_type_matcher } UPB_INLINE char* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_serialize(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_serialize_ex(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_clear_ranges(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct xds_type_v3_DoubleRange* const* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_ranges(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct xds_type_v3_DoubleRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_has_ranges(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); + size_t size; + xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_ranges(msg, &size); + return size != 0; } -UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_clear_ranges(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(4, 8)); -} -UPB_INLINE const struct xds_type_v3_DoubleRange* const* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_ranges(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, size_t* len) { - return (const struct xds_type_v3_DoubleRange* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); -} -UPB_INLINE bool xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_has_on_match(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_clear_on_match(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_clear_on_match(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_on_match(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct xds_type_matcher_v3_Matcher_OnMatch*); + const struct xds_type_matcher_v3_Matcher_OnMatch* default_val = NULL; + const struct xds_type_matcher_v3_Matcher_OnMatch* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_has_on_match(const xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE struct xds_type_v3_DoubleRange** xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_mutable_ranges(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, size_t* len) { - return (struct xds_type_v3_DoubleRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); +UPB_INLINE struct xds_type_v3_DoubleRange** xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_mutable_ranges(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct xds_type_v3_DoubleRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE struct xds_type_v3_DoubleRange** xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_resize_ranges(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, size_t len, upb_Arena* arena) { - return (struct xds_type_v3_DoubleRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); +UPB_INLINE struct xds_type_v3_DoubleRange** xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_resize_ranges(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (struct xds_type_v3_DoubleRange**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_v3_DoubleRange* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_add_ranges(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, upb_Arena* arena) { - struct xds_type_v3_DoubleRange* sub = (struct xds_type_v3_DoubleRange*)_upb_Message_New(&xds_type_v3_DoubleRange_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_v3_DoubleRange* sub = (struct xds_type_v3_DoubleRange*)_upb_Message_New(&xds_type_v3_DoubleRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_set_on_match(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher *msg, struct xds_type_matcher_v3_Matcher_OnMatch* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct xds_type_matcher_v3_Matcher_OnMatch*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_mutable_on_match(xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_on_match(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_set_on_match(msg, sub); + sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msg_init, arena); + if (sub) xds_type_matcher_v3_DoubleRangeMatcher_RangeMatcher_set_on_match(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_type_matcher_v3_range_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_range_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_RANGE_PROTO_UPB_H_ */ 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 b56ea5e9877..848e22d53cd 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 @@ -7,39 +7,48 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/regex.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_RegexMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_RegexMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_RegexMatcher__fields[2] = { - {1, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_RegexMatcher__fields[2] = { + {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msg_init = { &xds_type_matcher_v3_RegexMatcher_submsgs[0], &xds_type_matcher_v3_RegexMatcher__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_pom_1bt_max64b}, + {0x000800003f000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -const upb_MiniTable xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = { +const upb_MiniTable xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init = { NULL, NULL, - UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + 0, 0, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(255), 0, }; static const upb_MiniTable *messages_layout[2] = { - &xds_type_matcher_v3_RegexMatcher_msginit, - &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, + &xds_type_matcher_v3_RegexMatcher_msg_init, + &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_regex_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_regex_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -48,5 +57,5 @@ const upb_MiniTable_File xds_type_matcher_v3_regex_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 e4678598676..82260cee677 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 @@ -9,35 +9,38 @@ #ifndef XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_RegexMatcher; -struct xds_type_matcher_v3_RegexMatcher_GoogleRE2; typedef struct xds_type_matcher_v3_RegexMatcher xds_type_matcher_v3_RegexMatcher; typedef struct xds_type_matcher_v3_RegexMatcher_GoogleRE2 xds_type_matcher_v3_RegexMatcher_GoogleRE2; -extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit; +extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init; /* xds.type.matcher.v3.RegexMatcher */ UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_RegexMatcher*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_msginit, arena); + return (xds_type_matcher_v3_RegexMatcher*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_RegexMatcher* ret = xds_type_matcher_v3_RegexMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -47,7 +50,7 @@ UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_pa int options, upb_Arena* arena) { xds_type_matcher_v3_RegexMatcher* ret = xds_type_matcher_v3_RegexMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -55,13 +58,13 @@ UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_pa } UPB_INLINE char* xds_type_matcher_v3_RegexMatcher_serialize(const xds_type_matcher_v3_RegexMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -69,49 +72,62 @@ typedef enum { xds_type_matcher_v3_RegexMatcher_engine_type_NOT_SET = 0 } xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases; UPB_INLINE xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases xds_type_matcher_v3_RegexMatcher_engine_type_case(const xds_type_matcher_v3_RegexMatcher* msg) { - return (xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_RegexMatcher_has_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void xds_type_matcher_v3_RegexMatcher_clear_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_RegexMatcher_engine_type_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_RegexMatcher_clear_google_re2(xds_type_matcher_v3_RegexMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) { - return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, NULL); + const xds_type_matcher_v3_RegexMatcher_GoogleRE2* default_val = NULL; + const xds_type_matcher_v3_RegexMatcher_GoogleRE2* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_type_matcher_v3_RegexMatcher_clear_regex(const xds_type_matcher_v3_RegexMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); +UPB_INLINE bool xds_type_matcher_v3_RegexMatcher_has_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void xds_type_matcher_v3_RegexMatcher_clear_regex(xds_type_matcher_v3_RegexMatcher* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_type_matcher_v3_RegexMatcher_regex(const xds_type_matcher_v3_RegexMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_type_matcher_v3_RegexMatcher_set_google_re2(xds_type_matcher_v3_RegexMatcher *msg, xds_type_matcher_v3_RegexMatcher_GoogleRE2* value) { - UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 24), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_mutable_google_re2(xds_type_matcher_v3_RegexMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_RegexMatcher_GoogleRE2* sub = (struct xds_type_matcher_v3_RegexMatcher_GoogleRE2*)xds_type_matcher_v3_RegexMatcher_google_re2(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub); + sub = (struct xds_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, arena); + if (sub) xds_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_RegexMatcher_set_regex(xds_type_matcher_v3_RegexMatcher *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.type.matcher.v3.RegexMatcher.GoogleRE2 */ UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_Arena* arena) { - return (xds_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena); + return (xds_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_RegexMatcher_GoogleRE2* ret = xds_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -121,7 +137,7 @@ UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_Regex int options, upb_Arena* arena) { xds_type_matcher_v3_RegexMatcher_GoogleRE2* ret = xds_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -129,23 +145,23 @@ UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_Regex } UPB_INLINE char* xds_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const xds_type_matcher_v3_RegexMatcher_GoogleRE2* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msg_init, options, arena, &ptr, len); return ptr; } -extern const upb_MiniTable_File xds_type_matcher_v3_regex_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_regex_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ */ 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 c4e683f7fb9..75b30e8a00c 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 @@ -7,52 +7,69 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/matcher/v3/string.upb.h" #include "xds/type/matcher/v3/regex.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_matcher_v3_StringMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_RegexMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_StringMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_RegexMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_StringMatcher__fields[6] = { - {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {6, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_StringMatcher__fields[6] = { + {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_StringMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_StringMatcher_msg_init = { &xds_type_matcher_v3_StringMatcher_submsgs[0], &xds_type_matcher_v3_StringMatcher__fields[0], - UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040100000a, &upb_pos_1bt}, + {0x0008000402000012, &upb_pos_1bt}, + {0x000800040300001a, &upb_pos_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800040500002a, &upb_pom_1bt_maxmaxb}, + {0x000000003f000030, &upb_psb1_1bt}, + {0x000800040700003a, &upb_pos_1bt}, + }) }; -static const upb_MiniTable_Sub xds_type_matcher_v3_ListStringMatcher_submsgs[1] = { - {.submsg = &xds_type_matcher_v3_StringMatcher_msginit}, +static const upb_MiniTableSub xds_type_matcher_v3_ListStringMatcher_submsgs[1] = { + {.submsg = &xds_type_matcher_v3_StringMatcher_msg_init}, }; -static const upb_MiniTable_Field xds_type_matcher_v3_ListStringMatcher__fields[1] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_matcher_v3_ListStringMatcher__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_matcher_v3_ListStringMatcher_msginit = { +const upb_MiniTable xds_type_matcher_v3_ListStringMatcher_msg_init = { &xds_type_matcher_v3_ListStringMatcher_submsgs[0], &xds_type_matcher_v3_ListStringMatcher__fields[0], - UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_type_matcher_v3_StringMatcher_msginit, - &xds_type_matcher_v3_ListStringMatcher_msginit, + &xds_type_matcher_v3_StringMatcher_msg_init, + &xds_type_matcher_v3_ListStringMatcher_msg_init, }; -const upb_MiniTable_File xds_type_matcher_v3_string_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_matcher_v3_string_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -61,5 +78,5 @@ const upb_MiniTable_File xds_type_matcher_v3_string_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 1211783a8fd..382e766c4a3 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 @@ -9,37 +9,40 @@ #ifndef XDS_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ #define XDS_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_matcher_v3_StringMatcher; -struct xds_type_matcher_v3_ListStringMatcher; typedef struct xds_type_matcher_v3_StringMatcher xds_type_matcher_v3_StringMatcher; typedef struct xds_type_matcher_v3_ListStringMatcher xds_type_matcher_v3_ListStringMatcher; -extern const upb_MiniTable xds_type_matcher_v3_StringMatcher_msginit; -extern const upb_MiniTable xds_type_matcher_v3_ListStringMatcher_msginit; +extern const upb_MiniTable xds_type_matcher_v3_StringMatcher_msg_init; +extern const upb_MiniTable xds_type_matcher_v3_ListStringMatcher_msg_init; struct xds_type_matcher_v3_RegexMatcher; -extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msginit; +extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msg_init; /* xds.type.matcher.v3.StringMatcher */ UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msginit, arena); + return (xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_StringMatcher* ret = xds_type_matcher_v3_StringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_StringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_StringMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -49,7 +52,7 @@ UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_ int options, upb_Arena* arena) { xds_type_matcher_v3_StringMatcher* ret = xds_type_matcher_v3_StringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_StringMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_StringMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -57,13 +60,13 @@ UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_ } UPB_INLINE char* xds_type_matcher_v3_StringMatcher_serialize(const xds_type_matcher_v3_StringMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -75,97 +78,138 @@ typedef enum { xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET = 0 } xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases; UPB_INLINE xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases xds_type_matcher_v3_StringMatcher_match_pattern_case(const xds_type_matcher_v3_StringMatcher* msg) { - return (xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_exact(const xds_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1; -} -UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_exact(const xds_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_exact(xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_exact(const xds_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_prefix(const xds_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2; +UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_exact(const xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_prefix(const xds_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_prefix(xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_prefix(const xds_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_suffix(const xds_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3; +UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_prefix(const xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_suffix(const xds_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_suffix(xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_suffix(const xds_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5; +UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_suffix(const xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_safe_regex(xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_StringMatcher_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, const struct xds_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL); + const struct xds_type_matcher_v3_RegexMatcher* default_val = NULL; + const struct xds_type_matcher_v3_RegexMatcher* ret; + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_ignore_case(const xds_type_matcher_v3_StringMatcher* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; +UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_ignore_case(xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool xds_type_matcher_v3_StringMatcher_ignore_case(const xds_type_matcher_v3_StringMatcher* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_contains(const xds_type_matcher_v3_StringMatcher* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7; -} -UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_contains(const xds_type_matcher_v3_StringMatcher* msg) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET); +UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_contains(xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_contains(const xds_type_matcher_v3_StringMatcher* msg) { - return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 7, upb_StringView_FromString("")); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_contains(const xds_type_matcher_v3_StringMatcher* msg) { + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_exact(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1); + const upb_MiniTableField field = {1, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_prefix(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2); + const upb_MiniTableField field = {2, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_suffix(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3); + const upb_MiniTableField field = {3, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_safe_regex(xds_type_matcher_v3_StringMatcher *msg, struct xds_type_matcher_v3_RegexMatcher* value) { - UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5); + const upb_MiniTableField field = {5, 8, -5, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_StringMatcher_mutable_safe_regex(xds_type_matcher_v3_StringMatcher* msg, upb_Arena* arena) { struct xds_type_matcher_v3_RegexMatcher* sub = (struct xds_type_matcher_v3_RegexMatcher*)xds_type_matcher_v3_StringMatcher_safe_regex(msg); if (sub == NULL) { - sub = (struct xds_type_matcher_v3_RegexMatcher*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_msginit, arena); - if (!sub) return NULL; - xds_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub); + sub = (struct xds_type_matcher_v3_RegexMatcher*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_msg_init, arena); + if (sub) xds_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub); } return sub; } UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_ignore_case(xds_type_matcher_v3_StringMatcher *msg, bool value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value; + const upb_MiniTableField field = {6, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_contains(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) { - UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 7); + const upb_MiniTableField field = {7, 8, -5, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.type.matcher.v3.ListStringMatcher */ UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListStringMatcher_new(upb_Arena* arena) { - return (xds_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&xds_type_matcher_v3_ListStringMatcher_msginit, arena); + return (xds_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&xds_type_matcher_v3_ListStringMatcher_msg_init, arena); } UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListStringMatcher_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_matcher_v3_ListStringMatcher* ret = xds_type_matcher_v3_ListStringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ListStringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ListStringMatcher_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -175,7 +219,7 @@ UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListString int options, upb_Arena* arena) { xds_type_matcher_v3_ListStringMatcher* ret = xds_type_matcher_v3_ListStringMatcher_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ListStringMatcher_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ListStringMatcher_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -183,44 +227,69 @@ UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListString } UPB_INLINE char* xds_type_matcher_v3_ListStringMatcher_serialize(const xds_type_matcher_v3_ListStringMatcher* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void xds_type_matcher_v3_ListStringMatcher_clear_patterns(xds_type_matcher_v3_ListStringMatcher* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const xds_type_matcher_v3_StringMatcher* const* xds_type_matcher_v3_ListStringMatcher_patterns(const xds_type_matcher_v3_ListStringMatcher* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const xds_type_matcher_v3_StringMatcher* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} UPB_INLINE bool xds_type_matcher_v3_ListStringMatcher_has_patterns(const xds_type_matcher_v3_ListStringMatcher* msg) { - return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE void xds_type_matcher_v3_ListStringMatcher_clear_patterns(const xds_type_matcher_v3_ListStringMatcher* msg) { - _upb_array_detach(msg, UPB_SIZE(0, 0)); -} -UPB_INLINE const xds_type_matcher_v3_StringMatcher* const* xds_type_matcher_v3_ListStringMatcher_patterns(const xds_type_matcher_v3_ListStringMatcher* msg, size_t* len) { - return (const xds_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); + size_t size; + xds_type_matcher_v3_ListStringMatcher_patterns(msg, &size); + return size != 0; } -UPB_INLINE xds_type_matcher_v3_StringMatcher** xds_type_matcher_v3_ListStringMatcher_mutable_patterns(xds_type_matcher_v3_ListStringMatcher* msg, size_t* len) { - return (xds_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); +UPB_INLINE xds_type_matcher_v3_StringMatcher** xds_type_matcher_v3_ListStringMatcher_mutable_patterns(xds_type_matcher_v3_ListStringMatcher* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (xds_type_matcher_v3_StringMatcher**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } -UPB_INLINE xds_type_matcher_v3_StringMatcher** xds_type_matcher_v3_ListStringMatcher_resize_patterns(xds_type_matcher_v3_ListStringMatcher* msg, size_t len, upb_Arena* arena) { - return (xds_type_matcher_v3_StringMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); +UPB_INLINE xds_type_matcher_v3_StringMatcher** xds_type_matcher_v3_ListStringMatcher_resize_patterns(xds_type_matcher_v3_ListStringMatcher* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_matcher_v3_StringMatcher**)upb_Message_ResizeArray(msg, &field, size, arena); } UPB_INLINE struct xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_ListStringMatcher_add_patterns(xds_type_matcher_v3_ListStringMatcher* msg, upb_Arena* arena) { - struct xds_type_matcher_v3_StringMatcher* sub = (struct xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msginit, arena); - bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct xds_type_matcher_v3_StringMatcher* sub = (struct xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } -extern const upb_MiniTable_File xds_type_matcher_v3_string_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_matcher_v3_string_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/v3/cel.upb.c b/src/core/ext/upb-generated/xds/type/v3/cel.upb.c index 047c8f92f50..0528c6e227d 100644 --- a/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +++ b/src/core/ext/upb-generated/xds/type/v3/cel.upb.c @@ -7,7 +7,9 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/v3/cel.upb.h" #include "google/api/expr/v1alpha1/checked.upb.h" #include "google/api/expr/v1alpha1/syntax.upb.h" @@ -15,46 +17,59 @@ #include "xds/annotations/v3/status.upb.h" #include "validate/validate.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_v3_CelExpression_submsgs[2] = { - {.submsg = &google_api_expr_v1alpha1_ParsedExpr_msginit}, - {.submsg = &google_api_expr_v1alpha1_CheckedExpr_msginit}, +static const upb_MiniTableSub xds_type_v3_CelExpression_submsgs[2] = { + {.submsg = &google_api_expr_v1alpha1_ParsedExpr_msg_init}, + {.submsg = &google_api_expr_v1alpha1_CheckedExpr_msg_init}, }; -static const upb_MiniTable_Field xds_type_v3_CelExpression__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_v3_CelExpression__fields[2] = { + {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_v3_CelExpression_msginit = { +const upb_MiniTable xds_type_v3_CelExpression_msg_init = { &xds_type_v3_CelExpression_submsgs[0], &xds_type_v3_CelExpression__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pom_1bt_maxmaxb}, + {0x0008000002010012, &upb_pom_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Sub xds_type_v3_CelExtractString_submsgs[2] = { - {.submsg = &xds_type_v3_CelExpression_msginit}, - {.submsg = &google_protobuf_StringValue_msginit}, +static const upb_MiniTableSub xds_type_v3_CelExtractString_submsgs[2] = { + {.submsg = &xds_type_v3_CelExpression_msg_init}, + {.submsg = &google_protobuf_StringValue_msg_init}, }; -static const upb_MiniTable_Field xds_type_v3_CelExtractString__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_v3_CelExtractString__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_v3_CelExtractString_msginit = { +const upb_MiniTable xds_type_v3_CelExtractString_msg_init = { &xds_type_v3_CelExtractString_submsgs[0], &xds_type_v3_CelExtractString__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, + {0x0010000002010012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[2] = { - &xds_type_v3_CelExpression_msginit, - &xds_type_v3_CelExtractString_msginit, + &xds_type_v3_CelExpression_msg_init, + &xds_type_v3_CelExtractString_msg_init, }; -const upb_MiniTable_File xds_type_v3_cel_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_v3_cel_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -63,5 +78,5 @@ const upb_MiniTable_File xds_type_v3_cel_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/v3/cel.upb.h b/src/core/ext/upb-generated/xds/type/v3/cel.upb.h index 016cc541843..81eeba972fd 100644 --- a/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +++ b/src/core/ext/upb-generated/xds/type/v3/cel.upb.h @@ -9,41 +9,44 @@ #ifndef XDS_TYPE_V3_CEL_PROTO_UPB_H_ #define XDS_TYPE_V3_CEL_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_v3_CelExpression; -struct xds_type_v3_CelExtractString; typedef struct xds_type_v3_CelExpression xds_type_v3_CelExpression; typedef struct xds_type_v3_CelExtractString xds_type_v3_CelExtractString; -extern const upb_MiniTable xds_type_v3_CelExpression_msginit; -extern const upb_MiniTable xds_type_v3_CelExtractString_msginit; +extern const upb_MiniTable xds_type_v3_CelExpression_msg_init; +extern const upb_MiniTable xds_type_v3_CelExtractString_msg_init; struct google_api_expr_v1alpha1_CheckedExpr; struct google_api_expr_v1alpha1_ParsedExpr; struct google_protobuf_StringValue; -extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit; -extern const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msginit; -extern const upb_MiniTable google_protobuf_StringValue_msginit; +extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msg_init; +extern const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msg_init; +extern const upb_MiniTable google_protobuf_StringValue_msg_init; /* xds.type.v3.CelExpression */ UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_new(upb_Arena* arena) { - return (xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msginit, arena); + return (xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msg_init, arena); } UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_v3_CelExpression* ret = xds_type_v3_CelExpression_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_CelExpression_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_v3_CelExpression_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -53,7 +56,7 @@ UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_parse_ex(const c int options, upb_Arena* arena) { xds_type_v3_CelExpression* ret = xds_type_v3_CelExpression_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_CelExpression_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_v3_CelExpression_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -61,13 +64,13 @@ UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_parse_ex(const c } UPB_INLINE char* xds_type_v3_CelExpression_serialize(const xds_type_v3_CelExpression* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_CelExpression_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_CelExpression_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_v3_CelExpression_serialize_ex(const xds_type_v3_CelExpression* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_CelExpression_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_CelExpression_msg_init, options, arena, &ptr, len); return ptr; } typedef enum { @@ -76,48 +79,61 @@ typedef enum { xds_type_v3_CelExpression_expr_specifier_NOT_SET = 0 } xds_type_v3_CelExpression_expr_specifier_oneofcases; UPB_INLINE xds_type_v3_CelExpression_expr_specifier_oneofcases xds_type_v3_CelExpression_expr_specifier_case(const xds_type_v3_CelExpression* msg) { - return (xds_type_v3_CelExpression_expr_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (xds_type_v3_CelExpression_expr_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } -UPB_INLINE bool xds_type_v3_CelExpression_has_parsed_expr(const xds_type_v3_CelExpression* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1; -} -UPB_INLINE void xds_type_v3_CelExpression_clear_parsed_expr(const xds_type_v3_CelExpression* msg) { - UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_ParsedExpr*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_v3_CelExpression_expr_specifier_NOT_SET); +UPB_INLINE void xds_type_v3_CelExpression_clear_parsed_expr(xds_type_v3_CelExpression* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_ParsedExpr* xds_type_v3_CelExpression_parsed_expr(const xds_type_v3_CelExpression* msg) { - return UPB_READ_ONEOF(msg, const struct google_api_expr_v1alpha1_ParsedExpr*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL); + const struct google_api_expr_v1alpha1_ParsedExpr* default_val = NULL; + const struct google_api_expr_v1alpha1_ParsedExpr* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_v3_CelExpression_has_checked_expr(const xds_type_v3_CelExpression* msg) { - return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2; +UPB_INLINE bool xds_type_v3_CelExpression_has_parsed_expr(const xds_type_v3_CelExpression* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_v3_CelExpression_clear_checked_expr(const xds_type_v3_CelExpression* msg) { - UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_CheckedExpr*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_v3_CelExpression_expr_specifier_NOT_SET); +UPB_INLINE void xds_type_v3_CelExpression_clear_checked_expr(xds_type_v3_CelExpression* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_api_expr_v1alpha1_CheckedExpr* xds_type_v3_CelExpression_checked_expr(const xds_type_v3_CelExpression* msg) { - return UPB_READ_ONEOF(msg, const struct google_api_expr_v1alpha1_CheckedExpr*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL); + const struct google_api_expr_v1alpha1_CheckedExpr* default_val = NULL; + const struct google_api_expr_v1alpha1_CheckedExpr* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_v3_CelExpression_has_checked_expr(const xds_type_v3_CelExpression* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_v3_CelExpression_set_parsed_expr(xds_type_v3_CelExpression *msg, struct google_api_expr_v1alpha1_ParsedExpr* value) { - UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_ParsedExpr*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1); + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_ParsedExpr* xds_type_v3_CelExpression_mutable_parsed_expr(xds_type_v3_CelExpression* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_ParsedExpr* sub = (struct google_api_expr_v1alpha1_ParsedExpr*)xds_type_v3_CelExpression_parsed_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_ParsedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_ParsedExpr_msginit, arena); - if (!sub) return NULL; - xds_type_v3_CelExpression_set_parsed_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_ParsedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_ParsedExpr_msg_init, arena); + if (sub) xds_type_v3_CelExpression_set_parsed_expr(msg, sub); } return sub; } UPB_INLINE void xds_type_v3_CelExpression_set_checked_expr(xds_type_v3_CelExpression *msg, struct google_api_expr_v1alpha1_CheckedExpr* value) { - UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_CheckedExpr*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2); + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* xds_type_v3_CelExpression_mutable_checked_expr(xds_type_v3_CelExpression* msg, upb_Arena* arena) { struct google_api_expr_v1alpha1_CheckedExpr* sub = (struct google_api_expr_v1alpha1_CheckedExpr*)xds_type_v3_CelExpression_checked_expr(msg); if (sub == NULL) { - sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena); - if (!sub) return NULL; - xds_type_v3_CelExpression_set_checked_expr(msg, sub); + sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msg_init, arena); + if (sub) xds_type_v3_CelExpression_set_checked_expr(msg, sub); } return sub; } @@ -125,12 +141,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* xds_type_v3_CelExpressio /* xds.type.v3.CelExtractString */ UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_new(upb_Arena* arena) { - return (xds_type_v3_CelExtractString*)_upb_Message_New(&xds_type_v3_CelExtractString_msginit, arena); + return (xds_type_v3_CelExtractString*)_upb_Message_New(&xds_type_v3_CelExtractString_msg_init, arena); } UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_v3_CelExtractString* ret = xds_type_v3_CelExtractString_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_CelExtractString_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_v3_CelExtractString_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -140,7 +156,7 @@ UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_parse_ex(c int options, upb_Arena* arena) { xds_type_v3_CelExtractString* ret = xds_type_v3_CelExtractString_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_CelExtractString_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_v3_CelExtractString_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -148,67 +164,77 @@ UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_parse_ex(c } UPB_INLINE char* xds_type_v3_CelExtractString_serialize(const xds_type_v3_CelExtractString* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_CelExtractString_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_CelExtractString_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_v3_CelExtractString_serialize_ex(const xds_type_v3_CelExtractString* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_CelExtractString_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_CelExtractString_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE bool xds_type_v3_CelExtractString_has_expr_extract(const xds_type_v3_CelExtractString* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_v3_CelExtractString_clear_expr_extract(const xds_type_v3_CelExtractString* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL; +UPB_INLINE void xds_type_v3_CelExtractString_clear_expr_extract(xds_type_v3_CelExtractString* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const xds_type_v3_CelExpression* xds_type_v3_CelExtractString_expr_extract(const xds_type_v3_CelExtractString* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const xds_type_v3_CelExpression*); + const xds_type_v3_CelExpression* default_val = NULL; + const xds_type_v3_CelExpression* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_v3_CelExtractString_has_default_value(const xds_type_v3_CelExtractString* msg) { - return _upb_hasbit(msg, 2); +UPB_INLINE bool xds_type_v3_CelExtractString_has_expr_extract(const xds_type_v3_CelExtractString* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } -UPB_INLINE void xds_type_v3_CelExtractString_clear_default_value(const xds_type_v3_CelExtractString* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL; +UPB_INLINE void xds_type_v3_CelExtractString_clear_default_value(xds_type_v3_CelExtractString* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_StringValue* xds_type_v3_CelExtractString_default_value(const xds_type_v3_CelExtractString* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_StringValue*); + const struct google_protobuf_StringValue* default_val = NULL; + const struct google_protobuf_StringValue* ret; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_v3_CelExtractString_has_default_value(const xds_type_v3_CelExtractString* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_v3_CelExtractString_set_expr_extract(xds_type_v3_CelExtractString *msg, xds_type_v3_CelExpression* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), xds_type_v3_CelExpression*) = value; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct xds_type_v3_CelExpression* xds_type_v3_CelExtractString_mutable_expr_extract(xds_type_v3_CelExtractString* msg, upb_Arena* arena) { struct xds_type_v3_CelExpression* sub = (struct xds_type_v3_CelExpression*)xds_type_v3_CelExtractString_expr_extract(msg); if (sub == NULL) { - sub = (struct xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msginit, arena); - if (!sub) return NULL; - xds_type_v3_CelExtractString_set_expr_extract(msg, sub); + sub = (struct xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msg_init, arena); + if (sub) xds_type_v3_CelExtractString_set_expr_extract(msg, sub); } return sub; } UPB_INLINE void xds_type_v3_CelExtractString_set_default_value(xds_type_v3_CelExtractString *msg, struct google_protobuf_StringValue* value) { - _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_StringValue*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_StringValue* xds_type_v3_CelExtractString_mutable_default_value(xds_type_v3_CelExtractString* msg, upb_Arena* arena) { struct google_protobuf_StringValue* sub = (struct google_protobuf_StringValue*)xds_type_v3_CelExtractString_default_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msginit, arena); - if (!sub) return NULL; - xds_type_v3_CelExtractString_set_default_value(msg, sub); + sub = (struct google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msg_init, arena); + if (sub) xds_type_v3_CelExtractString_set_default_value(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_type_v3_cel_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_v3_cel_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_V3_CEL_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/xds/type/v3/range.upb.c b/src/core/ext/upb-generated/xds/type/v3/range.upb.c index 601765c0180..bab2d8dc6a9 100644 --- a/src/core/ext/upb-generated/xds/type/v3/range.upb.c +++ b/src/core/ext/upb-generated/xds/type/v3/range.upb.c @@ -7,51 +7,72 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/v3/range.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Field xds_type_v3_Int64Range__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_v3_Int64Range__fields[2] = { + {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_v3_Int64Range_msginit = { +const upb_MiniTable xds_type_v3_Int64Range_msg_init = { NULL, &xds_type_v3_Int64Range__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv8_1bt}, + {0x000800003f000010, &upb_psv8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field xds_type_v3_Int32Range__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_v3_Int32Range__fields[2] = { + {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_v3_Int32Range_msginit = { +const upb_MiniTable xds_type_v3_Int32Range_msg_init = { NULL, &xds_type_v3_Int32Range__fields[0], - UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 8, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000008, &upb_psv4_1bt}, + {0x000400003f000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; -static const upb_MiniTable_Field xds_type_v3_DoubleRange__fields[2] = { - {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_v3_DoubleRange__fields[2] = { + {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_v3_DoubleRange_msginit = { +const upb_MiniTable xds_type_v3_DoubleRange_msg_init = { NULL, &xds_type_v3_DoubleRange__fields[0], - UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f000009, &upb_psf8_1bt}, + {0x000800003f000011, &upb_psf8_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[3] = { - &xds_type_v3_Int64Range_msginit, - &xds_type_v3_Int32Range_msginit, - &xds_type_v3_DoubleRange_msginit, + &xds_type_v3_Int64Range_msg_init, + &xds_type_v3_Int32Range_msg_init, + &xds_type_v3_DoubleRange_msg_init, }; -const upb_MiniTable_File xds_type_v3_range_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_v3_range_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -60,5 +81,5 @@ const upb_MiniTable_File xds_type_v3_range_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" diff --git a/src/core/ext/upb-generated/xds/type/v3/range.upb.h b/src/core/ext/upb-generated/xds/type/v3/range.upb.h index 7b8885f6c38..1b7014dc825 100644 --- a/src/core/ext/upb-generated/xds/type/v3/range.upb.h +++ b/src/core/ext/upb-generated/xds/type/v3/range.upb.h @@ -9,38 +9,40 @@ #ifndef XDS_TYPE_V3_RANGE_PROTO_UPB_H_ #define XDS_TYPE_V3_RANGE_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_v3_Int64Range; -struct xds_type_v3_Int32Range; -struct xds_type_v3_DoubleRange; typedef struct xds_type_v3_Int64Range xds_type_v3_Int64Range; typedef struct xds_type_v3_Int32Range xds_type_v3_Int32Range; typedef struct xds_type_v3_DoubleRange xds_type_v3_DoubleRange; -extern const upb_MiniTable xds_type_v3_Int64Range_msginit; -extern const upb_MiniTable xds_type_v3_Int32Range_msginit; -extern const upb_MiniTable xds_type_v3_DoubleRange_msginit; +extern const upb_MiniTable xds_type_v3_Int64Range_msg_init; +extern const upb_MiniTable xds_type_v3_Int32Range_msg_init; +extern const upb_MiniTable xds_type_v3_DoubleRange_msg_init; /* xds.type.v3.Int64Range */ UPB_INLINE xds_type_v3_Int64Range* xds_type_v3_Int64Range_new(upb_Arena* arena) { - return (xds_type_v3_Int64Range*)_upb_Message_New(&xds_type_v3_Int64Range_msginit, arena); + return (xds_type_v3_Int64Range*)_upb_Message_New(&xds_type_v3_Int64Range_msg_init, arena); } UPB_INLINE xds_type_v3_Int64Range* xds_type_v3_Int64Range_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_v3_Int64Range* ret = xds_type_v3_Int64Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_Int64Range_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_v3_Int64Range_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -50,7 +52,7 @@ UPB_INLINE xds_type_v3_Int64Range* xds_type_v3_Int64Range_parse_ex(const char* b int options, upb_Arena* arena) { xds_type_v3_Int64Range* ret = xds_type_v3_Int64Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_Int64Range_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_v3_Int64Range_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -58,44 +60,56 @@ UPB_INLINE xds_type_v3_Int64Range* xds_type_v3_Int64Range_parse_ex(const char* b } UPB_INLINE char* xds_type_v3_Int64Range_serialize(const xds_type_v3_Int64Range* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_Int64Range_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_Int64Range_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_v3_Int64Range_serialize_ex(const xds_type_v3_Int64Range* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_Int64Range_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_Int64Range_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void xds_type_v3_Int64Range_clear_start(const xds_type_v3_Int64Range* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = 0; +UPB_INLINE void xds_type_v3_Int64Range_clear_start(xds_type_v3_Int64Range* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t xds_type_v3_Int64Range_start(const xds_type_v3_Int64Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_type_v3_Int64Range_clear_end(const xds_type_v3_Int64Range* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0; +UPB_INLINE void xds_type_v3_Int64Range_clear_end(xds_type_v3_Int64Range* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int64_t xds_type_v3_Int64Range_end(const xds_type_v3_Int64Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_type_v3_Int64Range_set_start(xds_type_v3_Int64Range *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_v3_Int64Range_set_end(xds_type_v3_Int64Range *msg, int64_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.type.v3.Int32Range */ UPB_INLINE xds_type_v3_Int32Range* xds_type_v3_Int32Range_new(upb_Arena* arena) { - return (xds_type_v3_Int32Range*)_upb_Message_New(&xds_type_v3_Int32Range_msginit, arena); + return (xds_type_v3_Int32Range*)_upb_Message_New(&xds_type_v3_Int32Range_msg_init, arena); } UPB_INLINE xds_type_v3_Int32Range* xds_type_v3_Int32Range_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_v3_Int32Range* ret = xds_type_v3_Int32Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_Int32Range_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_v3_Int32Range_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -105,7 +119,7 @@ UPB_INLINE xds_type_v3_Int32Range* xds_type_v3_Int32Range_parse_ex(const char* b int options, upb_Arena* arena) { xds_type_v3_Int32Range* ret = xds_type_v3_Int32Range_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_Int32Range_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_v3_Int32Range_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -113,44 +127,56 @@ UPB_INLINE xds_type_v3_Int32Range* xds_type_v3_Int32Range_parse_ex(const char* b } UPB_INLINE char* xds_type_v3_Int32Range_serialize(const xds_type_v3_Int32Range* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_Int32Range_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_Int32Range_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_v3_Int32Range_serialize_ex(const xds_type_v3_Int32Range* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_Int32Range_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_Int32Range_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void xds_type_v3_Int32Range_clear_start(const xds_type_v3_Int32Range* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; +UPB_INLINE void xds_type_v3_Int32Range_clear_start(xds_type_v3_Int32Range* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t xds_type_v3_Int32Range_start(const xds_type_v3_Int32Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_type_v3_Int32Range_clear_end(const xds_type_v3_Int32Range* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; +UPB_INLINE void xds_type_v3_Int32Range_clear_end(xds_type_v3_Int32Range* msg) { + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t xds_type_v3_Int32Range_end(const xds_type_v3_Int32Range* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_type_v3_Int32Range_set_start(xds_type_v3_Int32Range *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_v3_Int32Range_set_end(xds_type_v3_Int32Range *msg, int32_t value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; + const upb_MiniTableField field = {2, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } /* xds.type.v3.DoubleRange */ UPB_INLINE xds_type_v3_DoubleRange* xds_type_v3_DoubleRange_new(upb_Arena* arena) { - return (xds_type_v3_DoubleRange*)_upb_Message_New(&xds_type_v3_DoubleRange_msginit, arena); + return (xds_type_v3_DoubleRange*)_upb_Message_New(&xds_type_v3_DoubleRange_msg_init, arena); } UPB_INLINE xds_type_v3_DoubleRange* xds_type_v3_DoubleRange_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_v3_DoubleRange* ret = xds_type_v3_DoubleRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_DoubleRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_v3_DoubleRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -160,7 +186,7 @@ UPB_INLINE xds_type_v3_DoubleRange* xds_type_v3_DoubleRange_parse_ex(const char* int options, upb_Arena* arena) { xds_type_v3_DoubleRange* ret = xds_type_v3_DoubleRange_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_DoubleRange_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_v3_DoubleRange_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -168,41 +194,53 @@ UPB_INLINE xds_type_v3_DoubleRange* xds_type_v3_DoubleRange_parse_ex(const char* } UPB_INLINE char* xds_type_v3_DoubleRange_serialize(const xds_type_v3_DoubleRange* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_DoubleRange_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_DoubleRange_msg_init, 0, arena, &ptr, len); return ptr; } UPB_INLINE char* xds_type_v3_DoubleRange_serialize_ex(const xds_type_v3_DoubleRange* msg, int options, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_DoubleRange_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_DoubleRange_msg_init, options, arena, &ptr, len); return ptr; } -UPB_INLINE void xds_type_v3_DoubleRange_clear_start(const xds_type_v3_DoubleRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0; +UPB_INLINE void xds_type_v3_DoubleRange_clear_start(xds_type_v3_DoubleRange* msg) { + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double xds_type_v3_DoubleRange_start(const xds_type_v3_DoubleRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE void xds_type_v3_DoubleRange_clear_end(const xds_type_v3_DoubleRange* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = 0; +UPB_INLINE void xds_type_v3_DoubleRange_clear_end(xds_type_v3_DoubleRange* msg) { + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE double xds_type_v3_DoubleRange_end(const xds_type_v3_DoubleRange* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); + double default_val = 0; + double ret; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } UPB_INLINE void xds_type_v3_DoubleRange_set_start(xds_type_v3_DoubleRange *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; + const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_v3_DoubleRange_set_end(xds_type_v3_DoubleRange *msg, double value) { - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value; + const upb_MiniTableField field = {2, 8, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } -extern const upb_MiniTable_File xds_type_v3_range_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_v3_range_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_V3_RANGE_PROTO_UPB_H_ */ 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 37e2b0614c7..575d1e1d8cb 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 @@ -7,32 +7,41 @@ * regenerated. */ #include -#include "upb/msg_internal.h" +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" #include "xds/type/v3/typed_struct.upb.h" #include "google/protobuf/struct.upb.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" -static const upb_MiniTable_Sub xds_type_v3_TypedStruct_submsgs[1] = { - {.submsg = &google_protobuf_Struct_msginit}, +static const upb_MiniTableSub xds_type_v3_TypedStruct_submsgs[1] = { + {.submsg = &google_protobuf_Struct_msg_init}, }; -static const upb_MiniTable_Field xds_type_v3_TypedStruct__fields[2] = { - {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField xds_type_v3_TypedStruct__fields[2] = { + {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; -const upb_MiniTable xds_type_v3_TypedStruct_msginit = { +const upb_MiniTable xds_type_v3_TypedStruct_msg_init = { &xds_type_v3_TypedStruct_submsgs[0], &xds_type_v3_TypedStruct__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_pss_1bt}, + {0x0018000001000012, &upb_psm_1bt_maxmaxb}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[1] = { - &xds_type_v3_TypedStruct_msginit, + &xds_type_v3_TypedStruct_msg_init, }; -const upb_MiniTable_File xds_type_v3_typed_struct_proto_upb_file_layout = { +const upb_MiniTableFile xds_type_v3_typed_struct_proto_upb_file_layout = { messages_layout, NULL, NULL, @@ -41,5 +50,5 @@ const upb_MiniTable_File xds_type_v3_typed_struct_proto_upb_file_layout = { 0, }; -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" 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 51500aa50bd..a90447b4ecd 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 @@ -9,34 +9,38 @@ #ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_ #define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_ -#include "upb/msg_internal.h" -#include "upb/decode.h" -#include "upb/decode_fast.h" -#include "upb/encode.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -struct xds_type_v3_TypedStruct; typedef struct xds_type_v3_TypedStruct xds_type_v3_TypedStruct; -extern const upb_MiniTable xds_type_v3_TypedStruct_msginit; +extern const upb_MiniTable xds_type_v3_TypedStruct_msg_init; struct google_protobuf_Struct; -extern const upb_MiniTable google_protobuf_Struct_msginit; +extern const upb_MiniTable google_protobuf_Struct_msg_init; /* xds.type.v3.TypedStruct */ UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_new(upb_Arena* arena) { - return (xds_type_v3_TypedStruct*)_upb_Message_New(&xds_type_v3_TypedStruct_msginit, arena); + return (xds_type_v3_TypedStruct*)_upb_Message_New(&xds_type_v3_TypedStruct_msg_init, arena); } UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse(const char* buf, size_t size, upb_Arena* arena) { xds_type_v3_TypedStruct* ret = xds_type_v3_TypedStruct_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_TypedStruct_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, &xds_type_v3_TypedStruct_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -46,7 +50,7 @@ UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse_ex(const char* int options, upb_Arena* arena) { xds_type_v3_TypedStruct* ret = xds_type_v3_TypedStruct_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &xds_type_v3_TypedStruct_msginit, extreg, options, arena) != + if (upb_Decode(buf, size, ret, &xds_type_v3_TypedStruct_msg_init, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -54,54 +58,65 @@ UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse_ex(const char* } UPB_INLINE char* xds_type_v3_TypedStruct_serialize(const xds_type_v3_TypedStruct* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_TypedStruct_msginit, 0, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_TypedStruct_msg_init, 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) { char* ptr; - (void)upb_Encode(msg, &xds_type_v3_TypedStruct_msginit, options, arena, &ptr, len); + (void)upb_Encode(msg, &xds_type_v3_TypedStruct_msg_init, 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); +UPB_INLINE void xds_type_v3_TypedStruct_clear_type_url(xds_type_v3_TypedStruct* msg) { + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView xds_type_v3_TypedStruct_type_url(const xds_type_v3_TypedStruct* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } -UPB_INLINE bool xds_type_v3_TypedStruct_has_value(const xds_type_v3_TypedStruct* msg) { - return _upb_hasbit(msg, 1); -} -UPB_INLINE void xds_type_v3_TypedStruct_clear_value(const xds_type_v3_TypedStruct* msg) { - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL; +UPB_INLINE void xds_type_v3_TypedStruct_clear_value(xds_type_v3_TypedStruct* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const struct google_protobuf_Struct* xds_type_v3_TypedStruct_value(const xds_type_v3_TypedStruct* msg) { - return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); + const struct google_protobuf_Struct* default_val = NULL; + const struct google_protobuf_Struct* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool xds_type_v3_TypedStruct_has_value(const xds_type_v3_TypedStruct* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void xds_type_v3_TypedStruct_set_type_url(xds_type_v3_TypedStruct *msg, upb_StringView value) { - *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; + const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void xds_type_v3_TypedStruct_set_value(xds_type_v3_TypedStruct *msg, struct google_protobuf_Struct* value) { - _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE struct google_protobuf_Struct* xds_type_v3_TypedStruct_mutable_value(xds_type_v3_TypedStruct* msg, upb_Arena* arena) { struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)xds_type_v3_TypedStruct_value(msg); if (sub == NULL) { - sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena); - if (!sub) return NULL; - xds_type_v3_TypedStruct_set_value(msg, sub); + sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msg_init, arena); + if (sub) xds_type_v3_TypedStruct_set_value(msg, sub); } return sub; } -extern const upb_MiniTable_File xds_type_v3_typed_struct_proto_upb_file_layout; +extern const upb_MiniTableFile xds_type_v3_typed_struct_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c index 2a6e09ee110..aeb3ccf039c 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/certs.upbdefs.h" #include "envoy/admin/v3/certs.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h index a00cc0ece34..8235c2f71af 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_CERTS_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_CERTS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_certs_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_SubjectAlternateName_getmsgdef(u } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CERTS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c index e5eb3982d74..1cf9d08512c 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/clusters.upbdefs.h" #include "envoy/admin/v3/clusters.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h index ba8fe80d068..798ec107741 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_clusters_proto_upbdefinit; @@ -45,6 +46,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_HostHealthStatus_getmsgdef(upb_D } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c index 49d8e417eb7..574f3a71625 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/config_dump.upbdefs.h" #include "envoy/admin/v3/config_dump.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h index c06712d999b..839bf59506e 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_config_dump_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_SecretsConfigDump_StaticSecret_g } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c index e24c13ce2e3..77d231c96b5 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/config_dump_shared.upbdefs.h" #include "envoy/admin/v3/config_dump_shared.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h index 0259257c3c4..a528592c2df 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_CONFIG_DUMP_SHARED_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_CONFIG_DUMP_SHARED_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_config_dump_shared_proto_upbdefinit; @@ -120,6 +121,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_EcdsConfigDump_EcdsFilterConfig_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_CONFIG_DUMP_SHARED_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c index 6f6f1551aa1..c6ff92c6b79 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/init_dump.upbdefs.h" #include "envoy/admin/v3/init_dump.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h index 0bfc412ed3d..b599767c818 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_init_dump_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_UnreadyTargetsDumps_UnreadyTarge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c index 7e60b4f4dfb..e4aae5b5465 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/listeners.upbdefs.h" #include "envoy/admin/v3/listeners.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h index 2ff04fa53c1..40e138b1fee 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_LISTENERS_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_LISTENERS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_listeners_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_ListenerStatus_getmsgdef(upb_Def } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_LISTENERS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c index 4ca19acc4e9..31545c72392 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/memory.upbdefs.h" #include "envoy/admin/v3/memory.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h index 26e810467e0..97eda40bc1e 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_MEMORY_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_MEMORY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_memory_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_Memory_getmsgdef(upb_DefPool *s) } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_MEMORY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c index 4cbc9efec34..6e35cecf6f1 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/metrics.upbdefs.h" #include "envoy/admin/v3/metrics.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h index 4cdfb7512a5..48da546a45b 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_METRICS_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_METRICS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_metrics_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_SimpleMetric_getmsgdef(upb_DefPo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_METRICS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c index 49e37fb889b..919cd893545 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/mutex_stats.upbdefs.h" #include "envoy/admin/v3/mutex_stats.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h index 67fef393dfb..67ae02284d9 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_mutex_stats_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_MutexStats_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c index d62747015c9..32cec198a57 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/server_info.upbdefs.h" #include "envoy/admin/v3/server_info.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h index 029dcdfde90..a4eb49b68bf 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_server_info_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_CommandLineOptions_getmsgdef(upb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c index a7c160fe4e0..795ad092067 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/admin/v3/tap.upbdefs.h" #include "envoy/admin/v3/tap.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h index 3ba0e5aeae2..aa63548daaf 100644 --- a/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ADMIN_V3_TAP_PROTO_UPBDEFS_H_ #define ENVOY_ADMIN_V3_TAP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_admin_v3_tap_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_admin_v3_TapRequest_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ADMIN_V3_TAP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c index 39ee7d766db..db2e159e4c5 100644 --- a/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/annotations/deprecation.upbdefs.h" #include "envoy/annotations/deprecation.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h index f5beac8e869..8bcbf9de7ae 100644 --- a/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPBDEFS_H_ #define ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c index f5357814143..78b5244b569 100644 --- a/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/annotations/resource.upbdefs.h" #include "envoy/annotations/resource.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h index f775b381678..2aac38a3806 100644 --- a/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPBDEFS_H_ #define ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_annotations_resource_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_annotations_ResourceAnnotation_getmsgdef( } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c index 9a454fbe1fd..9fbe4f3f618 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/accesslog/v3/accesslog.upbdefs.h" #include "envoy/config/accesslog/v3/accesslog.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h index 6d6c12e3348..a2405a86914 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit; @@ -100,6 +101,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_ExtensionFilter_getms } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c index 814c5a858c3..d166525e9e4 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/bootstrap/v3/bootstrap.upbdefs.h" #include "envoy/config/bootstrap/v3/bootstrap.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h index d176854cf22..00b283b5033 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit; @@ -115,6 +116,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_CustomInlineHeader_ge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c index 0390b67c479..3d69ace51d8 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/cluster/v3/circuit_breaker.upbdefs.h" #include "envoy/config/cluster/v3/circuit_breaker.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h index e5150bb5094..fe1abaff964 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_CircuitBreakers_Thresho } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c index 31c4178bcd1..596abbadf1c 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/cluster/v3/cluster.upbdefs.h" #include "envoy/config/cluster/v3/cluster.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h index 242e91bcd2c..e761c6ecbd8 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_cluster_v3_cluster_proto_upbdefinit; @@ -145,6 +146,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_TrackClusterStats_getms } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c index 1c7aef3da00..830a748d189 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/cluster/v3/filter.upbdefs.h" #include "envoy/config/cluster/v3/filter.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h index 64607f5d0ad..9ab3f174aa9 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_cluster_v3_filter_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Filter_getmsgdef(upb_De } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c index 59be3337860..cfdabc00d6a 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/cluster/v3/outlier_detection.upbdefs.h" #include "envoy/config/cluster/v3/outlier_detection.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h index f78dba87d62..0a0b0f59b2e 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_OutlierDetection_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c index 3b56230e3fa..ea67ff71cdf 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/common/matcher/v3/matcher.upbdefs.h" #include "envoy/config/common/matcher/v3/matcher.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h index ad829ed7e9a..d337e0b22da 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_common_matcher_v3_matcher_proto_upbdefinit; @@ -100,6 +101,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_HttpGenericBodyM } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c index 5e6a4b0f50e..e2909d32808 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/address.upbdefs.h" #include "envoy/config/core/v3/address.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h index 285dfe7f87e..1a9be780f1b 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit; @@ -65,6 +66,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_CidrRange_getmsgdef(upb_De } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c index 85af331ace3..156fda8046d 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/backoff.upbdefs.h" #include "envoy/config/core/v3/backoff.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h index 22b9e1fd0ff..c032117edd9 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_backoff_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_BackoffStrategy_getmsgdef( } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c index a4e32fa882d..4f71e6de56c 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/base.upbdefs.h" #include "envoy/config/core/v3/base.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h index 93f5696ee7b..1e7b578efdf 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit; @@ -145,6 +146,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ControlPlane_getmsgdef(upb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c index b0e7360e73c..ff686a8c781 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/config_source.upbdefs.h" #include "envoy/config/core/v3/config_source.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h index c0fdd5a42d5..bd21b77bc1a 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit; @@ -65,6 +66,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RestSubscription_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c index 4e05b6d4207..c0cb49a847d 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/event_service_config.upbdefs.h" #include "envoy/config/core/v3/event_service_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h index aeb42872a20..9705fd4fba0 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_event_service_config_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_EventServiceConfig_getmsgd } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c index b602a97cf93..69fb716cf20 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/extension.upbdefs.h" #include "envoy/config/core/v3/extension.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h index b13c47cb428..08d745115db 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_TypedExtensionConfig_getms } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c index f14974760b9..cd6bc69fc92 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/grpc_method_list.upbdefs.h" #include "envoy/config/core/v3/grpc_method_list.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h index 8681e514f80..95eaa858ae0 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_grpc_method_list_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcMethodList_Service_get } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c index ab59beee08c..674fa364747 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/grpc_service.upbdefs.h" #include "envoy/config/core/v3/grpc_service.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h index be2c84d2159..ee189489f2e 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit; @@ -95,6 +96,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_Cha } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c index 67123642774..37d2e8b1366 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/health_check.upbdefs.h" #include "envoy/config/core/v3/health_check.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h index 1ddc0a52dec..0f02cfab6ee 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_health_check_proto_upbdefinit; @@ -70,6 +71,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_TlsOptions_get } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c index ecd17bf4ffe..50de24e3256 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/http_uri.upbdefs.h" #include "envoy/config/core/v3/http_uri.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h index 0e1eac8b83c..c8336748afc 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_http_uri_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HttpUri_getmsgdef(upb_DefP } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c index d8c0ee95068..5e9501250a1 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/protocol.upbdefs.h" #include "envoy/config/core/v3/protocol.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h index 6e4bd83a93f..b2616486ab0 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit; @@ -105,6 +106,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SchemeHeaderTransformation } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c index c6b552a197f..d3c71a93490 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/proxy_protocol.upbdefs.h" #include "envoy/config/core/v3/proxy_protocol.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h index 6eab65d6033..e2d1af4b6d1 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_proxy_protocol_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ProxyProtocolConfig_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c index 5f115884865..b916b0f2eaa 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/resolver.upbdefs.h" #include "envoy/config/core/v3/resolver.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h index ef6e1695413..7aef9b303d3 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_resolver_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_DnsResolutionConfig_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c index ceeb10782c9..c8f578f068e 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/socket_option.upbdefs.h" #include "envoy/config/core/v3/socket_option.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h index c281c19922c..0c69f176369 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_socket_option_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SocketOptionsOverride_getm } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c index c8ecf4aa519..51fbd332256 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/substitution_format_string.upbdefs.h" #include "envoy/config/core/v3/substitution_format_string.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h index 7530fb23de5..1054fe0131f 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_substitution_format_string_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SubstitutionFormatString_g } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c index a5b3f3bc558..6b5e3086053 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/core/v3/udp_socket_config.upbdefs.h" #include "envoy/config/core/v3/udp_socket_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h index 5539f729332..0d836e69b98 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_core_v3_udp_socket_config_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_core_v3_UdpSocketConfig_getmsgdef( } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c index 66eedd9375b..15e186ab5aa 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/endpoint/v3/endpoint.upbdefs.h" #include "envoy/config/endpoint/v3/endpoint.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h index a886c79fd21..ca331dc9da5 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_endpoint_v3_endpoint_proto_upbdefinit; @@ -45,6 +46,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterLoadAssignment_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c index 47ba2e446ca..b02cf56b064 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/endpoint/v3/endpoint_components.upbdefs.h" #include "envoy/config/endpoint/v3/endpoint_components.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h index eb25da5952f..cb0a881dc11 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit; @@ -55,6 +56,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_LocalityLbEndpoints_Lb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c index f5b6c5828b9..1e02cbd1861 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/endpoint/v3/load_report.upbdefs.h" #include "envoy/config/endpoint/v3/load_report.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h index 8ef3ed05d85..0d1775beaab 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_endpoint_v3_load_report_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterStats_DroppedRe } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c index 68183a06022..781b5d35f2a 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/listener/v3/api_listener.upbdefs.h" #include "envoy/config/listener/v3/api_listener.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h index b1b94eb600d..7cf0bd783db 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_listener_v3_api_listener_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ApiListener_getmsgdef( } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c index 6a566a4d04a..b3858c6ecd1 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/listener/v3/listener.upbdefs.h" #include "envoy/config/listener/v3/listener.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h index 69aadd72841..8f84d6654f6 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_listener_v3_listener_proto_upbdefinit; @@ -75,6 +76,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ApiListenerManager_get } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c index 85bb66c7126..50ad4ded4ae 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/listener/v3/listener_components.upbdefs.h" #include "envoy/config/listener/v3/listener_components.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h index 46bd8406827..0df2792aaff 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_listener_v3_listener_components_proto_upbdefinit; @@ -60,6 +61,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ListenerFilter_getmsgd } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c index 53d5cf085fb..d665703b3a1 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/listener/v3/quic_config.upbdefs.h" #include "envoy/config/listener/v3/quic_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h index d59f070330f..5000854a3dc 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_listener_v3_quic_config_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_QuicProtocolOptions_ge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c index 32b5682c312..6142edb7c40 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/listener/v3/udp_listener_config.upbdefs.h" #include "envoy/config/listener/v3/udp_listener_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h index 2257f36dd4e..cd488ee65f5 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ActiveRawUdpListenerCo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c index 41d1add7fd0..dca333ae426 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/metrics/v3/metrics_service.upbdefs.h" #include "envoy/config/metrics/v3/metrics_service.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h index 736343f82c6..ab650f2ab9e 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_metrics_v3_metrics_service_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_MetricsServiceConfig_ge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c index cfd0ca4bcf4..1b3f11dedad 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/metrics/v3/stats.upbdefs.h" #include "envoy/config/metrics/v3/stats.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h index c3bcb26df62..427e8068673 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_metrics_v3_stats_proto_upbdefinit; @@ -65,6 +66,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_HystrixSink_getmsgdef(u } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c index 4d35105301e..8b110c6651e 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/overload/v3/overload.upbdefs.h" #include "envoy/config/overload/v3/overload.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h index 76225a896be..4a885ac7409 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_overload_v3_overload_proto_upbdefinit; @@ -70,6 +71,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_OverloadManager_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c index 19f30fcb89d..0b043ad7dae 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/rbac/v3/rbac.upbdefs.h" #include "envoy/config/rbac/v3/rbac.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h index 8f0cca914e2..f3077438a8f 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_rbac_v3_rbac_proto_upbdefinit; @@ -80,6 +81,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Action_getmsgdef(upb_DefPo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c index 8546bf75f55..e01bc3c00d9 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/route/v3/route.upbdefs.h" #include "envoy/config/route/v3/route.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h index 178308dbf82..b10c83d8ad2 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_route_v3_route_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_route_v3_Vhds_getmsgdef(upb_DefPoo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c index f05036fca90..247a3b74337 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/route/v3/route_components.upbdefs.h" #include "envoy/config/route/v3/route_components.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h index 906d8b5362b..91a440d90a9 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit; @@ -310,6 +311,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_route_v3_FilterConfig_getmsgdef(up } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c index 6744b8acb11..f3e4f07766a 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/route/v3/scoped_route.upbdefs.h" #include "envoy/config/route/v3/scoped_route.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h index 76b17548058..9ec5807ac12 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_route_v3_scoped_route_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_route_v3_ScopedRouteConfiguration_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c index 2f1eed02b58..0d7600f12c2 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/tap/v3/common.upbdefs.h" #include "envoy/config/tap/v3/common.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h index 1d974d011b7..364ff113e83 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_tap_v3_common_proto_upbdefinit; @@ -85,6 +86,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_StreamingGrpcSink_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c index 93e2c4386be..fca5f0a1c99 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/datadog.upbdefs.h" #include "envoy/config/trace/v3/datadog.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h index 0c60980aeb0..9afc2d832fe 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_datadog_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_DatadogConfig_getmsgdef(u } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c index 4569a9a7b92..d7528c3b0b0 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/dynamic_ot.upbdefs.h" #include "envoy/config/trace/v3/dynamic_ot.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h index b64a008b30f..30563f83df5 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_dynamic_ot_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_DynamicOtConfig_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c index 4d08265c4e2..4b6a4acfd34 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/http_tracer.upbdefs.h" #include "envoy/config/trace/v3/http_tracer.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h index b07852f0747..2acbfd7ebed 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_http_tracer_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_Tracing_Http_getmsgdef(up } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c index 28f21211f6b..11f7d5a6476 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/lightstep.upbdefs.h" #include "envoy/config/trace/v3/lightstep.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h index ef0adf4898f..f9efa7ca5e6 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_lightstep_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_LightstepConfig_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c index 1b429cf3a17..20478958fcd 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/opencensus.upbdefs.h" #include "envoy/config/trace/v3/opencensus.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h index b9e286871c0..d71fe83c617 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_opencensus_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_OpenCensusConfig_getmsgde } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c index e94bf8f8455..a9910c1853c 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/opentelemetry.upbdefs.h" #include "envoy/config/trace/v3/opentelemetry.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h index 74f9e4c7c1f..2d73369bb87 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_OPENTELEMETRY_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_OPENTELEMETRY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_opentelemetry_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_OpenTelemetryConfig_getms } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_OPENTELEMETRY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c index cee13e62c14..c18d54a968b 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/service.upbdefs.h" #include "envoy/config/trace/v3/service.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h index d427898f3fe..11825fa998e 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_service_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_TraceServiceConfig_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c index f1784856a16..a59b203b57f 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/skywalking.upbdefs.h" #include "envoy/config/trace/v3/skywalking.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h index b02a71ce5d8..a85af64a1e1 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_skywalking_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_ClientConfig_getmsgdef(up } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c index 9cebfdee999..fa785fb5b9f 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/trace.upbdefs.h" #include "envoy/config/trace/v3/trace.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h index 29800681ec3..64328cf33bb 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_trace_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init envoy_config_trace_v3_trace_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c index a4d7e5de119..eff30ec62b5 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/xray.upbdefs.h" #include "envoy/config/trace/v3/xray.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h index 2f09f1ba673..99d033c0f62 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_xray_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_XRayConfig_SegmentFields_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c index d798e3a5886..f1dd8f028d9 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/config/trace/v3/zipkin.upbdefs.h" #include "envoy/config/trace/v3/zipkin.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h index 29dbd24f0c4..d935c6b83e0 100644 --- a/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_config_trace_v3_zipkin_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_ZipkinConfig_getmsgdef(up } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c index ae5023a60d8..35ed7d31ce8 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h" #include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h index 2e7ac1d61a0..85a63d8d0c0 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_clusters_aggregate_v3_ClusterC } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c index 6a8aeb9bbca..fa1c04d29b9 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/filters/common/fault/v3/fault.upbdefs.h" #include "envoy/extensions/filters/common/fault/v3/fault.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h index 10c7aad74c1..7466f434977 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_filters_common_fault_v3_FaultR } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c index 80db92e75a9..31e525a39c7 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/filters/http/fault/v3/fault.upbdefs.h" #include "envoy/extensions/filters/http/fault/v3/fault.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h index 36ef3015733..63d7d6f2132 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_fault_v3_HTTPFaul } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c index 8a94a4d7404..03e2cc930ec 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h" #include "envoy/extensions/filters/http/rbac/v3/rbac.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h index 94c0a4f774f..ec65dcc99fb 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_filters_http_rbac_v3_rbac_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_rbac_v3_RBACPerRo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c index fb50afe4601..da207b995de 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/filters/http/router/v3/router.upbdefs.h" #include "envoy/extensions/filters/http/router/v3/router.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h index 323d4873290..d6d7a7803c9 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_router_v3_Router_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c index 8885ebe1566..9812b6091c7 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h" #include "envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h index a1f0e5910ae..0968558d0e5 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_STATEFUL_SESSION_V3_STATEFUL_SESSION_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_FILTERS_HTTP_STATEFUL_SESSION_V3_STATEFUL_SESSION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_filters_http_stateful_session_v3_stateful_session_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_stateful_session_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_STATEFUL_SESSION_V3_STATEFUL_SESSION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c index 5164142f1c2..bdd192c782d 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h index 1d34eb985c7..f2bb3e5003f 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit; @@ -125,6 +126,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connectio } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c index 492b1802ae4..c440af64eaa 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h" #include "envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h index cd4011ae179..3afb4063c9a 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_HTTP_STATEFUL_SESSION_COOKIE_V3_COOKIE_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_HTTP_STATEFUL_SESSION_COOKIE_V3_COOKIE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_http_stateful_session_cookie_v3_cookie_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_http_stateful_session_cookie_v } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_HTTP_STATEFUL_SESSION_COOKIE_V3_COOKIE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c index d2b3c9da53f..3c0f14863a4 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h" #include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h index dee4061fdee..38b861fb6f0 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_cert_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_cert_proto_up } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c index b88aba6bde4..c3820d55745 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h" #include "envoy/extensions/transport_sockets/tls/v3/common.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h index e7d82faa998..d21f54107b9 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit; @@ -60,6 +61,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_Certi } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c index d4254367467..f1de5914b49 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h" #include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h index d135a24d887..ebd44449573 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_Secre } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c index 715d54605d0..4cf6fdb8fa0 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h" #include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h index 5b410820acf..f4fc1fe9a08 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit; @@ -60,6 +61,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_Commo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c index 17c6be1e20a..41ed52262e8 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h" #include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h index ffd02efce8d..7ad4637dbeb 100644 --- a/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPBDEFS_H_ #define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_SPIFF } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c index 50984f404b1..5e1f3780e06 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/service/discovery/v3/ads.upbdefs.h" #include "envoy/service/discovery/v3/ads.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h index fa40716b20a..500249a4d8b 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPBDEFS_H_ #define ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_service_discovery_v3_ads_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_AdsDummy_getmsgdef(u } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c index ad2391d185a..2fdfc54dd4f 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/service/discovery/v3/discovery.upbdefs.h" #include "envoy/service/discovery/v3/discovery.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h index 3f2f14139ab..9ca66b035c6 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPBDEFS_H_ #define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_service_discovery_v3_discovery_proto_upbdefinit; @@ -95,6 +96,6 @@ UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_Resource_CacheContro } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c index 739effafabb..b377963d5c2 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/service/load_stats/v3/lrs.upbdefs.h" #include "envoy/service/load_stats/v3/lrs.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h index a7f65b493c0..7f168e5df47 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPBDEFS_H_ #define ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_service_load_stats_v3_lrs_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_service_load_stats_v3_LoadStatsResponse_g } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c index 50dbc1b6898..162459c02d0 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/service/status/v3/csds.upbdefs.h" #include "envoy/service/status/v3/csds.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h index e0e1f3474b3..be58e5d0de4 100644 --- a/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPBDEFS_H_ #define ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_service_status_v3_csds_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_service_status_v3_ClientStatusResponse_ge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c index 3f2dd34e9e9..6d8a6e74607 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/http/v3/cookie.upbdefs.h" #include "envoy/type/http/v3/cookie.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h index 88eaa0b1118..638eb3fec1a 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_http_v3_cookie_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_http_v3_Cookie_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c index 67cc5a53ba4..700dccb3852 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/http/v3/path_transformation.upbdefs.h" #include "envoy/type/http/v3/path_transformation.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h index 42cefd9f0a7..beefc3d761c 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_http_v3_path_transformation_proto_upbdefinit; @@ -45,6 +46,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_http_v3_PathTransformation_Operation } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c index 1b0d96d85f2..6dae34d0a53 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/filter_state.upbdefs.h" #include "envoy/type/matcher/v3/filter_state.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h index 3201db6b38a..b9a0da8378c 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_FILTER_STATE_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_FILTER_STATE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_filter_state_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_FilterStateMatcher_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_FILTER_STATE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c index 60c9a937b45..cdfbf61cdbc 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/http_inputs.upbdefs.h" #include "envoy/type/matcher/v3/http_inputs.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h index c449d9b98e5..a416f6ad772 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_http_inputs_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_HttpRequestQueryParamMatc } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c index 0548bd3fc9f..206169d75cf 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/metadata.upbdefs.h" #include "envoy/type/matcher/v3/metadata.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h index a2685f7935c..02e18645608 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_metadata_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_MetadataMatcher_PathSegme } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c index 9085c0d9e09..4d9f5744d21 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/node.upbdefs.h" #include "envoy/type/matcher/v3/node.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h index 8955d8cdfc6..18cae4d6e84 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_node_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_NodeMatcher_getmsgdef(upb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c index 5349417d4d3..217e91808c7 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/number.upbdefs.h" #include "envoy/type/matcher/v3/number.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h index 37c32c764c5..ea4abd8235a 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_number_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_DoubleMatcher_getmsgdef(u } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c index cd946fd5793..075cd1756a7 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/path.upbdefs.h" #include "envoy/type/matcher/v3/path.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h index c1d13208104..9524ef55a66 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_path_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_PathMatcher_getmsgdef(upb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c index 68b31046a85..fcdc115b11e 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/regex.upbdefs.h" #include "envoy/type/matcher/v3/regex.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h index 29e40faef9e..91cb6e36d71 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_regex_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_RegexMatchAndSubstitute_g } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c index c24b7b519c9..bece9319dfa 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/status_code_input.upbdefs.h" #include "envoy/type/matcher/v3/status_code_input.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h index 13b7f83d7bc..35a40f3d484 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_STATUS_CODE_INPUT_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_STATUS_CODE_INPUT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_status_code_input_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_HttpResponseStatusCodeCla } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_STATUS_CODE_INPUT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c index c7d47a367da..b7b22d63cd8 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/string.upbdefs.h" #include "envoy/type/matcher/v3/string.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h index f06fa7fab3c..190a145d287 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_ListStringMatcher_getmsgd } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c index 0b63c1e1b2e..6bc6267ee58 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/struct.upbdefs.h" #include "envoy/type/matcher/v3/struct.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h index 7cc209af458..b9bfd088859 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_struct_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_StructMatcher_PathSegment } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c index 53d8f45cc46..deb6425c951 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/matcher/v3/value.upbdefs.h" #include "envoy/type/matcher/v3/value.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h index c673e1df4c5..1d3ae18369b 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_matcher_v3_value_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_ListMatcher_getmsgdef(upb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c index 6bdc604251c..6a128d9080d 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/metadata/v3/metadata.upbdefs.h" #include "envoy/type/metadata/v3/metadata.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h index dd7fbeeeb15..c9231195375 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_metadata_v3_metadata_proto_upbdefinit; @@ -60,6 +61,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKind_Host_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c index b32d0d42720..808f49434df 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/tracing/v3/custom_tag.upbdefs.h" #include "envoy/type/tracing/v3/custom_tag.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h index 725360e64ba..8a87f4c720c 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_tracing_v3_custom_tag_proto_upbdefinit; @@ -50,6 +51,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_tracing_v3_CustomTag_Metadata_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c index 1fb85ce33a4..d2473dacf8f 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/hash_policy.upbdefs.h" #include "envoy/type/v3/hash_policy.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h index eb0bb343f66..ac8904a961e 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_hash_policy_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_HashPolicy_FilterState_getmsgdef( } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c index 091b8453ad4..cc1a3b453e7 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/http.upbdefs.h" #include "envoy/type/v3/http.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h index 10dfa7bbcb7..484bce20fab 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_HTTP_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_HTTP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_http_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init envoy_type_v3_http_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_HTTP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c index 9bf68dd9da1..9c64e8059d3 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/http_status.upbdefs.h" #include "envoy/type/v3/http_status.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h index 25e28fbb972..846eca98d6d 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_http_status_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_HttpStatus_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c index bb83bb47dd1..865adf5c3df 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/percent.upbdefs.h" #include "envoy/type/v3/percent.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h index e0254c94e82..952671b0e72 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_PERCENT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_FractionalPercent_getmsgdef(upb_D } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_PERCENT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c index de8a95dc765..2c2413edd13 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/range.upbdefs.h" #include "envoy/type/v3/range.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h index 22a905d2c26..78c8491acba 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_RANGE_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_RANGE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_DoubleRange_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_RANGE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c index c8000e76c2d..c72f908c41c 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/ratelimit_strategy.upbdefs.h" #include "envoy/type/v3/ratelimit_strategy.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h index 0ba06e8b306..9157f71ac5d 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_RATELIMIT_STRATEGY_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_RATELIMIT_STRATEGY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_ratelimit_strategy_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_RateLimitStrategy_RequestsPerTime } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_RATELIMIT_STRATEGY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c index bbdfa63e852..0362f30f011 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/ratelimit_unit.upbdefs.h" #include "envoy/type/v3/ratelimit_unit.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h index 0c75338adc5..6b564cf7a12 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_ratelimit_unit_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init envoy_type_v3_ratelimit_unit_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c index b95907bc603..56155d794f2 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/semantic_version.upbdefs.h" #include "envoy/type/v3/semantic_version.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h index ce20299d9d1..d65924ffda6 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_semantic_version_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_SemanticVersion_getmsgdef(upb_Def } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c b/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c index cd38650392b..10a4c120068 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "envoy/type/v3/token_bucket.upbdefs.h" #include "envoy/type/v3/token_bucket.upb.h" diff --git a/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h b/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h index ab11878d73f..4e88dfe11e9 100644 --- a/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +++ b/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h @@ -9,15 +9,16 @@ #ifndef ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPBDEFS_H_ #define ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init envoy_type_v3_token_bucket_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *envoy_type_v3_TokenBucket_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c b/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c index 45a64bd293e..d6f5e44346e 100644 --- a/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/api/annotations.upbdefs.h" #include "google/api/annotations.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h b/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h index 69ceac64445..50a974c32ec 100644 --- a/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_API_ANNOTATIONS_PROTO_UPBDEFS_H_ #define GOOGLE_API_ANNOTATIONS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_api_annotations_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init google_api_annotations_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_ANNOTATIONS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c index 88643a951fd..978f33b3644 100644 --- a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/api/expr/v1alpha1/checked.upbdefs.h" #include "google/api/expr/v1alpha1/checked.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h index bf296098e52..850228b5a30 100644 --- a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPBDEFS_H_ #define GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_api_expr_v1alpha1_checked_proto_upbdefinit; @@ -90,6 +91,6 @@ UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Reference_getmsgdef(up } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c index cafb767efd2..e531fb31793 100644 --- a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/api/expr/v1alpha1/syntax.upbdefs.h" #include "google/api/expr/v1alpha1/syntax.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h index 89c09507118..6e4908c547f 100644 --- a/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPBDEFS_H_ #define GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_api_expr_v1alpha1_syntax_proto_upbdefinit; @@ -95,6 +96,6 @@ UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_SourcePosition_getmsgd } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c b/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c index 99df28fa36e..fbfc9b627d3 100644 --- a/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/api/http.upbdefs.h" #include "google/api/http.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h b/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h index be3134fa5b9..8ee6c892ba4 100644 --- a/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_API_HTTP_PROTO_UPBDEFS_H_ #define GOOGLE_API_HTTP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_api_http_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *google_api_CustomHttpPattern_getmsgdef(upb_DefP } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_HTTP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c b/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c index 1487a0c6a9c..2a6c7d2c381 100644 --- a/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/api/httpbody.upbdefs.h" #include "google/api/httpbody.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h b/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h index 336d4a53f7a..7fb51affa96 100644 --- a/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_API_HTTPBODY_PROTO_UPBDEFS_H_ #define GOOGLE_API_HTTPBODY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_api_httpbody_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *google_api_HttpBody_getmsgdef(upb_DefPool *s) { } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_API_HTTPBODY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c index c5ee7cb6872..6ad80239767 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/any.upbdefs.h" #include "google/protobuf/any.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h index a4a8dce6408..f7a87fec915 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_ANY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_Any_getmsgdef(upb_DefPool *s) { } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_ANY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c index 67e715936c1..9014a6550df 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c @@ -6,16 +6,16 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/descriptor.upbdefs.h" #include "google/protobuf/descriptor.upb.h" -static const char descriptor[7667] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', +static const char descriptor[8545] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n', '\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', -'\004', 'f', 'i', 'l', 'e', '\"', '\344', '\004', '\n', '\023', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', +'\004', 'f', 'i', 'l', 'e', '\"', '\376', '\004', '\n', '\023', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '\036', '\n', '\n', 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'y', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\n', 'd', 'e', 'p', @@ -39,284 +39,319 @@ static const char descriptor[7667] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', ' 's', 'o', 'u', 'r', 'c', 'e', '_', 'c', 'o', 'd', 'e', '_', 'i', 'n', 'f', 'o', '\030', '\t', ' ', '\001', '(', '\013', '2', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', 'R', '\016', 's', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', '\026', '\n', '\006', -'s', 'y', 'n', 't', 'a', 'x', '\030', '\014', ' ', '\001', '(', '\t', 'R', '\006', 's', 'y', 'n', 't', 'a', 'x', '\"', '\271', '\006', '\n', '\017', -'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', -' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ';', '\n', '\005', 'f', 'i', 'e', 'l', 'd', '\030', '\002', ' ', '\003', '(', '\013', -'2', '%', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', -'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\005', 'f', 'i', 'e', 'l', 'd', '\022', 'C', '\n', '\t', -'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\006', ' ', '\003', '(', '\013', '2', '%', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', -'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', -'r', 'o', 't', 'o', 'R', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', 'A', '\n', '\013', 'n', 'e', 's', 't', 'e', 'd', -'_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\003', '(', '\013', '2', ' ', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', -'o', 'b', 'u', 'f', '.', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\n', 'n', 'e', 's', -'t', 'e', 'd', 'T', 'y', 'p', 'e', '\022', 'A', '\n', '\t', 'e', 'n', 'u', 'm', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\003', '(', -'\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'D', -'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\010', 'e', 'n', 'u', 'm', 'T', 'y', 'p', 'e', '\022', -'X', '\n', '\017', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\005', ' ', '\003', '(', '\013', '2', -'/', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'e', 's', 'c', 'r', 'i', 'p', -'t', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'R', '\016', -'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', '\022', 'D', '\n', '\n', 'o', 'n', 'e', 'o', 'f', '_', 'd', -'e', 'c', 'l', '\030', '\010', ' ', '\003', '(', '\013', '2', '%', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', -'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\t', -'o', 'n', 'e', 'o', 'f', 'D', 'e', 'c', 'l', '\022', '9', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\001', '(', -'\013', '2', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', -'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', 'U', '\n', '\016', 'r', 'e', 's', -'e', 'r', 'v', 'e', 'd', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\t', ' ', '\003', '(', '\013', '2', '.', '.', 'g', 'o', 'o', 'g', 'l', -'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', -'o', '.', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', 'R', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', -'R', 'a', 'n', 'g', 'e', '\022', '#', '\n', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', -'\003', '(', '\t', 'R', '\014', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'N', 'a', 'm', 'e', '\032', 'z', '\n', '\016', 'E', 'x', 't', 'e', -'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', -'R', '\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', -'\022', '@', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'g', 'o', 'o', 'g', 'l', -'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', -'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\032', '7', '\n', '\r', 'R', 'e', 's', 'e', 'r', -'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', -'s', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\"', '|', -'\n', '\025', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', +'s', 'y', 'n', 't', 'a', 'x', '\030', '\014', ' ', '\001', '(', '\t', 'R', '\006', 's', 'y', 'n', 't', 'a', 'x', '\022', '\030', '\n', '\007', 'e', +'d', 'i', 't', 'i', 'o', 'n', '\030', '\r', ' ', '\001', '(', '\t', 'R', '\007', 'e', 'd', 'i', 't', 'i', 'o', 'n', '\"', '\271', '\006', '\n', +'\017', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', +'\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ';', '\n', '\005', 'f', 'i', 'e', 'l', 'd', '\030', '\002', ' ', '\003', '(', +'\013', '2', '%', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', +'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\005', 'f', 'i', 'e', 'l', 'd', '\022', 'C', '\n', +'\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\006', ' ', '\003', '(', '\013', '2', '%', '.', 'g', 'o', 'o', 'g', 'l', 'e', +'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', +'P', 'r', 'o', 't', 'o', 'R', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', 'A', '\n', '\013', 'n', 'e', 's', 't', 'e', +'d', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\003', '(', '\013', '2', ' ', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', +'t', 'o', 'b', 'u', 'f', '.', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\n', 'n', 'e', +'s', 't', 'e', 'd', 'T', 'y', 'p', 'e', '\022', 'A', '\n', '\t', 'e', 'n', 'u', 'm', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\003', +'(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', +'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\010', 'e', 'n', 'u', 'm', 'T', 'y', 'p', 'e', +'\022', 'X', '\n', '\017', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\005', ' ', '\003', '(', '\013', +'2', '/', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'e', 's', 'c', 'r', 'i', +'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'R', +'\016', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', '\022', 'D', '\n', '\n', 'o', 'n', 'e', 'o', 'f', '_', +'d', 'e', 'c', 'l', '\030', '\010', ' ', '\003', '(', '\013', '2', '%', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', +'\t', 'o', 'n', 'e', 'o', 'f', 'D', 'e', 'c', 'l', '\022', '9', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\001', +'(', '\013', '2', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', +'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', 'U', '\n', '\016', 'r', 'e', +'s', 'e', 'r', 'v', 'e', 'd', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\t', ' ', '\003', '(', '\013', '2', '.', '.', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', +'t', 'o', '.', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', 'R', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', +'d', 'R', 'a', 'n', 'g', 'e', '\022', '#', '\n', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'n', 'a', 'm', 'e', '\030', '\n', +' ', '\003', '(', '\t', 'R', '\014', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'N', 'a', 'm', 'e', '\032', 'z', '\n', '\016', 'E', 'x', 't', +'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', +'\005', 'R', '\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', +'d', '\022', '@', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', +'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\032', '7', '\n', '\r', 'R', 'e', 's', 'e', +'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', +'\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\"', +'|', '\n', '\025', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', +'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', +'\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', +'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', +'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', +'\"', '\301', '\006', '\n', '\024', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', +'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', +'u', 'm', 'b', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', 'A', '\n', '\005', 'l', 'a', +'b', 'e', 'l', '\030', '\004', ' ', '\001', '(', '\016', '2', '+', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'L', +'a', 'b', 'e', 'l', 'R', '\005', 'l', 'a', 'b', 'e', 'l', '\022', '>', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\005', ' ', '\001', '(', '\016', +'2', '*', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', +'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'T', 'y', 'p', 'e', 'R', '\004', 't', 'y', 'p', 'e', +'\022', '\033', '\n', '\t', 't', 'y', 'p', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\010', 't', 'y', 'p', 'e', +'N', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'e', 'x', 't', 'e', 'n', 'd', 'e', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'e', +'x', 't', 'e', 'n', 'd', 'e', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', +'\007', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'o', 'n', +'e', 'o', 'f', '_', 'i', 'n', 'd', 'e', 'x', '\030', '\t', ' ', '\001', '(', '\005', 'R', '\n', 'o', 'n', 'e', 'o', 'f', 'I', 'n', 'd', +'e', 'x', '\022', '\033', '\n', '\t', 'j', 's', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(', '\t', 'R', '\010', 'j', 's', +'o', 'n', 'N', 'a', 'm', 'e', '\022', '7', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '\035', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', +'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'p', 'r', 'o', 't', 'o', '3', '_', 'o', +'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\021', ' ', '\001', '(', '\010', 'R', '\016', 'p', 'r', 'o', 't', 'o', '3', 'O', 'p', 't', 'i', +'o', 'n', 'a', 'l', '\"', '\266', '\002', '\n', '\004', 'T', 'y', 'p', 'e', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'D', 'O', 'U', +'B', 'L', 'E', '\020', '\001', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'F', 'L', 'O', 'A', 'T', '\020', '\002', '\022', '\016', '\n', '\n', +'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', '6', '4', '\020', '\003', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', +'6', '4', '\020', '\004', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', '3', '2', '\020', '\005', '\022', '\020', '\n', '\014', 'T', +'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', '6', '4', '\020', '\006', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', +'E', 'D', '3', '2', '\020', '\007', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'B', 'O', 'O', 'L', '\020', '\010', '\022', '\017', '\n', '\013', +'T', 'Y', 'P', 'E', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\t', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'G', 'R', 'O', +'U', 'P', '\020', '\n', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'S', 'S', 'A', 'G', 'E', '\020', '\013', '\022', '\016', '\n', +'\n', 'T', 'Y', 'P', 'E', '_', 'B', 'Y', 'T', 'E', 'S', '\020', '\014', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', +'T', '3', '2', '\020', '\r', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '\020', '\016', '\022', '\021', '\n', '\r', 'T', +'Y', 'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', 'D', '3', '2', '\020', '\017', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', +'I', 'X', 'E', 'D', '6', '4', '\020', '\020', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '3', '2', '\020', '\021', +'\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '6', '4', '\020', '\022', '\"', 'C', '\n', '\005', 'L', 'a', 'b', 'e', +'l', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'O', 'P', 'T', 'I', 'O', 'N', 'A', 'L', '\020', '\001', '\022', '\022', '\n', '\016', +'L', 'A', 'B', 'E', 'L', '_', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D', '\020', '\002', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', +'_', 'R', 'E', 'P', 'E', 'A', 'T', 'E', 'D', '\020', '\003', '\"', 'c', '\n', '\024', 'O', 'n', 'e', 'o', 'f', 'D', 'e', 's', 'c', 'r', +'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', +'\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', +'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', +'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\343', '\002', '\n', '\023', 'E', 'n', 'u', 'm', 'D', 'e', 's', 'c', +'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', +'R', '\004', 'n', 'a', 'm', 'e', '\022', '?', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'g', +'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', +'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '6', '\n', '\007', +'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', +'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', +'n', 's', '\022', ']', '\n', '\016', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\004', ' ', '\003', '(', +'\013', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'D', +'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'E', 'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', +'e', 'd', 'R', 'a', 'n', 'g', 'e', 'R', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '#', '\n', +'\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'n', 'a', 'm', 'e', '\030', '\005', ' ', '\003', '(', '\t', 'R', '\014', 'r', 'e', 's', +'e', 'r', 'v', 'e', 'd', 'N', 'a', 'm', 'e', '\032', ';', '\n', '\021', 'E', 'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', +'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 's', 't', 'a', +'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\"', '\203', '\001', '\n', '\030', +'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', +'\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', +'m', 'b', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', ';', '\n', '\007', 'o', 'p', 't', +'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', +'i', 'o', 'n', 's', '\"', '\247', '\001', '\n', '\026', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', +'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', +'e', '\022', '>', '\n', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\030', '\002', ' ', '\003', '(', '\013', '2', '&', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', +'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\022', '9', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', +'s', '\030', '\003', ' ', '\001', '(', '\013', '2', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', +'.', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', +'\211', '\002', '\n', '\025', 'M', 'e', 't', 'h', 'o', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', +'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\035', '\n', '\n', 'i', +'n', 'p', 'u', 't', '_', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'i', 'n', 'p', 'u', 't', 'T', 'y', 'p', +'e', '\022', '\037', '\n', '\013', 'o', 'u', 't', 'p', 'u', 't', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\n', 'o', +'u', 't', 'p', 'u', 't', 'T', 'y', 'p', 'e', '\022', '8', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\004', ' ', '\001', '(', +'\013', '2', '\036', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', +'d', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', '0', '\n', '\020', 'c', 'l', 'i', 'e', +'n', 't', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\017', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\022', '0', '\n', '\020', 's', 'e', 'r', 'v', +'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\006', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\017', 's', 'e', 'r', 'v', 'e', 'r', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\"', '\221', '\t', '\n', '\013', 'F', 'i', 'l', +'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '!', '\n', '\014', 'j', 'a', 'v', 'a', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', +'\001', ' ', '\001', '(', '\t', 'R', '\013', 'j', 'a', 'v', 'a', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '0', '\n', '\024', 'j', 'a', 'v', +'a', '_', 'o', 'u', 't', 'e', 'r', '_', 'c', 'l', 'a', 's', 's', 'n', 'a', 'm', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\022', +'j', 'a', 'v', 'a', 'O', 'u', 't', 'e', 'r', 'C', 'l', 'a', 's', 's', 'n', 'a', 'm', 'e', '\022', '5', '\n', '\023', 'j', 'a', 'v', +'a', '_', 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', '_', 'f', 'i', 'l', 'e', 's', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', +'a', 'l', 's', 'e', 'R', '\021', 'j', 'a', 'v', 'a', 'M', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'F', 'i', 'l', 'e', 's', '\022', 'D', +'\n', '\035', 'j', 'a', 'v', 'a', '_', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', 'e', 'q', 'u', 'a', 'l', 's', '_', 'a', 'n', +'d', '_', 'h', 'a', 's', 'h', '\030', '\024', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\031', 'j', 'a', 'v', 'a', 'G', 'e', 'n', +'e', 'r', 'a', 't', 'e', 'E', 'q', 'u', 'a', 'l', 's', 'A', 'n', 'd', 'H', 'a', 's', 'h', '\022', ':', '\n', '\026', 'j', 'a', 'v', +'a', '_', 's', 't', 'r', 'i', 'n', 'g', '_', 'c', 'h', 'e', 'c', 'k', '_', 'u', 't', 'f', '8', '\030', '\033', ' ', '\001', '(', '\010', +':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', 'j', 'a', 'v', 'a', 'S', 't', 'r', 'i', 'n', 'g', 'C', 'h', 'e', 'c', 'k', 'U', +'t', 'f', '8', '\022', 'S', '\n', '\014', 'o', 'p', 't', 'i', 'm', 'i', 'z', 'e', '_', 'f', 'o', 'r', '\030', '\t', ' ', '\001', '(', '\016', +'2', ')', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', +'t', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', 'd', 'e', ':', '\005', 'S', 'P', 'E', 'E', 'D', +'R', '\013', 'o', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'F', 'o', 'r', '\022', '\035', '\n', '\n', 'g', 'o', '_', 'p', 'a', 'c', 'k', 'a', +'g', 'e', '\030', '\013', ' ', '\001', '(', '\t', 'R', '\t', 'g', 'o', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '5', '\n', '\023', 'c', 'c', +'_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\020', ' ', '\001', '(', '\010', ':', '\005', +'f', 'a', 'l', 's', 'e', 'R', '\021', 'c', 'c', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', +'9', '\n', '\025', 'j', 'a', 'v', 'a', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', +'\021', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', 'j', 'a', 'v', 'a', 'G', 'e', 'n', 'e', 'r', 'i', 'c', +'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '5', '\n', '\023', 'p', 'y', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', +'r', 'v', 'i', 'c', 'e', 's', '\030', '\022', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'p', 'y', 'G', 'e', +'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '7', '\n', '\024', 'p', 'h', 'p', '_', 'g', 'e', 'n', 'e', +'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '*', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\022', 'p', 'h', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '%', '\n', '\n', 'd', +'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\027', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', +'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '.', '\n', '\020', 'c', 'c', '_', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'a', 'r', +'e', 'n', 'a', 's', '\030', '\037', ' ', '\001', '(', '\010', ':', '\004', 't', 'r', 'u', 'e', 'R', '\016', 'c', 'c', 'E', 'n', 'a', 'b', 'l', +'e', 'A', 'r', 'e', 'n', 'a', 's', '\022', '*', '\n', '\021', 'o', 'b', 'j', 'c', '_', 'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', +'f', 'i', 'x', '\030', '$', ' ', '\001', '(', '\t', 'R', '\017', 'o', 'b', 'j', 'c', 'C', 'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', +'x', '\022', ')', '\n', '\020', 'c', 's', 'h', 'a', 'r', 'p', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', '%', ' ', '\001', +'(', '\t', 'R', '\017', 'c', 's', 'h', 'a', 'r', 'p', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '!', '\n', '\014', 's', 'w', +'i', 'f', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\'', ' ', '\001', '(', '\t', 'R', '\013', 's', 'w', 'i', 'f', 't', 'P', 'r', +'e', 'f', 'i', 'x', '\022', '(', '\n', '\020', 'p', 'h', 'p', '_', 'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', +'(', ' ', '\001', '(', '\t', 'R', '\016', 'p', 'h', 'p', 'C', 'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '#', '\n', '\r', +'p', 'h', 'p', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', ')', ' ', '\001', '(', '\t', 'R', '\014', 'p', 'h', 'p', 'N', +'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '4', '\n', '\026', 'p', 'h', 'p', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', +'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', ',', ' ', '\001', '(', '\t', 'R', '\024', 'p', 'h', 'p', 'M', 'e', 't', 'a', 'd', +'a', 't', 'a', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '!', '\n', '\014', 'r', 'u', 'b', 'y', '_', 'p', 'a', 'c', 'k', +'a', 'g', 'e', '\030', '-', ' ', '\001', '(', '\t', 'R', '\013', 'r', 'u', 'b', 'y', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', 'X', '\n', +'\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', +'\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', +'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', +'o', 'd', 'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', +'Z', 'E', '\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', +'\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\273', '\003', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', +'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', +'i', 'r', 'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', +'m', 'e', 's', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', +'o', '_', 's', 't', 'a', 'n', 'd', 'a', 'r', 'd', '_', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'a', 'c', 'c', +'e', 's', 's', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\034', 'n', 'o', 'S', 't', 'a', +'n', 'd', 'a', 'r', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'A', 'c', 'c', 'e', 's', 's', 'o', 'r', '\022', '%', +'\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\033', '\n', '\t', 'm', 'a', 'p', '_', 'e', 'n', 't', 'r', 'y', +'\030', '\007', ' ', '\001', '(', '\010', 'R', '\010', 'm', 'a', 'p', 'E', 'n', 't', 'r', 'y', '\022', 'V', '\n', '&', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', 'i', 'e', 'l', 'd', '_', 'c', +'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\030', '\013', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\"', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', 'd', 'C', 'o', 'n', 'f', 'l', +'i', 'c', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', +'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', +'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', +'\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', +'\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\267', '\010', '\n', '\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', +'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', +'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005', 'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', +'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', +'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', +'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y', 'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', +'\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'l', 'a', 'z', 'y', '\022', '.', '\n', '\017', 'u', 'n', 'v', +'e', 'r', 'i', 'f', 'i', 'e', 'd', '_', 'l', 'a', 'z', 'y', '\030', '\017', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\016', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', 'L', 'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', +'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', '(', '\n', '\014', 'd', 'e', 'b', 'u', 'g', '_', 'r', 'e', 'd', 'a', 'c', 't', '\030', '\020', +' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\013', 'd', 'e', 'b', 'u', 'g', 'R', 'e', 'd', 'a', 'c', 't', '\022', +'K', '\n', '\t', 'r', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001', '(', '\016', '2', '-', '.', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', +'O', 'p', 't', 'i', 'o', 'n', 'R', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', 'R', '\t', 'r', 'e', 't', 'e', 'n', 't', 'i', 'o', +'n', '\022', 'F', '\n', '\006', 't', 'a', 'r', 'g', 'e', 't', '\030', '\022', ' ', '\001', '(', '\016', '2', '.', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', +'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', 'R', '\006', 't', 'a', 'r', 'g', 'e', 't', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', -'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', -'\301', '\006', '\n', '\024', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', -'\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', -'m', 'b', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', 'A', '\n', '\005', 'l', 'a', 'b', -'e', 'l', '\030', '\004', ' ', '\001', '(', '\016', '2', '+', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', -'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'L', 'a', -'b', 'e', 'l', 'R', '\005', 'l', 'a', 'b', 'e', 'l', '\022', '>', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\005', ' ', '\001', '(', '\016', '2', -'*', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', -'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'T', 'y', 'p', 'e', 'R', '\004', 't', 'y', 'p', 'e', '\022', -'\033', '\n', '\t', 't', 'y', 'p', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\010', 't', 'y', 'p', 'e', 'N', -'a', 'm', 'e', '\022', '\032', '\n', '\010', 'e', 'x', 't', 'e', 'n', 'd', 'e', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'e', 'x', -'t', 'e', 'n', 'd', 'e', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', -' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'o', 'n', 'e', -'o', 'f', '_', 'i', 'n', 'd', 'e', 'x', '\030', '\t', ' ', '\001', '(', '\005', 'R', '\n', 'o', 'n', 'e', 'o', 'f', 'I', 'n', 'd', 'e', -'x', '\022', '\033', '\n', '\t', 'j', 's', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(', '\t', 'R', '\010', 'j', 's', 'o', -'n', 'N', 'a', 'm', 'e', '\022', '7', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '\035', '.', -'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', -'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'p', 'r', 'o', 't', 'o', '3', '_', 'o', 'p', -'t', 'i', 'o', 'n', 'a', 'l', '\030', '\021', ' ', '\001', '(', '\010', 'R', '\016', 'p', 'r', 'o', 't', 'o', '3', 'O', 'p', 't', 'i', 'o', -'n', 'a', 'l', '\"', '\266', '\002', '\n', '\004', 'T', 'y', 'p', 'e', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'D', 'O', 'U', 'B', -'L', 'E', '\020', '\001', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'F', 'L', 'O', 'A', 'T', '\020', '\002', '\022', '\016', '\n', '\n', 'T', -'Y', 'P', 'E', '_', 'I', 'N', 'T', '6', '4', '\020', '\003', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '6', -'4', '\020', '\004', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', '3', '2', '\020', '\005', '\022', '\020', '\n', '\014', 'T', 'Y', -'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', '6', '4', '\020', '\006', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', -'D', '3', '2', '\020', '\007', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'B', 'O', 'O', 'L', '\020', '\010', '\022', '\017', '\n', '\013', 'T', -'Y', 'P', 'E', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\t', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'G', 'R', 'O', 'U', -'P', '\020', '\n', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'S', 'S', 'A', 'G', 'E', '\020', '\013', '\022', '\016', '\n', '\n', -'T', 'Y', 'P', 'E', '_', 'B', 'Y', 'T', 'E', 'S', '\020', '\014', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', -'3', '2', '\020', '\r', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '\020', '\016', '\022', '\021', '\n', '\r', 'T', 'Y', -'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', 'D', '3', '2', '\020', '\017', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', 'I', -'X', 'E', 'D', '6', '4', '\020', '\020', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '3', '2', '\020', '\021', '\022', -'\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '6', '4', '\020', '\022', '\"', 'C', '\n', '\005', 'L', 'a', 'b', 'e', 'l', -'\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'O', 'P', 'T', 'I', 'O', 'N', 'A', 'L', '\020', '\001', '\022', '\022', '\n', '\016', 'L', -'A', 'B', 'E', 'L', '_', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D', '\020', '\002', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', -'R', 'E', 'P', 'E', 'A', 'T', 'E', 'D', '\020', '\003', '\"', 'c', '\n', '\024', 'O', 'n', 'e', 'o', 'f', 'D', 'e', 's', 'c', 'r', 'i', -'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', -'n', 'a', 'm', 'e', '\022', '7', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'g', -'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', -'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\343', '\002', '\n', '\023', 'E', 'n', 'u', 'm', 'D', 'e', 's', 'c', 'r', -'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', -'\004', 'n', 'a', 'm', 'e', '\022', '?', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'g', 'o', -'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', -'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '6', '\n', '\007', 'o', -'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', -'t', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', -'s', '\022', ']', '\n', '\016', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\004', ' ', '\003', '(', '\013', -'2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'D', 'e', -'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'E', 'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', 'e', -'d', 'R', 'a', 'n', 'g', 'e', 'R', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '#', '\n', '\r', -'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'n', 'a', 'm', 'e', '\030', '\005', ' ', '\003', '(', '\t', 'R', '\014', 'r', 'e', 's', 'e', -'r', 'v', 'e', 'd', 'N', 'a', 'm', 'e', '\032', ';', '\n', '\021', 'E', 'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', -'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 's', 't', 'a', 'r', -'t', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\"', '\203', '\001', '\n', '\030', 'E', -'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', -'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', 'm', -'b', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', ';', '\n', '\007', 'o', 'p', 't', 'i', -'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', -'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', -'o', 'n', 's', '\"', '\247', '\001', '\n', '\026', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', -'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', -'\022', '>', '\n', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\030', '\002', ' ', '\003', '(', '\013', '2', '&', '.', 'g', 'o', 'o', 'g', 'l', 'e', -'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', -'r', 'P', 'r', 'o', 't', 'o', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\022', '9', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', -'\030', '\003', ' ', '\001', '(', '\013', '2', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', -'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\211', -'\002', '\n', '\025', 'M', 'e', 't', 'h', 'o', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', -'\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\035', '\n', '\n', 'i', 'n', -'p', 'u', 't', '_', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'i', 'n', 'p', 'u', 't', 'T', 'y', 'p', 'e', -'\022', '\037', '\n', '\013', 'o', 'u', 't', 'p', 'u', 't', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\n', 'o', 'u', -'t', 'p', 'u', 't', 'T', 'y', 'p', 'e', '\022', '8', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\004', ' ', '\001', '(', '\013', -'2', '\036', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', -'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', '0', '\n', '\020', 'c', 'l', 'i', 'e', 'n', -'t', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', -'\017', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\022', '0', '\n', '\020', 's', 'e', 'r', 'v', 'e', -'r', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\006', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', -'\017', 's', 'e', 'r', 'v', 'e', 'r', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\"', '\221', '\t', '\n', '\013', 'F', 'i', 'l', 'e', -'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '!', '\n', '\014', 'j', 'a', 'v', 'a', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\001', -' ', '\001', '(', '\t', 'R', '\013', 'j', 'a', 'v', 'a', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '0', '\n', '\024', 'j', 'a', 'v', 'a', -'_', 'o', 'u', 't', 'e', 'r', '_', 'c', 'l', 'a', 's', 's', 'n', 'a', 'm', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\022', 'j', -'a', 'v', 'a', 'O', 'u', 't', 'e', 'r', 'C', 'l', 'a', 's', 's', 'n', 'a', 'm', 'e', '\022', '5', '\n', '\023', 'j', 'a', 'v', 'a', -'_', 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', '_', 'f', 'i', 'l', 'e', 's', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', -'l', 's', 'e', 'R', '\021', 'j', 'a', 'v', 'a', 'M', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'F', 'i', 'l', 'e', 's', '\022', 'D', '\n', -'\035', 'j', 'a', 'v', 'a', '_', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', 'e', 'q', 'u', 'a', 'l', 's', '_', 'a', 'n', 'd', -'_', 'h', 'a', 's', 'h', '\030', '\024', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\031', 'j', 'a', 'v', 'a', 'G', 'e', 'n', 'e', -'r', 'a', 't', 'e', 'E', 'q', 'u', 'a', 'l', 's', 'A', 'n', 'd', 'H', 'a', 's', 'h', '\022', ':', '\n', '\026', 'j', 'a', 'v', 'a', -'_', 's', 't', 'r', 'i', 'n', 'g', '_', 'c', 'h', 'e', 'c', 'k', '_', 'u', 't', 'f', '8', '\030', '\033', ' ', '\001', '(', '\010', ':', -'\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', 'j', 'a', 'v', 'a', 'S', 't', 'r', 'i', 'n', 'g', 'C', 'h', 'e', 'c', 'k', 'U', 't', -'f', '8', '\022', 'S', '\n', '\014', 'o', 'p', 't', 'i', 'm', 'i', 'z', 'e', '_', 'f', 'o', 'r', '\030', '\t', ' ', '\001', '(', '\016', '2', -')', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', 't', -'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', 'd', 'e', ':', '\005', 'S', 'P', 'E', 'E', 'D', 'R', -'\013', 'o', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'F', 'o', 'r', '\022', '\035', '\n', '\n', 'g', 'o', '_', 'p', 'a', 'c', 'k', 'a', 'g', -'e', '\030', '\013', ' ', '\001', '(', '\t', 'R', '\t', 'g', 'o', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '5', '\n', '\023', 'c', 'c', '_', -'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\020', ' ', '\001', '(', '\010', ':', '\005', 'f', -'a', 'l', 's', 'e', 'R', '\021', 'c', 'c', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '9', -'\n', '\025', 'j', 'a', 'v', 'a', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\021', -' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', 'j', 'a', 'v', 'a', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', -'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '5', '\n', '\023', 'p', 'y', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', -'v', 'i', 'c', 'e', 's', '\030', '\022', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'p', 'y', 'G', 'e', 'n', -'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '7', '\n', '\024', 'p', 'h', 'p', '_', 'g', 'e', 'n', 'e', 'r', -'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '*', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', -'\022', 'p', 'h', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '%', '\n', '\n', 'd', 'e', -'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\027', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', -'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '.', '\n', '\020', 'c', 'c', '_', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'a', 'r', 'e', -'n', 'a', 's', '\030', '\037', ' ', '\001', '(', '\010', ':', '\004', 't', 'r', 'u', 'e', 'R', '\016', 'c', 'c', 'E', 'n', 'a', 'b', 'l', 'e', -'A', 'r', 'e', 'n', 'a', 's', '\022', '*', '\n', '\021', 'o', 'b', 'j', 'c', '_', 'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', 'f', -'i', 'x', '\030', '$', ' ', '\001', '(', '\t', 'R', '\017', 'o', 'b', 'j', 'c', 'C', 'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', 'x', -'\022', ')', '\n', '\020', 'c', 's', 'h', 'a', 'r', 'p', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', '%', ' ', '\001', '(', -'\t', 'R', '\017', 'c', 's', 'h', 'a', 'r', 'p', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '!', '\n', '\014', 's', 'w', 'i', -'f', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\'', ' ', '\001', '(', '\t', 'R', '\013', 's', 'w', 'i', 'f', 't', 'P', 'r', 'e', -'f', 'i', 'x', '\022', '(', '\n', '\020', 'p', 'h', 'p', '_', 'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '(', -' ', '\001', '(', '\t', 'R', '\016', 'p', 'h', 'p', 'C', 'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '#', '\n', '\r', 'p', -'h', 'p', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', ')', ' ', '\001', '(', '\t', 'R', '\014', 'p', 'h', 'p', 'N', 'a', -'m', 'e', 's', 'p', 'a', 'c', 'e', '\022', '4', '\n', '\026', 'p', 'h', 'p', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'n', -'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', ',', ' ', '\001', '(', '\t', 'R', '\024', 'p', 'h', 'p', 'M', 'e', 't', 'a', 'd', 'a', -'t', 'a', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '!', '\n', '\014', 'r', 'u', 'b', 'y', '_', 'p', 'a', 'c', 'k', 'a', -'g', 'e', '\030', '-', ' ', '\001', '(', '\t', 'R', '\013', 'r', 'u', 'b', 'y', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', 'X', '\n', '\024', -'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', -'(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', -'t', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', -'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', -'d', 'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', 'Z', -'E', '\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', '\350', -'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\343', '\002', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e', -'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', 'i', -'r', 'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', 'm', -'e', 's', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', 'o', -'_', 's', 't', 'a', 'n', 'd', 'a', 'r', 'd', '_', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'a', 'c', 'c', 'e', -'s', 's', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\034', 'n', 'o', 'S', 't', 'a', 'n', -'d', 'a', 'r', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'A', 'c', 'c', 'e', 's', 's', 'o', 'r', '\022', '%', '\n', -'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', -'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\033', '\n', '\t', 'm', 'a', 'p', '_', 'e', 'n', 't', 'r', 'y', '\030', -'\007', ' ', '\001', '(', '\010', 'R', '\010', 'm', 'a', 'p', 'E', 'n', 't', 'r', 'y', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', -'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', -'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', -'t', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', -'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', -'\005', '\020', '\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\222', '\004', '\n', -'\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ', -'\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', -'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005', -'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a', -'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o', -'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', -'s', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y', -'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', -'l', 'a', 'z', 'y', '\022', '.', '\n', '\017', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', '_', 'l', 'a', 'z', 'y', '\030', '\017', -' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\016', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', 'L', 'a', -'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', -'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', -'\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', 'X', '\n', '\024', 'u', 'n', 'i', -'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', -'$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', -'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', -'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T', 'R', 'I', -'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', 'T', 'R', 'I', 'N', 'G', '_', -'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', -'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', '\022', '\r', '\n', -'\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', -'\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', 'u', -'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', -'\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', -'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', -'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\300', '\001', '\n', -'\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a', 'l', 'i', -'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n', '\n', 'd', -'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', -'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', -'d', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', -'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', -'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', -'\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\236', '\001', '\n', '\020', 'E', 'n', 'u', 'm', -'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', -'d', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', -'d', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', -'\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', -'.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', -'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', -'\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', -'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', -'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', +'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', '\n', +'\006', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', 'T', +'R', 'I', 'N', 'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', '\n', +'\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', +'\020', '\001', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '\"', 'U', '\n', '\017', 'O', 'p', 't', 'i', +'o', 'n', 'R', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\022', '\025', '\n', '\021', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', 'N', '_', +'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\025', '\n', '\021', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', 'N', '_', 'R', 'U', +'N', 'T', 'I', 'M', 'E', '\020', '\001', '\022', '\024', '\n', '\020', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', 'N', '_', 'S', 'O', 'U', 'R', +'C', 'E', '\020', '\002', '\"', '\214', '\002', '\n', '\020', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', +'\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', +'\022', '\024', '\n', '\020', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'L', 'E', '\020', '\001', '\022', '\037', '\n', +'\033', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'X', 'T', 'E', 'N', 'S', 'I', 'O', 'N', '_', 'R', 'A', +'N', 'G', 'E', '\020', '\002', '\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'S', 'S', +'A', 'G', 'E', '\020', '\003', '\022', '\025', '\n', '\021', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'E', 'L', +'D', '\020', '\004', '\022', '\025', '\n', '\021', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'O', 'N', 'E', 'O', 'F', '\020', +'\005', '\022', '\024', '\n', '\020', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '\020', '\006', '\022', '\032', +'\n', '\026', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '_', 'E', 'N', 'T', 'R', 'Y', '\020', +'\007', '\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'S', 'E', 'R', 'V', 'I', 'C', 'E', '\020', +'\010', '\022', '\026', '\n', '\022', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'T', 'H', 'O', 'D', '\020', '\t', +'*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', +'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', +'_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', +'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', +'\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\230', '\002', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', +'\022', '\037', '\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a', 'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', +'l', 'o', 'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', +'\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'V', '\n', +'&', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', +'i', 'e', 'l', 'd', '_', 'c', 'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\030', '\006', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', +'\"', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', +'d', 'C', 'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', -'*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', -'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', -'\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', 'e', -'m', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.', 'g', 'o', -'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', -'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', 'M', -'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', -'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', -'_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', -'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', -'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'P', -'\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', 'E', -'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', '_', -'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', 'T', -'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', 'n', -'t', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', -' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', -'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', 'r', -'t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', 'l', -'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', 'e', -'\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', ' ', -'\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', -'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', -'\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', 'b', -'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', -'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', 'R', -'\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', -'_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', 'a', -'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', 'p', -'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014', 'i', 's', -'_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't', 'e', 'n', -'s', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'D', -'\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g', 'l', 'e', -'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', -'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', 'o', -'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', -'\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', -'s', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', -'\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', '+', '\n', -'\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', -'\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e', 'a', 'd', -'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006', ' ', '\003', -'(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', 'n', -'t', 's', '\"', '\321', '\001', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', -'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', -'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', -'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', -'i', 'o', 'n', '\032', 'm', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', -'\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', -'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', -'\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', -'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', -'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', -'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', -'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', -'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', -'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', +'*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\236', '\001', '\n', '\020', 'E', 'n', 'u', +'m', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', +'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', +'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', +'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', +'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', +'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', +'\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', +'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', +'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', +'t', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', +'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', +'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', +'t', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', +':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', +'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.', 'g', +'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', +'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', +'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', +'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', +'d', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', +'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', +'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', +'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', +'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', +'_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', +'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', +'\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', +'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', +'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', +'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', +'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', +' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', +'\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', +'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', +'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V', 'a', +'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', +'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', +'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', +'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', +'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014', 'i', +'s', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't', 'e', +'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', +'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', +'.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', +'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', +'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', +'\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', +'\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', '+', +'\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(', '\t', +'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e', 'a', +'d', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006', ' ', +'\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', +'n', 't', 's', '\"', '\320', '\002', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', +'\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', +'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', +'d', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', +'t', 'i', 'o', 'n', '\032', '\353', '\001', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', +'t', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u', +'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l', +'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020', +'\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\022', 'R', '\n', '\010', 's', 'e', 'm', 'a', 'n', +'t', 'i', 'c', '\030', '\005', ' ', '\001', '(', '\016', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', +'t', 'a', 't', 'i', 'o', 'n', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'R', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', +'\"', '(', '\n', '\010', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\007', '\n', +'\003', 'S', 'E', 'T', '\020', '\001', '\022', '\t', '\n', '\005', 'A', 'L', 'I', 'A', 'S', '\020', '\002', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', +'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', +'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', +'.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', +'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', +'.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', }; static _upb_DefPool_Init *deps[1] = { @@ -327,5 +362,5 @@ _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit = { deps, &google_protobuf_descriptor_proto_upb_file_layout, "google/protobuf/descriptor.proto", - UPB_STRINGVIEW_INIT(descriptor, 7667) + UPB_STRINGVIEW_INIT(descriptor, 8545) }; diff --git a/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h index 058c759314a..e33e0f6829f 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit; @@ -160,6 +161,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_GeneratedCodeInfo_Annotation_ge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c index c8d10ff5d5e..c14903bb6ae 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/duration.upbdefs.h" #include "google/protobuf/duration.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h index e50c557de8a..365cdea98a1 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_DURATION_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_DURATION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_Duration_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_DURATION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c index d0cc8401388..f61e5e0a018 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/empty.upbdefs.h" #include "google/protobuf/empty.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h index 66fafcc97f0..388d85a6a2a 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_EMPTY_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_EMPTY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_empty_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_Empty_getmsgdef(upb_DefPool *s) } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_EMPTY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c index 3c4eea791cb..fc235b21270 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/struct.upbdefs.h" #include "google/protobuf/struct.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h index b4052f459c9..066aa6a1a8c 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_STRUCT_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_STRUCT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit; @@ -45,6 +46,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_ListValue_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_STRUCT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c index b4770b88b51..8104f835535 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/timestamp.upbdefs.h" #include "google/protobuf/timestamp.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h index 15d26414a44..c27e7e3227d 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_Timestamp_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c b/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c index 36a469a7f64..fa1758c6916 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/protobuf/wrappers.upbdefs.h" #include "google/protobuf/wrappers.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h b/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h index 41fdf43c686..d57bead9476 100644 --- a/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPBDEFS_H_ #define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit; @@ -70,6 +71,6 @@ UPB_INLINE const upb_MessageDef *google_protobuf_BytesValue_getmsgdef(upb_DefPoo } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c b/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c index 42ddb607d9f..436f8656200 100644 --- a/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +++ b/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "google/rpc/status.upbdefs.h" #include "google/rpc/status.upb.h" diff --git a/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h b/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h index 6ed28188960..5c3ea07e212 100644 --- a/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +++ b/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h @@ -9,15 +9,16 @@ #ifndef GOOGLE_RPC_STATUS_PROTO_UPBDEFS_H_ #define GOOGLE_RPC_STATUS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init google_rpc_status_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *google_rpc_Status_getmsgdef(upb_DefPool *s) { } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_RPC_STATUS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c b/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c index 607a78ce739..c71dfd975c6 100644 --- a/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "opencensus/proto/trace/v1/trace_config.upbdefs.h" #include "opencensus/proto/trace/v1/trace_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h b/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h index e781009565d..1f4a6e02c45 100644 --- a/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPBDEFS_H_ #define OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init opencensus_proto_trace_v1_trace_config_proto_upbdefinit; @@ -45,6 +46,6 @@ UPB_INLINE const upb_MessageDef *opencensus_proto_trace_v1_RateLimitingSampler_g } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c b/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c index 92c529b67db..774222114db 100644 --- a/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +++ b/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/proto/grpc/lookup/v1/rls_config.upbdefs.h" #include "src/proto/grpc/lookup/v1/rls_config.upb.h" diff --git a/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h b/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h index 3a7591fa5de..5de7ea16086 100644 --- a/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +++ b/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h @@ -9,15 +9,16 @@ #ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPBDEFS_H_ #define SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit; @@ -70,6 +71,6 @@ UPB_INLINE const upb_MessageDef *grpc_lookup_v1_RouteLookupClusterSpecifier_getm } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c b/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c index 5d127acfbc1..02b05f7b84f 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +++ b/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "udpa/annotations/migrate.upbdefs.h" #include "udpa/annotations/migrate.upb.h" diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h b/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h index a929d1aee5a..6a8b3b53304 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +++ b/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h @@ -9,15 +9,16 @@ #ifndef UDPA_ANNOTATIONS_MIGRATE_PROTO_UPBDEFS_H_ #define UDPA_ANNOTATIONS_MIGRATE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *udpa_annotations_FileMigrateAnnotation_getmsgde } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_MIGRATE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c b/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c index d65650e0289..23bea230d81 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +++ b/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "udpa/annotations/security.upbdefs.h" #include "udpa/annotations/security.upb.h" diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h b/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h index 018e42a858d..6ccb4e45bac 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +++ b/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h @@ -9,15 +9,16 @@ #ifndef UDPA_ANNOTATIONS_SECURITY_PROTO_UPBDEFS_H_ #define UDPA_ANNOTATIONS_SECURITY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init udpa_annotations_security_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *udpa_annotations_FieldSecurityAnnotation_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_SECURITY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c b/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c index ddad6c8f650..1a96d4458fb 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +++ b/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "udpa/annotations/sensitive.upbdefs.h" #include "udpa/annotations/sensitive.upb.h" diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h b/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h index 596979eba00..8a7297dcf9f 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +++ b/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h @@ -9,15 +9,16 @@ #ifndef UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPBDEFS_H_ #define UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c b/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c index 882e46d38a2..710d4c020ae 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +++ b/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "udpa/annotations/status.upbdefs.h" #include "udpa/annotations/status.upb.h" diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h b/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h index 7857d080917..8b01f1dc210 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +++ b/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h @@ -9,15 +9,16 @@ #ifndef UDPA_ANNOTATIONS_STATUS_PROTO_UPBDEFS_H_ #define UDPA_ANNOTATIONS_STATUS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *udpa_annotations_StatusAnnotation_getmsgdef(upb } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_STATUS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c b/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c index 153b3cf18b2..2fd242f37a0 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +++ b/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "udpa/annotations/versioning.upbdefs.h" #include "udpa/annotations/versioning.upb.h" diff --git a/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h b/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h index 53ffd45b4c0..4722513a24b 100644 --- a/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +++ b/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h @@ -9,15 +9,16 @@ #ifndef UDPA_ANNOTATIONS_VERSIONING_PROTO_UPBDEFS_H_ #define UDPA_ANNOTATIONS_VERSIONING_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *udpa_annotations_VersioningAnnotation_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UDPA_ANNOTATIONS_VERSIONING_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c b/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c index 77b91818e6f..d6212485af8 100644 --- a/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +++ b/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "validate/validate.upbdefs.h" #include "validate/validate.upb.h" diff --git a/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h b/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h index 9889c2d3ef0..7ff2808c98f 100644 --- a/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +++ b/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h @@ -9,15 +9,16 @@ #ifndef VALIDATE_VALIDATE_PROTO_UPBDEFS_H_ #define VALIDATE_VALIDATE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init validate_validate_proto_upbdefinit; @@ -140,6 +141,6 @@ UPB_INLINE const upb_MessageDef *validate_TimestampRules_getmsgdef(upb_DefPool * } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* VALIDATE_VALIDATE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c b/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c index e5f99a77311..32c1273be5c 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/annotations/v3/migrate.upbdefs.h" #include "xds/annotations/v3/migrate.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h b/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h index 67c1d40f574..c1b5e12d428 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPBDEFS_H_ #define XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_annotations_v3_migrate_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *xds_annotations_v3_FileMigrateAnnotation_getmsg } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c b/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c index d27375d4b08..37f208dd4f9 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/annotations/v3/security.upbdefs.h" #include "xds/annotations/v3/security.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h b/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h index 2eb3df504a4..c20092233e4 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPBDEFS_H_ #define XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_annotations_v3_security_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_annotations_v3_FieldSecurityAnnotation_getm } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c b/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c index b4e39d050e4..6223cceb407 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/annotations/v3/sensitive.upbdefs.h" #include "xds/annotations/v3/sensitive.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h b/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h index e12dff62f21..774071b67d4 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPBDEFS_H_ #define XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_annotations_v3_sensitive_proto_upbdefinit; @@ -25,6 +26,6 @@ extern _upb_DefPool_Init xds_annotations_v3_sensitive_proto_upbdefinit; } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c b/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c index 54755b2c9b8..85f887ced0f 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/annotations/v3/status.upbdefs.h" #include "xds/annotations/v3/status.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h b/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h index 353a125b624..9076b90c422 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_ #define XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit; @@ -45,6 +46,6 @@ UPB_INLINE const upb_MessageDef *xds_annotations_v3_StatusAnnotation_getmsgdef(u } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c b/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c index a7e1275e2f9..4bb508389a4 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/annotations/v3/versioning.upbdefs.h" #include "xds/annotations/v3/versioning.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h b/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h index f80d5c054c6..377bc10023b 100644 --- a/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPBDEFS_H_ #define XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_annotations_v3_versioning_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_annotations_v3_VersioningAnnotation_getmsgd } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c index 3f7c5fd9f6c..8e9fc22e0d0 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/authority.upbdefs.h" #include "xds/core/v3/authority.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h index 69de07806df..95da63a1c52 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_AUTHORITY_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_AUTHORITY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_authority_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_Authority_getmsgdef(upb_DefPool *s) } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_AUTHORITY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c index 7106ffe6784..38cdba655d0 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/cidr.upbdefs.h" #include "xds/core/v3/cidr.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h index 0942d064073..3e932b37ee3 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_CIDR_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_CIDR_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_cidr_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_CidrRange_getmsgdef(upb_DefPool *s) } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_CIDR_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c index 1142c2027eb..b6516993597 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/collection_entry.upbdefs.h" #include "xds/core/v3/collection_entry.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h index c514547529a..49fd3223f14 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_collection_entry_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_CollectionEntry_InlineEntry_getmsgd } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c index a30d846beec..c4f3fdd7a46 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/context_params.upbdefs.h" #include "xds/core/v3/context_params.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h index d970656bec3..435cd0e6c6a 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_context_params_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_ContextParams_ParamsEntry_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c index bbb93ab3797..eaacb51dee1 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/extension.upbdefs.h" #include "xds/core/v3/extension.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h index 7f86bef7365..3252d711b9c 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_extension_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_TypedExtensionConfig_getmsgdef(upb_ } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c index a6fe5cc5292..8f829c2ceba 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/resource.upbdefs.h" #include "xds/core/v3/resource.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h index fb079f1e169..ecbc918b40c 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_RESOURCE_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_RESOURCE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_resource_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_Resource_getmsgdef(upb_DefPool *s) } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_RESOURCE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c index c8255cea6af..a3c5d6bf3df 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/resource_locator.upbdefs.h" #include "xds/core/v3/resource_locator.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h index 09d9c5a3e41..9033d858d59 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_resource_locator_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_ResourceLocator_Directive_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c b/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c index 062d4286996..eae12a90dd7 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/core/v3/resource_name.upbdefs.h" #include "xds/core/v3/resource_name.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h b/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h index a8e65b17609..e9ccafd26a6 100644 --- a/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_CORE_V3_RESOURCE_NAME_PROTO_UPBDEFS_H_ #define XDS_CORE_V3_RESOURCE_NAME_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_core_v3_resource_name_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_core_v3_ResourceName_getmsgdef(upb_DefPool } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_CORE_V3_RESOURCE_NAME_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c index 356fd9fc632..4f1850e8e3e 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/cel.upbdefs.h" #include "xds/type/matcher/v3/cel.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h index 69100418b55..7ff71b97e53 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_CEL_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_CEL_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_cel_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_CelMatcher_getmsgdef(upb_De } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_CEL_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c index 1ed6c95b83e..c171cdc7cc6 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/domain.upbdefs.h" #include "xds/type/matcher/v3/domain.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h index afac7100570..8060f378ca7 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_DOMAIN_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_DOMAIN_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_domain_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_ServerNameMatcher_DomainMat } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_DOMAIN_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c index 498f0db21b0..4d83ad6978a 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/http_inputs.upbdefs.h" #include "xds/type/matcher/v3/http_inputs.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h index 81bbf082e35..1458b630683 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_http_inputs_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_HttpAttributesCelMatchInput } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c index 5e77cf9ab20..fdfd4ee6120 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/ip.upbdefs.h" #include "xds/type/matcher/v3/ip.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h index 55b7b14609e..28e385b4533 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_IP_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_IP_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_ip_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_IPMatcher_IPRangeMatcher_ge } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_IP_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c index b8b4447b021..42a1b3acfac 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/matcher.upbdefs.h" #include "xds/type/matcher/v3/matcher.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h index 13e0e59387a..2819f37b4a3 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_matcher_proto_upbdefinit; @@ -75,6 +76,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherTree_MatchMa } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c index 5bbbfe7e65b..206516ca407 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/range.upbdefs.h" #include "xds/type/matcher/v3/range.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h index bb4a20b15cd..1ff4138a395 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_RANGE_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_RANGE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_range_proto_upbdefinit; @@ -55,6 +56,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_DoubleRangeMatcher_RangeMat } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_RANGE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c index 2607bf81610..9398f026522 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/regex.upbdefs.h" #include "xds/type/matcher/v3/regex.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h index 7e9f9e5d470..8f89d23c3c3 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_regex_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_RegexMatcher_GoogleRE2_getm } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c index 7aac82fa74d..3c9d09069ae 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/matcher/v3/string.upbdefs.h" #include "xds/type/matcher/v3/string.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h index f83b2a0ac07..ee567fc062e 100644 --- a/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ #define XDS_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_matcher_v3_string_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_ListStringMatcher_getmsgdef } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c index 7470921dfa4..8926c53bad4 100644 --- a/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/v3/cel.upbdefs.h" #include "xds/type/v3/cel.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h index e7f5a14e790..d6ebaadb80c 100644 --- a/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_V3_CEL_PROTO_UPBDEFS_H_ #define XDS_TYPE_V3_CEL_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_v3_cel_proto_upbdefinit; @@ -35,6 +36,6 @@ UPB_INLINE const upb_MessageDef *xds_type_v3_CelExtractString_getmsgdef(upb_DefP } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_V3_CEL_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c index 8d082bba566..3e47187448c 100644 --- a/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/v3/range.upbdefs.h" #include "xds/type/v3/range.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h index 6b18b8ef421..2f8552e0572 100644 --- a/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_V3_RANGE_PROTO_UPBDEFS_H_ #define XDS_TYPE_V3_RANGE_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_v3_range_proto_upbdefinit; @@ -40,6 +41,6 @@ UPB_INLINE const upb_MessageDef *xds_type_v3_DoubleRange_getmsgdef(upb_DefPool * } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_V3_RANGE_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c b/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c index 85d87377e4a..26d5b7ebd18 100644 --- a/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +++ b/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c @@ -6,7 +6,7 @@ * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include "xds/type/v3/typed_struct.upbdefs.h" #include "xds/type/v3/typed_struct.upb.h" diff --git a/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h b/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h index 99ed3b5d9ab..03119edf801 100644 --- a/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +++ b/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h @@ -9,15 +9,16 @@ #ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_ #define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_ -#include "upb/def.h" -#include "upb/port_def.inc" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { #endif -#include "upb/def.h" +#include "upb/reflection/def.h" -#include "upb/port_def.inc" +#include "upb/port/def.inc" extern _upb_DefPool_Init xds_type_v3_typed_struct_proto_upbdefinit; @@ -30,6 +31,6 @@ UPB_INLINE const upb_MessageDef *xds_type_v3_TypedStruct_getmsgdef(upb_DefPool * } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_ */ diff --git a/src/core/ext/xds/upb_utils.h b/src/core/ext/xds/upb_utils.h index ae2ed1dd227..fd901278189 100644 --- a/src/core/ext/xds/upb_utils.h +++ b/src/core/ext/xds/upb_utils.h @@ -22,7 +22,7 @@ #include #include "absl/strings/string_view.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" namespace grpc_core { diff --git a/src/core/ext/xds/xds_api.cc b/src/core/ext/xds/xds_api.cc index 331b6aadbd3..a1a10d5e42b 100644 --- a/src/core/ext/xds/xds_api.cc +++ b/src/core/ext/xds/xds_api.cc @@ -40,9 +40,9 @@ #include "google/protobuf/struct.upb.h" #include "google/protobuf/timestamp.upb.h" #include "google/rpc/status.upb.h" -#include "upb/def.h" -#include "upb/text_encode.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/reflection/def.h" +#include "upb/text/encode.h" #include "upb/upb.hpp" #include diff --git a/src/core/ext/xds/xds_api.h b/src/core/ext/xds/xds_api.h index 63d8047e79d..65c55139a70 100644 --- a/src/core/ext/xds/xds_api.h +++ b/src/core/ext/xds/xds_api.h @@ -30,8 +30,8 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" #include "envoy/admin/v3/config_dump_shared.upb.h" -#include "upb/arena.h" -#include "upb/def.hpp" +#include "upb/mem/arena.h" +#include "upb/reflection/def.hpp" #include "src/core/ext/xds/xds_bootstrap.h" #include "src/core/ext/xds/xds_client_stats.h" diff --git a/src/core/ext/xds/xds_client.cc b/src/core/ext/xds/xds_client.cc index b5ccb2ecbcf..112c9b6b085 100644 --- a/src/core/ext/xds/xds_client.cc +++ b/src/core/ext/xds/xds_client.cc @@ -31,7 +31,7 @@ #include "absl/strings/string_view.h" #include "absl/strings/strip.h" #include "absl/types/optional.h" -#include "upb/arena.h" +#include "upb/mem/arena.h" #include #include diff --git a/src/core/ext/xds/xds_client.h b/src/core/ext/xds/xds_client.h index 049e4378a62..e8303d275b5 100644 --- a/src/core/ext/xds/xds_client.h +++ b/src/core/ext/xds/xds_client.h @@ -30,7 +30,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include diff --git a/src/core/ext/xds/xds_cluster.cc b/src/core/ext/xds/xds_cluster.cc index 9d62d2bd325..3f44f274ec8 100644 --- a/src/core/ext/xds/xds_cluster.cc +++ b/src/core/ext/xds/xds_cluster.cc @@ -43,8 +43,8 @@ #include "google/protobuf/any.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/text_encode.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/text/encode.h" #include diff --git a/src/core/ext/xds/xds_cluster.h b/src/core/ext/xds/xds_cluster.h index c9b0eb2e364..6cc2c91c835 100644 --- a/src/core/ext/xds/xds_cluster.h +++ b/src/core/ext/xds/xds_cluster.h @@ -33,7 +33,7 @@ #include "envoy/config/cluster/v3/cluster.upbdefs.h" #include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h" #include "envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h" #include "src/core/ext/xds/xds_bootstrap.h" diff --git a/src/core/ext/xds/xds_cluster_specifier_plugin.cc b/src/core/ext/xds/xds_cluster_specifier_plugin.cc index 6984e9b60e6..adf89a47d21 100644 --- a/src/core/ext/xds/xds_cluster_specifier_plugin.cc +++ b/src/core/ext/xds/xds_cluster_specifier_plugin.cc @@ -26,8 +26,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/types/variant.h" -#include "upb/json_encode.h" -#include "upb/status.h" +#include "upb/base/status.h" +#include "upb/json/encode.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 94660316858..bc2939ce0ac 100644 --- a/src/core/ext/xds/xds_cluster_specifier_plugin.h +++ b/src/core/ext/xds/xds_cluster_specifier_plugin.h @@ -24,8 +24,8 @@ #include #include "absl/strings/string_view.h" -#include "upb/arena.h" -#include "upb/def.h" +#include "upb/mem/arena.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_common_types.h" #include "src/core/lib/gprpp/validation_errors.h" diff --git a/src/core/ext/xds/xds_common_types.cc b/src/core/ext/xds/xds_common_types.cc index 5e4071d116e..b7c88ba44e4 100644 --- a/src/core/ext/xds/xds_common_types.cc +++ b/src/core/ext/xds/xds_common_types.cc @@ -39,9 +39,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/status.h" +#include "upb/base/status.h" +#include "upb/json/encode.h" +#include "upb/mem/arena.h" #include "upb/upb.hpp" #include "xds/type/v3/typed_struct.upb.h" diff --git a/src/core/ext/xds/xds_endpoint.cc b/src/core/ext/xds/xds_endpoint.cc index a0fe6945fa4..2638423d1c1 100644 --- a/src/core/ext/xds/xds_endpoint.cc +++ b/src/core/ext/xds/xds_endpoint.cc @@ -39,7 +39,7 @@ #include "envoy/config/endpoint/v3/endpoint_components.upb.h" #include "envoy/type/v3/percent.upb.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/text_encode.h" +#include "upb/text/encode.h" #include diff --git a/src/core/ext/xds/xds_endpoint.h b/src/core/ext/xds/xds_endpoint.h index 21f502c213f..4c3010483dd 100644 --- a/src/core/ext/xds/xds_endpoint.h +++ b/src/core/ext/xds/xds_endpoint.h @@ -32,7 +32,7 @@ #include "absl/random/random.h" #include "absl/strings/string_view.h" #include "envoy/config/endpoint/v3/endpoint.upbdefs.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_client.h" #include "src/core/ext/xds/xds_client_stats.h" diff --git a/src/core/ext/xds/xds_http_fault_filter.cc b/src/core/ext/xds/xds_http_fault_filter.cc index 938e52214f6..5405029f087 100644 --- a/src/core/ext/xds/xds_http_fault_filter.cc +++ b/src/core/ext/xds/xds_http_fault_filter.cc @@ -32,7 +32,6 @@ #include "envoy/extensions/filters/http/fault/v3/fault.upbdefs.h" #include "envoy/type/v3/percent.upb.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/def.h" #include diff --git a/src/core/ext/xds/xds_http_fault_filter.h b/src/core/ext/xds/xds_http_fault_filter.h index 964f82a5d1c..690d89eb684 100644 --- a/src/core/ext/xds/xds_http_fault_filter.h +++ b/src/core/ext/xds/xds_http_fault_filter.h @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_common_types.h" #include "src/core/ext/xds/xds_http_filters.h" diff --git a/src/core/ext/xds/xds_http_filters.h b/src/core/ext/xds/xds_http_filters.h index cad90d39d8e..b99f12bd4f9 100644 --- a/src/core/ext/xds/xds_http_filters.h +++ b/src/core/ext/xds/xds_http_filters.h @@ -30,7 +30,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_common_types.h" #include "src/core/ext/xds/xds_resource_type.h" diff --git a/src/core/ext/xds/xds_http_rbac_filter.cc b/src/core/ext/xds/xds_http_rbac_filter.cc index e2ee291166b..c2931e4ccbc 100644 --- a/src/core/ext/xds/xds_http_rbac_filter.cc +++ b/src/core/ext/xds/xds_http_rbac_filter.cc @@ -40,7 +40,7 @@ #include "envoy/type/matcher/v3/string.upb.h" #include "envoy/type/v3/range.upb.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/upb.h" +#include "upb/collections/map.h" #include "src/core/ext/filters/rbac/rbac_filter.h" #include "src/core/ext/filters/rbac/rbac_service_config_parser.h" diff --git a/src/core/ext/xds/xds_http_rbac_filter.h b/src/core/ext/xds/xds_http_rbac_filter.h index 53c1c8c556d..c066521658a 100644 --- a/src/core/ext/xds/xds_http_rbac_filter.h +++ b/src/core/ext/xds/xds_http_rbac_filter.h @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_common_types.h" #include "src/core/ext/xds/xds_http_filters.h" diff --git a/src/core/ext/xds/xds_http_stateful_session_filter.cc b/src/core/ext/xds/xds_http_stateful_session_filter.cc index f545c5d0437..e03819abcd4 100644 --- a/src/core/ext/xds/xds_http_stateful_session_filter.cc +++ b/src/core/ext/xds/xds_http_stateful_session_filter.cc @@ -30,7 +30,6 @@ #include "envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h" #include "envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h" #include "envoy/type/http/v3/cookie.upb.h" -#include "upb/def.h" #include "src/core/ext/filters/stateful_session/stateful_session_filter.h" #include "src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h" diff --git a/src/core/ext/xds/xds_http_stateful_session_filter.h b/src/core/ext/xds/xds_http_stateful_session_filter.h index e5ebae6bb06..4fe68e57bc8 100644 --- a/src/core/ext/xds/xds_http_stateful_session_filter.h +++ b/src/core/ext/xds/xds_http_stateful_session_filter.h @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_common_types.h" #include "src/core/ext/xds/xds_http_filters.h" diff --git a/src/core/ext/xds/xds_listener.cc b/src/core/ext/xds/xds_listener.cc index a94be35d97f..e5f1a486652 100644 --- a/src/core/ext/xds/xds_listener.cc +++ b/src/core/ext/xds/xds_listener.cc @@ -44,8 +44,8 @@ #include "google/protobuf/any.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/text_encode.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/text/encode.h" #include diff --git a/src/core/ext/xds/xds_listener.h b/src/core/ext/xds/xds_listener.h index 5062310f6c7..bc5e8d86cc2 100644 --- a/src/core/ext/xds/xds_listener.h +++ b/src/core/ext/xds/xds_listener.h @@ -34,7 +34,7 @@ #include "absl/types/variant.h" #include "envoy/config/listener/v3/listener.upbdefs.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_bootstrap_grpc.h" #include "src/core/ext/xds/xds_client.h" diff --git a/src/core/ext/xds/xds_resource_type.h b/src/core/ext/xds/xds_resource_type.h index 7dbcfecac9e..4a9f96ad13c 100644 --- a/src/core/ext/xds/xds_resource_type.h +++ b/src/core/ext/xds/xds_resource_type.h @@ -24,8 +24,8 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "upb/arena.h" -#include "upb/def.h" +#include "upb/mem/arena.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_bootstrap.h" #include "src/core/lib/debug/trace.h" diff --git a/src/core/ext/xds/xds_route_config.cc b/src/core/ext/xds/xds_route_config.cc index 81d128a6df2..aef1037abf2 100644 --- a/src/core/ext/xds/xds_route_config.cc +++ b/src/core/ext/xds/xds_route_config.cc @@ -51,9 +51,9 @@ #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" #include "re2/re2.h" -#include "upb/def.h" -#include "upb/text_encode.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/collections/map.h" +#include "upb/text/encode.h" #include #include diff --git a/src/core/ext/xds/xds_route_config.h b/src/core/ext/xds/xds_route_config.h index dabde3740c3..09c9c9129b0 100644 --- a/src/core/ext/xds/xds_route_config.h +++ b/src/core/ext/xds/xds_route_config.h @@ -33,7 +33,7 @@ #include "envoy/config/route/v3/route.upb.h" #include "envoy/config/route/v3/route.upbdefs.h" #include "re2/re2.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "src/core/ext/xds/xds_bootstrap_grpc.h" #include "src/core/ext/xds/xds_client.h" diff --git a/src/core/lib/gprpp/status_helper.cc b/src/core/lib/gprpp/status_helper.cc index 31930dd120f..bb6c84e81b9 100644 --- a/src/core/lib/gprpp/status_helper.cc +++ b/src/core/lib/gprpp/status_helper.cc @@ -34,8 +34,8 @@ #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/base/string_view.h" +#include "upb/mem/arena.h" #include "upb/upb.hpp" #include diff --git a/src/core/lib/security/authorization/cel_authorization_engine.cc b/src/core/lib/security/authorization/cel_authorization_engine.cc index 2a75f76903f..b69effbad6d 100644 --- a/src/core/lib/security/authorization/cel_authorization_engine.cc +++ b/src/core/lib/security/authorization/cel_authorization_engine.cc @@ -24,7 +24,8 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "absl/types/span.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/collections/map.h" #include diff --git a/src/cpp/common/alts_context.cc b/src/cpp/common/alts_context.cc index adbe4362f77..e9fa2c194dc 100644 --- a/src/cpp/common/alts_context.cc +++ b/src/cpp/common/alts_context.cc @@ -21,7 +21,8 @@ #include #include -#include "upb/upb.h" +#include "upb/base/string_view.h" +#include "upb/collections/map.h" #include #include diff --git a/src/cpp/ext/gcp/observability_logging_sink.cc b/src/cpp/ext/gcp/observability_logging_sink.cc index e286b5341bb..bd2cb3ef8da 100644 --- a/src/cpp/ext/gcp/observability_logging_sink.cc +++ b/src/cpp/ext/gcp/observability_logging_sink.cc @@ -25,8 +25,6 @@ #include #include -#include - #include "absl/numeric/int128.h" #include "absl/strings/escaping.h" #include "absl/strings/match.h" @@ -52,6 +50,9 @@ #include "src/core/lib/json/json.h" #include "src/cpp/ext/filters/census/open_census_call_tracer.h" +// IWYU pragma: no_include "google/protobuf/struct.pb.h" +// IWYU pragma: no_include "google/protobuf/timestamp.pb.h" + namespace grpc { namespace internal { diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc index 674da4d130f..ce49768c6a7 100644 --- a/src/cpp/ext/proto_server_reflection.cc +++ b/src/cpp/ext/proto_server_reflection.cc @@ -24,6 +24,7 @@ #include #include +// IWYU pragma: no_include "google/protobuf/descriptor.h" // IWYU pragma: no_include using grpc::reflection::v1alpha::ErrorResponse; diff --git a/src/cpp/server/channelz/channelz_service.cc b/src/cpp/server/channelz/channelz_service.cc index 8ae823054e8..39e7ade93ab 100644 --- a/src/cpp/server/channelz/channelz_service.cc +++ b/src/cpp/server/channelz/channelz_service.cc @@ -23,6 +23,9 @@ #include #include +// IWYU pragma: no_include "google/protobuf/json/json.h" +// IWYU pragma: no_include "google/protobuf/util/json_util.h" + // IWYU pragma: no_include namespace grpc { diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc index f0abdf9e8f2..092e40a8e2e 100644 --- a/src/cpp/server/health/default_health_check_service.cc +++ b/src/cpp/server/health/default_health_check_service.cc @@ -23,7 +23,7 @@ #include #include -#include "upb/upb.h" +#include "upb/base/string_view.h" #include "upb/upb.hpp" #include diff --git a/src/cpp/server/load_reporter/load_reporter.cc b/src/cpp/server/load_reporter/load_reporter.cc index eac1ea4e61c..e26786e532b 100644 --- a/src/cpp/server/load_reporter/load_reporter.cc +++ b/src/cpp/server/load_reporter/load_reporter.cc @@ -29,8 +29,6 @@ #include #include -#include - #include "opencensus/tags/tag_key.h" #include @@ -38,6 +36,8 @@ #include "src/cpp/server/load_reporter/constants.h" #include "src/cpp/server/load_reporter/get_cpu_stats.h" +// IWYU pragma: no_include "google/protobuf/duration.pb.h" + namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc index 63df2814e99..2c19660514c 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc @@ -22,7 +22,6 @@ #include -#include #include #include @@ -30,6 +29,8 @@ #include "src/cpp/server/load_reporter/constants.h" +// IWYU pragma: no_include "google/protobuf/duration.pb.h" + namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/orca/orca_service.cc b/src/cpp/server/orca/orca_service.cc index f936fceadaf..784cbe6eb62 100644 --- a/src/cpp/server/orca/orca_service.cc +++ b/src/cpp/server/orca/orca_service.cc @@ -26,7 +26,7 @@ #include "absl/time/time.h" #include "absl/types/optional.h" #include "google/protobuf/duration.upb.h" -#include "upb/upb.h" +#include "upb/base/string_view.h" #include "upb/upb.hpp" #include "xds/data/orca/v3/orca_load_report.upb.h" #include "xds/service/orca/v3/orca.upb.h" diff --git a/src/csharp/build/dependencies.props b/src/csharp/build/dependencies.props index 5875b80ac01..60d4d58619d 100644 --- a/src/csharp/build/dependencies.props +++ b/src/csharp/build/dependencies.props @@ -2,6 +2,6 @@ 2.55.0-dev - 3.21.12 + 3.22.2 diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index fc9f59ebce6..d67a9ea75f2 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -100,7 +100,7 @@ Pod::Spec.new do |s| s.preserve_paths = plugin # Restrict the protoc version to the one supported by this plugin. - s.dependency '!ProtoCompiler', '3.21.12' + s.dependency '!ProtoCompiler', '3.22.2' # For the Protobuf dependency not to complain: s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.10' diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 268c7b566d0..eecbe0a1d0f 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -102,7 +102,7 @@ Pod::Spec.new do |s| s.preserve_paths = plugin # Restrict the protoc version to the one supported by this plugin. - s.dependency '!ProtoCompiler', '3.21.12' + s.dependency '!ProtoCompiler', '3.22.2' # For the Protobuf dependency not to complain: s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.10' diff --git a/src/objective-c/!ProtoCompiler.podspec b/src/objective-c/!ProtoCompiler.podspec index 12b31121e46..e7b4ba557b9 100644 --- a/src/objective-c/!ProtoCompiler.podspec +++ b/src/objective-c/!ProtoCompiler.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler' - v = '3.21.12' + v = '3.22.2' s.version = v s.summary = 'The Protobuf Compiler (protoc) generates Objective-C files from .proto files' s.description = <<-DESC diff --git a/src/objective-c/examples/InterceptorSample/Podfile b/src/objective-c/examples/InterceptorSample/Podfile index 2ddcbd4f7b0..6f5c5ab002d 100644 --- a/src/objective-c/examples/InterceptorSample/Podfile +++ b/src/objective-c/examples/InterceptorSample/Podfile @@ -1,4 +1,4 @@ -platform :ios, '9.0' +platform :ios, '10.0' install! 'cocoapods', :deterministic_uuids => false diff --git a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec index cf5cdef91c3..ddd04560c0d 100644 --- a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec +++ b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec @@ -7,10 +7,10 @@ Pod::Spec.new do |s| s.summary = 'RemoteTest example' s.source = { :git => 'https://github.com/grpc/grpc.git' } - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.10' - s.tvos.deployment_target = '10.0' - s.watchos.deployment_target = '4.0' + s.ios.deployment_target = '10.0' + s.osx.deployment_target = '10.12' + s.tvos.deployment_target = '12.0' + s.watchos.deployment_target = '6.0' # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.dependency "!ProtoCompiler-gRPCPlugin" diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile index 14184d49f63..eb6387edced 100644 --- a/src/objective-c/examples/Sample/Podfile +++ b/src/objective-c/examples/Sample/Podfile @@ -1,5 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '9.0' +platform :ios, '10.0' install! 'cocoapods', :deterministic_uuids => false diff --git a/src/objective-c/examples/SwiftSample/Podfile b/src/objective-c/examples/SwiftSample/Podfile index abe5adcca73..07c8863ba29 100644 --- a/src/objective-c/examples/SwiftSample/Podfile +++ b/src/objective-c/examples/SwiftSample/Podfile @@ -1,5 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '9.0' +platform :ios, '10.0' install! 'cocoapods', :deterministic_uuids => false diff --git a/src/objective-c/examples/watchOS-sample/Podfile b/src/objective-c/examples/watchOS-sample/Podfile index 0de6e71a253..4898a239a36 100644 --- a/src/objective-c/examples/watchOS-sample/Podfile +++ b/src/objective-c/examples/watchOS-sample/Podfile @@ -14,11 +14,11 @@ def grpc_deps end target 'watchOS-sample' do -platform :ios, '9.0' +platform :ios, '10.0' grpc_deps end target 'watchOS-sample WatchKit Extension' do -platform :watchos, '4.0' +platform :watchos, '6.0' grpc_deps end diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index dcab5dcd455..9975bb561c2 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -1273,26 +1273,50 @@ CORE_SOURCE_FILES = [ 'third_party/re2/util/pcre.cc', 'third_party/re2/util/rune.cc', 'third_party/re2/util/strutil.cc', - 'third_party/upb/third_party/utf8_range/naive.c', - 'third_party/upb/third_party/utf8_range/range2-neon.c', - 'third_party/upb/third_party/utf8_range/range2-sse.c', - 'third_party/upb/upb/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', + 'third_party/upb/upb/base/status.c', + 'third_party/upb/upb/collections/array.c', + 'third_party/upb/upb/collections/map.c', + 'third_party/upb/upb/collections/map_sorter.c', + 'third_party/upb/upb/hash/common.c', + 'third_party/upb/upb/json/decode.c', + 'third_party/upb/upb/json/encode.c', + 'third_party/upb/upb/lex/atoi.c', + 'third_party/upb/upb/lex/round_trip.c', + 'third_party/upb/upb/lex/strtod.c', + 'third_party/upb/upb/lex/unicode.c', + 'third_party/upb/upb/mem/alloc.c', + 'third_party/upb/upb/mem/arena.c', + 'third_party/upb/upb/message/accessors.c', + 'third_party/upb/upb/message/message.c', + 'third_party/upb/upb/mini_table/common.c', + 'third_party/upb/upb/mini_table/decode.c', + 'third_party/upb/upb/mini_table/encode.c', + 'third_party/upb/upb/mini_table/extension_registry.c', + 'third_party/upb/upb/reflection/def_builder.c', + 'third_party/upb/upb/reflection/def_pool.c', + 'third_party/upb/upb/reflection/def_type.c', + 'third_party/upb/upb/reflection/desc_state.c', + 'third_party/upb/upb/reflection/enum_def.c', + 'third_party/upb/upb/reflection/enum_reserved_range.c', + 'third_party/upb/upb/reflection/enum_value_def.c', + 'third_party/upb/upb/reflection/extension_range.c', + 'third_party/upb/upb/reflection/field_def.c', + 'third_party/upb/upb/reflection/file_def.c', + 'third_party/upb/upb/reflection/message.c', + 'third_party/upb/upb/reflection/message_def.c', + 'third_party/upb/upb/reflection/message_reserved_range.c', + 'third_party/upb/upb/reflection/method_def.c', + 'third_party/upb/upb/reflection/oneof_def.c', + 'third_party/upb/upb/reflection/service_def.c', + 'third_party/upb/upb/text/encode.c', + 'third_party/upb/upb/wire/decode.c', + 'third_party/upb/upb/wire/decode_fast.c', + 'third_party/upb/upb/wire/encode.c', + 'third_party/upb/upb/wire/eps_copy_input_stream.c', + 'third_party/upb/upb/wire/reader.c', + 'third_party/utf8_range/naive.c', + 'third_party/utf8_range/range2-neon.c', + 'third_party/utf8_range/range2-sse.c', 'third_party/zlib/adler32.c', 'third_party/zlib/compress.c', 'third_party/zlib/crc32.c', diff --git a/src/upb/gen_build_yaml.py b/src/upb/gen_build_yaml.py index 6d58c946187..5f7ef6653c4 100755 --- a/src/upb/gen_build_yaml.py +++ b/src/upb/gen_build_yaml.py @@ -29,61 +29,161 @@ try: 'build': 'all', 'language': 'c', 'src': [ - "third_party/upb/third_party/utf8_range/naive.c", - "third_party/upb/third_party/utf8_range/range2-neon.c", - "third_party/upb/third_party/utf8_range/range2-sse.c", - "third_party/upb/upb/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", + "third_party/utf8_range/naive.c", + "third_party/utf8_range/range2-neon.c", + "third_party/utf8_range/range2-sse.c", + "third_party/upb/upb/base/status.c", + "third_party/upb/upb/collections/array.c", + "third_party/upb/upb/collections/map.c", + "third_party/upb/upb/collections/map_sorter.c", + "third_party/upb/upb/hash/common.c", + "third_party/upb/upb/json/decode.c", + "third_party/upb/upb/json/encode.c", + "third_party/upb/upb/lex/atoi.c", + "third_party/upb/upb/lex/round_trip.c", + "third_party/upb/upb/lex/strtod.c", + "third_party/upb/upb/lex/unicode.c", + "third_party/upb/upb/mem/alloc.c", + "third_party/upb/upb/mem/arena.c", + "third_party/upb/upb/message/accessors.c", + "third_party/upb/upb/message/message.c", + "third_party/upb/upb/mini_table/common.c", + "third_party/upb/upb/mini_table/decode.c", + "third_party/upb/upb/mini_table/encode.c", + "third_party/upb/upb/mini_table/extension_registry.c", + "third_party/upb/upb/reflection/def_builder.c", + "third_party/upb/upb/reflection/def_pool.c", + "third_party/upb/upb/reflection/def_type.c", + "third_party/upb/upb/reflection/desc_state.c", + "third_party/upb/upb/reflection/enum_def.c", + "third_party/upb/upb/reflection/enum_reserved_range.c", + "third_party/upb/upb/reflection/enum_value_def.c", + "third_party/upb/upb/reflection/extension_range.c", + "third_party/upb/upb/reflection/field_def.c", + "third_party/upb/upb/reflection/file_def.c", + "third_party/upb/upb/reflection/message.c", + "third_party/upb/upb/reflection/message_def.c", + "third_party/upb/upb/reflection/message_reserved_range.c", + "third_party/upb/upb/reflection/method_def.c", + "third_party/upb/upb/reflection/oneof_def.c", + "third_party/upb/upb/reflection/service_def.c", + "third_party/upb/upb/text/encode.c", + "third_party/upb/upb/wire/decode.c", + "third_party/upb/upb/wire/decode_fast.c", + "third_party/upb/upb/wire/encode.c", + "third_party/upb/upb/wire/eps_copy_input_stream.c", + "third_party/upb/upb/wire/reader.c", "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c", "src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c", ], 'headers': [ - "third_party/upb/third_party/utf8_range/utf8_range.h", + "third_party/utf8_range/utf8_range.h", + "third_party/upb/upb/alloc.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/base/descriptor_constants.h", + "third_party/upb/upb/base/log2.h", + "third_party/upb/upb/base/status.h", + "third_party/upb/upb/base/string_view.h", + "third_party/upb/upb/collections/array.h", + "third_party/upb/upb/collections/array_internal.h", + "third_party/upb/upb/collections/map_gencode_util.h", + "third_party/upb/upb/collections/map.h", + "third_party/upb/upb/collections/map_internal.h", + "third_party/upb/upb/collections/map_sorter_internal.h", + "third_party/upb/upb/collections/message_value.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/hash/common.h", + "third_party/upb/upb/hash/int_table.h", + "third_party/upb/upb/hash/str_table.h", + "third_party/upb/upb/json/decode.h", "third_party/upb/upb/json_decode.h", + "third_party/upb/upb/json/encode.h", "third_party/upb/upb/json_encode.h", + "third_party/upb/upb/lex/atoi.h", + "third_party/upb/upb/lex/round_trip.h", + "third_party/upb/upb/lex/strtod.h", + "third_party/upb/upb/lex/unicode.h", "third_party/upb/upb/map.h", - "third_party/upb/upb/message_value.h", + "third_party/upb/upb/mem/alloc.h", + "third_party/upb/upb/mem/arena.h", + "third_party/upb/upb/mem/arena_internal.h", + "third_party/upb/upb/message/accessors.h", + "third_party/upb/upb/message/extension_internal.h", + "third_party/upb/upb/message/internal.h", + "third_party/upb/upb/message/message.h", + "third_party/upb/upb/mini_table/common.h", + "third_party/upb/upb/mini_table/common_internal.h", + "third_party/upb/upb/mini_table/decode.h", + "third_party/upb/upb/mini_table/encode_internal.h", + "third_party/upb/upb/mini_table/encode_internal.hpp", + "third_party/upb/upb/mini_table/enum_internal.h", + "third_party/upb/upb/mini_table/extension_internal.h", + "third_party/upb/upb/mini_table/extension_registry.h", + "third_party/upb/upb/mini_table/field_internal.h", + "third_party/upb/upb/mini_table/file_internal.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/mini_table/message_internal.h", + "third_party/upb/upb/mini_table/sub_internal.h", + "third_party/upb/upb/mini_table/types.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/port/def.inc", + "third_party/upb/upb/port/undef.inc", + "third_party/upb/upb/port/vsnprintf_compat.h", + "third_party/upb/upb/reflection/common.h", + "third_party/upb/upb/reflection/def_builder_internal.h", + "third_party/upb/upb/reflection/def.h", + "third_party/upb/upb/reflection/def.hpp", + "third_party/upb/upb/reflection/def_pool.h", + "third_party/upb/upb/reflection/def_pool_internal.h", + "third_party/upb/upb/reflection/def_type.h", + "third_party/upb/upb/reflection/desc_state_internal.h", + "third_party/upb/upb/reflection/enum_def.h", + "third_party/upb/upb/reflection/enum_def_internal.h", + "third_party/upb/upb/reflection/enum_reserved_range.h", + "third_party/upb/upb/reflection/enum_reserved_range_internal.h", + "third_party/upb/upb/reflection/enum_value_def.h", + "third_party/upb/upb/reflection/enum_value_def_internal.h", + "third_party/upb/upb/reflection/extension_range.h", + "third_party/upb/upb/reflection/extension_range_internal.h", + "third_party/upb/upb/reflection/field_def.h", + "third_party/upb/upb/reflection/field_def_internal.h", + "third_party/upb/upb/reflection/file_def.h", + "third_party/upb/upb/reflection/file_def_internal.h", "third_party/upb/upb/reflection.h", "third_party/upb/upb/reflection.hpp", + "third_party/upb/upb/reflection/message_def.h", + "third_party/upb/upb/reflection/message_def_internal.h", + "third_party/upb/upb/reflection/message.h", + "third_party/upb/upb/reflection/message.hpp", + "third_party/upb/upb/reflection/message_reserved_range.h", + "third_party/upb/upb/reflection/message_reserved_range_internal.h", + "third_party/upb/upb/reflection/method_def.h", + "third_party/upb/upb/reflection/method_def_internal.h", + "third_party/upb/upb/reflection/oneof_def.h", + "third_party/upb/upb/reflection/oneof_def_internal.h", + "third_party/upb/upb/reflection/service_def.h", + "third_party/upb/upb/reflection/service_def_internal.h", + "third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h", "third_party/upb/upb/status.h", - "third_party/upb/upb/table_internal.h", + "third_party/upb/upb/string_view.h", + "third_party/upb/upb/text/encode.h", "third_party/upb/upb/text_encode.h", "third_party/upb/upb/upb.h", "third_party/upb/upb/upb.hpp", + "third_party/upb/upb/wire/common_internal.h", + "third_party/upb/upb/wire/decode_fast.h", + "third_party/upb/upb/wire/decode.h", + "third_party/upb/upb/wire/decode_internal.h", + "third_party/upb/upb/wire/encode.h", + "third_party/upb/upb/wire/eps_copy_input_stream.h", + "third_party/upb/upb/wire/reader.h", + "third_party/upb/upb/wire/swap_internal.h", + "third_party/upb/upb/wire/types.h", "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", "src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h", ], diff --git a/templates/config.m4.template b/templates/config.m4.template index 0f7447c33d5..d581911334b 100644 --- a/templates/config.m4.template +++ b/templates/config.m4.template @@ -16,6 +16,7 @@ PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl-with-bazel/src/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/re2) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/upb) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/utf8_range) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/xxhash) LIBS="-lpthread $LIBS" diff --git a/templates/config.w32.template b/templates/config.w32.template index f4afa1d0690..05f7a00c771 100644 --- a/templates/config.w32.template +++ b/templates/config.w32.template @@ -37,6 +37,7 @@ "/I"+configure_module_dirname+"\\third_party\\boringssl-with-bazel\\src\\include "+ "/I"+configure_module_dirname+"\\third_party\\re2 "+ "/I"+configure_module_dirname+"\\third_party\\upb "+ + "/I"+configure_module_dirname+"\\third_party\\utf8_range "+ "/I"+configure_module_dirname+"\\third_party\\xxhash "+ "/I"+configure_module_dirname+"\\third_party\\zlib "); <% diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index 6eb7d4431fe..88942c985c2 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -154,6 +154,7 @@ ' "$(PODS_TARGET_SRCROOT)/src/core/ext/upbdefs-generated"'${"\\"} ' "$(PODS_TARGET_SRCROOT)/third_party/re2"'${"\\"} ' "$(PODS_TARGET_SRCROOT)/third_party/upb"'${"\\"} + ' "$(PODS_TARGET_SRCROOT)/third_party/utf8_range"'${"\\"} ' "$(PODS_TARGET_SRCROOT)/third_party/xxhash"', # If we don't set these two settings, `include/grpc/support/time.h` and # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the diff --git a/test/core/xds/xds_client_test.cc b/test/core/xds/xds_client_test.cc index 91ea508e16d..fc2fcc4191d 100644 --- a/test/core/xds/xds_client_test.cc +++ b/test/core/xds/xds_client_test.cc @@ -37,7 +37,7 @@ #include "absl/types/variant.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include #include @@ -63,6 +63,8 @@ // IWYU pragma: no_include // IWYU pragma: no_include // IWYU pragma: no_include +// IWYU pragma: no_include "google/protobuf/json/json.h" +// IWYU pragma: no_include "google/protobuf/util/json_util.h" using envoy::service::discovery::v3::DiscoveryRequest; using envoy::service::discovery::v3::DiscoveryResponse; diff --git a/test/core/xds/xds_cluster_resource_type_test.cc b/test/core/xds/xds_cluster_resource_type_test.cc index 4da65b3e1b8..d6ec8a90bf9 100644 --- a/test/core/xds/xds_cluster_resource_type_test.cc +++ b/test/core/xds/xds_cluster_resource_type_test.cc @@ -30,7 +30,7 @@ #include "absl/types/variant.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/core/xds/xds_common_types_test.cc b/test/core/xds/xds_common_types_test.cc index d9dc0b1efe7..e7cd6a945b3 100644 --- a/test/core/xds/xds_common_types_test.cc +++ b/test/core/xds/xds_common_types_test.cc @@ -16,7 +16,8 @@ #include "src/core/ext/xds/xds_common_types.h" -#include +#include + #include #include #include @@ -35,7 +36,7 @@ #include "google/protobuf/duration.upb.h" #include "gtest/gtest.h" #include "re2/re2.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/core/xds/xds_endpoint_resource_type_test.cc b/test/core/xds/xds_endpoint_resource_type_test.cc index 58b2422dd1e..24294f93f98 100644 --- a/test/core/xds/xds_endpoint_resource_type_test.cc +++ b/test/core/xds/xds_endpoint_resource_type_test.cc @@ -30,7 +30,7 @@ #include "absl/strings/str_format.h" #include "absl/types/optional.h" #include "gtest/gtest.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/core/xds/xds_http_filters_test.cc b/test/core/xds/xds_http_filters_test.cc index 33f1ff333bd..120b10899bb 100644 --- a/test/core/xds/xds_http_filters_test.cc +++ b/test/core/xds/xds_http_filters_test.cc @@ -16,6 +16,8 @@ #include "src/core/ext/xds/xds_http_filters.h" +#include + #include #include #include @@ -29,7 +31,7 @@ #include "absl/strings/strip.h" #include "absl/types/variant.h" #include "gtest/gtest.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/core/xds/xds_lb_policy_registry_test.cc b/test/core/xds/xds_lb_policy_registry_test.cc index 50f4014054d..48554f8937b 100644 --- a/test/core/xds/xds_lb_policy_registry_test.cc +++ b/test/core/xds/xds_lb_policy_registry_test.cc @@ -18,7 +18,8 @@ #include "src/core/ext/xds/xds_lb_policy_registry.h" -#include +#include + #include #include @@ -30,7 +31,7 @@ #include "absl/status/statusor.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/core/xds/xds_listener_resource_type_test.cc b/test/core/xds/xds_listener_resource_type_test.cc index fe27a224492..d362d458b8b 100644 --- a/test/core/xds/xds_listener_resource_type_test.cc +++ b/test/core/xds/xds_listener_resource_type_test.cc @@ -34,7 +34,7 @@ #include "absl/types/variant.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/core/xds/xds_route_config_resource_type_test.cc b/test/core/xds/xds_route_config_resource_type_test.cc index 6df26067da4..b07e7815bc6 100644 --- a/test/core/xds/xds_route_config_resource_type_test.cc +++ b/test/core/xds/xds_route_config_resource_type_test.cc @@ -16,7 +16,6 @@ #include -#include #include #include #include @@ -39,7 +38,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "re2/re2.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include diff --git a/test/distrib/bazel/python/BUILD b/test/distrib/bazel/python/BUILD index 127a43568c8..a587e759ecb 100644 --- a/test/distrib/bazel/python/BUILD +++ b/test/distrib/bazel/python/BUILD @@ -67,6 +67,11 @@ py_test( srcs = ["helloworld.py"], main = "helloworld.py", python_version = "PY3", + tags = [ + # TODO(jtattermusch): Remove the "manual" tag to run on CI again once + # https://github.com/grpc/grpc/issues/32778 is fixed. + "manual", + ], deps = [ ":duration_py_pb2", ":helloworld_py_pb2", @@ -108,6 +113,11 @@ py_test( srcs = ["helloworld_moved.py"], main = "helloworld_moved.py", python_version = "PY3", + tags = [ + # TODO(jtattermusch): Remove the "manual" tag to run on CI again once + # https://github.com/grpc/grpc/issues/32778 is fixed. + "manual", + ], deps = [ ":duration_py_pb2", ":helloworld_moved_py_pb2", diff --git a/test/distrib/bazel/python/WORKSPACE b/test/distrib/bazel/python/WORKSPACE index e8120154545..3ffc4a4b2d8 100644 --- a/test/distrib/bazel/python/WORKSPACE +++ b/test/distrib/bazel/python/WORKSPACE @@ -20,3 +20,20 @@ local_repository( name = "some_other_repo", path = "../python_second_test_repo", ) + +load("@upb//bazel:system_python.bzl", "system_python") + +system_python( + name = "system_python", + minimum_python_version = "3.7", +) + +load("@system_python//:pip.bzl", "pip_parse") + +pip_parse( + name = "pip_deps", + requirements = "@upb//python:requirements.txt", + requirements_overrides = { + "3.11": "@upb//python:requirements_311.txt", + }, +) diff --git a/test/distrib/cpp/run_distrib_test_cmake.bat b/test/distrib/cpp/run_distrib_test_cmake.bat index 9824e94ee9e..d8d5ff14fe3 100644 --- a/test/distrib/cpp/run_distrib_test_cmake.bat +++ b/test/distrib/cpp/run_distrib_test_cmake.bat @@ -52,7 +52,7 @@ popd @rem Install protobuf mkdir third_party\protobuf\cmake\build pushd third_party\protobuf\cmake\build -cmake -G %VS_GENERATOR% -A %VS_ARCHITECTURE% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DZLIB_ROOT=%INSTALL_DIR% -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..\.. +cmake -G %VS_GENERATOR% -A %VS_ARCHITECTURE% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -Dprotobuf_ABSL_PROVIDER=package -DZLIB_ROOT=%INSTALL_DIR% -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..\.. cmake --build . --config Release --target install || goto :error popd @@ -99,6 +99,7 @@ cmake ^ -DgRPC_BUILD_MSVC_MP_COUNT=-1 ^ -DgRPC_ABSL_PROVIDER=package ^ -DgRPC_CARES_PROVIDER=package ^ + -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG ^ -DgRPC_PROTOBUF_PROVIDER=package ^ -DProtobuf_USE_STATIC_LIBS=ON ^ -DgRPC_RE2_PROVIDER=package ^ diff --git a/test/distrib/cpp/run_distrib_test_cmake.sh b/test/distrib/cpp/run_distrib_test_cmake.sh index 5be6617dd9f..73fba56129a 100755 --- a/test/distrib/cpp/run_distrib_test_cmake.sh +++ b/test/distrib/cpp/run_distrib_test_cmake.sh @@ -43,7 +43,7 @@ popd # Install protobuf mkdir -p "third_party/protobuf/cmake/build" pushd "third_party/protobuf/cmake/build" -cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../.. +cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -Dprotobuf_ABSL_PROVIDER=package ../.. make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install popd @@ -75,6 +75,7 @@ cmake \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_CARES_PROVIDER=package \ -DgRPC_ABSL_PROVIDER=package \ + -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG \ -DgRPC_PROTOBUF_PROVIDER=package \ -DgRPC_RE2_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package \ diff --git a/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh b/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh index 74341ccbbf8..22ce463e57f 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh @@ -78,6 +78,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release \ -Dabsl_DIR=/tmp/stage/lib/cmake/absl \ -DProtobuf_DIR=/tmp/stage/lib/cmake/protobuf \ + -Dutf8_range_DIR=/tmp/stage/lib/cmake/utf8_range \ -DgRPC_DIR=/tmp/stage/lib/cmake/grpc \ ../.. make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" diff --git a/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh b/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh index 907479dd210..c5ba10ab1d8 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh @@ -24,5 +24,5 @@ GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_J cd examples/cpp/helloworld mkdir -p cmake/build cd cmake/build -cmake -DGRPC_AS_SUBMODULE=ON ../.. +cmake -DGRPC_AS_SUBMODULE=ON -Dprotobuf_INSTALL=OFF -Dutf8_range_ENABLE_INSTALL=OFF ../.. make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" diff --git a/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh b/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh index 74b8f288c60..9cf2f8f8c20 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh @@ -42,6 +42,8 @@ cmake \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_SSL_PROVIDER=package \ -DGRPC_FETCHCONTENT=ON \ + -Dprotobuf_INSTALL=OFF \ + -Dutf8_range_ENABLE_INSTALL=OFF \ -DFETCHCONTENT_SOURCE_DIR_GRPC="$grpc_dir" \ ../.. make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" diff --git a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh index 1ccca6a5733..fbec50fcd6d 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh @@ -40,7 +40,7 @@ popd # Install protobuf mkdir -p "third_party/protobuf/cmake/build" pushd "third_party/protobuf/cmake/build" -cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../.. +cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -Dprotobuf_ABSL_PROVIDER=package ../.. make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install popd @@ -71,6 +71,7 @@ popd git submodule foreach 'cd $toplevel; rm -rf $name' # Install gRPC +# TODO(jtattermusch): avoid the need for setting utf8_range_DIR mkdir -p "cmake/build" pushd "cmake/build" cmake \ @@ -80,7 +81,9 @@ cmake \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_ABSL_PROVIDER=package \ -DgRPC_CARES_PROVIDER=package \ + -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG \ -DgRPC_PROTOBUF_PROVIDER=package \ + -Dutf8_range_DIR=/usr/local/lib/cmake/utf8_range \ -DgRPC_RE2_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package \ diff --git a/third_party/README.md b/third_party/README.md index 40b0b64d362..dd9a6db3551 100644 --- a/third_party/README.md +++ b/third_party/README.md @@ -130,9 +130,9 @@ Since upb is vendored in the gRPC repo, you cannot use submodule to update it. P - `mv $GRPC_ROOT/third_party/upb-main $GRPC_ROOT/third_party/upb` 2. Update the dependency in `grpc_deps.bzl` to the same commit 3. Populate the bazel download mirror by running `bazel/update_mirror.sh` -4. Update `src/upb/gen_build_yaml.py` for newly added or removed upb files - - 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. +4. Inspect `src/upb/gen_build_yaml.py` and update it with added or removed upb files + - Running `cd third_party/upb; bazel query "deps(upb) union deps(json) union deps(textformat)"` + 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/protobuf b/third_party/protobuf index f0dc78d7e6e..5ddb1fc609d 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c +Subproject commit 5ddb1fc609d2416e8575c9e7435c608222c2edb2 diff --git a/third_party/protobuf.patch b/third_party/protobuf.patch index 6a3f5e3785b..3422a7be9ad 100644 --- a/third_party/protobuf.patch +++ b/third_party/protobuf.patch @@ -5,7 +5,7 @@ index 97ac28028..8b7585d9d 100644 @@ -31,3 +31,9 @@ # Copyright 2007 Google Inc. All Rights Reserved. - __version__ = '4.21.12' + __version__ = '4.22.2' + +if __name__ != '__main__': + try: diff --git a/third_party/protobuf2.patch b/third_party/protobuf2.patch new file mode 100644 index 00000000000..6bbee4abe66 --- /dev/null +++ b/third_party/protobuf2.patch @@ -0,0 +1,31 @@ +diff --git a/python/internal.bzl b/python/internal.bzl +index d9ba37ef8..6596a2d39 100644 +--- a/python/internal.bzl ++++ b/python/internal.bzl +@@ -1,5 +1,11 @@ + # Internal helpers for building the Python protobuf runtime. + ++def _remove_cross_repo_path(path): ++ components = path.split("/") ++ if components[0] == "..": ++ return "/".join(components[2:]) ++ return path ++ + def _internal_copy_files_impl(ctx): + strip_prefix = ctx.attr.strip_prefix + if strip_prefix[-1] != "/": +@@ -7,10 +13,11 @@ def _internal_copy_files_impl(ctx): + + src_dests = [] + for src in ctx.files.srcs: +- if src.short_path[:len(strip_prefix)] != strip_prefix: ++ short_path = _remove_cross_repo_path(src.short_path) ++ if short_path[:len(strip_prefix)] != strip_prefix: + fail("Source does not start with %s: %s" % +- (strip_prefix, src.short_path)) +- dest = ctx.actions.declare_file(src.short_path[len(strip_prefix):]) ++ (strip_prefix, short_path)) ++ dest = ctx.actions.declare_file(short_path[len(strip_prefix):]) + src_dests.append([src, dest]) + + if ctx.attr.is_windows: diff --git a/third_party/upb/.bazelci/presubmit.yml b/third_party/upb/.bazelci/presubmit.yml index 29bfc53c2c7..c7630471420 100644 --- a/third_party/upb/.bazelci/presubmit.yml +++ b/third_party/upb/.bazelci/presubmit.yml @@ -1,12 +1,16 @@ --- tasks: ubuntu: - platform: ubuntu1804 + platform: ubuntu2004 shell_commands: - - "sudo apt -y update && sudo apt -y install libreadline-dev cmake" + - "sudo apt -y update && sudo apt -y install libreadline-dev cmake rsync" + build_flags: + - "--incompatible_disallow_empty_glob" test_targets: - //... macos: platform: macos + build_flags: + - "--incompatible_disallow_empty_glob" test_targets: - //... diff --git a/third_party/upb/.bazelrc b/third_party/upb/.bazelrc index 23492c03deb..9f61850dd55 100644 --- a/third_party/upb/.bazelrc +++ b/third_party/upb/.bazelrc @@ -1,7 +1,8 @@ # temporary fix for https://github.com/bazelbuild/bazel/issues/12905 on macOS build --features=-debug_prefix_map_pwd_is_dot -build --extra_toolchains=@system_python//:python_toolchain +# Pin to C++17 +build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 # Use our custom-configured c++ toolchain. diff --git a/third_party/upb/.github/actions/setup-bazel-cache/action.yml b/third_party/upb/.github/actions/setup-bazel-cache/action.yml new file mode 100644 index 00000000000..ac9ea833297 --- /dev/null +++ b/third_party/upb/.github/actions/setup-bazel-cache/action.yml @@ -0,0 +1,21 @@ +name: "Setup Bazel Caching" +description: "Sets up Bazel caching" +inputs: + cache_url: + description: "URL of the Bazel cache to read/write" + required: false + default: https://storage.googleapis.com/protobuf-bazel-cache/upb + read_only: + description: "If true, we can read from the cache but not write it." + required: false + default: ${{ github.event.pull_request.head.repo.full_name != 'protocolbuffers/upb' }} +outputs: + cache_args: + description: "Caching related arguments to pass to 'bazel build" + value: --remote_cache=${{ inputs.cache_url }} ${{ steps.set_auth_arg.outputs.auth_arg }} +runs: + using: "composite" + steps: + - id: set_auth_arg + run: echo auth_arg=${{ inputs.read_only == 'true' && '--remote_upload_local_results=false' || '--google_default_credentials' }} >> $GITHUB_OUTPUT + shell: bash diff --git a/third_party/upb/.github/workflows/bazel_tests.yml b/third_party/upb/.github/workflows/bazel_tests.yml index 8416481ae8a..024427abbe8 100644 --- a/third_party/upb/.github/workflows/bazel_tests.yml +++ b/third_party/upb/.github/workflows/bazel_tests.yml @@ -4,30 +4,36 @@ on: push: branches: - main + - '[0-9]+.x' pull_request: branches: - main + - '[0-9]+.x' workflow_dispatch: 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. matrix: include: - - { CC: clang, os: ubuntu-20.04, flags: "" } - - { CC: clang, os: ubuntu-20.04, flags: "-c opt" } # Some warnings only fire with -c opt - - { CC: gcc, os: ubuntu-20.04, flags: "-c opt" } - - { CC: clang, os: ubuntu-20.04, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" } - - { CC: clang, os: ubuntu-20.04, flags: "--config=asan -c dbg -- -benchmarks:benchmark -python/..." } - - { CC: clang, os: ubuntu-20.04, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -upb/bindings/lua/...", install: "libunwind-dev" } - - { CC: clang, os: ubuntu-20.04, flags: "--copt=-m32 --linkopt=-m32 -- -... benchmarks:benchmark ", install: "g++-multilib" } - - { CC: clang, os: macos-11, flags: "" } + # Temporarily disabled until Copybara fixes its cap of 30 jobs per PR. + # - { NAME: "Fastbuild", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "" } + # - { NAME: "Optmized", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "-c opt" } # Some warnings only fire with -c opt + - { NAME: "GCC Optimized", BAZEL: bazel, CC: gcc-12, os: ubuntu-22.04, flags: "-c opt" } + - { NAME: "FastTable", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" } + - { NAME: "ASAN", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--config=asan -c dbg -- -benchmarks:benchmark -python/..." } + - { NAME: "UBSAN", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -lua/...", install: "libunwind-dev" } + - { NAME: "32-bit", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--copt=-m32 --linkopt=-m32 -- -... benchmarks:benchmark ", install: "g++-multilib" } + - { NAME: "macOS", BAZEL: bazel, CC: clang, os: macos-11, flags: "" } + # We support two Bazel versions back per https://opensource.google/documentation/policies/cplusplus-support + - { NAME: "Bazel 4.1.0", BAZEL: bazel-4.1.0-linux-x86_64, CC: clang, os: ubuntu-20-large, flags: "" } + - { NAME: "Bazel 5.3.0", BAZEL: bazel-5.3.0-linux-x86_64, CC: clang, os: ubuntu-20-large, flags: "" } + + name: ${{ matrix.NAME }} steps: - uses: actions/checkout@v2 @@ -36,17 +42,54 @@ jobs: 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' }} + if: ${{ github.event.pull_request.head.repo.full_name == 'protocolbuffers/upb' }} + - name: Download historical Bazel version + run: | + FILENAME=$HOME/bin/${{ matrix.BAZEL }} + VERSION=$(echo ${{ matrix.BAZEL }} | cut -d- -f 2 ) + mkdir -p $HOME/bin + echo $HOME/bin >> $GITHUB_PATH + wget -O $FILENAME https://github.com/bazelbuild/bazel/releases/download/$VERSION/${{ matrix.BAZEL }} + chmod a+x $FILENAME + if: ${{ matrix.BAZEL != 'bazel' }} + - name: Check tool versions + run: | + ${{ matrix.CC }} --version + ${{ matrix.BAZEL }} --version + - id: bazel-cache + name: Set up Bazel caching + uses: ./.github/actions/setup-bazel-cache - name: Setup Python venv - run: rm -rf /tmp/venv && python3 -m venv /tmp/venv + run: rm -rf /tmp/venv && python3 -m venv /tmp/venv && source /tmp/venv/bin/activate && python3 --version - name: Install dependencies run: sudo apt update && sudo apt install -y ${{ matrix.install }} if: matrix.install != '' + - name: Install numpy + run: source /tmp/venv/bin/activate && pip3 install numpy - name: Run tests - run: cd ${{ github.workspace }} && PATH=/tmp/venv/bin:$PATH CC=${{ matrix.CC }} bazel test --test_output=errors $BAZEL_CACHE $BAZEL_CACHE_AUTH ... ${{ matrix.flags }} + run: cd ${{ github.workspace }} && source /tmp/venv/bin/activate && CC=${{ matrix.CC }} ${{ matrix.BAZEL }} test --test_output=errors ${{ steps.bazel-cache.outputs.cache_args }} ... ${{ matrix.flags }} + + # Temporarily disabled until Copybara fixes its cap of 30 jobs per PR. + # no-python: + # runs-on: ubuntu-20-large + + # strategy: + # fail-fast: false # Don't cancel all jobs if one fails. + + # name: "No System Python" + + # 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.event.pull_request.head.repo.full_name == 'protocolbuffers/upb' }} + # - id: bazel-cache + # name: Set up Bazel caching + # uses: ./.github/actions/setup-bazel-cache + # - name: Uninstall python + # run: which python3 && sudo mv `which python3` /tmp && ! which python3 + # - name: Run tests + # run: cd ${{ github.workspace }} && bazel test --test_output=errors ${{ steps.bazel-cache.outputs.cache_args }} //python/... -- -//python/dist:source_wheel diff --git a/third_party/upb/.github/workflows/cifuzz.yml b/third_party/upb/.github/workflows/cifuzz.yml index 092b1079fff..148e15d9151 100644 --- a/third_party/upb/.github/workflows/cifuzz.yml +++ b/third_party/upb/.github/workflows/cifuzz.yml @@ -2,7 +2,7 @@ name: CIFuzz on: [pull_request] jobs: Fuzzing: - runs-on: ubuntu-latest + runs-on: ubuntu-22-large strategy: fail-fast: false matrix: diff --git a/third_party/upb/.github/workflows/clang_format.yml b/third_party/upb/.github/workflows/clang_format.yml index b6e9fe24dde..51035005865 100644 --- a/third_party/upb/.github/workflows/clang_format.yml +++ b/third_party/upb/.github/workflows/clang_format.yml @@ -4,14 +4,16 @@ on: push: branches: - main + - '[0-9]+.x' pull_request: branches: - main + - '[0-9]+.x' workflow_dispatch: jobs: check_clang_format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-20-large steps: - uses: actions/checkout@v2 - name: Run ClangFormat diff --git a/third_party/upb/.github/workflows/generate_files.yml b/third_party/upb/.github/workflows/generate_files.yml index e4462f05413..ce9d4da3e28 100644 --- a/third_party/upb/.github/workflows/generate_files.yml +++ b/third_party/upb/.github/workflows/generate_files.yml @@ -5,16 +5,20 @@ on: push: branches: - main + - '[0-9]+.x' jobs: generate: - runs-on: ubuntu-20.04 + if: github.repository == 'protocolbuffers/upb' + runs-on: ubuntu-22-large steps: - - uses: actions/checkout@v2 - - name: Merge generated branch with main - run: cd ${{ github.workspace }} && (git checkout generated || git checkout -b generated) && git merge --no-edit main - - name: Rebuild generated CMake files - run: cd ${{ github.workspace }} && bazel test cmake:test_generated_files || bazel-bin/cmake/test_generated_files --fix - - name: Commit and push changes to generated files - run: cd ${{ github.workspace }} && git add -A && (git diff --staged --quiet || git commit -am "Regenerated files") && git push + - uses: actions/checkout@v3 + with: + # Note: this token has an expiration date, so if the workflow starts + # failing then you may need to generate a fresh token. + token: ${{ secrets.BOT_ACCESS_TOKEN }} + - name: Configure name and email address in Git + run: cd ${{ github.workspace }} && git config user.name "Protobuf Team Bot" && git config user.email "protobuf-team-bot@google.com" + - name: Commit and push update + run: cd ${{ github.workspace }} && ./cmake/push_auto_update.sh diff --git a/third_party/upb/.github/workflows/mergeable.yml b/third_party/upb/.github/workflows/mergeable.yml new file mode 100644 index 00000000000..255bc1c92c0 --- /dev/null +++ b/third_party/upb/.github/workflows/mergeable.yml @@ -0,0 +1,15 @@ +mergeable: + pull_requests: + label: + and: + - must_exclude: + regex: '^disposition/DO NOT MERGE' + message: 'Pull request marked not mergeable' + - must_include: + regex: 'mergeable:force-allow' + message: 'Pull requests should not be merged directly and should instead + be handled by Copybara. + + To enable Github merges, add the `mergeable:force-allow` label and get a second + approval. This should almost never be used except for releases or as a break glass + measure after discussing with the team.' \ No newline at end of file diff --git a/third_party/upb/.github/workflows/python_tests.yml b/third_party/upb/.github/workflows/python_tests.yml index cd282635a29..7f242b7a6c5 100644 --- a/third_party/upb/.github/workflows/python_tests.yml +++ b/third_party/upb/.github/workflows/python_tests.yml @@ -4,19 +4,20 @@ on: push: branches: - main + - '[0-9]+.x' pull_request: branches: - main + - '[0-9]+.x' workflow_dispatch: jobs: build_wheels: name: Build Wheels - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'protocolbuffers' }} + runs-on: ubuntu-large + if: ${{ github.event.pull_request.head.repo.full_name == 'protocolbuffers/upb' }} 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 + DOCKER_IMAGE: us-docker.pkg.dev/protobuf-build/release-containers/linux/apple@sha256:8f5ae27bccb454068b14a6fe50628adf2ce867ddf3b15807aaf1d9d4affcbc51 steps: - uses: actions/checkout@v2 @@ -28,13 +29,16 @@ jobs: - name: Use gcloud CLI run: gcloud info - name: Configure Docker - run: gcloud auth configure-docker + run: gcloud auth configure-docker -q us-docker.pkg.dev - name: Pull Docker Image run: docker pull $DOCKER_IMAGE + - id: bazel-cache + name: Set up Bazel caching + uses: ./.github/actions/setup-bazel-cache - 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 + 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 ${{ steps.bazel-cache.outputs.cache_args }} python/dist:test_wheel python/dist:source_wheel - name: Move Wheels - run: mkdir wheels && find _build/out -name 'protobuf*.whl' -exec mv '{}' wheels ';' + run: mkdir wheels && find _build/out \( -name 'protobuf*.whl' -o -name 'protobuf-*.tar.gz' \) -exec mv '{}' wheels ';' - uses: actions/upload-artifact@v3 with: name: python-wheels @@ -50,20 +54,25 @@ jobs: # 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 } + - { os: ubuntu-18-large, python-version: "3.7", architecture: x64, type: 'binary' } + - { os: macos-11, python-version: "3.7", architecture: x64, type: 'binary' } + - { os: ubuntu-20-large, python-version: "3.10", architecture: x64, type: 'binary' } + - { os: macos-12, python-version: "3.10", architecture: x64, type: 'binary' } + - { os: ubuntu-18-large, python-version: "3.7", architecture: x64, type: 'source' } + - { os: macos-11, python-version: "3.7", architecture: x64, type: 'source' } + - { os: ubuntu-20-large, python-version: "3.10", architecture: x64, type: 'source' } + - { os: macos-12, python-version: "3.10", architecture: x64, type: 'source' } + # 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 } + - { os: windows-2019-large, python-version: "3.7", architecture: x86, type: 'binary' } + - { os: windows-2019-large, python-version: "3.8", architecture: x86, type: 'binary' } + - { os: windows-2019-large, python-version: "3.9", architecture: x86, type: 'binary' } + - { os: windows-2019-large, python-version: "3.10", architecture: x86, type: 'binary' } + - { os: windows-2019-large, python-version: "3.7", architecture: x64, type: 'binary' } + - { os: windows-2019-large, python-version: "3.8", architecture: x64, type: 'binary' } + - { os: windows-2019-large, python-version: "3.9", architecture: x64, type: 'binary' } + - { os: windows-2019-large, python-version: "3.10", architecture: x64, type: 'binary' } runs-on: ${{ matrix.os }} defaults: run: @@ -89,11 +98,23 @@ jobs: 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: Install numpy + run: pip install numpy + - name: Install Protobuf Binary Wheel + run: pip install -vvv --no-index --find-links wheels protobuf + if: ${{ matrix.type == 'binary' }} + - name: Install Protobuf Source Wheel + run: | + cd wheels + tar -xzvf *.tar.gz + cd protobuf-*/ + pip install . + if: ${{ matrix.type == 'source' }} - 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: Install Protobuf Test Wheel + run: pip install -vvv --no-index --find-links wheels protobuftests - 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') @@ -108,7 +129,7 @@ jobs: fail-fast: false # Don't cancel all jobs if one fails. matrix: python-version: ["3.7", "3.10"] - runs-on: ubuntu-latest + runs-on: ubuntu-large steps: - name: Download Wheels @@ -127,6 +148,8 @@ jobs: python -m venv env source env/bin/activate echo "VIRTUAL ENV:" $VIRTUAL_ENV + - name: Install numpy + run: pip install numpy - name: Install Protobuf Wheels run: pip install -vvv --no-index --find-links wheels protobuf protobuftests - name: Run the unit tests diff --git a/third_party/upb/BUILD b/third_party/upb/BUILD index 95701d1d2f9..79844a80f5e 100644 --- a/third_party/upb/BUILD +++ b/third_party/upb/BUILD @@ -27,21 +27,33 @@ load( "//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", - "make_shell_script", ) load( "//bazel:upb_proto_library.bzl", - "upb_fasttable_enabled", "upb_proto_library", "upb_proto_library_copts", "upb_proto_reflection_library", ) +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load( + "//upbc:bootstrap_compiler.bzl", + "bootstrap_cc_library", + "bootstrap_upb_proto_library", +) + +# begin:google_only +# load( +# "//third_party/bazel_rules/rules_kotlin/kotlin/native:native_interop_hint.bzl", +# "kt_native_interop_hint", +# ) +# end:google_only # begin:github_only load( - "//bazel:build_defs.bzl", + "//bazel:amalgamation.bzl", "upb_amalgamation", ) +load("@rules_pkg//:mappings.bzl", "pkg_files") # end:github_only licenses(["notice"]) @@ -62,7 +74,7 @@ config_setting( visibility = ["//visibility:public"], ) -upb_fasttable_enabled( +bool_flag( name = "fasttable_enabled", build_setting_default = False, visibility = ["//visibility:public"], @@ -71,6 +83,7 @@ upb_fasttable_enabled( config_setting( name = "fasttable_enabled_setting", flag_values = {"//:fasttable_enabled": "true"}, + visibility = ["//visibility:public"], ) upb_proto_library_copts( @@ -79,6 +92,8 @@ upb_proto_library_copts( visibility = ["//visibility:public"], ) +# Please update copy.bara.sky target = ":friends" if +# you make changes to this list. package_group( name = "friends", packages = [], @@ -89,151 +104,193 @@ package_group( cc_library( name = "port", hdrs = [ - "upb/internal/vsnprintf_compat.h", + "upb/port/vsnprintf_compat.h", ], copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "upb/port_def.inc", - "upb/port_undef.inc", + "upb/port/def.inc", + "upb/port/undef.inc", ], visibility = ["//:__subpackages__"], ) cc_library( name = "upb", - srcs = [ - "upb/arena.c", - "upb/decode.c", - "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/upb.c", - ], hdrs = [ + "upb/alloc.h", "upb/arena.h", + "upb/array.h", + "upb/base/descriptor_constants.h", + "upb/base/status.h", + "upb/base/string_view.h", + "upb/collections/array.h", "upb/decode.h", "upb/encode.h", "upb/extension_registry.h", + "upb/map.h", + "upb/mem/alloc.h", + "upb/mem/arena.h", + "upb/message/extension_internal.h", + "upb/message/message.h", + "upb/mini_table/extension_registry.h", "upb/msg.h", "upb/status.h", + "upb/string_view.h", "upb/upb.h", "upb/upb.hpp", + "upb/wire/decode.h", + "upb/wire/encode.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - ":extension_registry", + ":base", + ":collections_internal", ":fastdecode", + ":hash", + ":lex", + ":mem", + ":message_internal", + ":mini_table_internal", ":port", - "//third_party/utf8_range", + ":wire", ], ) cc_library( - name = "extension_registry", + name = "base", srcs = [ - "upb/extension_registry.c", - "upb/msg.h", - "upb/msg_internal.h", - "upb/upb.h", + "upb/base/status.c", ], hdrs = [ - "upb/extension_registry.h", + "upb/base/descriptor_constants.h", + "upb/base/log2.h", + "upb/base/status.h", + "upb/base/string_view.h", ], copts = UPB_DEFAULT_COPTS, - visibility = ["//visibility:public"], - deps = [ - ":port", - ":table", - ], + visibility = ["//:__subpackages__"], + deps = [":port"], ) cc_library( - name = "mini_descriptor", - srcs = [ - "upb/mini_descriptor.c", - ], + name = "mini_table", hdrs = [ - "upb/mini_descriptor.h", + "upb/mini_table.h", + "upb/mini_table/decode.h", + "upb/mini_table/extension_registry.h", + "upb/mini_table/types.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - ":descriptor_upb_proto", - ":mini_table", + ":base", + ":mem", + ":mini_table_internal", ":port", - ":reflection", - ":table", - ":upb", ], ) cc_library( name = "mini_table_internal", - hdrs = [ - "upb/msg_internal.h", + srcs = [ + "upb/mini_table/common.c", + "upb/mini_table/decode.c", + "upb/mini_table/encode.c", + "upb/mini_table/extension_registry.c", ], + hdrs = [ + "upb/mini_table/common.h", + "upb/mini_table/common_internal.h", + "upb/mini_table/decode.h", + "upb/mini_table/encode_internal.h", + "upb/mini_table/encode_internal.hpp", + "upb/mini_table/enum_internal.h", + "upb/mini_table/extension_internal.h", + "upb/mini_table/extension_registry.h", + "upb/mini_table/field_internal.h", + "upb/mini_table/file_internal.h", + "upb/mini_table/message_internal.h", + "upb/mini_table/sub_internal.h", + "upb/mini_table/types.h", + ], + visibility = ["//visibility:public"], deps = [ - ":extension_registry", + ":base", + ":hash", + ":mem", ":port", - ":table", - ":upb", ], ) cc_library( - name = "mini_table", - srcs = [ - "upb/mini_table.c", - ], + name = "message", hdrs = [ - "upb/mini_table.h", - "upb/mini_table.hpp", + "upb/message/message.h", ], 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", + ":mem", + ":message_internal", ":mini_table", + ":port", + ], +) + +cc_library( + name = "message_internal", + srcs = [ + "upb/message/message.c", + ], + hdrs = [ + "upb/message/extension_internal.h", + "upb/message/internal.h", + "upb/message/message.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":base", + ":hash", + ":mem", + ":mini_table_internal", + ":port", + ], +) + +cc_library( + name = "message_accessors", + srcs = [ + "upb/message/accessors.c", + ], + hdrs = [ + "upb/message/accessors.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":collections_internal", + ":eps_copy_input_stream", + ":hash", + ":message_internal", ":mini_table_internal", ":port", ":upb", + ":wire", + ":wire_reader", ], ) cc_test( - name = "mini_table_test", + name = "mini_table_encode_test", srcs = [ - "upb/internal/table.h", - "upb/mini_table_test.cc", + "upb/mini_table/encode_test.cc", ], deps = [ - ":extension_registry", - ":mini_table", + ":collections_internal", + ":hash", + ":message_internal", ":mini_table_internal", ":port", ":upb", @@ -244,17 +301,16 @@ cc_test( ) cc_test( - name = "mini_table_accessors_test", - srcs = ["upb/mini_table_accessors_test.cc"], + name = "message_accessors_test", + srcs = ["upb/message/accessors_test.cc"], deps = [ ":collections", - ":mini_table", - ":mini_table_accessors", + ":message_accessors", ":mini_table_internal", - ":test_messages_proto2_proto_upb", - ":test_messages_proto3_proto_upb", - ":test_upb_proto", ":upb", + "//upb/test:test_messages_proto2_upb_proto", + "//upb/test:test_messages_proto3_upb_proto", + "//upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", @@ -263,21 +319,16 @@ cc_test( cc_library( name = "fastdecode", - srcs = [ - "upb/decode.h", - "upb/decode_fast.c", - "upb/decode_fast.h", - "upb/internal/decode.h", - "upb/internal/upb.h", - "upb/msg.h", - "upb/msg_internal.h", - ], copts = UPB_DEFAULT_COPTS, deps = [ - ":extension_registry", + ":base", + ":collections_internal", + ":hash", + ":mem_internal", + ":message_internal", + ":mini_table_internal", ":port", - ":table", - "//third_party/utf8_range", + ":wire", ], ) @@ -290,19 +341,67 @@ cc_library( cc_library( name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", hdrs = [ - "upb/decode.h", - "upb/decode_fast.h", - "upb/encode.h", + "upb/collections/array.h", + "upb/collections/array_internal.h", + "upb/collections/map_gencode_util.h", + "upb/collections/message_value.h", "upb/extension_registry.h", - "upb/msg.h", - "upb/msg_internal.h", - "upb/port_def.inc", - "upb/port_undef.inc", + "upb/message/accessors.h", + "upb/message/extension_internal.h", + "upb/message/internal.h", + "upb/message/message.h", + "upb/mini_table/common.h", + "upb/mini_table/enum_internal.h", + "upb/mini_table/extension_internal.h", + "upb/mini_table/field_internal.h", + "upb/mini_table/file_internal.h", + "upb/mini_table/message_internal.h", + "upb/mini_table/sub_internal.h", + "upb/mini_table/types.h", + "upb/port/def.inc", + "upb/port/undef.inc", + "upb/wire/decode.h", + "upb/wire/decode_fast.h", + "upb/wire/encode.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - ":table", + ":base", + ":collections_internal", + ":hash", + ":upb", + ], +) + +# Common support code for C++ generated code. +cc_library( + name = "generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + hdrs = [ + "upb/message/extension_internal.h", + "upb/message/internal.h", + "upb/message/message.h", + "upb/mini_table/enum_internal.h", + "upb/mini_table/extension_internal.h", + "upb/mini_table/field_internal.h", + "upb/mini_table/file_internal.h", + "upb/mini_table/message_internal.h", + "upb/mini_table/sub_internal.h", + "upb/mini_table/types.h", + "upb/port/def.inc", + "upb/port/undef.inc", + "upb/upb.hpp", + "upb/wire/decode.h", + "upb/wire/decode_fast.h", + "upb/wire/encode.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":base", + ":collections_internal", + ":hash", + ":mini_table", ":upb", ], ) @@ -310,23 +409,32 @@ cc_library( cc_library( name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", hdrs = [ - "upb/def.h", - "upb/port_def.inc", - "upb/port_undef.inc", + "upb/port/def.inc", + "upb/port/undef.inc", + "upb/reflection/def.h", + "upb/reflection/def_pool_internal.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ + ":base", ":descriptor_upb_proto", - ":reflection", - ":table", + ":hash", + ":mini_table_internal", + ":reflection_internal", ], ) -upb_proto_library( +bootstrap_upb_proto_library( name = "descriptor_upb_proto", + base_dir = "upb/reflection/", + google3_src_files = ["net/proto2/proto/descriptor.proto"], + google3_src_rules = ["//net/proto2/proto:descriptor_proto_source"], + oss_src_files = ["google/protobuf/descriptor.proto"], + oss_src_rules = ["@com_google_protobuf//:descriptor_proto_srcs"], + oss_strip_prefix = "third_party/protobuf/github/bootstrap/src", + proto_lib_deps = ["@com_google_protobuf//:descriptor_proto"], visibility = ["//visibility:public"], - deps = ["@com_google_protobuf//:descriptor_proto"], ) upb_proto_reflection_library( @@ -337,48 +445,135 @@ upb_proto_reflection_library( 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", + "upb/collections/array.h", + "upb/collections/map.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - ":descriptor_upb_proto", - ":mini_table", + ":base", + ":collections_internal", + ":mem", ":port", - ":table", - ":upb", ], ) cc_library( - name = "reflection", + name = "collections_internal", srcs = [ - "upb/def.c", - "upb/msg.h", - "upb/reflection.c", + "upb/collections/array.c", + "upb/collections/map.c", + "upb/collections/map_sorter.c", ], + hdrs = [ + "upb/collections/array.h", + "upb/collections/array_internal.h", + "upb/collections/map.h", + "upb/collections/map_gencode_util.h", + "upb/collections/map_internal.h", + "upb/collections/map_sorter_internal.h", + "upb/collections/message_value.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//:__subpackages__"], + deps = [ + ":base", + ":hash", + ":mem", + ":message_internal", + ":mini_table_internal", + ":port", + ], +) + +# TODO(b/232091617): Once we can delete the deprecated forwarding headers +# (= everything in upb/) we can move this build target down into reflection/ +bootstrap_cc_library( + name = "reflection", hdrs = [ "upb/def.h", "upb/def.hpp", "upb/reflection.h", "upb/reflection.hpp", + "upb/reflection/def.h", + "upb/reflection/def.hpp", + "upb/reflection/message.h", + "upb/reflection/message.hpp", ], + bootstrap_deps = [":reflection_internal"], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ ":collections", - ":descriptor_upb_proto", - ":mini_table", ":port", - ":table", + ":upb", + ], +) + +bootstrap_cc_library( + name = "reflection_internal", + srcs = [ + "upb/reflection/def_builder.c", + "upb/reflection/def_pool.c", + "upb/reflection/def_type.c", + "upb/reflection/desc_state.c", + "upb/reflection/enum_def.c", + "upb/reflection/enum_reserved_range.c", + "upb/reflection/enum_value_def.c", + "upb/reflection/extension_range.c", + "upb/reflection/field_def.c", + "upb/reflection/file_def.c", + "upb/reflection/message.c", + "upb/reflection/message_def.c", + "upb/reflection/message_reserved_range.c", + "upb/reflection/method_def.c", + "upb/reflection/oneof_def.c", + "upb/reflection/service_def.c", + ], + hdrs = [ + "upb/reflection/common.h", + "upb/reflection/def.h", + "upb/reflection/def.hpp", + "upb/reflection/def_builder_internal.h", + "upb/reflection/def_pool.h", + "upb/reflection/def_pool_internal.h", + "upb/reflection/def_type.h", + "upb/reflection/desc_state_internal.h", + "upb/reflection/enum_def.h", + "upb/reflection/enum_def_internal.h", + "upb/reflection/enum_reserved_range.h", + "upb/reflection/enum_reserved_range_internal.h", + "upb/reflection/enum_value_def.h", + "upb/reflection/enum_value_def_internal.h", + "upb/reflection/extension_range.h", + "upb/reflection/extension_range_internal.h", + "upb/reflection/field_def.h", + "upb/reflection/field_def_internal.h", + "upb/reflection/file_def.h", + "upb/reflection/file_def_internal.h", + "upb/reflection/message.h", + "upb/reflection/message.hpp", + "upb/reflection/message_def.h", + "upb/reflection/message_def_internal.h", + "upb/reflection/message_reserved_range.h", + "upb/reflection/message_reserved_range_internal.h", + "upb/reflection/method_def.h", + "upb/reflection/method_def_internal.h", + "upb/reflection/oneof_def.h", + "upb/reflection/oneof_def_internal.h", + "upb/reflection/service_def.h", + "upb/reflection/service_def_internal.h", + ], + bootstrap_deps = [":descriptor_upb_proto"], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":collections", + ":hash", + ":message_accessors", + ":mini_table_internal", + ":port", ":upb", ], ) @@ -386,35 +581,45 @@ cc_library( cc_library( name = "textformat", srcs = [ - "upb/internal/upb.h", - "upb/text_encode.c", + "upb/text/encode.c", ], hdrs = [ + "upb/text/encode.h", "upb/text_encode.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ + ":collections_internal", + ":eps_copy_input_stream", + ":lex", ":port", ":reflection", - ":table", + ":wire", + ":wire_reader", + ":wire_types", ], ) +# TODO(b/232091617): Once we can delete the deprecated forwarding headers +# (= everything in upb/) we can move this build target down into json/ cc_library( name = "json", srcs = [ - "upb/internal/upb.h", - "upb/json_decode.c", - "upb/json_encode.c", + "upb/json/decode.c", + "upb/json/encode.c", ], hdrs = [ + "upb/json/decode.h", + "upb/json/encode.h", "upb/json_decode.h", "upb/json_encode.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ + ":collections", + ":lex", ":port", ":reflection", ":upb", @@ -424,58 +629,33 @@ cc_library( # Tests ######################################################################## cc_test( - name = "test_generated_code", - srcs = ["upb/test_generated_code.cc"], + name = "def_builder_test", + srcs = [ + "upb/reflection/common.h", + "upb/reflection/def_builder_internal.h", + "upb/reflection/def_builder_test.cc", + "upb/reflection/def_type.h", + ], + # TODO(b/259158612): fix this test on Windows. + target_compatible_with = select({ + "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], + "//conditions:default": [], + }), deps = [ - ":empty_upbdefs_proto", + ":descriptor_upb_proto", + ":hash", ":port", - ":test_messages_proto2_proto_upb", - ":test_messages_proto3_proto_upb", - ":test_upb_proto", + ":reflection", + ":reflection_internal", ":upb", "@com_google_googletest//:gtest_main", ], ) -proto_library( - name = "test_proto", - testonly = 1, - srcs = ["upb/test.proto"], -) - -upb_proto_library( - name = "test_upb_proto", - testonly = 1, - deps = [":test_proto"], -) - -proto_library( - name = "empty_proto", - srcs = ["upb/empty.proto"], -) - -upb_proto_reflection_library( - name = "empty_upbdefs_proto", - testonly = 1, - deps = [":empty_proto"], -) - -upb_proto_library( - name = "test_messages_proto2_proto_upb", - testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto2_proto"], -) - -upb_proto_library( - name = "test_messages_proto3_proto_upb", - testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], -) - proto_library( name = "json_test_proto", testonly = 1, - srcs = ["upb/json_test.proto"], + srcs = ["upb/json/test.proto"], deps = ["@com_google_protobuf//:struct_proto"], ) @@ -492,8 +672,8 @@ upb_proto_reflection_library( ) cc_test( - name = "json_test", - srcs = ["upb/json_test.cc"], + name = "json_decode_test", + srcs = ["upb/json/decode_test.cc"], deps = [ ":json", ":json_test_upb_proto", @@ -506,52 +686,61 @@ cc_test( ) cc_test( - name = "msg_test", - srcs = ["upb/msg_test.cc"], + name = "json_encode_test", + srcs = ["upb/json/encode_test.cc"], deps = [ ":json", - ":msg_test_upb_proto", - ":msg_test_upb_proto_reflection", + ":json_test_upb_proto", + ":json_test_upb_proto_reflection", ":reflection", - ":test_messages_proto3_proto_upb", + ":struct_upb_proto", ":upb", "@com_google_googletest//:gtest_main", ], ) -proto_library( - name = "msg_test_proto", - testonly = 1, - srcs = ["upb/msg_test.proto"], - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], +cc_test( + name = "collections_test", + srcs = ["upb/collections/test.cc"], + deps = [ + ":collections", + ":upb", + "@com_google_googletest//:gtest_main", + ], ) -upb_proto_library( - name = "msg_test_upb_proto", - testonly = 1, - deps = [":msg_test_proto"], -) - -upb_proto_reflection_library( - name = "msg_test_upb_proto_reflection", - testonly = 1, - deps = [":msg_test_proto"], +cc_test( + name = "message_test", + srcs = ["upb/message/test.cc"], + deps = [ + ":json", + ":message_test_upb_proto", + ":message_test_upb_proto_reflection", + ":reflection", + ":upb", + "//upb/test:fuzz_util", + "//upb/test:test_messages_proto3_upb_proto", + "@com_google_googletest//:gtest_main", + ], ) proto_library( - name = "test_cpp_proto", - srcs = ["upb/test_cpp.proto"], - deps = ["@com_google_protobuf//:timestamp_proto"], + name = "message_test_proto", + testonly = 1, + srcs = ["upb/message/test.proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], ) upb_proto_library( - name = "test_cpp_upb_proto", - deps = ["test_cpp_proto"], + name = "message_test_upb_proto", + testonly = 1, + deps = [":message_test_proto"], ) upb_proto_reflection_library( - name = "test_cpp_upb_proto_reflection", - deps = ["test_cpp_proto"], + name = "message_test_upb_proto_reflection", + testonly = 1, + deps = [":message_test_proto"], ) upb_proto_library( @@ -559,169 +748,190 @@ upb_proto_library( deps = ["@com_google_protobuf//:struct_proto"], ) -upb_proto_library( - name = "timestamp_upb_proto", - deps = ["@com_google_protobuf//:timestamp_proto"], -) - -upb_proto_reflection_library( - name = "timestamp_upb_proto_reflection", - deps = ["@com_google_protobuf//:timestamp_proto"], -) - cc_test( - name = "test_cpp", - srcs = ["upb/test_cpp.cc"], + name = "atoi_test", + srcs = ["upb/lex/atoi_test.cc"], copts = UPB_DEFAULT_CPPOPTS, deps = [ - ":test_cpp_upb_proto", - ":test_cpp_upb_proto_reflection", - ":timestamp_upb_proto", - ":timestamp_upb_proto_reflection", - "//:json", - "//:port", - "//:reflection", - "//:upb", + ":lex", + "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", ], ) cc_test( - name = "test_table", - srcs = ["upb/test_table.cc"], + name = "hash_test", + srcs = ["upb/hash/test.cc"], copts = UPB_DEFAULT_CPPOPTS, deps = [ - "//:port", - "//:table", - "//:upb", + ":hash", + ":port", + ":upb", "@com_google_googletest//:gtest_main", ], ) -upb_proto_library( - name = "conformance_proto_upb", - testonly = 1, - deps = ["@com_google_protobuf//conformance:conformance_proto"], -) - -upb_proto_reflection_library( - name = "conformance_proto_upbdefs", - testonly = 1, - deps = ["@com_google_protobuf//conformance:conformance_proto"], -) - -upb_proto_reflection_library( - name = "test_messages_proto2_upbdefs", - testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto2_proto"], -) - -upb_proto_reflection_library( - name = "test_messages_proto3_upbdefs", - testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], -) - -cc_binary( - name = "conformance_upb", - testonly = 1, - srcs = ["upb/conformance_upb.c"], - copts = UPB_DEFAULT_COPTS, - data = ["upb/conformance_upb_failures.txt"], - deps = [ - ":conformance_proto_upb", - ":conformance_proto_upbdefs", - ":test_messages_proto2_upbdefs", - ":test_messages_proto3_upbdefs", - "//:json", - "//:port", - "//:reflection", - "//:textformat", - "//:upb", - ], -) - -make_shell_script( - name = "gen_test_conformance_upb", - out = "test_conformance_upb.sh", - contents = "external/com_google_protobuf/conformance/conformance_test_runner " + - " --enforce_recommended " + - " --failure_list ./upb/conformance_upb_failures.txt" + - " ./conformance_upb", -) - -sh_test( - name = "test_conformance_upb", - srcs = ["test_conformance_upb.sh"], - data = [ - "upb/conformance_upb_failures.txt", - ":conformance_upb", - "@com_google_protobuf//conformance:conformance_test_runner", - ], - deps = ["@bazel_tools//tools/bash/runfiles"], -) - -cc_binary( - name = "conformance_upb_dynamic_minitable", - testonly = 1, - srcs = ["upb/conformance_upb.c"], - copts = UPB_DEFAULT_COPTS + [ - "-DREBUILD_MINITABLES", - ], - data = ["upb/conformance_upb_failures.txt"], - deps = [ - ":conformance_proto_upb", - ":conformance_proto_upbdefs", - ":test_messages_proto2_upbdefs", - ":test_messages_proto3_upbdefs", - "//:json", - "//:port", - "//:reflection", - "//:textformat", - "//:upb", - ], -) - -make_shell_script( - name = "gen_test_conformance_upb_dynamic_minitable", - out = "test_conformance_upb_dynamic_minitable.sh", - contents = "external/com_google_protobuf/conformance/conformance_test_runner " + - " --enforce_recommended " + - " --failure_list ./upb/conformance_upb_failures.txt" + - " ./conformance_upb_dynamic_minitable", -) - -sh_test( - name = "test_conformance_upb_dynamic_minitable", - srcs = ["test_conformance_upb_dynamic_minitable.sh"], - data = [ - "upb/conformance_upb_failures.txt", - ":conformance_upb_dynamic_minitable", - "@com_google_protobuf//conformance:conformance_test_runner", - ], - deps = ["@bazel_tools//tools/bash/runfiles"], -) - # Internal C/C++ libraries ##################################################### cc_library( - name = "table", + name = "mem", hdrs = [ - "upb/arena.h", - "upb/internal/table.h", - "upb/status.h", - "upb/table_internal.h", - "upb/upb.h", - ], - visibility = [ - "//python:__pkg__", - "//tests:__pkg__", + "upb/mem/alloc.h", + "upb/mem/arena.h", ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//:__subpackages__"], deps = [ + ":mem_internal", ":port", ], ) +cc_library( + name = "mem_internal", + srcs = [ + "upb/mem/alloc.c", + "upb/mem/arena.c", + ], + hdrs = [ + "upb/mem/alloc.h", + "upb/mem/arena.h", + "upb/mem/arena_internal.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//:__subpackages__"], + deps = [":port"], +) + +cc_library( + name = "wire", + hdrs = [ + "upb/wire/decode.h", + "upb/wire/encode.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":mem", + ":message_internal", + ":mini_table_internal", + ":port", + ":wire_internal", + ], +) + +cc_library( + name = "wire_internal", + srcs = [ + "upb/wire/decode.c", + "upb/wire/decode_fast.c", + "upb/wire/encode.c", + ], + hdrs = [ + "upb/wire/common_internal.h", + "upb/wire/decode.h", + "upb/wire/decode_fast.h", + "upb/wire/decode_internal.h", + "upb/wire/encode.h", + "upb/wire/swap_internal.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//:__subpackages__"], + deps = [ + ":base", + ":collections_internal", + ":eps_copy_input_stream", + ":hash", + ":mem_internal", + ":message_internal", + ":mini_table_internal", + ":port", + ":wire_reader", + ":wire_types", + "@utf8_range", + ], +) + +cc_library( + name = "wire_types", + hdrs = ["upb/wire/types.h"], + visibility = ["//visibility:public"], +) + +cc_library( + name = "eps_copy_input_stream", + srcs = ["upb/wire/eps_copy_input_stream.c"], + hdrs = ["upb/wire/eps_copy_input_stream.h"], + visibility = ["//visibility:public"], + deps = [ + ":mem", + ":port", + ], +) + +cc_library( + name = "wire_reader", + srcs = [ + "upb/wire/reader.c", + "upb/wire/swap_internal.h", + ], + hdrs = ["upb/wire/reader.h"], + visibility = ["//visibility:public"], + deps = [ + ":eps_copy_input_stream", + ":port", + ":wire_types", + ], +) + +cc_test( + name = "eps_copy_input_stream_test", + srcs = ["upb/wire/eps_copy_input_stream_test.cc"], + deps = [ + ":eps_copy_input_stream", + ":upb", + "@com_google_googletest//:gtest_main", + ], +) + +cc_library( + name = "hash", + srcs = [ + "upb/hash/common.c", + ], + hdrs = [ + "upb/hash/common.h", + "upb/hash/int_table.h", + "upb/hash/str_table.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//:__subpackages__"], + deps = [ + ":base", + ":mem", + ":port", + ], +) + +cc_library( + name = "lex", + srcs = [ + "upb/lex/atoi.c", + "upb/lex/round_trip.c", + "upb/lex/strtod.c", + "upb/lex/unicode.c", + ], + hdrs = [ + "upb/lex/atoi.h", + "upb/lex/round_trip.h", + "upb/lex/strtod.h", + "upb/lex/unicode.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//:__subpackages__"], + deps = [":port"], +) + # Amalgamation ################################################################# # begin:github_only @@ -733,15 +943,26 @@ upb_amalgamation( "upb.h", ], libs = [ - ":collections", + ":base", + ":collections_internal", ":descriptor_upb_proto", - ":extension_registry", + ":eps_copy_input_stream", ":fastdecode", - ":mini_table", + ":hash", + ":lex", + ":mem_internal", + ":mini_table_internal", + ":message_accessors", + ":message_internal", ":port", ":reflection", + ":reflection_internal", ":upb", + ":wire_internal", + ":wire_reader", + ":wire_types", ], + strip_import_prefix = ["src"], ) cc_library( @@ -749,7 +970,7 @@ cc_library( srcs = ["upb.c"], hdrs = ["upb.h"], copts = UPB_DEFAULT_COPTS, - deps = ["//third_party/utf8_range"], + deps = ["@utf8_range"], ) upb_amalgamation( @@ -759,18 +980,30 @@ upb_amalgamation( "php-upb.h", ], libs = [ - ":collections", + ":base", + ":collections_internal", ":descriptor_upb_proto", ":descriptor_upb_proto_reflection", - ":extension_registry", + ":eps_copy_input_stream", ":fastdecode", + ":hash", ":json", - ":mini_table", + ":lex", + ":mem_internal", + ":message_accessors", + ":message_internal", + ":mini_table_internal", ":port", ":reflection", + ":reflection_internal", ":upb", + ":wire_internal", + ":wire_reader", + ":wire_types", ], prefix = "php-", + strip_import_prefix = ["src"], + visibility = ["@com_google_protobuf//php:__subpackages__"], ) cc_library( @@ -778,7 +1011,7 @@ cc_library( srcs = ["php-upb.c"], hdrs = ["php-upb.h"], copts = UPB_DEFAULT_COPTS, - deps = ["//third_party/utf8_range"], + deps = ["@utf8_range"], ) upb_amalgamation( @@ -788,17 +1021,29 @@ upb_amalgamation( "ruby-upb.h", ], libs = [ - ":collections", + ":base", + ":collections_internal", ":descriptor_upb_proto", - ":extension_registry", + ":eps_copy_input_stream", ":fastdecode", + ":hash", ":json", - ":mini_table", + ":lex", + ":mem_internal", + ":message_accessors", + ":message_internal", + ":mini_table_internal", ":port", ":reflection", + ":reflection_internal", ":upb", + ":wire_internal", + ":wire_reader", + ":wire_types", ], prefix = "ruby-", + strip_import_prefix = ["src"], + visibility = ["@com_google_protobuf//ruby:__subpackages__"], ) cc_library( @@ -806,7 +1051,7 @@ cc_library( srcs = ["ruby-upb.c"], hdrs = ["ruby-upb.h"], copts = UPB_DEFAULT_COPTS, - deps = ["//third_party/utf8_range"], + deps = ["@utf8_range"], ) exports_files( @@ -814,19 +1059,34 @@ exports_files( "third_party/lunit/console.lua", "third_party/lunit/lunit.lua", ], - visibility = ["//upb/bindings/lua:__pkg__"], + visibility = ["//lua:__pkg__"], ) filegroup( name = "cmake_files", srcs = glob([ - "upbc/**/*", "upb/**/*", "third_party/**/*", ]), visibility = ["//cmake:__pkg__"], ) + +pkg_files( + name = "upb_source_files", + srcs = glob( + [ + "upb/**/*.c", + "upb/**/*.h", + "upb/**/*.hpp", + "upb/**/*.inc", + ], + exclude = ["upb/**/conformance_upb.c"], + ), + strip_prefix = "", + visibility = ["//python/dist:__pkg__"], +) + # end:github_only # begin:google_only @@ -837,7 +1097,24 @@ filegroup( # main = "update_check_runs.py", # deps = [ # "//third_party/py/absl:app", +# "//third_party/py/absl/flags", # ], # ) # +# kt_native_interop_hint( +# name = "upb_kotlin_native_hint", +# compatible_with = ["//buildenv/target:non_prod"], +# headers_to_exclude = glob([ +# "**/*.hpp", +# ]), +# no_string_conversion = ["upb_MiniTable_Build"], +# strict_enums = ["upb_FieldType"], +# ) +# +# kt_native_interop_hint( +# name = "suppress_kotlin_interop", +# compatible_with = ["//buildenv/target:non_prod"], +# suppressed = True, +# ) +# # end:google_only diff --git a/third_party/upb/DESIGN.md b/third_party/upb/DESIGN.md index aa6a2882809..41a2097e7f3 100644 --- a/third_party/upb/DESIGN.md +++ b/third_party/upb/DESIGN.md @@ -123,7 +123,7 @@ static const upb_msglayout_field upb_test_MessageName__fields[2] = { {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR}, }; -const upb_msglayout upb_test_MessageName_msginit = { +const upb_msglayout upb_test_MessageName_msg_init = { NULL, &upb_test_MessageName__fields[0], UPB_SIZE(16, 16), 2, false, 2, 255, diff --git a/third_party/upb/README.md b/third_party/upb/README.md index 9b74b969ce7..dcba8f6e116 100644 --- a/third_party/upb/README.md +++ b/third_party/upb/README.md @@ -7,8 +7,8 @@ in C. upb is the core runtime for protobuf languages extensions in [Ruby](https://github.com/protocolbuffers/protobuf/tree/master/ruby), -[PHP](https://github.com/protocolbuffers/protobuf/tree/master/php), and (soon) -Python. +[PHP](https://github.com/protocolbuffers/protobuf/tree/master/php), and +[Python](https://github.com/protocolbuffers/upb/tree/main/python). While upb offers a C API, the C API & ABI **are not stable**. For this reason, upb is not generally offered as a C library for direct consumption, and there @@ -57,6 +57,12 @@ For PHP, use [PECL](https://pecl.php.net/package/protobuf): $ sudo pecl install protobuf ``` +For Python, use [PyPI](https://pypi.org/project/protobuf/): + +``` +$ sudo pip install protobuf +``` + Alternatively, you can build and install upb using [vcpkg](https://github.com/microsoft/vcpkg/) dependency manager: diff --git a/third_party/upb/WORKSPACE b/third_party/upb/WORKSPACE index 2748b3285f6..c14b710ee8e 100644 --- a/third_party/upb/WORKSPACE +++ b/third_party/upb/WORKSPACE @@ -4,11 +4,13 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("//bazel:workspace_deps.bzl", "upb_deps") upb_deps() -register_toolchains("@system_python//:python_toolchain") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() +load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps") +utf8_range_deps() + http_archive( name = "lua", build_file = "//bazel:lua.BUILD", @@ -21,10 +23,13 @@ http_archive( ) http_archive( - name = "com_google_googletest", - urls = ["https://github.com/google/googletest/archive/b6cd405286ed8635ece71c72f118e659f4ade3fb.zip"], # 2019-01-07 - strip_prefix = "googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb", - sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86", + name = "com_google_googletest", + sha256 = "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2", + strip_prefix = "googletest-release-1.12.1", + urls = [ + "https://mirror.bazel.build/github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz", + "https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz", + ], ) http_archive( @@ -44,9 +49,18 @@ http_archive( http_archive( name = "rules_fuzzing", - sha256 = "23bb074064c6f488d12044934ab1b0631e8e6898d5cf2f6bde087adb01111573", - strip_prefix = "rules_fuzzing-0.3.1", - urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.1.zip"], + sha256 = "d9002dd3cd6437017f08593124fdd1b13b3473c7b929ceb0e60d317cb9346118", + strip_prefix = "rules_fuzzing-0.3.2", + urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.2.zip"], +) + +http_archive( + name = "com_google_absl", + sha256 = "e7fdfe0bed87702a22c5b73b6b5fe08bedd25f17d617e52df6061b0f47d480b0", + strip_prefix = "abseil-cpp-e6044634dd7caec2d79a13aecc9e765023768757", + urls = [ + "https://github.com/abseil/abseil-cpp/archive/e6044634dd7caec2d79a13aecc9e765023768757.tar.gz" + ], ) load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") @@ -56,3 +70,32 @@ rules_fuzzing_dependencies() load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init") rules_fuzzing_init() + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + +load("//bazel:system_python.bzl", "system_python") +system_python( + name = "system_python", + minimum_python_version = "3.7", +) + +load("@system_python//:register.bzl", "register_system_python") +register_system_python() + +load("@system_python//:pip.bzl", "pip_parse") + +pip_parse( + name="pip_deps", + requirements = "//python:requirements.txt", + requirements_overrides = { + "3.11": "//python:requirements_311.txt", + }, +) + +load("@pip_deps//:requirements.bzl", "install_deps") +install_deps() + +load("@system_python//:fuzzing_py.bzl", "fuzzing_py_install_deps") +fuzzing_py_install_deps() diff --git a/third_party/upb/bazel/BUILD b/third_party/upb/bazel/BUILD index 148f4a0bee3..3fc1d98b4c5 100644 --- a/third_party/upb/bazel/BUILD +++ b/third_party/upb/bazel/BUILD @@ -27,6 +27,11 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) +exports_files( + ["workspace_deps.bzl"], + visibility = ["//cmake:__pkg__"], +) + py_binary( name = "amalgamate", srcs = ["amalgamate.py"], diff --git a/third_party/upb/bazel/amalgamate.py b/third_party/upb/bazel/amalgamate.py index 70399085ca7..d15ea57cf2b 100755 --- a/third_party/upb/bazel/amalgamate.py +++ b/third_party/upb/bazel/amalgamate.py @@ -36,42 +36,36 @@ def parse_include(line): return match.groups()[0] if match else None class Amalgamator: - def __init__(self, output_path, prefix): + def __init__(self, h_out, c_out): self.include_paths = ["."] - self.included = set(["upb/port_def.inc", "upb/port_undef.inc"]) - self.output_h = open(output_path + prefix + "upb.h", "w") - self.output_c = open(output_path + prefix + "upb.c", "w") + self.included = set() + self.output_h = open(h_out, "w") + self.output_c = open(c_out, "w") + self.h_out = h_out.split("/")[-1] + def amalgamate(self, h_files, c_files): + self.h_files = set(h_files) self.output_c.write("/* Amalgamated source file */\n") - self.output_c.write('#include "%supb.h"\n' % (prefix)) - if prefix == "ruby-": + self.output_c.write('#include "%s"\n' % (self.h_out)) + if self.h_out == "ruby-upb.h": self.output_h.write("// Ruby is still using proto3 enum semantics for proto2\n") self.output_h.write("#define UPB_DISABLE_PROTO2_ENUM_CHECKING\n") - self.output_c.write(open("upb/port_def.inc").read()) self.output_h.write("/* Amalgamated source file */\n") - self.output_h.write(open("upb/port_def.inc").read()) - def add_include_path(self, path): - self.include_paths.append(path) + port_def = self._find_include_file("upb/port/def.inc") + port_undef = self._find_include_file("upb/port/undef.inc") + self._process_file(port_def, self.output_h) + self._process_file(port_def, self.output_c) - def finish(self): - self._add_header("upb/port_undef.inc") - self.add_src("upb/port_undef.inc") + for file in c_files: + self._process_file(file, self.output_c) + + self._process_file(port_undef, self.output_h) + self._process_file(port_undef, self.output_c) def _process_file(self, infile_name, outfile): - file = None - for path in self.include_paths: - try: - full_path = os.path.join(path, infile_name) - file = open(full_path) - break - except IOError: - pass - if not file: - raise RuntimeError("Couldn't open file " + infile_name) - - lines = file.readlines() + lines = open(infile_name).readlines() has_copyright = lines[1].startswith(" * Copyright") if has_copyright: @@ -79,51 +73,52 @@ class Amalgamator: lines.pop(0) lines.pop(0) - lines.insert(0, "\n/** " + infile_name + " " + ("*" * 60) +"/"); - for line in lines: - if not self._process_include(line, outfile): + if not self._process_include(line): outfile.write(line) - def _process_include(self, line, outfile): + def _find_include_file(self, name): + for h_file in self.h_files: + if h_file.endswith(name): + return h_file + + def _process_include(self, line): include = parse_include(line) if not include: return False if not (include.startswith("upb") or include.startswith("google")): return False + if include and (include.endswith("port/def.inc") or include.endswith("port/undef.inc")): + # Skip, we handle this separately + return True if include.endswith("hpp"): # Skip, we don't support the amalgamation from C++. return True + elif include in self.included: + return True else: # Include this upb header inline. - if include not in self.included: + h_file = self._find_include_file(include) + if h_file: + self.h_files.remove(h_file) self.included.add(include) - self._add_header(include) - return True - - def _add_header(self, filename): - self._process_file(filename, self.output_h) - - def add_src(self, filename): - self._process_file(filename, self.output_c) + self._process_file(h_file, self.output_h) + return True + raise RuntimeError("Couldn't find include: " + include + ", h_files=" + repr(self.h_files)) # ---- main ---- -output_path = sys.argv[1] -prefix = sys.argv[2] -amalgamator = Amalgamator(output_path, prefix) -files = [] +c_out = sys.argv[1] +h_out = sys.argv[2] +amalgamator = Amalgamator(h_out, c_out) +c_files = [] +h_files = [] for arg in sys.argv[3:]: arg = arg.strip() - if arg.startswith("-I"): - amalgamator.add_include_path(arg[2:]) - elif arg.endswith(".h") or arg.endswith(".inc"): - pass + if arg.endswith(".h") or arg.endswith(".inc"): + h_files.append(arg) else: - files.append(arg) + c_files.append(arg) -for filename in files: - amalgamator.add_src(filename) - -amalgamator.finish() +amalgamator.amalgamate(h_files, c_files) diff --git a/third_party/upb/bazel/amalgamation.bzl b/third_party/upb/bazel/amalgamation.bzl new file mode 100644 index 00000000000..cabbaccd911 --- /dev/null +++ b/third_party/upb/bazel/amalgamation.bzl @@ -0,0 +1,85 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Internal rules for building upb.""" + +load(":upb_proto_library.bzl", "GeneratedSrcsInfo") + +# upb_amalgamation() rule, with file_list aspect. + +SrcList = provider( + fields = { + "srcs": "list of srcs", + }, +) + +def _file_list_aspect_impl(target, ctx): + if GeneratedSrcsInfo in target: + srcs = target[GeneratedSrcsInfo] + return [SrcList(srcs = srcs.srcs + srcs.hdrs)] + + srcs = [] + for src in ctx.rule.attr.srcs: + srcs += src.files.to_list() + for hdr in ctx.rule.attr.hdrs: + srcs += hdr.files.to_list() + for hdr in ctx.rule.attr.textual_hdrs: + srcs += hdr.files.to_list() + return [SrcList(srcs = srcs)] + +_file_list_aspect = aspect( + implementation = _file_list_aspect_impl, +) + +def _upb_amalgamation(ctx): + inputs = [] + for lib in ctx.attr.libs: + inputs += lib[SrcList].srcs + srcs = [src for src in inputs if not src.path.endswith("hpp")] + ctx.actions.run( + inputs = inputs, + outputs = ctx.outputs.outs, + arguments = [f.path for f in ctx.outputs.outs] + [f.path for f in srcs], + progress_message = "Making amalgamation", + executable = ctx.executable._amalgamator, + ) + return [] + +upb_amalgamation = rule( + attrs = { + "_amalgamator": attr.label( + executable = True, + cfg = "exec", + default = "//bazel:amalgamate", + ), + "prefix": attr.string( + default = "", + ), + "libs": attr.label_list(aspects = [_file_list_aspect]), + "outs": attr.output_list(), + "strip_import_prefix": attr.string_list(), + }, + implementation = _upb_amalgamation, +) diff --git a/third_party/upb/bazel/build_defs.bzl b/third_party/upb/bazel/build_defs.bzl index b5bc64f071e..e4212b3c679 100644 --- a/third_party/upb/bazel/build_defs.bzl +++ b/third_party/upb/bazel/build_defs.bzl @@ -25,8 +25,6 @@ """Internal rules for building upb.""" -load(":upb_proto_library.bzl", "GeneratedSrcsInfo") - _DEFAULT_CPPOPTS = [] _DEFAULT_COPTS = [] @@ -35,12 +33,11 @@ _DEFAULT_CPPOPTS.extend([ "-Wextra", # "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang) "-Werror", + "-Wno-unused-parameter", "-Wno-long-long", ]) _DEFAULT_COPTS.extend([ "-std=c99", - "-pedantic", - "-Werror=pedantic", "-Wall", "-Wstrict-prototypes", # GCC (at least) emits spurious warnings for this that cannot be fixed @@ -102,59 +99,3 @@ def make_shell_script(name, contents, out): outs = [out], cmd = "(cat <<'HEREDOC'\n%s\nHEREDOC\n) > $@" % contents, ) - -# upb_amalgamation() rule, with file_list aspect. - -SrcList = provider( - fields = { - "srcs": "list of srcs", - }, -) - -def _file_list_aspect_impl(target, ctx): - if GeneratedSrcsInfo in target: - srcs = target[GeneratedSrcsInfo] - return [SrcList(srcs = srcs.srcs + srcs.hdrs)] - - srcs = [] - for src in ctx.rule.attr.srcs: - srcs += src.files.to_list() - for hdr in ctx.rule.attr.hdrs: - srcs += hdr.files.to_list() - for hdr in ctx.rule.attr.textual_hdrs: - srcs += hdr.files.to_list() - return [SrcList(srcs = srcs)] - -_file_list_aspect = aspect( - implementation = _file_list_aspect_impl, -) - -def _upb_amalgamation(ctx): - inputs = [] - for lib in ctx.attr.libs: - inputs += lib[SrcList].srcs - srcs = [src for src in inputs if src.path.endswith("c")] - ctx.actions.run( - inputs = inputs, - outputs = ctx.outputs.outs, - arguments = [ctx.bin_dir.path + "/", ctx.attr.prefix] + [f.path for f in srcs] + ["-I" + root for root in _get_real_roots(inputs)], - progress_message = "Making amalgamation", - executable = ctx.executable._amalgamator, - ) - return [] - -upb_amalgamation = rule( - attrs = { - "_amalgamator": attr.label( - executable = True, - cfg = "exec", - default = "//bazel:amalgamate", - ), - "prefix": attr.string( - default = "", - ), - "libs": attr.label_list(aspects = [_file_list_aspect]), - "outs": attr.output_list(), - }, - implementation = _upb_amalgamation, -) diff --git a/third_party/upb/bazel/protobuf.patch b/third_party/upb/bazel/protobuf.patch index b942a2ab2bc..f92bde95cad 100644 --- a/third_party/upb/bazel/protobuf.patch +++ b/third_party/upb/bazel/protobuf.patch @@ -1,17 +1,3 @@ ---- 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", -+ ] - ), - imports = ["python"], - srcs_version = "PY2AND3", - --- python/google/protobuf/internal/test_util.py +++ python/google/protobuf/internal/test_util.py @@ -39,6 +39,7 @@ __author__ = 'robinson@google.com (Will Robinson)' @@ -29,7 +15,7 @@ +def _SearchUp(path, filename): + path = pathlib.Path(path).resolve() + for parent in [path] + list(path.parents): -+ file_path = parent / ('src/google/protobuf/testdata/' + filename) ++ file_path = parent / ('google/protobuf/testdata/' + filename) + if file_path.exists(): + # Found it. Load the golden file from the testdata directory. + return file_path.open('rb') @@ -52,3 +38,33 @@ # Search internally. path = '.' + +--- python/internal.bzl ++++ python/internal.bzl +@@ -1,5 +1,11 @@ + # Internal helpers for building the Python protobuf runtime. + ++def _remove_cross_repo_path(path): ++ components = path.split("/") ++ if components[0] == "..": ++ return "/".join(components[2:]) ++ return path ++ + def _internal_copy_files_impl(ctx): + strip_prefix = ctx.attr.strip_prefix + if strip_prefix[-1] != "/": +@@ -7,10 +13,11 @@ def _internal_copy_files_impl(ctx): + + src_dests = [] + for src in ctx.files.srcs: +- if src.short_path[:len(strip_prefix)] != strip_prefix: ++ short_path = _remove_cross_repo_path(src.short_path) ++ if short_path[:len(strip_prefix)] != strip_prefix: + fail("Source does not start with %s: %s" % +- (strip_prefix, src.short_path)) +- dest = ctx.actions.declare_file(src.short_path[len(strip_prefix):]) ++ (strip_prefix, short_path)) ++ dest = ctx.actions.declare_file(short_path[len(strip_prefix):]) + src_dests.append([src, dest]) + + if ctx.attr.is_windows: diff --git a/third_party/upb/bazel/py_proto_library.bzl b/third_party/upb/bazel/py_proto_library.bzl index 72351256cd3..1ce3a6e11b3 100644 --- a/third_party/upb/bazel/py_proto_library.bzl +++ b/third_party/upb/bazel/py_proto_library.bzl @@ -41,6 +41,14 @@ load("@rules_proto//proto:defs.bzl", "ProtoInfo") # Generic support code ######################################################### +# begin:github_only +_is_google3 = False +# end:github_only + +# begin:google_only +# _is_google3 = True +# end:google_only + def _get_real_short_path(file): # For some reason, files from other archives have short paths that look like: # ../com_google_protobuf/google/protobuf/descriptor.proto @@ -58,13 +66,25 @@ def _get_real_short_path(file): short_path = short_path.split(virtual_imports)[1].split("/", 1)[1] return short_path -def _get_real_root(file): +def _get_real_root(ctx, file): real_short_path = _get_real_short_path(file) - return file.path[:-len(real_short_path) - 1] + root = file.path[:-len(real_short_path) - 1] + + if not _is_google3 and ctx.rule.attr.strip_import_prefix: + root = paths.join(root, ctx.rule.attr.strip_import_prefix[1:]) + return root def _generate_output_file(ctx, src, extension): + package = ctx.label.package + if not _is_google3: + strip_import_prefix = ctx.rule.attr.strip_import_prefix + if strip_import_prefix and strip_import_prefix != "/": + if not package.startswith(strip_import_prefix[1:]): + fail("%s does not begin with prefix %s" % (package, strip_import_prefix)) + package = package[len(strip_import_prefix):] + real_short_path = _get_real_short_path(src) - real_short_path = paths.relativize(real_short_path, ctx.label.package) + real_short_path = paths.relativize(real_short_path, package) output_filename = paths.replace_extension(real_short_path, extension) ret = ctx.actions.declare_file(output_filename) return ret @@ -98,7 +118,7 @@ def _py_proto_library_aspect_impl(target, ctx): outputs = srcs, executable = ctx.executable._protoc, arguments = [ - "--python_out=" + _get_real_root(srcs[0]), + "--python_out=" + _get_real_root(ctx, srcs[0]), "--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets]), ] + [_get_real_short_path(file) for file in proto_sources], diff --git a/third_party/upb/bazel/system_python.bzl b/third_party/upb/bazel/system_python.bzl index 7e2dac92b4c..5cb34d5ffdd 100644 --- a/third_party/upb/bazel/system_python.bzl +++ b/third_party/upb/bazel/system_python.bzl @@ -25,7 +25,74 @@ """Repository rule for using Python 3.x headers from the system.""" +# Mock out rules_python's pip.bzl for cases where no system python is found. +_mock_pip = """ +def _pip_install_impl(repository_ctx): + repository_ctx.file("BUILD.bazel", ''' +py_library( + name = "noop", + visibility = ["//visibility:public"], +) +''') + repository_ctx.file("requirements.bzl", ''' +def install_deps(*args, **kwargs): + print("WARNING: could not install pip dependencies") + +def requirement(*args, **kwargs): + return "@{}//:noop" +'''.format(repository_ctx.attr.name)) +pip_install = repository_rule( + implementation = _pip_install_impl, + attrs = { + "requirements": attr.string(), + "requirements_overrides": attr.string_dict(), + "python_interpreter_target": attr.string(), + }, +) +pip_parse = pip_install +""" + +# Alias rules_python's pip.bzl for cases where a system python is found. +_alias_pip = """ +load("@rules_python//python:pip.bzl", _pip_install = "pip_install", _pip_parse = "pip_parse") + +def _get_requirements(requirements, requirements_overrides): + for version, override in requirements_overrides.items(): + if version in "{python_version}": + requirements = override + break + return requirements + +def pip_install(requirements, requirements_overrides={{}}, **kwargs): + _pip_install( + python_interpreter_target = "@{repo}//:interpreter", + requirements = _get_requirements(requirements, requirements_overrides), + **kwargs, + ) +def pip_parse(requirements, requirements_overrides={{}}, **kwargs): + _pip_parse( + python_interpreter_target = "@{repo}//:interpreter", + requirements = _get_requirements(requirements, requirements_overrides), + **kwargs, + ) +""" + +_mock_fuzzing_py = """ +def fuzzing_py_install_deps(): + print("WARNING: could not install fuzzing_py dependencies") +""" + +# Alias rules_fuzzing's requirements.bzl for cases where a system python is found. +_alias_fuzzing_py = """ +load("@fuzzing_py_deps//:requirements.bzl", _fuzzing_py_install_deps = "install_deps") + +def fuzzing_py_install_deps(): + _fuzzing_py_install_deps() +""" + _build_file = """ +load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") cc_library( @@ -35,9 +102,55 @@ cc_library( visibility = ["//visibility:public"], ) +string_flag( + name = "internal_python_support", + build_setting_default = "{support}", + values = [ + "None", + "Supported", + "Unsupported", + ] +) + +config_setting( + name = "none", + flag_values = {{ + ":internal_python_support": "None", + }}, + visibility = ["//visibility:public"], +) + +config_setting( + name = "supported", + flag_values = {{ + ":internal_python_support": "Supported", + }}, + visibility = ["//visibility:public"], +) + +config_setting( + name = "unsupported", + flag_values = {{ + ":internal_python_support": "Unsupported", + }}, + visibility = ["//visibility:public"], +) + +selects.config_setting_group( + name = "exists", + match_any = [":supported", ":unsupported"], + visibility = ["//visibility:public"], +) + +sh_binary( + name = "interpreter", + srcs = ["interpreter"], + visibility = ["//visibility:public"], +) + py_runtime( name = "py3_runtime", - interpreter_path = "{}", + interpreter_path = "{interpreter}", python_version = "PY3", ) @@ -53,40 +166,116 @@ 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() +_register = """ +def register_system_python(): + native.register_toolchains("@{}//:python_toolchain") +""" -def _get_config_var(repository_ctx, name): +_mock_register = """ +def register_system_python(): + pass +""" + +def _get_python_version(repository_ctx): + py_program = "import sys; print(str(sys.version_info.major) + '.' + str(sys.version_info.minor) + '.' + str(sys.version_info.micro))" + result = repository_ctx.execute(["python3", "-c", py_program]) + return (result.stdout).strip().split(".") + +def _get_python_path(repository_ctx): py_program = "import sysconfig; print(sysconfig.get_config_var('%s'), end='')" - result = repository_ctx.execute(["python3", "-c", py_program % (name)]) + result = repository_ctx.execute(["python3", "-c", py_program % ("INCLUDEPY")]) if result.return_code != 0: return None return result.stdout -def _python_headers_impl(repository_ctx): - path = _get_config_var(repository_ctx, "INCLUDEPY") - if not path: +def _populate_package(ctx, path, python3, python_version): + ctx.symlink(path, "python") + supported = True + for idx, v in enumerate(ctx.attr.minimum_python_version.split(".")): + if int(python_version[idx]) < int(v): + supported = False + break + if "win" in ctx.os.name: # 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") + print("WARNING: python is not supported on Windows") + supported = False + + build_file = _build_file.format( + interpreter = python3, + support = "Supported" if supported else "Unsupported", + ) + + ctx.file("interpreter", "exec {} \"$@\"".format(python3)) + ctx.file("BUILD.bazel", build_file) + ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = '{}{}'".format(python_version[0], python_version[1])) + ctx.file("register.bzl", _register.format(ctx.attr.name)) + if supported: + ctx.file("pip.bzl", _alias_pip.format( + python_version = ".".join(python_version), + repo = ctx.attr.name, + )) + ctx.file("fuzzing_py.bzl", _alias_fuzzing_py) + else: + # Dependencies are unlikely to be satisfiable for unsupported versions of python. + ctx.file("pip.bzl", _mock_pip) + ctx.file("fuzzing_py.bzl", _mock_fuzzing_py) + +def _populate_empty_package(ctx): + # Mock out all the entrypoints we need to run from WORKSPACE. Targets that + # actually need python should use `target_compatible_with` and the generated + # @system_python//:exists or @system_python//:supported constraints. + ctx.file( + "BUILD.bazel", + _build_file.format( + interpreter = "", + support = "None", + ), + ) + ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = 'None'") + ctx.file("register.bzl", _mock_register) + ctx.file("pip.bzl", _mock_pip) + ctx.file("fuzzing_py.bzl", _mock_fuzzing_py) + +def _system_python_impl(repository_ctx): + path = _get_python_path(repository_ctx) python3 = repository_ctx.which("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. + if path and python_version[0] == "3": + _populate_package(repository_ctx, path, python3, python_version) + else: + # buildifier: disable=print + print("WARNING: no system python available, builds against system python will fail") + _populate_empty_package(repository_ctx) + +# The system_python() repository rule exposes information from the version of python installed in the current system. # # In WORKSPACE: # system_python( # name = "system_python_repo", +# minimum_python_version = "3.7", # ) # -# This repository exposes a single rule that you can depend on from BUILD: +# This repository exposes some repository rules for configuring python in Bazel. The python toolchain +# *must* be registered in your WORKSPACE: +# load("@system_python_repo//:register.bzl", "register_system_python") +# register_system_python() +# +# Pip dependencies can optionally be specified using a wrapper around rules_python's repository rules: +# load("@system_python//:pip.bzl", "pip_install") +# pip_install( +# name="pip_deps", +# requirements = "@com_google_protobuf//python:requirements.txt", +# ) +# An optional argument `requirements_overrides` takes a dictionary mapping python versions to alternate +# requirements files. This works around the requirement for fully pinned dependencies in python_rules. +# +# Four config settings are exposed from this repository to help declare target compatibility in Bazel. +# For example, `@system_python_repo//:exists` will be true if a system python version has been found. +# The `none` setting will be true only if no python version was found, and `supported`/`unsupported` +# correspond to whether or not the system version is compatible with `minimum_python_version`. +# +# This repository also exposes a header rule that you can depend on from BUILD files: # cc_library( # name = "foobar", # srcs = ["foobar.cc"], @@ -96,6 +285,9 @@ def _python_headers_impl(repository_ctx): # The headers should correspond to the version of python obtained by running # the `python3` command on the system. system_python = repository_rule( - implementation = _python_headers_impl, + implementation = _system_python_impl, local = True, + attrs = { + "minimum_python_version": attr.string(default = "3.7"), + }, ) diff --git a/third_party/upb/bazel/upb_proto_library.bzl b/third_party/upb/bazel/upb_proto_library.bzl index cb9800ca987..b1eb3eb48db 100644 --- a/third_party/upb/bazel/upb_proto_library.bzl +++ b/third_party/upb/bazel/upb_proto_library.bzl @@ -29,8 +29,19 @@ """ load("@bazel_skylib//lib:paths.bzl", "paths") + +# begin:google_only +# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") +# end:google_only + +# begin:github_only +# Compatibility code for Bazel 4.x. Remove this when we drop support for Bazel 4.x. load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +def use_cpp_toolchain(): + return ["@bazel_tools//tools/cpp:toolchain_type"] +# end:github_only + # Generic support code ######################################################### # begin:github_only @@ -58,17 +69,37 @@ def _get_real_short_path(file): short_path = short_path.split(virtual_imports)[1].split("/", 1)[1] return short_path -def _get_real_root(file): +def _get_real_root(ctx, file): real_short_path = _get_real_short_path(file) - return file.path[:-len(real_short_path) - 1] + root = file.path[:-len(real_short_path) - 1] + + if not _is_google3 and ctx.rule.attr.strip_import_prefix: + root = paths.join(root, ctx.rule.attr.strip_import_prefix[1:]) + return root def _generate_output_file(ctx, src, extension): + package = ctx.label.package + if not _is_google3: + strip_import_prefix = ctx.rule.attr.strip_import_prefix + if strip_import_prefix and strip_import_prefix != "/": + if not package.startswith(strip_import_prefix[1:]): + fail("%s does not begin with prefix %s" % (package, strip_import_prefix)) + package = package[len(strip_import_prefix):] + real_short_path = _get_real_short_path(src) - real_short_path = paths.relativize(real_short_path, ctx.label.package) + real_short_path = paths.relativize(real_short_path, package) output_filename = paths.replace_extension(real_short_path, extension) ret = ctx.actions.declare_file(output_filename) return ret +def _generate_include_path(src, out, extension): + short_path = _get_real_short_path(src) + short_path = paths.replace_extension(short_path, extension) + if not out.path.endswith(short_path): + fail("%s does not end with %s" % (out.path, short_path)) + + return out.path[:-len(short_path)] + def _filter_none(elems): out = [] for elem in elems: @@ -76,7 +107,7 @@ def _filter_none(elems): out.append(elem) return out -def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): +def _cc_library_func(ctx, name, hdrs, srcs, copts, includes, dep_ccinfos): """Like cc_library(), but callable from rules. Args: @@ -84,6 +115,8 @@ def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): name: Unique name used to generate output files. hdrs: Public headers that can be #included from other rules. srcs: C/C++ source files. + copts: Additional options for cc compilation. + includes: Additional include paths. dep_ccinfos: CcInfo providers of dependencies we should build/link against. Returns: @@ -111,11 +144,14 @@ def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): cc_toolchain = toolchain, name = name, srcs = srcs, + includes = includes, public_hdrs = hdrs, user_compile_flags = copts, compilation_contexts = compilation_contexts, **blaze_only_args ) + + # buildifier: disable=unused-variable (linking_context, linking_outputs) = cc_common.create_linking_context_from_compilation_outputs( actions = ctx.actions, name = name, @@ -123,6 +159,7 @@ def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): cc_toolchain = toolchain, compilation_outputs = compilation_outputs, linking_contexts = linking_contexts, + disallow_dynamic_library = cc_common.is_enabled(feature_configuration = feature_configuration, feature_name = "targets_windows"), **blaze_only_args ) @@ -131,38 +168,17 @@ def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): linking_context = linking_context, ) -# Build setting for whether fasttable code generation is enabled ############### - -_FastTableEnabled = provider( - fields = { - "enabled": "whether fasttable is enabled", - }, -) - -def fasttable_enabled_impl(ctx): - raw_setting = ctx.build_setting_value - - if raw_setting: - # TODO(haberman): check that the target CPU supports fasttable. - pass - - return _FastTableEnabled(enabled = raw_setting) - -upb_fasttable_enabled = rule( - implementation = fasttable_enabled_impl, - build_setting = config.bool(flag = True), -) - # Dummy rule to expose select() copts to aspects ############################## -_UpbProtoLibraryCopts = provider( +UpbProtoLibraryCoptsInfo = provider( + "Provides copts for upb proto targets", fields = { "copts": "copts for upb_proto_library()", }, ) def upb_proto_library_copts_impl(ctx): - return _UpbProtoLibraryCopts(copts = ctx.attr.copts) + return UpbProtoLibraryCoptsInfo(copts = ctx.attr.copts) upb_proto_library_copts = rule( implementation = upb_proto_library_copts_impl, @@ -172,29 +188,41 @@ upb_proto_library_copts = rule( # upb_proto_library / upb_proto_reflection_library shared code ################# GeneratedSrcsInfo = provider( + "Provides generated headers and sources", fields = { "srcs": "list of srcs", "hdrs": "list of hdrs", + "includes": "list of extra includes", }, ) -_UpbWrappedCcInfo = provider(fields = ["cc_info"]) -_UpbDefsWrappedCcInfo = provider(fields = ["cc_info"]) -_WrappedGeneratedSrcsInfo = provider(fields = ["srcs"]) -_WrappedDefsGeneratedSrcsInfo = provider(fields = ["srcs"]) +UpbWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"]) +_UpbDefsWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"]) +_UpbWrappedGeneratedSrcsInfo = provider("Provider for generated sources", fields = ["srcs"]) +_WrappedDefsGeneratedSrcsInfo = provider( + "Provider for generated reflective sources", + fields = ["srcs"], +) def _compile_upb_protos(ctx, generator, proto_info, proto_sources): if len(proto_sources) == 0: - return GeneratedSrcsInfo(srcs = [], hdrs = []) + return GeneratedSrcsInfo(srcs = [], hdrs = [], includes = []) ext = "." + generator tool = getattr(ctx.executable, "_gen_" + generator) srcs = [_generate_output_file(ctx, name, ext + ".c") for name in proto_sources] hdrs = [_generate_output_file(ctx, name, ext + ".h") for name in proto_sources] transitive_sets = proto_info.transitive_descriptor_sets.to_list() - fasttable_enabled = (hasattr(ctx.attr, "_fasttable_enabled") and - ctx.attr._fasttable_enabled[_FastTableEnabled].enabled) - codegen_params = "fasttable:" if fasttable_enabled else "" + + args = ctx.actions.args() + args.use_param_file(param_file_arg = "@%s") + args.set_param_file_format("multiline") + + args.add("--" + generator + "_out=" + _get_real_root(ctx, srcs[0])) + args.add("--plugin=protoc-gen-" + generator + "=" + tool.path) + args.add("--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets])) + args.add_all(proto_sources, map_each = _get_real_short_path) + ctx.actions.run( inputs = depset( direct = [proto_info.direct_descriptor_set], @@ -203,16 +231,15 @@ def _compile_upb_protos(ctx, generator, proto_info, proto_sources): tools = [tool], outputs = srcs + hdrs, executable = ctx.executable._protoc, - arguments = [ - "--" + generator + "_out=" + codegen_params + _get_real_root(srcs[0]), - "--plugin=protoc-gen-" + generator + "=" + tool.path, - "--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets]), - ] + - [_get_real_short_path(file) for file in proto_sources], + arguments = [args], progress_message = "Generating upb protos for :" + ctx.label.name, mnemonic = "GenUpbProtos", ) - return GeneratedSrcsInfo(srcs = srcs, hdrs = hdrs) + return GeneratedSrcsInfo( + srcs = srcs, + hdrs = hdrs, + includes = [_generate_include_path(proto_sources[0], hdrs[0], ext + ".h")], + ) def _upb_proto_rule_impl(ctx): if len(ctx.attr.deps) != 1: @@ -221,18 +248,18 @@ def _upb_proto_rule_impl(ctx): if _WrappedDefsGeneratedSrcsInfo in dep: srcs = dep[_WrappedDefsGeneratedSrcsInfo].srcs - elif _WrappedGeneratedSrcsInfo in dep: - srcs = dep[_WrappedGeneratedSrcsInfo].srcs + elif _UpbWrappedGeneratedSrcsInfo in dep: + srcs = dep[_UpbWrappedGeneratedSrcsInfo].srcs else: - fail("proto_library rule must generate _WrappedGeneratedSrcsInfo or " + + fail("proto_library rule must generate _UpbWrappedGeneratedSrcsInfo or " + "_WrappedDefsGeneratedSrcsInfo (aspect should have handled this).") if _UpbDefsWrappedCcInfo in dep: cc_info = dep[_UpbDefsWrappedCcInfo].cc_info - elif _UpbWrappedCcInfo in dep: - cc_info = dep[_UpbWrappedCcInfo].cc_info + elif UpbWrappedCcInfo in dep: + cc_info = dep[UpbWrappedCcInfo].cc_info else: - fail("proto_library rule must generate _UpbWrappedCcInfo or " + + fail("proto_library rule must generate UpbWrappedCcInfo or " + "_UpbDefsWrappedCcInfo (aspect should have handled this).") lib = cc_info.linking_context.linker_inputs.to_list()[0].libraries[0] @@ -252,24 +279,25 @@ def _upb_proto_aspect_impl(target, ctx, generator, cc_provider, file_provider): files = _compile_upb_protos(ctx, generator, proto_info, proto_info.direct_sources) deps = ctx.rule.attr.deps + getattr(ctx.attr, "_" + generator) dep_ccinfos = [dep[CcInfo] for dep in deps if CcInfo in dep] - dep_ccinfos += [dep[_UpbWrappedCcInfo].cc_info for dep in deps if _UpbWrappedCcInfo in dep] + dep_ccinfos += [dep[UpbWrappedCcInfo].cc_info for dep in deps if UpbWrappedCcInfo in dep] dep_ccinfos += [dep[_UpbDefsWrappedCcInfo].cc_info for dep in deps if _UpbDefsWrappedCcInfo in dep] if generator == "upbdefs": - if _UpbWrappedCcInfo not in target: - fail("Target should have _UpbWrappedCcInfo provider") - dep_ccinfos += [target[_UpbWrappedCcInfo].cc_info] + if UpbWrappedCcInfo not in target: + fail("Target should have UpbWrappedCcInfo provider") + dep_ccinfos.append(target[UpbWrappedCcInfo].cc_info) cc_info = _cc_library_func( ctx = ctx, name = ctx.rule.attr.name + "." + generator, hdrs = files.hdrs, srcs = files.srcs, - copts = ctx.attr._copts[_UpbProtoLibraryCopts].copts, + includes = files.includes, + copts = ctx.attr._copts[UpbProtoLibraryCoptsInfo].copts, dep_ccinfos = dep_ccinfos, ) return [cc_provider(cc_info = cc_info), file_provider(srcs = files)] -def _upb_proto_library_aspect_impl(target, ctx): - return _upb_proto_aspect_impl(target, ctx, "upb", _UpbWrappedCcInfo, _WrappedGeneratedSrcsInfo) +def upb_proto_library_aspect_impl(target, ctx): + return _upb_proto_aspect_impl(target, ctx, "upb", UpbWrappedCcInfo, _UpbWrappedGeneratedSrcsInfo) def _upb_proto_reflection_library_aspect_impl(target, ctx): return _upb_proto_aspect_impl(target, ctx, "upbdefs", _UpbDefsWrappedCcInfo, _WrappedDefsGeneratedSrcsInfo) @@ -285,7 +313,7 @@ def _maybe_add(d): # upb_proto_library() ########################################################## -_upb_proto_library_aspect = aspect( +upb_proto_library_aspect = aspect( attrs = _maybe_add({ "_copts": attr.label( default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use", @@ -293,7 +321,7 @@ _upb_proto_library_aspect = aspect( "_gen_upb": attr.label( executable = True, cfg = "exec", - default = "//upbc:protoc-gen-upb", + default = "//upbc:protoc-gen-upb_stage1", ), "_protoc": attr.label( executable = True, @@ -308,14 +336,14 @@ _upb_proto_library_aspect = aspect( ]), "_fasttable_enabled": attr.label(default = "//:fasttable_enabled"), }), - implementation = _upb_proto_library_aspect_impl, + implementation = upb_proto_library_aspect_impl, provides = [ - _UpbWrappedCcInfo, - _WrappedGeneratedSrcsInfo, + UpbWrappedCcInfo, + _UpbWrappedGeneratedSrcsInfo, ], attr_aspects = ["deps"], fragments = ["cpp"], - toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], + toolchains = use_cpp_toolchain(), incompatible_use_toolchain_transition = True, ) @@ -324,7 +352,7 @@ upb_proto_library = rule( implementation = _upb_proto_rule_impl, attrs = { "deps": attr.label_list( - aspects = [_upb_proto_library_aspect], + aspects = [upb_proto_library_aspect], allow_rules = ["proto_library"], providers = [ProtoInfo], ), @@ -363,12 +391,12 @@ _upb_proto_reflection_library_aspect = aspect( _WrappedDefsGeneratedSrcsInfo, ], required_aspect_providers = [ - _UpbWrappedCcInfo, - _WrappedGeneratedSrcsInfo, + UpbWrappedCcInfo, + _UpbWrappedGeneratedSrcsInfo, ], attr_aspects = ["deps"], fragments = ["cpp"], - toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], + toolchains = use_cpp_toolchain(), incompatible_use_toolchain_transition = True, ) @@ -378,7 +406,7 @@ upb_proto_reflection_library = rule( attrs = { "deps": attr.label_list( aspects = [ - _upb_proto_library_aspect, + upb_proto_library_aspect, _upb_proto_reflection_library_aspect, ], allow_rules = ["proto_library"], diff --git a/third_party/upb/bazel/workspace_deps.bzl b/third_party/upb/bazel/workspace_deps.bzl index 655a668b8e5..d42e0ac7c58 100644 --- a/third_party/upb/bazel/workspace_deps.bzl +++ b/third_party/upb/bazel/workspace_deps.bzl @@ -1,7 +1,6 @@ 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] @@ -13,29 +12,46 @@ def _github_archive(repo, commit, **kwargs): def upb_deps(): maybe( - http_archive, + _github_archive, name = "com_google_absl", - url = "https://github.com/abseil/abseil-cpp/archive/b9b925341f9e90f5e7aa0cf23f036c29c7e454eb.zip", - strip_prefix = "abseil-cpp-b9b925341f9e90f5e7aa0cf23f036c29c7e454eb", - sha256 = "bb2a0b57c92b6666e8acb00f4cbbfce6ddb87e83625fb851b0e78db581340617", + repo = "https://github.com/abseil/abseil-cpp", + commit = "78be63686ba732b25052be15f8d6dee891c05749", # Abseil LTS 20230125 + sha256 = "4f356a07b9ec06ef51f943928508566e992f621ed5fa4dd588865d7bed1284cd", ) maybe( _github_archive, name = "com_google_protobuf", repo = "https://github.com/protocolbuffers/protobuf", - commit = "14803e6f63d4785ecd95adeeae3ac42a728b3857", - patches = ["//bazel:protobuf.patch"], + commit = "ec1a192689871dc63c83d7491e38c364c11b4527", + sha256 = "069bfaf612e96b81e88c52767e90197b0cbd5eacd1c9c0bb3c7e582d920db095", + patches = ["@upb//bazel:protobuf.patch"], ) - rules_python_version = "740825b7f74930c62f44af95c9a4c1bd428d2c53" # Latest @ 2021-06-23 + maybe( + _github_archive, + name = "utf8_range", + repo = "https://github.com/protocolbuffers/utf8_range", + commit = "de0b4a8ff9b5d4c98108bdfe723291a33c52c54f", + sha256 = "5da960e5e5d92394c809629a03af3c7709d2d3d0ca731dacb3a9fb4bf28f7702", + ) maybe( http_archive, + name = "rules_pkg", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", + "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", + ], + sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", + ) + + maybe( + _github_archive, name = "rules_python", - strip_prefix = "rules_python-{}".format(rules_python_version), - url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version), - sha256 = "09a3c4791c61b62c2cbc5b2cbea4ccc32487b38c7a2cc8f87a794d7a659cc742", + repo = "https://github.com/bazelbuild/rules_python", + commit = "912a5051f51581784fd64094f6bdabf93f6d698f", # 0.14.0 + sha256 = "a3e4b4ade7c4a52e757b16a16e94d0b2640333062180cba577d81fac087a501d", ) maybe( @@ -45,10 +61,6 @@ def upb_deps(): urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.tar.gz"], ) - system_python( - name = "system_python", - ) - #Python Downloads python_source_archive( diff --git a/third_party/upb/benchmarks/BUILD b/third_party/upb/benchmarks/BUILD index a7852c776d2..07207fc6c78 100644 --- a/third_party/upb/benchmarks/BUILD +++ b/third_party/upb/benchmarks/BUILD @@ -24,7 +24,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # begin:google_only -# load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", "cc_proto_library") +# load("@rules_cc//cc:defs.bzl", "cc_proto_library") # end:google_only load( @@ -249,4 +249,5 @@ genrule( cmd = "size $$($$OSTYPE == 'linux-gnu' ? '--format=GNU -d' : '') $(SRCS) > $@", # "size" sometimes isn't available remotely. local = 1, + tags = ["no-remote-exec"], ) diff --git a/third_party/upb/benchmarks/benchmark.cc b/third_party/upb/benchmarks/benchmark.cc index e752d3e7eb8..8ad30f02217 100644 --- a/third_party/upb/benchmarks/benchmark.cc +++ b/third_party/upb/benchmarks/benchmark.cc @@ -29,19 +29,20 @@ #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 "google/protobuf/dynamic_message.h" #include "benchmarks/descriptor.pb.h" #include "benchmarks/descriptor.upb.h" #include "benchmarks/descriptor.upbdefs.h" #include "benchmarks/descriptor_sv.pb.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor; namespace protobuf = ::google::protobuf; -/* A buffer big enough to parse descriptor.proto without going to heap. */ -char buf[65535]; +// A buffer big enough to parse descriptor.proto without going to heap. +// We use 64-bit ints here to force alignment. +int64_t buf[8191]; void CollectFileDescriptors( const _upb_DefPool_Init* file, @@ -169,7 +170,7 @@ static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) { protobuf::Arena arena; protobuf::DescriptorPool pool; for (auto file : serialized_files) { - protobuf::StringPiece input(file.data, file.size); + absl::string_view input(file.data, file.size); auto proto = protobuf::Arena::CreateMessage(&arena); bool ok = proto->ParseFrom(input) && @@ -264,7 +265,7 @@ struct Proto2Factory { private: protobuf::ArenaOptions GetOptions() { protobuf::ArenaOptions opts; - opts.initial_block = buf; + opts.initial_block = (char*)buf; opts.initial_block_size = sizeof(buf); return opts; } @@ -284,7 +285,7 @@ void BM_Parse_Proto2(benchmark::State& state) { for (auto _ : state) { Proto2Factory proto_factory; auto proto = proto_factory.GetProto(); - protobuf::StringPiece input(descriptor.data, descriptor.size); + absl::string_view input(descriptor.data, descriptor.size); bool ok = proto->template ParseFrom(input); if (!ok) { printf("Failed to parse.\n"); diff --git a/third_party/upb/benchmarks/build_defs.bzl b/third_party/upb/benchmarks/build_defs.bzl index 3fc4dd22a8c..168dab6634f 100644 --- a/third_party/upb/benchmarks/build_defs.bzl +++ b/third_party/upb/benchmarks/build_defs.bzl @@ -24,7 +24,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # begin:google_only -# load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", _cc_proto_library = "cc_proto_library") +# load("@rules_cc//cc:defs.bzl", _cc_proto_library = "cc_proto_library") # # _is_google3 = True # end:google_only diff --git a/third_party/upb/cmake/BUILD.bazel b/third_party/upb/cmake/BUILD.bazel index 10572f052cf..19662dd73ef 100644 --- a/third_party/upb/cmake/BUILD.bazel +++ b/third_party/upb/cmake/BUILD.bazel @@ -25,7 +25,7 @@ load( ":build_defs.bzl", - "generated_file_staleness_test", + "staleness_test", ) load( "//bazel:build_defs.bzl", @@ -40,6 +40,9 @@ py_library( name = "staleness_test_lib", testonly = 1, srcs = ["staleness_test_lib.py"], + # This is public only for use by the staleness_test() macro. Please do not + # depend on this target directly. + visibility = ["//visibility:public"], ) py_binary( @@ -52,6 +55,7 @@ genrule( srcs = [ "//:BUILD", "//:WORKSPACE", + "//bazel:workspace_deps.bzl", ], outs = ["generated-in/CMakeLists.txt"], cmd = "$(location :make_cmakelists) $@", @@ -68,7 +72,7 @@ genrule( cmd = "cp $(SRCS) $(@D)/generated-in/google/protobuf", ) -generated_file_staleness_test( +staleness_test( name = "test_generated_files", outs = [ "CMakeLists.txt", @@ -96,7 +100,7 @@ sh_test( ":copy_protos", ":gen_cmakelists", "//:cmake_files", - "//third_party/utf8_range:cmake_files", + "@utf8_range//:utf8_range_srcs", ], deps = ["@bazel_tools//tools/bash/runfiles"], ) diff --git a/third_party/upb/cmake/CMakeLists.txt b/third_party/upb/cmake/CMakeLists.txt new file mode 100644 index 00000000000..1fa44d86f33 --- /dev/null +++ b/third_party/upb/cmake/CMakeLists.txt @@ -0,0 +1,320 @@ +# This file was generated from BUILD using tools/make_cmakelists.py. + +cmake_minimum_required(VERSION 3.1) + +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +else() + cmake_policy(VERSION 3.12) +endif() + +cmake_minimum_required (VERSION 3.0) +cmake_policy(SET CMP0048 NEW) + +project(upb) +set(CMAKE_C_STANDARD 99) + + +# Prevent CMake from setting -rdynamic on Linux (!!). +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") + +# Set default build type. +if(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif() + +# When using Ninja, compiler output won't be colorized without this. +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG(-fdiagnostics-color=always SUPPORTS_COLOR_ALWAYS) +if(SUPPORTS_COLOR_ALWAYS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always") +endif() + +# Implement ASAN/UBSAN options +if(UPB_ENABLE_ASAN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") +endif() + +if(UPB_ENABLE_UBSAN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") +endif() + +include_directories(..) +include_directories(../cmake) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +if(NOT TARGET utf8_range) + if(EXISTS ../external/utf8_range) + # utf8_range is already installed + include_directories(../external/utf8_range) + else() + include(FetchContent) + FetchContent_Declare( + utf8_range + GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git" + GIT_TAG "de0b4a8ff9b5d4c98108bdfe723291a33c52c54f" + ) + FetchContent_GetProperties(utf8_range) + if(NOT utf8_range_POPULATED) + FetchContent_Populate(utf8_range) + include_directories(${utf8_range_SOURCE_DIR}) + endif() + endif() +endif() + +if(APPLE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup -flat_namespace") +elseif(UNIX) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id") +endif() + +enable_testing() + +add_library(port INTERFACE) +add_library(upb INTERFACE) +target_link_libraries(upb INTERFACE + base + collections_internal + fastdecode + hash + lex + mem + message_internal + mini_table_internal + port + wire) +add_library(base + ../upb/base/status.c + ../upb/base/descriptor_constants.h + ../upb/base/log2.h + ../upb/base/status.h + ../upb/base/string_view.h) +target_link_libraries(base + port) +add_library(mini_table INTERFACE) +target_link_libraries(mini_table INTERFACE + base + mem + mini_table_internal + port) +add_library(mini_table_internal + ../upb/mini_table/common.c + ../upb/mini_table/decode.c + ../upb/mini_table/encode.c + ../upb/mini_table/extension_registry.c + ../upb/mini_table/common.h + ../upb/mini_table/common_internal.h + ../upb/mini_table/decode.h + ../upb/mini_table/encode_internal.h + ../upb/mini_table/encode_internal.hpp + ../upb/mini_table/enum_internal.h + ../upb/mini_table/extension_internal.h + ../upb/mini_table/extension_registry.h + ../upb/mini_table/field_internal.h + ../upb/mini_table/file_internal.h + ../upb/mini_table/message_internal.h + ../upb/mini_table/sub_internal.h + ../upb/mini_table/types.h) +target_link_libraries(mini_table_internal + base + hash + mem + port) +add_library(message INTERFACE) +target_link_libraries(message INTERFACE + mem + message_internal + mini_table + port) +add_library(message_internal + ../upb/message/message.c + ../upb/message/extension_internal.h + ../upb/message/internal.h + ../upb/message/message.h) +target_link_libraries(message_internal + base + hash + mem + mini_table_internal + port) +add_library(message_accessors + ../upb/message/accessors.c + ../upb/message/accessors.h) +target_link_libraries(message_accessors + collections_internal + eps_copy_input_stream + hash + message_internal + mini_table_internal + port + upb + wire + wire_reader) +add_library(fastdecode INTERFACE) +target_link_libraries(fastdecode INTERFACE + base + collections_internal + hash + mem_internal + message_internal + mini_table_internal + port + wire) +add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE) +target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE + base + collections_internal + hash + upb) +add_library(generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE) +target_link_libraries(generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE + base + collections_internal + hash + mini_table + upb) +add_library(generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE) +target_link_libraries(generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE + base + descriptor_upb_proto + hash + mini_table_internal + reflection_internal) +add_library(collections INTERFACE) +target_link_libraries(collections INTERFACE + base + collections_internal + mem + port) +add_library(collections_internal + ../upb/collections/array.c + ../upb/collections/map.c + ../upb/collections/map_sorter.c + ../upb/collections/array.h + ../upb/collections/array_internal.h + ../upb/collections/map.h + ../upb/collections/map_gencode_util.h + ../upb/collections/map_internal.h + ../upb/collections/map_sorter_internal.h + ../upb/collections/message_value.h) +target_link_libraries(collections_internal + base + hash + mem + message_internal + mini_table_internal + port) +add_library(textformat + ../upb/text/encode.c + ../upb/text/encode.h + ../upb/text_encode.h) +target_link_libraries(textformat + collections_internal + eps_copy_input_stream + lex + port + reflection + wire + wire_reader + wire_types) +add_library(json + ../upb/json/decode.c + ../upb/json/encode.c + ../upb/json/decode.h + ../upb/json/encode.h + ../upb/json_decode.h + ../upb/json_encode.h) +target_link_libraries(json + collections + lex + port + reflection + upb) +add_library(mem INTERFACE) +target_link_libraries(mem INTERFACE + mem_internal + port) +add_library(mem_internal + ../upb/mem/alloc.c + ../upb/mem/arena.c + ../upb/mem/alloc.h + ../upb/mem/arena.h + ../upb/mem/arena_internal.h) +target_link_libraries(mem_internal + port) +add_library(wire INTERFACE) +target_link_libraries(wire INTERFACE + mem + message_internal + mini_table_internal + port + wire_internal) +add_library(wire_internal + ../upb/wire/decode.c + ../upb/wire/decode_fast.c + ../upb/wire/encode.c + ../upb/wire/common_internal.h + ../upb/wire/decode.h + ../upb/wire/decode_fast.h + ../upb/wire/decode_internal.h + ../upb/wire/encode.h + ../upb/wire/swap_internal.h) +target_link_libraries(wire_internal + base + collections_internal + eps_copy_input_stream + hash + mem_internal + message_internal + mini_table_internal + port + wire_reader + wire_types + utf8_range) +add_library(wire_types INTERFACE) +add_library(eps_copy_input_stream + ../upb/wire/eps_copy_input_stream.c + ../upb/wire/eps_copy_input_stream.h) +target_link_libraries(eps_copy_input_stream + mem + port) +add_library(wire_reader + ../upb/wire/reader.c + ../upb/wire/swap_internal.h + ../upb/wire/reader.h) +target_link_libraries(wire_reader + eps_copy_input_stream + port + wire_types) +add_library(hash + ../upb/hash/common.c + ../upb/hash/common.h + ../upb/hash/int_table.h + ../upb/hash/str_table.h) +target_link_libraries(hash + base + mem + port) +add_library(lex + ../upb/lex/atoi.c + ../upb/lex/round_trip.c + ../upb/lex/strtod.c + ../upb/lex/unicode.c + ../upb/lex/atoi.h + ../upb/lex/round_trip.h + ../upb/lex/strtod.h + ../upb/lex/unicode.h) +target_link_libraries(lex + port) + + diff --git a/third_party/upb/cmake/build_defs.bzl b/third_party/upb/cmake/build_defs.bzl index 9e30af952a6..157c3cb053a 100644 --- a/third_party/upb/cmake/build_defs.bzl +++ b/third_party/upb/cmake/build_defs.bzl @@ -25,7 +25,7 @@ """Bazel support functions related to CMake support.""" -def generated_file_staleness_test(name, outs, generated_pattern, **kwargs): +def staleness_test(name, outs, generated_pattern, target_files = None, tags = [], **kwargs): """Tests that checked-in file(s) match the contents of generated file(s). The resulting test will verify that all output files exist and have the @@ -38,11 +38,14 @@ def generated_file_staleness_test(name, outs, generated_pattern, **kwargs): generated_pattern: the pattern for transforming each "out" file into a generated file. For example, if generated_pattern="generated/%s" then a file foo.txt will look for generated file generated/foo.txt. + target_files: A glob representing all of the files that should be + covered by this rule. Files in this glob but not generated will + be deleted. (Not currently implemented in OSS). **kwargs: Additional keyword arguments to pass through to py_test(). """ script_name = name + ".py" - script_src = ":staleness_test.py" + script_src = Label("//cmake:staleness_test.py") # Filter out non-existing rules so Blaze doesn't error out before we even # run the test. @@ -57,7 +60,7 @@ def generated_file_staleness_test(name, outs, generated_pattern, **kwargs): outs = [script_name], srcs = [script_src], testonly = 1, - cmd = "cat $(location " + script_src + ") > $@; " + + cmd = "cp $< $@; " + "sed -i.bak -e 's|INSERT_FILE_LIST_HERE|" + "\\\n ".join(file_list) + "|' $@", ) @@ -67,7 +70,8 @@ def generated_file_staleness_test(name, outs, generated_pattern, **kwargs): data = existing_outs + [generated_pattern % file for file in outs], python_version = "PY3", deps = [ - ":staleness_test_lib", + Label("//cmake:staleness_test_lib"), ], + tags = ["staleness_test"] + tags, **kwargs ) diff --git a/third_party/upb/cmake/google/protobuf/descriptor.upb.c b/third_party/upb/cmake/google/protobuf/descriptor.upb.c new file mode 100644 index 00000000000..8a5b5e1e050 --- /dev/null +++ b/third_party/upb/cmake/google/protobuf/descriptor.upb.c @@ -0,0 +1,1130 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * google/protobuf/descriptor.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#include +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "google/protobuf/descriptor.upb.h" + +// Must be last. +#include "upb/port/def.inc" + +static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = { + {.submsg = &google_protobuf_FileDescriptorProto_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FileDescriptorSet_msg_init = { + &google_protobuf_FileDescriptorSet_submsgs[0], + &google_protobuf_FileDescriptorSet__fields[0], + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max192b}, + }) +}; + +static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[6] = { + {.submsg = &google_protobuf_DescriptorProto_msg_init}, + {.submsg = &google_protobuf_EnumDescriptorProto_msg_init}, + {.submsg = &google_protobuf_ServiceDescriptorProto_msg_init}, + {.submsg = &google_protobuf_FieldDescriptorProto_msg_init}, + {.submsg = &google_protobuf_FileOptions_msg_init}, + {.submsg = &google_protobuf_SourceCodeInfo_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] = { + {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FileDescriptorProto_msg_init = { + &google_protobuf_FileDescriptorProto_submsgs[0], + &google_protobuf_FileDescriptorProto__fields[0], + UPB_SIZE(72, 144), 13, kUpb_ExtMode_NonExtendable, 13, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800003f00001a, &upb_prb_1bt}, + {0x003000003f000022, &upb_prm_1bt_max128b}, + {0x003800003f01002a, &upb_prm_1bt_max64b}, + {0x004000003f020032, &upb_prm_1bt_max64b}, + {0x004800003f03003a, &upb_prm_1bt_max128b}, + {0x0050000003040042, &upb_psm_1bt_max256b}, + {0x005800000405004a, &upb_psm_1bt_max64b}, + {0x006000003f000050, &upb_prv4_1bt}, + {0x006800003f000058, &upb_prv4_1bt}, + {0x0070000005000062, &upb_psb_1bt}, + {0x008000000600006a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = { + {.submsg = &google_protobuf_FieldDescriptorProto_msg_init}, + {.submsg = &google_protobuf_DescriptorProto_msg_init}, + {.submsg = &google_protobuf_EnumDescriptorProto_msg_init}, + {.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msg_init}, + {.submsg = &google_protobuf_FieldDescriptorProto_msg_init}, + {.submsg = &google_protobuf_MessageOptions_msg_init}, + {.submsg = &google_protobuf_OneofDescriptorProto_msg_init}, + {.submsg = &google_protobuf_DescriptorProto_ReservedRange_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = { + {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_DescriptorProto_msg_init = { + &google_protobuf_DescriptorProto_submsgs[0], + &google_protobuf_DescriptorProto__fields[0], + UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000003f01001a, &upb_prm_1bt_max128b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f03002a, &upb_prm_1bt_max64b}, + {0x003800003f040032, &upb_prm_1bt_max128b}, + {0x004000000205003a, &upb_psm_1bt_max64b}, + {0x004800003f060042, &upb_prm_1bt_max64b}, + {0x005000003f07004a, &upb_prm_1bt_max64b}, + {0x005800003f000052, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { + {.submsg = &google_protobuf_ExtensionRangeOptions_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__fields[3] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msg_init = { + &google_protobuf_DescriptorProto_ExtensionRange_submsgs[0], + &google_protobuf_DescriptorProto_ExtensionRange__fields[0], + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x001000000300001a, &upb_psm_1bt_max64b}, + }) +}; + +static const upb_MiniTableField google_protobuf_DescriptorProto_ReservedRange__fields[2] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = { + NULL, + &google_protobuf_DescriptorProto_ReservedRange__fields[0], + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[1] = { + {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { + &google_protobuf_ExtensionRangeOptions_submsgs[0], + &google_protobuf_ExtensionRangeOptions__fields[0], + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = { + {.subenum = &google_protobuf_FieldDescriptorProto_Label_enum_init}, + {.subenum = &google_protobuf_FieldDescriptorProto_Type_enum_init}, + {.submsg = &google_protobuf_FieldOptions_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] = { + {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init = { + &google_protobuf_FieldDescriptorProto_submsgs[0], + &google_protobuf_FieldDescriptorProto__fields[0], + UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0028000002000012, &upb_psb_1bt}, + {0x0004000003000018, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0038000006000032, &upb_psb_1bt}, + {0x004800000700003a, &upb_psb_1bt}, + {0x0058000008020042, &upb_psm_1bt_max64b}, + {0x0010000009000048, &upb_psv4_1bt}, + {0x006000000a000052, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001400000b000188, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = { + {.submsg = &google_protobuf_OneofOptions_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] = { + {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_OneofDescriptorProto_msg_init = { + &google_protobuf_OneofDescriptorProto_submsgs[0], + &google_protobuf_OneofDescriptorProto__fields[0], + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = { + {.submsg = &google_protobuf_EnumValueDescriptorProto_msg_init}, + {.submsg = &google_protobuf_EnumOptions_msg_init}, + {.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = { + {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_EnumDescriptorProto_msg_init = { + &google_protobuf_EnumDescriptorProto_submsgs[0], + &google_protobuf_EnumDescriptorProto__fields[0], + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f00002a, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableField google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { + {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init = { + NULL, + &google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0], + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = { + {.submsg = &google_protobuf_EnumValueOptions_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields[3] = { + {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msg_init = { + &google_protobuf_EnumValueDescriptorProto_submsgs[0], + &google_protobuf_EnumValueDescriptorProto__fields[0], + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0004000002000010, &upb_psv4_1bt}, + {0x001800000300001a, &upb_psm_1bt_max64b}, + }) +}; + +static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = { + {.submsg = &google_protobuf_MethodDescriptorProto_msg_init}, + {.submsg = &google_protobuf_ServiceOptions_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3] = { + {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_ServiceDescriptorProto_msg_init = { + &google_protobuf_ServiceDescriptorProto_submsgs[0], + &google_protobuf_ServiceDescriptorProto__fields[0], + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + }) +}; + +static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = { + {.submsg = &google_protobuf_MethodOptions_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] = { + {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init = { + &google_protobuf_MethodDescriptorProto_submsgs[0], + &google_protobuf_MethodDescriptorProto__fields[0], + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800000300001a, &upb_psb_1bt}, + {0x0038000004000022, &upb_psm_1bt_max64b}, + {0x0001000005000028, &upb_psb1_1bt}, + {0x0002000006000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[2] = { + {.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init}, + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { + {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FileOptions_msg_init = { + &google_protobuf_FileOptions_submsgs[0], + &google_protobuf_FileOptions__fields[0], + UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0028000002000042, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000004000050, &upb_psb1_1bt}, + {0x003800000500005a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0009000006000180, &upb_psb1_2bt}, + {0x000a000007000188, &upb_psb1_2bt}, + {0x000b000008000190, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000c0000090001a0, &upb_psb1_2bt}, + {0x005800000e0002aa, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000d00000a0001b8, &upb_psb1_2bt}, + {0x00780000100002c2, &upb_psb_2bt}, + {0x00880000110002ca, &upb_psb_2bt}, + {0x00100000120002d0, &upb_psb1_2bt}, + {0x000e00000b0001d8, &upb_psb1_2bt}, + {0x00980000130002e2, &upb_psb_2bt}, + {0x00a80000140002ea, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000f00000c0001f8, &upb_psb1_2bt}, + }) +}; + +static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_MessageOptions__fields[6] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_MessageOptions_msg_init = { + &google_protobuf_MessageOptions_submsgs[0], + &google_protobuf_MessageOptions__fields[0], + 16, 6, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0002000002000010, &upb_psb1_1bt}, + {0x0003000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000004000038, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0005000005000058, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[5] = { + {.subenum = &google_protobuf_FieldOptions_CType_enum_init}, + {.subenum = &google_protobuf_FieldOptions_JSType_enum_init}, + {.subenum = &google_protobuf_FieldOptions_OptionRetention_enum_init}, + {.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init}, + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_FieldOptions__fields[11] = { + {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FieldOptions_msg_init = { + &google_protobuf_FieldOptions_submsgs[0], + &google_protobuf_FieldOptions__fields[0], + UPB_SIZE(32, 40), 11, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000002000010, &upb_psb1_1bt}, + {0x0009000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000a000004000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000006000050, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0011000007000078, &upb_psb1_1bt}, + {0x0012000008000180, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002000003f043eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_OneofOptions__fields[1] = { + {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_OneofOptions_msg_init = { + &google_protobuf_OneofOptions_submsgs[0], + &google_protobuf_OneofOptions__fields[0], + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_EnumOptions__fields[4] = { + {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_EnumOptions_msg_init = { + &google_protobuf_EnumOptions_submsgs[0], + &google_protobuf_EnumOptions__fields[0], + UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000010, &upb_psb1_1bt}, + {0x0002000002000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0003000003000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[2] = { + {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { + &google_protobuf_EnumValueOptions_submsgs[0], + &google_protobuf_EnumValueOptions__fields[0], + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_ServiceOptions__fields[2] = { + {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { + &google_protobuf_ServiceOptions_submsgs[0], + &google_protobuf_ServiceOptions__fields[0], + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[2] = { + {.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init}, + {.submsg = &google_protobuf_UninterpretedOption_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_MethodOptions__fields[3] = { + {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_MethodOptions_msg_init = { + &google_protobuf_MethodOptions_submsgs[0], + &google_protobuf_MethodOptions__fields[0], + 16, 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f013eba, &upb_prm_2bt_max128b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = { + {.submsg = &google_protobuf_UninterpretedOption_NamePart_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = { + {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_UninterpretedOption_msg_init = { + &google_protobuf_UninterpretedOption_submsgs[0], + &google_protobuf_UninterpretedOption__fields[0], + UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x001000000100001a, &upb_psb_1bt}, + {0x0020000002000020, &upb_psv8_1bt}, + {0x0028000003000028, &upb_psv8_1bt}, + {0x0030000004000031, &upb_psf8_1bt}, + {0x003800000500003a, &upb_psb_1bt}, + {0x0048000006000042, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableField google_protobuf_UninterpretedOption_NamePart__fields[2] = { + {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init = { + NULL, + &google_protobuf_UninterpretedOption_NamePart__fields[0], + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 2, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0001000002000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = { + {.submsg = &google_protobuf_SourceCodeInfo_Location_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init = { + &google_protobuf_SourceCodeInfo_submsgs[0], + &google_protobuf_SourceCodeInfo__fields[0], + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + }) +}; + +static const upb_MiniTableField google_protobuf_SourceCodeInfo_Location__fields[5] = { + {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init = { + NULL, + &google_protobuf_SourceCodeInfo_Location__fields[0], + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_ppv4_1bt}, + {0x001000003f000012, &upb_ppv4_1bt}, + {0x001800000100001a, &upb_psb_1bt}, + {0x0028000002000022, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f000032, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = { + {.submsg = &google_protobuf_GeneratedCodeInfo_Annotation_msg_init}, +}; + +static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = { + {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init = { + &google_protobuf_GeneratedCodeInfo_submsgs[0], + &google_protobuf_GeneratedCodeInfo__fields[0], + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) +}; + +static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = { + {.subenum = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init}, +}; + +static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fields[5] = { + {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = { + &google_protobuf_GeneratedCodeInfo_Annotation_submsgs[0], + &google_protobuf_GeneratedCodeInfo_Annotation__fields[0], + UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_ppv4_1bt}, + {0x0018000001000012, &upb_psb_1bt}, + {0x0004000002000018, &upb_psv4_1bt}, + {0x0008000003000020, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTable *messages_layout[27] = { + &google_protobuf_FileDescriptorSet_msg_init, + &google_protobuf_FileDescriptorProto_msg_init, + &google_protobuf_DescriptorProto_msg_init, + &google_protobuf_DescriptorProto_ExtensionRange_msg_init, + &google_protobuf_DescriptorProto_ReservedRange_msg_init, + &google_protobuf_ExtensionRangeOptions_msg_init, + &google_protobuf_FieldDescriptorProto_msg_init, + &google_protobuf_OneofDescriptorProto_msg_init, + &google_protobuf_EnumDescriptorProto_msg_init, + &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, + &google_protobuf_EnumValueDescriptorProto_msg_init, + &google_protobuf_ServiceDescriptorProto_msg_init, + &google_protobuf_MethodDescriptorProto_msg_init, + &google_protobuf_FileOptions_msg_init, + &google_protobuf_MessageOptions_msg_init, + &google_protobuf_FieldOptions_msg_init, + &google_protobuf_OneofOptions_msg_init, + &google_protobuf_EnumOptions_msg_init, + &google_protobuf_EnumValueOptions_msg_init, + &google_protobuf_ServiceOptions_msg_init, + &google_protobuf_MethodOptions_msg_init, + &google_protobuf_UninterpretedOption_msg_init, + &google_protobuf_UninterpretedOption_NamePart_msg_init, + &google_protobuf_SourceCodeInfo_msg_init, + &google_protobuf_SourceCodeInfo_Location_msg_init, + &google_protobuf_GeneratedCodeInfo_msg_init, + &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, +}; + +const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init = { + 64, + 0, + { + 0xe, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init = { + 64, + 0, + { + 0x7fffe, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init = { + 64, + 0, + { + 0x3ff, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init = { + 64, + 0, + { + 0xe, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +static const upb_MiniTableEnum *enums_layout[9] = { + &google_protobuf_FieldDescriptorProto_Label_enum_init, + &google_protobuf_FieldDescriptorProto_Type_enum_init, + &google_protobuf_FieldOptions_CType_enum_init, + &google_protobuf_FieldOptions_JSType_enum_init, + &google_protobuf_FieldOptions_OptionRetention_enum_init, + &google_protobuf_FieldOptions_OptionTargetType_enum_init, + &google_protobuf_FileOptions_OptimizeMode_enum_init, + &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init, + &google_protobuf_MethodOptions_IdempotencyLevel_enum_init, +}; + +const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = { + messages_layout, + enums_layout, + NULL, + 27, + 9, + 0, +}; + +#include "upb/port/undef.inc" + diff --git a/third_party/upb/cmake/google/protobuf/descriptor.upb.h b/third_party/upb/cmake/google/protobuf/descriptor.upb.h new file mode 100644 index 00000000000..a464bb26cb3 --- /dev/null +++ b/third_party/upb/cmake/google/protobuf/descriptor.upb.h @@ -0,0 +1,4742 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * google/protobuf/descriptor.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ +#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ + +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet; +typedef struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto; +typedef struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto; +typedef struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange; +typedef struct google_protobuf_DescriptorProto_ReservedRange google_protobuf_DescriptorProto_ReservedRange; +typedef struct google_protobuf_ExtensionRangeOptions google_protobuf_ExtensionRangeOptions; +typedef struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto; +typedef struct google_protobuf_OneofDescriptorProto google_protobuf_OneofDescriptorProto; +typedef struct google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto; +typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange google_protobuf_EnumDescriptorProto_EnumReservedRange; +typedef struct google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto; +typedef struct google_protobuf_ServiceDescriptorProto google_protobuf_ServiceDescriptorProto; +typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescriptorProto; +typedef struct google_protobuf_FileOptions google_protobuf_FileOptions; +typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions; +typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions; +typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions; +typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions; +typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions; +typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions; +typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions; +typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption; +typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart; +typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo; +typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location; +typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo; +typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation; +extern const upb_MiniTable google_protobuf_FileDescriptorSet_msg_init; +extern const upb_MiniTable google_protobuf_FileDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_DescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msg_init; +extern const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init; +extern const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_OneofDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_EnumDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_ServiceDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init; +extern const upb_MiniTable google_protobuf_FileOptions_msg_init; +extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_OneofOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; +extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; +extern const upb_MiniTable google_protobuf_ServiceOptions_msg_init; +extern const upb_MiniTable google_protobuf_MethodOptions_msg_init; +extern const upb_MiniTable google_protobuf_UninterpretedOption_msg_init; +extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init; +extern const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init; +extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init; +extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init; +extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init; + +typedef enum { + google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, + google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, + google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3 +} google_protobuf_FieldDescriptorProto_Label; + +typedef enum { + google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1, + google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2, + google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3, + google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4, + google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5, + google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6, + google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7, + google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8, + google_protobuf_FieldDescriptorProto_TYPE_STRING = 9, + google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10, + google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11, + google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12, + google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13, + google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14, + google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15, + google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16, + google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17, + google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18 +} google_protobuf_FieldDescriptorProto_Type; + +typedef enum { + google_protobuf_FieldOptions_STRING = 0, + google_protobuf_FieldOptions_CORD = 1, + google_protobuf_FieldOptions_STRING_PIECE = 2 +} google_protobuf_FieldOptions_CType; + +typedef enum { + google_protobuf_FieldOptions_JS_NORMAL = 0, + google_protobuf_FieldOptions_JS_STRING = 1, + google_protobuf_FieldOptions_JS_NUMBER = 2 +} google_protobuf_FieldOptions_JSType; + +typedef enum { + google_protobuf_FieldOptions_RETENTION_UNKNOWN = 0, + google_protobuf_FieldOptions_RETENTION_RUNTIME = 1, + google_protobuf_FieldOptions_RETENTION_SOURCE = 2 +} google_protobuf_FieldOptions_OptionRetention; + +typedef enum { + google_protobuf_FieldOptions_TARGET_TYPE_UNKNOWN = 0, + google_protobuf_FieldOptions_TARGET_TYPE_FILE = 1, + google_protobuf_FieldOptions_TARGET_TYPE_EXTENSION_RANGE = 2, + google_protobuf_FieldOptions_TARGET_TYPE_MESSAGE = 3, + google_protobuf_FieldOptions_TARGET_TYPE_FIELD = 4, + google_protobuf_FieldOptions_TARGET_TYPE_ONEOF = 5, + google_protobuf_FieldOptions_TARGET_TYPE_ENUM = 6, + google_protobuf_FieldOptions_TARGET_TYPE_ENUM_ENTRY = 7, + google_protobuf_FieldOptions_TARGET_TYPE_SERVICE = 8, + google_protobuf_FieldOptions_TARGET_TYPE_METHOD = 9 +} google_protobuf_FieldOptions_OptionTargetType; + +typedef enum { + google_protobuf_FileOptions_SPEED = 1, + google_protobuf_FileOptions_CODE_SIZE = 2, + google_protobuf_FileOptions_LITE_RUNTIME = 3 +} google_protobuf_FileOptions_OptimizeMode; + +typedef enum { + google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0, + google_protobuf_GeneratedCodeInfo_Annotation_SET = 1, + google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2 +} google_protobuf_GeneratedCodeInfo_Annotation_Semantic; + +typedef enum { + google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0, + google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1, + google_protobuf_MethodOptions_IDEMPOTENT = 2 +} google_protobuf_MethodOptions_IdempotencyLevel; + + +extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; +extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; +extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init; + +/* google.protobuf.FileDescriptorSet */ + +UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) { + return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google_protobuf_FileDescriptorSet_msg_init, arena); +} +UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) { + size_t size; + google_protobuf_FileDescriptorSet_file(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.FileDescriptorProto */ + +UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_message_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_enum_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_service(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_extension(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) { + const google_protobuf_FileOptions* default_val = NULL; + const google_protobuf_FileOptions* ret; + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) { + const google_protobuf_SourceCodeInfo* default_val = NULL; + const google_protobuf_SourceCodeInfo* ret; + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_public_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_public_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_weak_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_weak_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_ServiceDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { + const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msg_init, arena); + if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) { + const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg); + if (sub == NULL) { + sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msg_init, arena); + if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub); + } + return sub; +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.DescriptorProto */ + +UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_field(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_nested_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_enum_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_extension_range(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_extension(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) { + const google_protobuf_MessageOptions* default_val = NULL; + const google_protobuf_MessageOptions* ret; + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_oneof_decl(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_reserved_range(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_reserved_name(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { + const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msg_init, arena); + if (sub) google_protobuf_DescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_OneofDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} + +/* google.protobuf.DescriptorProto.ExtensionRange */ + +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) { + return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msg_init, arena); +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const google_protobuf_ExtensionRangeOptions* default_val = NULL; + const google_protobuf_ExtensionRangeOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { + const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { + struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msg_init, arena); + if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.DescriptorProto.ReservedRange */ + +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) { + return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msg_init, arena); +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.ExtensionRangeOptions */ + +UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) { + return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) { + size_t size; + google_protobuf_ExtensionRangeOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.FieldDescriptorProto */ + +UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) { + const google_protobuf_FieldOptions* default_val = NULL; + const google_protobuf_FieldOptions* ret; + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { + const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msg_init, arena); + if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { + const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.OneofDescriptorProto */ + +UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) { + const google_protobuf_OneofOptions* default_val = NULL; + const google_protobuf_OneofOptions* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msg_init, arena); + if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.EnumDescriptorProto */ + +UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_value(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) { + const google_protobuf_EnumOptions* default_val = NULL; + const google_protobuf_EnumOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_reserved_range(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_reserved_name(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumValueDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msg_init, arena); + if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} + +/* google.protobuf.EnumDescriptorProto.EnumReservedRange */ + +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) { + return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, arena); +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { + const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.EnumValueDescriptorProto */ + +UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) { + const google_protobuf_EnumValueOptions* default_val = NULL; + const google_protobuf_EnumValueOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msg_init, arena); + if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.ServiceDescriptorProto */ + +UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) { + size_t size; + google_protobuf_ServiceDescriptorProto_method(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) { + const google_protobuf_ServiceOptions* default_val = NULL; + const google_protobuf_ServiceOptions* ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_MethodDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msg_init, arena); + if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.MethodDescriptorProto */ + +UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msg_init, arena); +} +UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) { + const google_protobuf_MethodOptions* default_val = NULL; + const google_protobuf_MethodOptions* ret; + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { + const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msg_init, arena); + if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { + const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { + const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.FileOptions */ + +UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) { + return (google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) { + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) { + bool default_val = true; + bool ret; + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) { + size_t size; + google_protobuf_FileOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { + const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.MessageOptions */ + +UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) { + return (google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MessageOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MessageOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) { + size_t size; + google_protobuf_MessageOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.FieldOptions */ + +UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) { + return (google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_target(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_target(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_target(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) { + size_t size; + google_protobuf_FieldOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = {17, 20, 9, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_target(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = {18, 24, 10, 3, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(28, 32), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.OneofOptions */ + +UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) { + return (google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) { + size_t size; + google_protobuf_OneofOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.EnumOptions */ + +UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) { + return (google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) { + size_t size; + google_protobuf_EnumOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.EnumValueOptions */ + +UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) { + return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) { + size_t size; + google_protobuf_EnumValueOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) { + const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.ServiceOptions */ + +UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) { + return (google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) { + size_t size; + google_protobuf_ServiceOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.MethodOptions */ + +UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) { + return (google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msg_init, arena); +} +UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodOptions_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodOptions_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) { + const upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) { + size_t size; + google_protobuf_MethodOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { + const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { + const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { + upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.UninterpretedOption */ + +UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) { + return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msg_init, arena); +} +UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) { + size_t size; + google_protobuf_UninterpretedOption_name(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) { + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) { + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) { + double default_val = 0; + double ret; + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { + const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { + const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { + const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { + const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { + const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.UninterpretedOption.NamePart */ + +UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) { + return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msg_init, arena); +} +UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { + const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.SourceCodeInfo */ + +UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { + return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msg_init, arena); +} +UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) { + size_t size; + google_protobuf_SourceCodeInfo_location(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_SourceCodeInfo_Location**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.SourceCodeInfo.Location */ + +UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) { + return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msg_init, arena); +} +UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_path(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_path(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_span(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_span(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_leading_detached_comments(msg, &size); + return size != 0; +} + +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { + const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { + const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} + +/* google.protobuf.GeneratedCodeInfo */ + +UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) { + return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_msg_init, arena); +} +UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) { + const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) { + size_t size; + google_protobuf_GeneratedCodeInfo_annotation(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) { + upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.GeneratedCodeInfo.Annotation */ + +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) { + return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msg_init, arena); +} +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, 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) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + size_t size; + google_protobuf_GeneratedCodeInfo_Annotation_path(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { + upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { + const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +extern const upb_MiniTableFile 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, 192) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */ diff --git a/third_party/upb/cmake/make_cmakelists.py b/third_party/upb/cmake/make_cmakelists.py index d64c14f6f35..fcfd0f3bb6f 100755 --- a/third_party/upb/cmake/make_cmakelists.py +++ b/third_party/upb/cmake/make_cmakelists.py @@ -68,6 +68,8 @@ class BuildFileFunctions(object): return if kwargs["name"] == "lupb": return + if "testonly" in kwargs: + return files = kwargs.get("srcs", []) + kwargs.get("hdrs", []) found_files = [] pregenerated_files = [ @@ -126,6 +128,9 @@ class BuildFileFunctions(object): def cc_fuzz_test(self, **kwargs): pass + def pkg_files(self, **kwargs): + pass + def py_library(self, **kwargs): pass @@ -150,7 +155,7 @@ class BuildFileFunctions(object): def cc_proto_library(self, **kwargs): pass - def generated_file_staleness_test(self, **kwargs): + def staleness_test(self, **kwargs): pass def upb_amalgamation(self, **kwargs): @@ -180,7 +185,7 @@ class BuildFileFunctions(object): def select(self, arg_dict): return [] - def glob(self, *args): + def glob(self, *args, **kwargs): return [] def licenses(self, *args): @@ -195,18 +200,32 @@ class BuildFileFunctions(object): def package_group(self, **kwargs): pass + def bool_flag(self, **kwargs): + pass + + def bootstrap_upb_proto_library(self, **kwargs): + pass + + def bootstrap_cc_library(self, **kwargs): + pass + class WorkspaceFileFunctions(object): def __init__(self, converter): self.converter = converter - def load(self, *args): + def load(self, *args, **kwargs): pass def workspace(self, **kwargs): self.converter.prelude += "project(%s)\n" % (kwargs["name"]) self.converter.prelude += "set(CMAKE_C_STANDARD 99)\n" + def maybe(self, rule, **kwargs): + if kwargs["name"] == "utf8_range": + self.converter.utf8_range_commit = kwargs["commit"] + pass + def http_archive(self, **kwargs): pass @@ -219,10 +238,13 @@ class WorkspaceFileFunctions(object): def bazel_version_repository(self, **kwargs): pass - def upb_deps(self): + def protobuf_deps(self): pass - def protobuf_deps(self): + def utf8_range_deps(self): + pass + + def pip_parse(self, **kwargs): pass def rules_fuzzing_dependencies(self): @@ -231,9 +253,15 @@ class WorkspaceFileFunctions(object): def rules_fuzzing_init(self): pass + def rules_pkg_dependencies(self): + pass + def system_python(self, **kwargs): pass + def register_system_python(self, **kwargs): + pass + def register_toolchains(self, toolchain): pass @@ -243,17 +271,25 @@ class WorkspaceFileFunctions(object): def python_nuget_package(self, **kwargs): pass + def install_deps(self): + pass + + def fuzzing_py_install_deps(self): + pass + class Converter(object): def __init__(self): self.prelude = "" self.toplevel = "" self.if_lua = "" + self.utf8_range_commit = "" def convert(self): return self.template % { "prelude": converter.prelude, "toplevel": converter.toplevel, + "utf8_range_commit": converter.utf8_range_commit, } template = textwrap.dedent("""\ @@ -310,6 +346,25 @@ class Converter(object): include_directories(../cmake) include_directories(${CMAKE_CURRENT_BINARY_DIR}) + if(NOT TARGET utf8_range) + if(EXISTS ../external/utf8_range) + # utf8_range is already installed + include_directories(../external/utf8_range) + else() + include(FetchContent) + FetchContent_Declare( + utf8_range + GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git" + GIT_TAG "%(utf8_range_commit)s" + ) + FetchContent_GetProperties(utf8_range) + if(NOT utf8_range_POPULATED) + FetchContent_Populate(utf8_range) + include_directories(${utf8_range_SOURCE_DIR}) + endif() + endif() + endif() + if(APPLE) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup -flat_namespace") elseif(UNIX) @@ -336,7 +391,9 @@ def GetDict(obj): globs = GetDict(converter) -exec(open("WORKSPACE").read(), GetDict(WorkspaceFileFunctions(converter))) +workspace_dict = GetDict(WorkspaceFileFunctions(converter)) +exec(open("bazel/workspace_deps.bzl").read(), workspace_dict) +exec(open("WORKSPACE").read(), workspace_dict) exec(open("BUILD").read(), GetDict(BuildFileFunctions(converter))) with open(sys.argv[1], "w") as f: diff --git a/third_party/upb/cmake/push_auto_update.sh b/third_party/upb/cmake/push_auto_update.sh new file mode 100755 index 00000000000..506dd5513f3 --- /dev/null +++ b/third_party/upb/cmake/push_auto_update.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# This script updates checked-in generated files (currently CMakeLists.txt, +# descriptor.upb.h, and descriptor.upb.c), commits the resulting change, and +# pushes it. This does not do anything useful when run manually, but should be +# run by our GitHub action instead. + +set -ex + +# Exit early if the previous commit was made by the bot. This reduces the risk +# of a bug causing an infinite loop of auto-generated commits. +if (git log -1 --pretty=format:'%an' | grep -q "Protobuf Team Bot"); then + echo "Previous commit was authored by bot" + exit 0 +fi + +cd $(dirname -- "$0")/.. +bazel test //cmake:test_generated_files || bazel-bin/cmake/test_generated_files --fix + +# Try to determine the most recent pull request number. +title=$(git log -1 --pretty='%s') +pr_from_merge=$(echo "$title" | sed -n 's/^Merge pull request #\([0-9]\+\).*/\1/p') +pr_from_squash=$(echo "$title" | sed -n 's/^.*(#\([0-9]\+\))$/\1/p') + +pr="" +if [ ! -z "$pr_from_merge" ]; then + pr="$pr_from_merge" +elif [ ! -z "$pr_from_squash" ]; then + pr="$pr_from_squash" +fi + +if [ ! -z "$pr" ]; then + commit_message="Auto-generate CMake file lists after PR #$pr" +else + # If we are unable to determine the pull request number, we fall back on this + # default commit message. Typically this should not occur, but could happen + # if a pull request was merged via a rebase. + commit_message="Auto-generate CMake file lists" +fi + +git add -A +git diff --staged --quiet || git commit -am "$commit_message" +git push diff --git a/third_party/upb/cmake/staleness_test.py b/third_party/upb/cmake/staleness_test.py index 58f1833c908..a21501f7f63 100644 --- a/third_party/upb/cmake/staleness_test.py +++ b/third_party/upb/cmake/staleness_test.py @@ -25,7 +25,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. -"""The py_test() script for generated_file_staleness_test() rules. +"""The py_test() script for staleness_test() rules. Note that this file is preprocessed! The INSERT_<...> text below is replaced with the actual list of files before we actually run the script. diff --git a/third_party/upb/cmake/staleness_test_lib.py b/third_party/upb/cmake/staleness_test_lib.py index 0748969c342..4887f248557 100644 --- a/third_party/upb/cmake/staleness_test_lib.py +++ b/third_party/upb/cmake/staleness_test_lib.py @@ -25,15 +25,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. -"""Shared code for validating generated_file_staleness_test() rules. +"""Shared code for validating staleness_test() rules. -This code is used by test scripts generated from -generated_file_staleness_test() rules. +This code is used by test scripts generated from staleness_test() rules. """ from __future__ import absolute_import from __future__ import print_function +import difflib import sys import os from shutil import copyfile @@ -172,7 +172,10 @@ def CheckFilesMatch(config): continue for pair in stale_files: - diff_errors.append("File %s is out of date" % pair.target) + with open(pair.generated) as g, open(pair.target) as t: + diff = ''.join(difflib.unified_diff(g.read().splitlines(keepends=True), + t.read().splitlines(keepends=True))) + diff_errors.append("File %s is out of date:\n%s" % (pair.target, diff)) if diff_errors: error_msg = "Files out of date!\n\n" diff --git a/third_party/upb/docs/style-guide.md b/third_party/upb/docs/style-guide.md index bc68e1a8ed3..e02571b5240 100644 --- a/third_party/upb/docs/style-guide.md +++ b/third_party/upb/docs/style-guide.md @@ -61,5 +61,5 @@ typedef struct { const int32_t* _values; // List of values <0 or >63 uint64_t _mask; // Bits are set for acceptable value 0 <= x < 64 int _value_count; -} upb_MiniTable_Enum; +} upb_MiniTableEnum; ``` diff --git a/third_party/upb/docs/wrapping-upb.md b/third_party/upb/docs/wrapping-upb.md index 68392d5d8fd..6a98c2268a9 100644 --- a/third_party/upb/docs/wrapping-upb.md +++ b/third_party/upb/docs/wrapping-upb.md @@ -173,12 +173,12 @@ class MyMessage(_message.Message): To use reflection-based access: -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. +1. Load and access descriptor data using the interfaces in upb/def.h. +2. Access message data using the interfaces in upb/reflection.h. ### MiniTables -MiniTables are a "lite" schema representation that are much smaller that +MiniTables are a "lite" schema representation that are much smaller than reflection. MiniTables omit names, options, and almost everything else from the `.proto` file, retaining only enough information to parse and serialize binary format. @@ -227,15 +227,15 @@ class FooMessage { ``` 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 +to JSON or TextFormat, because they do not 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: -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. +1. Load and access MiniDescriptors data using the interfaces in upb/mini_table.h. +2. Access message data using the interfaces in upb/msg_accessors.h. ## Memory Management diff --git a/third_party/upb/upb/bindings/lua/BUILD.bazel b/third_party/upb/lua/BUILD.bazel similarity index 91% rename from third_party/upb/upb/bindings/lua/BUILD.bazel rename to third_party/upb/lua/BUILD.bazel index d5ca32dbf6a..a8a204af1b3 100644 --- a/third_party/upb/upb/bindings/lua/BUILD.bazel +++ b/third_party/upb/lua/BUILD.bazel @@ -29,7 +29,7 @@ load( "UPB_DEFAULT_CPPOPTS", ) load( - "//upb/bindings/lua:lua_proto_library.bzl", + "//lua:lua_proto_library.bzl", "lua_proto_library", ) @@ -63,7 +63,7 @@ cc_binary( visibility = ["//visibility:public"], deps = [ "@com_google_absl//absl/strings", - "@com_google_protobuf//:protoc_lib", + "@com_google_protobuf//src/google/protobuf/compiler:code_generator", ], ) @@ -82,13 +82,13 @@ cc_test( ":test_proto_lua", "//:third_party/lunit/console.lua", "//:third_party/lunit/lunit.lua", - "//upb/bindings/lua:upb.lua", + "//lua:upb.lua", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//conformance:conformance_proto", ], linkstatic = 1, deps = [ - "//upb/bindings/lua:lupb", + "//lua:lupb", "@lua//:liblua", ], ) @@ -119,11 +119,11 @@ lua_proto_library( lua_proto_library( name = "test_messages_proto3_proto_lua", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], ) lua_proto_library( name = "test_messages_proto2_proto_lua", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto2_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], ) diff --git a/third_party/upb/lua/README.md b/third_party/upb/lua/README.md new file mode 100644 index 00000000000..9374f266fca --- /dev/null +++ b/third_party/upb/lua/README.md @@ -0,0 +1,8 @@ +# upb Lua bindings + +These are some bare-bones upb bindings for Lua. + +These bindings exist primarily for experimentation and testing. +They are incomplete and are not really intended for use in any application. +This is by no means a complete or supported protobuf library, and in fact +we don't even claim it to be functional. diff --git a/third_party/upb/upb/bindings/lua/def.c b/third_party/upb/lua/def.c similarity index 99% rename from third_party/upb/upb/bindings/lua/def.c rename to third_party/upb/lua/def.c index 602dbaf9a47..90161ec8195 100644 --- a/third_party/upb/upb/bindings/lua/def.c +++ b/third_party/upb/lua/def.c @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/def.h" +#include "upb/reflection/def.h" #include #include @@ -33,7 +33,7 @@ #include #include "lauxlib.h" -#include "upb/bindings/lua/upb.h" +#include "lua/upb.h" #include "upb/reflection.h" #define LUPB_ENUMDEF "lupb.enumdef" diff --git a/third_party/upb/upb/bindings/lua/lua_proto_library.bzl b/third_party/upb/lua/lua_proto_library.bzl similarity index 84% rename from third_party/upb/upb/bindings/lua/lua_proto_library.bzl rename to third_party/upb/lua/lua_proto_library.bzl index 24dfdd60471..cc1486a60bf 100644 --- a/third_party/upb/upb/bindings/lua/lua_proto_library.bzl +++ b/third_party/upb/lua/lua_proto_library.bzl @@ -29,6 +29,14 @@ load("@bazel_skylib//lib:paths.bzl", "paths") # Generic support code ######################################################### +# begin:github_only +_is_google3 = False +# end:github_only + +# begin:google_only +# _is_google3 = True +# end:google_only + def _get_real_short_path(file): # For some reason, files from other archives have short paths that look like: # ../com_google_protobuf/google/protobuf/descriptor.proto @@ -39,18 +47,26 @@ def _get_real_short_path(file): # Sometimes it has another few prefixes like: # _virtual_imports/any_proto/google/protobuf/any.proto + # benchmarks/_virtual_imports/100_msgs_proto/benchmarks/100_msgs.proto # We want just google/protobuf/any.proto. - if short_path.startswith("_virtual_imports"): - short_path = short_path.split("/", 2)[-1] + virtual_imports = "_virtual_imports/" + if virtual_imports in short_path: + short_path = short_path.split(virtual_imports)[1].split("/", 1)[1] return short_path -def _get_real_root(file): +def _get_real_root(ctx, file): real_short_path = _get_real_short_path(file) - return file.path[:-len(real_short_path) - 1] + root = file.path[:-len(real_short_path) - 1] + if not _is_google3 and ctx.rule.attr.strip_import_prefix: + root = paths.join(root, ctx.rule.attr.strip_import_prefix[1:]) + return root def _generate_output_file(ctx, src, extension): + package = ctx.label.package + if not _is_google3 and ctx.rule.attr.strip_import_prefix and ctx.rule.attr.strip_import_prefix != "/": + package = package[len(ctx.rule.attr.strip_import_prefix):] real_short_path = _get_real_short_path(src) - real_short_path = paths.relativize(real_short_path, ctx.label.package) + real_short_path = paths.relativize(real_short_path, package) output_filename = paths.replace_extension(real_short_path, extension) ret = ctx.actions.declare_file(output_filename) return ret @@ -74,7 +90,7 @@ def _compile_upb_protos(ctx, proto_info, proto_sources): outputs = files, executable = ctx.executable._protoc, arguments = [ - "--lua_out=" + _get_real_root(files[0]), + "--lua_out=" + _get_real_root(ctx, files[0]), "--plugin=protoc-gen-lua=" + ctx.executable._upbc.path, "--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets]), ] + @@ -111,7 +127,7 @@ _lua_proto_library_aspect = aspect( "_upbc": attr.label( executable = True, cfg = "exec", - default = "//upb/bindings/lua:protoc-gen-lua", + default = "//lua:protoc-gen-lua", ), "_protoc": attr.label( executable = True, diff --git a/third_party/upb/upb/bindings/lua/main.c b/third_party/upb/lua/main.c similarity index 95% rename from third_party/upb/upb/bindings/lua/main.c rename to third_party/upb/lua/main.c index 4245c4d89c5..9daf50987bd 100644 --- a/third_party/upb/upb/bindings/lua/main.c +++ b/third_party/upb/lua/main.c @@ -30,7 +30,7 @@ #include #include -#include "upb/bindings/lua/upb.h" +#include "lua/upb.h" lua_State* L; @@ -57,7 +57,7 @@ const char* init = "bazel-bin/external/com_google_protobuf/src/?.lua;" "bazel-bin/external/com_google_protobuf/?.lua;" "bazel-bin/external/com_google_protobuf/?.lua;" - "upb/bindings/lua/?.lua" + "lua/?.lua" "'"; int main(int argc, char** argv) { @@ -70,7 +70,7 @@ int main(int argc, char** argv) { signal(SIGINT, sighandler); ret = ret || lua_pcall(L, 1, LUA_MULTRET, 0) || - luaL_dofile(L, "upb/bindings/lua/test_upb.lua"); + luaL_dofile(L, "lua/test_upb.lua"); signal(SIGINT, SIG_DFL); if (ret) { diff --git a/third_party/upb/upb/bindings/lua/msg.c b/third_party/upb/lua/msg.c similarity index 98% rename from third_party/upb/upb/bindings/lua/msg.c rename to third_party/upb/lua/msg.c index 5da2765870d..094ec570d6c 100644 --- a/third_party/upb/upb/bindings/lua/msg.c +++ b/third_party/upb/lua/msg.c @@ -38,12 +38,13 @@ #include #include "lauxlib.h" -#include "upb/bindings/lua/upb.h" -#include "upb/json_decode.h" -#include "upb/json_encode.h" -#include "upb/port_def.inc" -#include "upb/reflection.h" -#include "upb/text_encode.h" +#include "lua/upb.h" +#include "upb/collections/map.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/port/def.inc" +#include "upb/reflection/message.h" +#include "upb/text/encode.h" /* * Message/Map/Array objects. These objects form a directed graph: a message @@ -578,7 +579,7 @@ static int lupb_Map_Newindex(lua_State* L) { upb_MessageValue key = lupb_tomsgval(L, lmap->key_type, 2, 1, LUPB_REF); if (lua_isnil(L, 3)) { - upb_Map_Delete(map, key); + upb_Map_Delete(map, key, NULL); } else { upb_MessageValue val = lupb_tomsgval(L, lmap->value_type, 3, 1, LUPB_COPY); upb_Map_Set(map, key, val, lupb_Arenaget(L, 1)); @@ -595,9 +596,8 @@ static int lupb_MapIterator_Next(lua_State* L) { size_t* iter = lua_touserdata(L, lua_upvalueindex(1)); lupb_map* lmap = lupb_map_check(L, map); - if (upb_MapIterator_Next(lmap->map, iter)) { - upb_MessageValue key = upb_MapIterator_Key(lmap->map, *iter); - upb_MessageValue val = upb_MapIterator_Value(lmap->map, *iter); + upb_MessageValue key, val; + if (upb_Map_Next(lmap->map, &key, &val, iter)) { lupb_pushmsgval(L, map, lmap->key_type, key); lupb_pushmsgval(L, map, lmap->value_type, val); return 2; @@ -679,7 +679,7 @@ upb_Message* lupb_msg_pushnew(lua_State* L, int narg) { lua_pushvalue(L, 1); lua_setiuservalue(L, -2, LUPB_MSGDEF_INDEX); - lmsg->msg = upb_Message_New(m, arena); + lmsg->msg = upb_Message_New(upb_MessageDef_MiniTable(m), arena); lupb_cacheset(L, lmsg->msg); return lmsg->msg; } @@ -825,7 +825,7 @@ static int lupb_msg_index(lua_State* L) { } } else { /* Value type, just push value and return .*/ - upb_MessageValue val = upb_Message_Get(msg, f); + upb_MessageValue val = upb_Message_GetFieldByDef(msg, f); lupb_pushmsgval(L, 0, upb_FieldDef_CType(f), val); } @@ -882,7 +882,7 @@ static int lupb_Message_Newindex(lua_State* L) { lupb_Arena_Fuseobjs(L, 1, 3); } - upb_Message_Set(msg, f, msgval, lupb_Arenaget(L, 1)); + upb_Message_SetFieldByDef(msg, f, msgval, lupb_Arenaget(L, 1)); /* Return the new value for chained assignments. */ lua_pushvalue(L, 3); diff --git a/third_party/upb/upb/bindings/lua/test.proto b/third_party/upb/lua/test.proto similarity index 100% rename from third_party/upb/upb/bindings/lua/test.proto rename to third_party/upb/lua/test.proto diff --git a/third_party/upb/upb/bindings/lua/test_upb.lua b/third_party/upb/lua/test_upb.lua similarity index 99% rename from third_party/upb/upb/bindings/lua/test_upb.lua rename to third_party/upb/lua/test_upb.lua index 998f3110ab8..f50eed0a2fb 100644 --- a/third_party/upb/upb/bindings/lua/test_upb.lua +++ b/third_party/upb/lua/test_upb.lua @@ -29,7 +29,7 @@ local upb = require "lupb" local lunit = require "lunit" -local upb_test = require "upb.bindings.lua.test_pb" +local upb_test = require "lua.test_pb" local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb" local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb" local descriptor = require "google.protobuf.descriptor_pb" @@ -667,7 +667,7 @@ end function test_foo() local defpool = upb.DefPool() - local filename = "external/com_google_protobuf/descriptor_proto-descriptor-set.proto.bin" + local filename = "external/com_google_protobuf/src/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") diff --git a/third_party/upb/upb/bindings/lua/upb.c b/third_party/upb/lua/upb.c similarity index 99% rename from third_party/upb/upb/bindings/lua/upb.c rename to third_party/upb/lua/upb.c index 3d59cddff0a..8c73e5fb7f4 100644 --- a/third_party/upb/upb/bindings/lua/upb.c +++ b/third_party/upb/lua/upb.c @@ -47,7 +47,7 @@ * domain of [u]int64 values. */ -#include "upb/bindings/lua/upb.h" +#include "lua/upb.h" #include #include diff --git a/third_party/upb/upb/bindings/lua/upb.h b/third_party/upb/lua/upb.h similarity index 98% rename from third_party/upb/upb/bindings/lua/upb.h rename to third_party/upb/lua/upb.h index e0dc79eb048..a06d964d550 100644 --- a/third_party/upb/upb/bindings/lua/upb.h +++ b/third_party/upb/lua/upb.h @@ -33,9 +33,9 @@ #define UPB_LUA_UPB_H_ #include "lauxlib.h" -#include "upb/def.h" #include "upb/msg.h" -#include "upb/reflection.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" /* Lua changes its API in incompatible ways in every minor release. * This is some shim code to paper over the differences. */ diff --git a/third_party/upb/upb/bindings/lua/upb.lua b/third_party/upb/lua/upb.lua similarity index 100% rename from third_party/upb/upb/bindings/lua/upb.lua rename to third_party/upb/lua/upb.lua diff --git a/third_party/upb/upb/bindings/lua/upbc.cc b/third_party/upb/lua/upbc.cc similarity index 100% rename from third_party/upb/upb/bindings/lua/upbc.cc rename to third_party/upb/lua/upbc.cc index 78e1473a7e1..e857f7aae9f 100644 --- a/third_party/upb/upb/bindings/lua/upbc.cc +++ b/third_party/upb/lua/upbc.cc @@ -23,14 +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 "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/compiler/plugin.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/io/printer.h" namespace protoc = ::google::protobuf::compiler; namespace protobuf = ::google::protobuf; diff --git a/third_party/upb/protos/BUILD b/third_party/upb/protos/BUILD new file mode 100644 index 00000000000..a848b920dce --- /dev/null +++ b/third_party/upb/protos/BUILD @@ -0,0 +1,99 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +load( + "//bazel:build_defs.bzl", + "UPB_DEFAULT_CPPOPTS", +) +load( + "//protos/bazel:upb_cc_proto_library.bzl", + "upb_cc_proto_library_copts", +) + +licenses(["notice"]) + +cc_library( + name = "protos", + srcs = ["protos.cc"], + hdrs = ["protos.h"], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//visibility:public"], + deps = [ + "//:message_accessors", + "//:mini_table", + "//:upb", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings:str_format", + ], +) + +cc_library( + name = "protos_internal", + hdrs = ["protos_internal.h"], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//visibility:public"], + deps = [ + ":protos", + "//:mini_table", + "//:upb", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings:str_format", + ], +) + +# Common support code for C++ generated code. +cc_library( + name = "generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + hdrs = [ + "protos_internal.h", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//visibility:public"], + deps = [ + ":protos", + ":protos_internal", + ], +) + +cc_test( + name = "protos_internal_test", + srcs = ["protos_internal_test.cc"], + copts = UPB_DEFAULT_CPPOPTS, + deps = [ + ":protos_internal", + "//:upb", + "//protos_generator/tests:test_model_upb_cc_proto", + "//protos_generator/tests:test_model_upb_proto", + "@com_google_googletest//:gtest_main", + ], +) + +upb_cc_proto_library_copts( + name = "upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//visibility:public"], +) diff --git a/third_party/upb/protos/bazel/BUILD b/third_party/upb/protos/bazel/BUILD new file mode 100644 index 00000000000..607edae9ca8 --- /dev/null +++ b/third_party/upb/protos/bazel/BUILD @@ -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. + +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +licenses(["notice"]) + +bzl_library( + name = "upb_cc_proto_library_bzl", + srcs = ["upb_cc_proto_library.bzl"], + visibility = ["//visibility:public"], + deps = [ + "@bazel_skylib//lib:paths", + "//bazel:upb_proto_library_bzl", + "@bazel_tools//tools/cpp:toolchain_utils.bzl", + ], +) diff --git a/third_party/upb/protos/bazel/upb_cc_proto_library.bzl b/third_party/upb/protos/bazel/upb_cc_proto_library.bzl new file mode 100644 index 00000000000..8fad95abc60 --- /dev/null +++ b/third_party/upb/protos/bazel/upb_cc_proto_library.bzl @@ -0,0 +1,322 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Public rules for using upb protos: + - upb_cc_proto_library() +""" + +load("@bazel_skylib//lib:paths.bzl", "paths") +load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") + +# begin:google_only +# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") +# +# end:google_only +# begin:github_only +# Compatibility code for Bazel 4.x. Remove this when we drop support for Bazel 4.x. +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") + +def use_cpp_toolchain(): + return ["@bazel_tools//tools/cpp:toolchain_type"] +# end:github_only + +# Generic support code ######################################################### + +# begin:github_only +_is_google3 = False +# end:github_only + +# begin:google_only +# _is_google3 = True +# end:google_only + +def _get_real_short_path(file): + # For some reason, files from other archives have short paths that look like: + # ../com_google_protobuf/google/protobuf/descriptor.proto + short_path = file.short_path + if short_path.startswith("../"): + second_slash = short_path.index("/", 3) + short_path = short_path[second_slash + 1:] + + # Sometimes it has another few prefixes like: + # _virtual_imports/any_proto/google/protobuf/any.proto + # benchmarks/_virtual_imports/100_msgs_proto/benchmarks/100_msgs.proto + # We want just google/protobuf/any.proto. + virtual_imports = "_virtual_imports/" + if virtual_imports in short_path: + short_path = short_path.split(virtual_imports)[1].split("/", 1)[1] + return short_path + +def _get_real_root(file): + real_short_path = _get_real_short_path(file) + return file.path[:-len(real_short_path) - 1] + +def _generate_output_file(ctx, src, extension): + real_short_path = _get_real_short_path(src) + real_short_path = paths.relativize(real_short_path, ctx.label.package) + output_filename = paths.replace_extension(real_short_path, extension) + ret = ctx.actions.declare_file(output_filename) + return ret + +def _filter_none(elems): + out = [] + for elem in elems: + if elem: + out.append(elem) + return out + +def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): + """Like cc_library(), but callable from rules. + + Args: + ctx: Rule context. + name: Unique name used to generate output files. + hdrs: Public headers that can be #included from other rules. + srcs: C/C++ source files. + copts: Additional options for cc compilation. + dep_ccinfos: CcInfo providers of dependencies we should build/link against. + + Returns: + CcInfo provider for this compilation. + """ + + compilation_contexts = [info.compilation_context for info in dep_ccinfos] + linking_contexts = [info.linking_context for info in dep_ccinfos] + toolchain = find_cpp_toolchain(ctx) + feature_configuration = cc_common.configure_features( + ctx = ctx, + cc_toolchain = toolchain, + requested_features = ctx.features, + unsupported_features = ctx.disabled_features, + ) + + blaze_only_args = {} + + if _is_google3: + blaze_only_args["grep_includes"] = ctx.file._grep_includes + + (compilation_context, compilation_outputs) = cc_common.compile( + actions = ctx.actions, + feature_configuration = feature_configuration, + cc_toolchain = toolchain, + name = name, + srcs = srcs, + public_hdrs = hdrs, + user_compile_flags = copts, + compilation_contexts = compilation_contexts, + **blaze_only_args + ) + + # buildifier: disable=unused-variable + (linking_context, linking_outputs) = cc_common.create_linking_context_from_compilation_outputs( + actions = ctx.actions, + name = name, + feature_configuration = feature_configuration, + cc_toolchain = toolchain, + compilation_outputs = compilation_outputs, + linking_contexts = linking_contexts, + **blaze_only_args + ) + + return CcInfo( + compilation_context = compilation_context, + linking_context = linking_context, + ) + +# Dummy rule to expose select() copts to aspects ############################## + +UpbCcProtoLibraryCoptsInfo = provider( + "Provides copts for upb cc proto targets", + fields = { + "copts": "copts for upb_cc_proto_library()", + }, +) + +def upb_cc_proto_library_copts_impl(ctx): + return UpbCcProtoLibraryCoptsInfo(copts = ctx.attr.copts) + +upb_cc_proto_library_copts = rule( + implementation = upb_cc_proto_library_copts_impl, + attrs = {"copts": attr.string_list(default = [])}, +) + +_UpbCcWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"]) +_WrappedCcGeneratedSrcsInfo = provider("Provider for generated sources", fields = ["srcs"]) + +def _compile_upb_cc_protos(ctx, generator, proto_info, proto_sources): + if len(proto_sources) == 0: + return GeneratedSrcsInfo(srcs = [], hdrs = []) + + tool = getattr(ctx.executable, "_gen_" + generator) + srcs = [_generate_output_file(ctx, name, ".upb.proto.cc") for name in proto_sources] + hdrs = [_generate_output_file(ctx, name, ".upb.proto.h") for name in proto_sources] + hdrs += [_generate_output_file(ctx, name, ".upb.fwd.h") for name in proto_sources] + transitive_sets = proto_info.transitive_descriptor_sets.to_list() + + args = ctx.actions.args() + args.use_param_file(param_file_arg = "@%s") + args.set_param_file_format("multiline") + + args.add("--" + generator + "_out=" + _get_real_root(srcs[0])) + args.add("--plugin=protoc-gen-" + generator + "=" + tool.path) + args.add("--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets])) + args.add_all(proto_sources, map_each = _get_real_short_path) + + ctx.actions.run( + inputs = depset( + direct = [proto_info.direct_descriptor_set], + transitive = [proto_info.transitive_descriptor_sets], + ), + tools = [tool], + outputs = srcs + hdrs, + executable = ctx.executable._protoc, + arguments = [args], + progress_message = "Generating upb cc protos for :" + ctx.label.name, + ) + return GeneratedSrcsInfo(srcs = srcs, hdrs = hdrs) + +def _upb_cc_proto_rule_impl(ctx): + if len(ctx.attr.deps) != 1: + fail("only one deps dependency allowed.") + dep = ctx.attr.deps[0] + + if _WrappedCcGeneratedSrcsInfo in dep: + srcs = dep[_WrappedCcGeneratedSrcsInfo].srcs + else: + fail("proto_library rule must generate _WrappedCcGeneratedSrcsInfo (aspect should have " + + "handled this).") + + if _UpbCcWrappedCcInfo in dep: + cc_info = dep[_UpbCcWrappedCcInfo].cc_info + elif UpbWrappedCcInfo in dep: + cc_info = dep[UpbWrappedCcInfo].cc_info + else: + fail("proto_library rule must generate UpbWrappedCcInfo or " + + "_UpbCcWrappedCcInfo (aspect should have handled this).") + + lib = cc_info.linking_context.linker_inputs.to_list()[0].libraries[0] + files = _filter_none([ + lib.static_library, + lib.pic_static_library, + lib.dynamic_library, + ]) + return [ + DefaultInfo(files = depset(files + srcs.hdrs + srcs.srcs)), + srcs, + cc_info, + ] + +def _upb_cc_proto_aspect_impl(target, ctx, generator, cc_provider, file_provider): + proto_info = target[ProtoInfo] + files = _compile_upb_cc_protos(ctx, generator, proto_info, proto_info.direct_sources) + deps = ctx.rule.attr.deps + getattr(ctx.attr, "_" + generator) + dep_ccinfos = [dep[CcInfo] for dep in deps if CcInfo in dep] + dep_ccinfos += [dep[UpbWrappedCcInfo].cc_info for dep in deps if UpbWrappedCcInfo in dep] + dep_ccinfos += [dep[_UpbCcWrappedCcInfo].cc_info for dep in deps if _UpbCcWrappedCcInfo in dep] + if UpbWrappedCcInfo not in target: + fail("Target should have UpbWrappedCcInfo provider") + dep_ccinfos.append(target[UpbWrappedCcInfo].cc_info) + cc_info = _cc_library_func( + ctx = ctx, + name = ctx.rule.attr.name + "." + generator, + hdrs = files.hdrs, + srcs = files.srcs, + copts = ctx.attr._ccopts[UpbCcProtoLibraryCoptsInfo].copts, + dep_ccinfos = dep_ccinfos, + ) + return [cc_provider(cc_info = cc_info), file_provider(srcs = files)] + +def _upb_cc_proto_library_aspect_impl(target, ctx): + return _upb_cc_proto_aspect_impl(target, ctx, "upbprotos", _UpbCcWrappedCcInfo, _WrappedCcGeneratedSrcsInfo) + +def _maybe_add(d): + if _is_google3: + d["_grep_includes"] = attr.label( + allow_single_file = True, + cfg = "exec", + default = "@bazel_tools//tools/cpp:grep-includes", + ) + return d + +_upb_cc_proto_library_aspect = aspect( + attrs = _maybe_add({ + "_ccopts": attr.label( + default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + ), + "_gen_upbprotos": attr.label( + executable = True, + cfg = "exec", + default = "//protos_generator:protoc-gen-upb-protos", + ), + "_protoc": attr.label( + executable = True, + cfg = "exec", + default = "@com_google_protobuf//:protoc", + ), + "_cc_toolchain": attr.label( + default = "@bazel_tools//tools/cpp:current_cc_toolchain", + ), + "_upbprotos": attr.label_list( + default = [ + # TODO: Add dependencies for cc runtime (absl/string etc..) + "//:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/status:statusor", + "//protos", + ], + ), + }), + implementation = _upb_cc_proto_library_aspect_impl, + provides = [ + _UpbCcWrappedCcInfo, + _WrappedCcGeneratedSrcsInfo, + ], + required_aspect_providers = [ + UpbWrappedCcInfo, + ], + attr_aspects = ["deps"], + fragments = ["cpp"], + toolchains = use_cpp_toolchain(), + incompatible_use_toolchain_transition = True, +) + +upb_cc_proto_library = rule( + output_to_genfiles = True, + implementation = _upb_cc_proto_rule_impl, + attrs = { + "deps": attr.label_list( + aspects = [ + upb_proto_library_aspect, + _upb_cc_proto_library_aspect, + ], + allow_rules = ["proto_library"], + providers = [ProtoInfo], + ), + "_ccopts": attr.label( + default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + ), + }, +) diff --git a/third_party/upb/protos/protos.cc b/third_party/upb/protos/protos.cc new file mode 100644 index 00000000000..7a651c497f0 --- /dev/null +++ b/third_party/upb/protos/protos.cc @@ -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 "protos/protos.h" + +#include "absl/strings/str_format.h" + +namespace protos { + +// begin:google_only +// absl::Status MessageAllocationError(SourceLocation loc) { +// return absl::Status(absl::StatusCode::kInternal, +// "Upb message allocation error", loc); +// } +// +// absl::Status ExtensionNotFoundError(int extension_number, SourceLocation loc) { +// return absl::Status( +// absl::StatusCode::kInternal, +// absl::StrFormat("Extension %d not found", extension_number), loc); +// } +// +// absl::Status MessageEncodeError(upb_EncodeStatus status, SourceLocation loc) { +// return absl::Status(absl::StatusCode::kInternal, +// absl::StrFormat("Upb message encoding error %d", status), +// loc +// +// ); +// } +// +// absl::Status MessageDecodeError(upb_DecodeStatus status, SourceLocation loc +// +// ) { +// return absl::Status(absl::StatusCode::kInternal, +// absl::StrFormat("Upb message parse error %d", status), loc +// +// ); +// } +// end:google_only + +// begin:github_only +absl::Status MessageAllocationError(SourceLocation loc) { + return absl::Status(absl::StatusCode::kUnknown, + "Upb message allocation error"); +} + +absl::Status ExtensionNotFoundError(int ext_number, SourceLocation loc) { + return absl::Status(absl::StatusCode::kUnknown, + absl::StrFormat("Extension %d not found", ext_number)); +} + +absl::Status MessageEncodeError(upb_EncodeStatus s, SourceLocation loc) { + return absl::Status(absl::StatusCode::kUnknown, "Encoding error"); +} + +absl::Status MessageDecodeError(upb_DecodeStatus status, SourceLocation loc + +) { + return absl::Status(absl::StatusCode::kUnknown, "Upb message parse error"); +} +// end:github_only + +namespace internal { + +upb_ExtensionRegistry* GetUpbExtensions( + const ExtensionRegistry& extension_registry) { + return extension_registry.registry_; +} + +absl::StatusOr Serialize(const upb_Message* message, + const upb_MiniTable* mini_table, + upb_Arena* arena, int options) { + size_t len; + char* ptr; + upb_EncodeStatus status = + upb_Encode(message, mini_table, options, arena, &ptr, &len); + if (status == kUpb_EncodeStatus_Ok) { + return absl::string_view(ptr, len); + } + return MessageEncodeError(status); +} + +} // namespace internal + +} // namespace protos diff --git a/third_party/upb/protos/protos.h b/third_party/upb/protos/protos.h new file mode 100644 index 00000000000..5721a73f784 --- /dev/null +++ b/third_party/upb/protos/protos.h @@ -0,0 +1,494 @@ +/* + * 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_PROTOS_PROTOS_H_ +#define UPB_PROTOS_PROTOS_H_ + +#include + +#include "absl/status/status.h" +#include "absl/status/statusor.h" +#include "upb/message/extension_internal.h" +#include "upb/mini_table/types.h" +#include "upb/upb.hpp" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" + +namespace protos { + +using Arena = ::upb::Arena; +class ExtensionRegistry; + +template +using Proxy = std::conditional_t::value, + typename std::remove_const_t::CProxy, + typename T::Proxy>; + +// Provides convenient access to Proxy and CProxy message types. +// +// Using rebinding and handling of const, Ptr and Ptr +// allows copying const with T* const and avoids using non-copyable Proxy types +// directly. +template +class Ptr final { + public: + Ptr() = delete; + + // Implicit conversions + Ptr(T* m) : p_(m) {} // NOLINT + Ptr(const Proxy* p) : p_(*p) {} // NOLINT + Ptr(Proxy p) : p_(p) {} // NOLINT + Ptr(const Ptr& m) = default; + + Ptr& operator=(Ptr v) & { + Proxy::Rebind(p_, v.p_); + return *this; + } + + Proxy operator*() const { return p_; } + Proxy* operator->() const { + return const_cast*>(std::addressof(p_)); + } + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wclass-conversion" +#endif + template ::value, int> = 0> + operator Ptr() const { + Proxy p(p_); + return Ptr(&p); + } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + + private: + Ptr(void* msg, upb_Arena* arena) : p_(msg, arena) {} // NOLINT + + friend class Ptr; + friend typename T::Access; + + Proxy p_; +}; + +inline absl::string_view UpbStrToStringView(upb_StringView str) { + return absl::string_view(str.data, str.size); +} + +// TODO: update bzl and move to upb runtime / protos.cc. +inline upb_StringView UpbStrFromStringView(absl::string_view str, + upb_Arena* arena) { + const size_t str_size = str.size(); + char* buffer = static_cast(upb_Arena_Malloc(arena, str_size)); + memcpy(buffer, str.data(), str_size); + return upb_StringView_FromDataAndSize(buffer, str_size); +} + +template +typename T::Proxy CreateMessage(::protos::Arena& arena) { + return typename T::Proxy(upb_Message_New(T::minitable(), arena.ptr()), + arena.ptr()); +} + +// begin:github_only +// This type exists to work around an absl type that has not yet been +// released. +struct SourceLocation { + static SourceLocation current() { return {}; } + absl::string_view file_name() { return ""; } + int line() { return 0; } +}; +// end:github_only + +// begin:google_only +// using SourceLocation = absl::SourceLocation; +// end:google_only + +absl::Status MessageAllocationError( + SourceLocation loc = SourceLocation::current()); + +absl::Status ExtensionNotFoundError( + int extension_number, SourceLocation loc = SourceLocation::current()); + +absl::Status MessageDecodeError(upb_DecodeStatus status, + SourceLocation loc = SourceLocation::current()); + +absl::Status MessageEncodeError(upb_EncodeStatus status, + SourceLocation loc = SourceLocation::current()); + +namespace internal { +template +T CreateMessage() { + return T(); +} + +template +typename T::Proxy CreateMessageProxy(void* msg, upb_Arena* arena) { + return typename T::Proxy(msg, arena); +} + +template +typename T::CProxy CreateMessage(upb_Message* msg) { + return typename T::CProxy(msg); +} + +class ExtensionMiniTableProvider { + public: + ExtensionMiniTableProvider(const upb_MiniTableExtension* mini_table_ext) + : mini_table_ext_(mini_table_ext) {} + const upb_MiniTableExtension* mini_table_ext() const { + return mini_table_ext_; + } + + private: + const upb_MiniTableExtension* mini_table_ext_; +}; + +// ------------------------------------------------------------------- +// ExtensionIdentifier +// This is the type of actual extension objects. E.g. if you have: +// extend Foo { +// optional MyExtension bar = 1234; +// } +// then "bar" will be defined in C++ as: +// ExtensionIdentifier bar(&namespace_bar_ext); +template +class ExtensionIdentifier : public ExtensionMiniTableProvider { + public: + using Extension = ExtensionType; + using Extendee = ExtendeeType; + + ExtensionIdentifier(const upb_MiniTableExtension* mini_table_ext) + : ExtensionMiniTableProvider(mini_table_ext) {} +}; + +template +void* GetInternalMsg(const T& message) { + return message.msg(); +} + +template +void* GetInternalMsg(const Ptr& message) { + return message->msg(); +} + +template +upb_Arena* GetArena(const T& message) { + return static_cast(message.GetInternalArena()); +} + +template +upb_Arena* GetArena(const Ptr& message) { + return static_cast(message->GetInternalArena()); +} + +upb_ExtensionRegistry* GetUpbExtensions( + const ExtensionRegistry& extension_registry); + +absl::StatusOr Serialize(const upb_Message* message, + const upb_MiniTable* mini_table, + upb_Arena* arena, int options); + +} // namespace internal + +class ExtensionRegistry { + public: + ExtensionRegistry( + const std::vector + extensions, + const upb::Arena& arena) + : registry_(upb_ExtensionRegistry_New(arena.ptr())) { + if (registry_) { + for (const auto& ext_provider : extensions) { + const auto* ext = ext_provider->mini_table_ext(); + bool success = upb_ExtensionRegistry_AddArray(registry_, &ext, 1); + if (!success) { + registry_ = nullptr; + break; + } + } + } + } + + private: + friend upb_ExtensionRegistry* ::protos::internal::GetUpbExtensions( + const ExtensionRegistry& extension_registry); + upb_ExtensionRegistry* registry_; +}; + +template +using EnableIfProtosClass = std::enable_if_t< + std::is_base_of::value && + std::is_base_of::value>; + +template +using EnableIfMutableProto = std::enable_if_t::value>; + +template > +bool HasExtension( + const T& message, + const ::protos::internal::ExtensionIdentifier& id) { + return _upb_Message_Getext(message.msg(), id.mini_table_ext()) != nullptr; +} + +template > +bool HasExtension( + const Ptr& message, + const ::protos::internal::ExtensionIdentifier& id) { + return _upb_Message_Getext(message->msg(), id.mini_table_ext()) != nullptr; +} + +template , typename = EnableIfMutableProto> +void ClearExtension( + const Ptr& message, + const ::protos::internal::ExtensionIdentifier& id) { + _upb_Message_ClearExtensionField(message->msg(), id.mini_table_ext()); +} + +template > +void ClearExtension( + const T& message, + const ::protos::internal::ExtensionIdentifier& id) { + _upb_Message_ClearExtensionField(message.msg(), id.mini_table_ext()); +} + +template > +absl::Status SetExtension( + const T& message, + const ::protos::internal::ExtensionIdentifier& id, + Extension& value) { + auto* message_arena = static_cast(message.GetInternalArena()); + upb_Message_Extension* msg_ext = _upb_Message_GetOrCreateExtension( + message.msg(), id.mini_table_ext(), message_arena); + if (!msg_ext) { + return MessageAllocationError(); + } + auto* extension_arena = static_cast(value.GetInternalArena()); + if (message_arena != extension_arena) { + upb_Arena_Fuse(message_arena, extension_arena); + } + msg_ext->data.ptr = value.msg(); + return absl::OkStatus(); +} + +template , typename = EnableIfMutableProto> +absl::Status SetExtension( + const Ptr& message, + const ::protos::internal::ExtensionIdentifier& id, + Extension& value) { + auto* message_arena = static_cast(message->GetInternalArena()); + upb_Message_Extension* msg_ext = _upb_Message_GetOrCreateExtension( + message->msg(), id.mini_table_ext(), message_arena); + if (!msg_ext) { + return MessageAllocationError(); + } + auto* extension_arena = static_cast(message->GetInternalArena()); + if (message_arena != extension_arena) { + upb_Arena_Fuse(message_arena, extension_arena); + } + msg_ext->data.ptr = ::protos::internal::GetInternalMsg(value); + return absl::OkStatus(); +} + +template > +absl::StatusOr> GetExtension( + const T& message, + const ::protos::internal::ExtensionIdentifier& id) { + const upb_Message_Extension* ext = + _upb_Message_Getext(message.msg(), id.mini_table_ext()); + if (!ext) { + return ExtensionNotFoundError(id.mini_table_ext()->field.number); + } + return Ptr( + ::protos::internal::CreateMessage(ext->data.ptr)); +} + +template > +absl::StatusOr> GetExtension( + const Ptr& message, + const ::protos::internal::ExtensionIdentifier& id) { + const upb_Message_Extension* ext = + _upb_Message_Getext(message->msg(), id.mini_table_ext()); + if (!ext) { + return ExtensionNotFoundError(id.mini_table_ext()->field.number); + } + return Ptr( + ::protos::internal::CreateMessage(ext->data.ptr)); +} + +template +bool Parse(T& message, absl::string_view bytes) { + _upb_Message_Clear(message.msg(), T::minitable()); + auto* arena = static_cast(message.GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message.msg(), T::minitable(), + /* extreg= */ nullptr, /* options= */ 0, + arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(T& message, absl::string_view bytes, + const ::protos::ExtensionRegistry& extension_registry) { + _upb_Message_Clear(message.msg(), T::minitable()); + auto* arena = static_cast(message.GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message.msg(), T::minitable(), + /* extreg= */ + ::protos::internal::GetUpbExtensions(extension_registry), + /* options= */ 0, arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(Ptr& message, absl::string_view bytes) { + _upb_Message_Clear(message->msg(), T::minitable()); + auto* arena = static_cast(message->GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message->msg(), T::minitable(), + /* extreg= */ nullptr, /* options= */ 0, + arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(Ptr& message, absl::string_view bytes, + const ::protos::ExtensionRegistry& extension_registry) { + _upb_Message_Clear(message->msg(), T::minitable()); + auto* arena = static_cast(message->GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message->msg(), T::minitable(), + /* extreg= */ + ::protos::internal::GetUpbExtensions(extension_registry), + /* options= */ 0, arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(std::unique_ptr& message, absl::string_view bytes) { + _upb_Message_Clear(message->msg(), T::minitable()); + auto* arena = static_cast(message->GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message->msg(), T::minitable(), + /* extreg= */ nullptr, /* options= */ 0, + arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(std::unique_ptr& message, absl::string_view bytes, + const ::protos::ExtensionRegistry& extension_registry) { + _upb_Message_Clear(message->msg(), T::minitable()); + auto* arena = static_cast(message->GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message->msg(), T::minitable(), + /* extreg= */ + ::protos::internal::GetUpbExtensions(extension_registry), + /* options= */ 0, arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(std::shared_ptr& message, absl::string_view bytes) { + _upb_Message_Clear(message->msg(), T::minitable()); + auto* arena = static_cast(message->GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message->msg(), T::minitable(), + /* extreg= */ nullptr, /* options= */ 0, + arena) == kUpb_DecodeStatus_Ok; +} + +template +bool Parse(std::shared_ptr& message, absl::string_view bytes, + const ::protos::ExtensionRegistry& extension_registry) { + _upb_Message_Clear(message->msg(), T::minitable()); + auto* arena = static_cast(message->GetInternalArena()); + return upb_Decode(bytes.data(), bytes.size(), message->msg(), T::minitable(), + /* extreg= */ + ::protos::internal::GetUpbExtensions(extension_registry), + /* options= */ 0, arena) == kUpb_DecodeStatus_Ok; +} + +template +absl::StatusOr Parse(absl::string_view bytes, int options = 0) { + T message; + auto* arena = static_cast(message.GetInternalArena()); + upb_DecodeStatus status = + upb_Decode(bytes.data(), bytes.size(), message.msg(), T::minitable(), + /* extreg= */ nullptr, /* options= */ 0, arena); + if (status == kUpb_DecodeStatus_Ok) { + return message; + } + return MessageDecodeError(status); +} + +template +absl::StatusOr Parse(absl::string_view bytes, + const ::protos::ExtensionRegistry& extension_registry, + int options = 0) { + T message; + auto* arena = static_cast(message.GetInternalArena()); + upb_DecodeStatus status = + upb_Decode(bytes.data(), bytes.size(), message.msg(), T::minitable(), + ::protos::internal::GetUpbExtensions(extension_registry), + /* options= */ 0, arena); + if (status == kUpb_DecodeStatus_Ok) { + return message; + } + return MessageDecodeError(status); +} + +template +absl::StatusOr Serialize(const T& message, upb::Arena& arena, + int options = 0) { + return ::protos::internal::Serialize( + ::protos::internal::GetInternalMsg(message), T::minitable(), arena.ptr(), + options); +} + +template +absl::StatusOr Serialize(std::unique_ptr& message, + upb::Arena& arena, + int options = 0) { + return ::protos::internal::Serialize(message->msg(), T::minitable(), + arena.ptr(), options); +} + +template +absl::StatusOr Serialize(std::shared_ptr& message, + upb::Arena& arena, + int options = 0) { + return ::protos::internal::Serialize(message->msg(), T::minitable(), + arena.ptr(), options); +} + +template +absl::StatusOr Serialize(Ptr message, upb::Arena& arena, + int options = 0) { + return ::protos::internal::Serialize(message->msg(), T::minitable(), + arena.ptr(), options); +} + +} // namespace protos + +#endif // UPB_PROTOS_PROTOS_H_ diff --git a/third_party/upb/protos/protos_internal.h b/third_party/upb/protos/protos_internal.h new file mode 100644 index 00000000000..85ba4d06793 --- /dev/null +++ b/third_party/upb/protos/protos_internal.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_PROTOS_PROTOS_INTERNAL_H_ +#define UPB_PROTOS_PROTOS_INTERNAL_H_ + +#include "protos/protos.h" + +namespace protos::internal { + +// Moves ownership of a message created in a source arena. +// +// Utility function to provide a way to move ownership across languages or VMs. +template +T MoveMessage(upb_Message* msg, upb_Arena* arena) { + return T(msg, arena); +} + +} // namespace protos::internal +#endif diff --git a/third_party/upb/protos/protos_internal_test.cc b/third_party/upb/protos/protos_internal_test.cc new file mode 100644 index 00000000000..99bfaa24027 --- /dev/null +++ b/third_party/upb/protos/protos_internal_test.cc @@ -0,0 +1,55 @@ +// 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 "protos/protos_internal.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include "protos_generator/tests/test_model.upb.h" +#include "protos_generator/tests/test_model.upb.proto.h" +#include "upb/arena.h" + +namespace protos::testing { +namespace { +using ::protos_generator::test::protos::TestModel; + +TEST(CppGeneratedCode, InternalMoveMessage) { + // Generate message (simulating message created in another VM/language) + upb_Arena* source_arena = upb_Arena_New(); + protos_generator_test_TestModel* message = + protos_generator_test_TestModel_new(source_arena); + ASSERT_NE(message, nullptr); + protos_generator_test_TestModel_set_int_value_with_default(message, 123); + + // Move ownership. + TestModel model = + protos::internal::MoveMessage(message, source_arena); + // Now that we have moved ownership, free original arena. + upb_Arena_Free(source_arena); + EXPECT_EQ(model.int_value_with_default(), 123); +} + +} // namespace +} // namespace protos::testing diff --git a/third_party/upb/protos_generator/BUILD b/third_party/upb/protos_generator/BUILD new file mode 100644 index 00000000000..182465d644c --- /dev/null +++ b/third_party/upb/protos_generator/BUILD @@ -0,0 +1,81 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +load( + "//bazel:build_defs.bzl", + "UPB_DEFAULT_CPPOPTS", +) + +licenses(["notice"]) + +cc_binary( + name = "protoc-gen-upb-protos", + srcs = [ + "protoc-gen-upb-protos.cc", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//visibility:public"], + deps = [ + ":generator", + "//upbc:file_layout", + "@com_google_protobuf//:protobuf", + "@com_google_protobuf//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( + name = "generator", + srcs = [ + "gen_accessors.cc", + "gen_enums.cc", + "gen_extensions.cc", + "gen_messages.cc", + "gen_utils.cc", + "output.cc", + ], + hdrs = [ + "gen_accessors.h", + "gen_enums.h", + "gen_extensions.h", + "gen_messages.h", + "gen_utils.h", + "output.h", + ], + visibility = ["//visibility:private"], + deps = [ + "//upbc:common", + "//upbc:file_layout", + "//upbc:keywords", + "//upbc:names", + "//upbc:plugin", + "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/container:flat_hash_set", + "@com_google_absl//absl/log:absl_check", + "@com_google_absl//absl/log:absl_log", + "@com_google_absl//absl/strings", + "@com_google_protobuf//:protobuf", + "@com_google_protobuf//src/google/protobuf/compiler:code_generator", + ], +) diff --git a/third_party/upb/protos_generator/gen_accessors.cc b/third_party/upb/protos_generator/gen_accessors.cc new file mode 100644 index 00000000000..a6cfe5320ec --- /dev/null +++ b/third_party/upb/protos_generator/gen_accessors.cc @@ -0,0 +1,729 @@ +// 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 "protos_generator/gen_accessors.h" + +#include "absl/container/flat_hash_set.h" +#include "absl/strings/match.h" +#include "absl/strings/string_view.h" +#include "google/protobuf/descriptor.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/output.h" +#include "upbc/keywords.h" +#include "upbc/names.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +using NameToFieldDescriptorMap = + absl::flat_hash_map; + +void WriteFieldAccessorHazzer(const protobuf::Descriptor* desc, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view resolved_upbc_name, + Output& output); +void WriteFieldAccessorClear(const protobuf::Descriptor* desc, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view resolved_upbc_name, + Output& output); +void WriteMapFieldAccessors(const protobuf::Descriptor* desc, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view resolved_upbc_name, + Output& output); + +void WriteMapAccessorDefinitions(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view class_name, + Output& output); +void WriteRepeatedMessageAccessor(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + absl::string_view class_name, Output& output); +void WriteRepeatedStringAccessor(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view class_name, + Output& output); +void WriteRepeatedScalarAccessor(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + absl::string_view class_name, Output& output); + +// Returns C++ class member name by resolving naming conflicts across +// proto field names (such as clear_ prefixes) and keyword collisions. +// +// The Upb C generator prefixes all accessors with package and class names +// avoiding collisions. Therefore we need to use raw field names when calling +// into C accessors but need to fully resolve conflicts for C++ class members. +std::string ResolveFieldName(const protobuf::FieldDescriptor* field, + const NameToFieldDescriptorMap& field_names); + +NameToFieldDescriptorMap CreateFieldNameMap( + const protobuf::Descriptor* message) { + NameToFieldDescriptorMap field_names; + for (int i = 0; i < message->field_count(); i++) { + const protobuf::FieldDescriptor* field = message->field(i); + field_names.emplace(field->name(), field); + } + return field_names; +} + +void WriteFieldAccessorsInHeader(const protobuf::Descriptor* desc, + Output& output) { + // Generate const methods. + OutputIndenter i(output); + + auto field_names = CreateFieldNameMap(desc); + auto upbc_field_names = upbc::CreateFieldNameMap(desc); + + for (const auto* field : FieldNumberOrder(desc)) { + std::string resolved_field_name = ResolveFieldName(field, field_names); + std::string resolved_upbc_name = + upbc::ResolveFieldName(field, upbc_field_names); + WriteFieldAccessorHazzer(desc, field, resolved_field_name, + resolved_upbc_name, output); + WriteFieldAccessorClear(desc, field, resolved_field_name, + resolved_upbc_name, output); + + if (field->is_map()) { + WriteMapFieldAccessors(desc, field, resolved_field_name, + resolved_upbc_name, output); + } else if (desc->options().map_entry()) { + // TODO(b/237399867) Implement map entry + } else if (field->is_repeated()) { + output( + R"cc( + inline size_t $1_size() const { + size_t len; + $0_$2(msg_, &len); + return len; + } + + inline void clear_$1() { $0_clear_$2(msg_); } + )cc", + MessageName(desc), resolved_field_name, resolved_upbc_name); + + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output( + R"cc( + $1 $2(size_t index) const; + absl::StatusOr<$0> add_$2(); + $0 mutable_$2(size_t index) const; + )cc", + MessagePtrConstType(field, /* const */ false), + MessagePtrConstType(field, /* const */ true), resolved_field_name, + resolved_upbc_name); + } else { + output( + R"cc( + $0 $1(size_t index) const; + bool add_$1($0 val); + void set_$1(size_t index, $0 val); + bool resize_$1(size_t len); + )cc", + CppConstType(field), resolved_field_name); + } + } else { + // non-repeated. + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) { + output(R"cc( + $0 $1() const; + void set_$1($0 value); + )cc", + CppConstType(field), resolved_field_name); + } else if (field->cpp_type() == + protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output(R"cc( + $1 $2() const; + $0 mutable_$2(); + )cc", + MessagePtrConstType(field, /* const */ false), + MessagePtrConstType(field, /* const */ true), + resolved_field_name, resolved_upbc_name); + } else { + output( + R"cc( + inline $0 $1() const { return $2_$3(msg_); } + inline void set_$1($0 value) { return $2_set_$3(msg_, value); } + )cc", + CppConstType(field), resolved_field_name, MessageName(desc), + resolved_upbc_name); + } + } + } +} + +void WriteFieldAccessorHazzer(const protobuf::Descriptor* desc, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view resolved_upbc_name, + Output& output) { + // Generate hazzer (if any). + if (field->has_presence()) { + // Has presence. + output("inline bool has_$0() const { return $1_has_$2(msg_); }\n", + resolved_field_name, MessageName(desc), resolved_upbc_name); + } +} + +void WriteFieldAccessorClear(const protobuf::Descriptor* desc, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view resolved_upbc_name, + Output& output) { + if (field->has_presence()) { + output("void clear_$0() { $2_clear_$1(msg_); }\n", resolved_field_name, + resolved_upbc_name, MessageName(desc)); + } +} + +void WriteMapFieldAccessors(const protobuf::Descriptor* desc, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view resolved_upbc_name, + Output& output) { + const protobuf::Descriptor* entry = field->message_type(); + const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1); + const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2); + output( + R"cc( + inline size_t $0_size() const { return $1_$3_size(msg_); } + inline void clear_$0() { $1_clear_$3(msg_); } + void delete_$0($2 key); + )cc", + resolved_field_name, MessageName(desc), CppConstType(key), + resolved_upbc_name); + + if (val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output( + R"cc( + bool set_$0($1 key, $3 value); + bool set_$0($1 key, $4 value); + absl::StatusOr<$3> get_$0($1 key); + )cc", + resolved_field_name, CppConstType(key), CppConstType(val), + MessagePtrConstType(val, /* is_const */ true), + MessagePtrConstType(val, /* is_const */ false)); + } else { + output( + R"cc( + bool set_$0($1 key, $2 value); + absl::StatusOr<$2> get_$0($1 key); + )cc", + resolved_field_name, CppConstType(key), CppConstType(val)); + } +} + +void WriteAccessorsInSource(const protobuf::Descriptor* desc, Output& output) { + std::string class_name = ClassName(desc); + absl::StrAppend(&class_name, "Access"); + output("namespace internal {\n"); + const char arena_expression[] = "arena_"; + auto field_names = CreateFieldNameMap(desc); + auto upbc_field_names = upbc::CreateFieldNameMap(desc); + + // Generate const methods. + OutputIndenter i(output); + for (const auto* field : FieldNumberOrder(desc)) { + std::string resolved_field_name = ResolveFieldName(field, field_names); + std::string resolved_upbc_name = + upbc::ResolveFieldName(field, upbc_field_names); + if (field->is_map()) { + WriteMapAccessorDefinitions(desc, field, resolved_field_name, class_name, + output); + } else if (desc->options().map_entry()) { + // TODO(b/237399867) Implement map entry + } else if (field->is_repeated()) { + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + WriteRepeatedMessageAccessor(desc, field, resolved_field_name, + class_name, output); + } else if (field->cpp_type() == + protobuf::FieldDescriptor::CPPTYPE_STRING) { + WriteRepeatedStringAccessor(desc, field, resolved_field_name, + class_name, output); + } else { + WriteRepeatedScalarAccessor(desc, field, resolved_field_name, + class_name, output); + } + } else { + // non-repeated field. + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) { + output( + R"cc( + $1 $0::$2() const { + return ::protos::UpbStrToStringView($3_$4(msg_)); + } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(desc), resolved_upbc_name); + // Set string. + output( + R"cc( + void $0::set_$2($1 value) { + $4_set_$3(msg_, ::protos::UpbStrFromStringView(value, $5)); + } + )cc", + class_name, CppConstType(field), resolved_field_name, + resolved_upbc_name, MessageName(desc), arena_expression); + } else if (field->cpp_type() == + protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output( + R"cc( + $1 $0::$2() const { + if (!has_$2()) { + return $4::default_instance(); + } + return ::protos::internal::CreateMessage<$4>((upb_Message*)($3_$5(msg_))); + } + )cc", + class_name, MessagePtrConstType(field, /* is_const */ true), + resolved_field_name, MessageName(desc), + MessageBaseType(field, /* maybe_const */ false), + resolved_upbc_name); + + output( + R"cc( + $1 $0::mutable_$2() { + return ::protos::internal::CreateMessageProxy<$4>( + (upb_Message*)($3_mutable_$5(msg_, $6)), $6); + } + )cc", + class_name, MessagePtrConstType(field, /* is_const */ false), + resolved_field_name, MessageName(desc), + MessageBaseType(field, /* maybe_const */ false), resolved_upbc_name, + arena_expression); + } + } + } + output("\n"); + output("} // namespace internal\n\n"); +} + +void WriteRepeatedMessageAccessor(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view class_name, + Output& output) { + const char arena_expression[] = "arena_"; + absl::string_view upbc_name = field->name(); + output( + R"cc( + $1 $0::$2(size_t index) const { + size_t len; + auto* ptr = $3_$5(msg_, &len); + assert(index < len); + return ::protos::internal::CreateMessage<$4>((upb_Message*)*(ptr + index)); + } + )cc", + class_name, MessagePtrConstType(field, /* is_const */ true), + resolved_field_name, MessageName(message), + MessageBaseType(field, /* maybe_const */ false), upbc_name); + output( + R"cc( + absl::StatusOr<$1> $0::add_$2() { + auto new_msg = $3_add_$6(msg_, $5); + if (!new_msg) { + return ::protos::MessageAllocationError(); + } + return ::protos::internal::CreateMessageProxy<$4>((upb_Message*)new_msg, $5); + } + )cc", + class_name, MessagePtrConstType(field, /* const */ false), + resolved_field_name, MessageName(message), + MessageBaseType(field, /* maybe_const */ false), arena_expression, + upbc_name); + output( + R"cc( + $1 $0::mutable_$2(size_t index) const { + size_t len; + auto* ptr = $3_$6(msg_, &len); + assert(index < len); + return ::protos::internal::CreateMessageProxy<$4>( + (upb_Message*)*(ptr + index), $5); + } + )cc", + class_name, MessagePtrConstType(field, /* is_const */ false), + resolved_field_name, MessageName(message), + MessageBaseType(field, /* maybe_const */ false), arena_expression, + upbc_name); +} + +void WriteRepeatedStringAccessor(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view class_name, + Output& output) { + absl::string_view upbc_name = field->name(); + output( + R"cc( + $1 $0::$2(size_t index) const { + size_t len; + auto* ptr = $3_mutable_$4(msg_, &len); + assert(index < len); + return ::protos::UpbStrToStringView(*(ptr + index)); + } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(message), upbc_name); + output( + R"cc( + bool $0::resize_$1(size_t len) { + return $2_resize_$3(msg_, len, arena_); + } + )cc", + class_name, resolved_field_name, MessageName(message), upbc_name); + output( + R"cc( + bool $0::add_$2($1 val) { + return $3_add_$4(msg_, ::protos::UpbStrFromStringView(val, arena_), arena_); + } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(message), upbc_name); + output( + R"cc( + void $0::set_$2(size_t index, $1 val) { + size_t len; + auto* ptr = $3_mutable_$4(msg_, &len); + assert(index < len); + *(ptr + index) = ::protos::UpbStrFromStringView(val, arena_); + } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(message), upbc_name); +} + +void WriteRepeatedScalarAccessor(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view class_name, + Output& output) { + absl::string_view upbc_name = field->name(); + output( + R"cc( + $1 $0::$2(size_t index) const { + size_t len; + auto* ptr = $3_mutable_$4(msg_, &len); + assert(index < len); + return *(ptr + index); + } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(message), upbc_name); + output( + R"cc( + bool $0::resize_$1(size_t len) { + return $2_resize_$3(msg_, len, arena_); + } + )cc", + class_name, resolved_field_name, MessageName(message), upbc_name); + output( + R"cc( + bool $0::add_$2($1 val) { return $3_add_$4(msg_, val, arena_); } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(message), upbc_name); + output( + R"cc( + void $0::set_$2(size_t index, $1 val) { + size_t len; + auto* ptr = $3_mutable_$4(msg_, &len); + assert(index < len); + *(ptr + index) = val; + } + )cc", + class_name, CppConstType(field), resolved_field_name, + MessageName(message), upbc_name); +} + +void WriteMapAccessorDefinitions(const protobuf::Descriptor* message, + const protobuf::FieldDescriptor* field, + const absl::string_view resolved_field_name, + const absl::string_view class_name, + Output& output) { + const protobuf::Descriptor* entry = field->message_type(); + const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1); + const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2); + absl::string_view upbc_name = field->name(); + absl::string_view converted_key_name = "key"; + absl::string_view optional_conversion_code = ""; + + if (key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) { + // Insert conversion from absl::string_view to upb_StringView. + // Creates upb_StringView on stack to prevent allocation. + converted_key_name = "upb_key"; + optional_conversion_code = + "upb_StringView upb_key = {key.data(), key.size()};\n"; + } + if (val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output( + R"cc( + bool $0::set_$1($2 key, $3 value) { + $6return $4_$8_set(msg_, $7, ($5*)value->msg(), arena_); + } + )cc", + class_name, resolved_field_name, CppConstType(key), + MessagePtrConstType(val, /* is_const */ true), MessageName(message), + MessageName(val->message_type()), optional_conversion_code, + converted_key_name, upbc_name); + output( + R"cc( + bool $0::set_$1($2 key, $3 value) { + $6return $4_$8_set(msg_, $7, ($5*)value->msg(), arena_); + } + )cc", + class_name, resolved_field_name, CppConstType(key), + MessagePtrConstType(val, /* is_const */ false), MessageName(message), + MessageName(val->message_type()), optional_conversion_code, + converted_key_name, upbc_name); + output( + R"cc( + absl::StatusOr<$3> $0::get_$1($2 key) { + $5* msg_value; + $7bool success = $4_$9_get(msg_, $8, &msg_value); + if (success) { + return ::protos::internal::CreateMessage<$6>(msg_value); + } + return absl::NotFoundError(""); + } + )cc", + class_name, resolved_field_name, CppConstType(key), + MessagePtrConstType(val, /* is_const */ true), MessageName(message), + MessageName(val->message_type()), + QualifiedClassName(val->message_type()), optional_conversion_code, + converted_key_name, upbc_name); + output( + R"cc( + void $0::delete_$1($2 key) { $6$4_$8_delete(msg_, $7); } + )cc", + class_name, resolved_field_name, CppConstType(key), + MessagePtrConstType(val, /* is_const */ false), MessageName(message), + MessageName(val->message_type()), optional_conversion_code, + converted_key_name, upbc_name); + } else if (val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) { + output( + R"cc( + bool $0::set_$1($2 key, $3 value) { + $5return $4_$7_set(msg_, $6, + ::protos::UpbStrFromStringView(value, arena_), + arena_); + } + )cc", + class_name, resolved_field_name, CppConstType(key), CppConstType(val), + MessageName(message), optional_conversion_code, converted_key_name, + upbc_name); + output( + R"cc( + absl::StatusOr<$3> $0::get_$1($2 key) { + upb_StringView value; + $5bool success = $4_$7_get(msg_, $6, &value); + if (success) { + return absl::string_view(value.data, value.size); + } + return absl::NotFoundError(""); + } + )cc", + class_name, resolved_field_name, CppConstType(key), CppConstType(val), + MessageName(message), optional_conversion_code, converted_key_name, + upbc_name); + output( + R"cc( + void $0::delete_$1($2 key) { $5$4_$7_delete(msg_, $6); } + )cc", + class_name, resolved_field_name, CppConstType(key), CppConstType(val), + MessageName(message), optional_conversion_code, converted_key_name, + upbc_name); + } else { + output( + R"cc( + bool $0::set_$1($2 key, $3 value) { + $5return $4_$7_set(msg_, $6, value, arena_); + } + )cc", + class_name, resolved_field_name, CppConstType(key), CppConstType(val), + MessageName(message), optional_conversion_code, converted_key_name, + upbc_name); + output( + R"cc( + absl::StatusOr<$3> $0::get_$1($2 key) { + $3 value; + $5bool success = $4_$7_get(msg_, $6, &value); + if (success) { + return value; + } + return absl::NotFoundError(""); + } + )cc", + class_name, resolved_field_name, CppConstType(key), CppConstType(val), + MessageName(message), optional_conversion_code, converted_key_name, + upbc_name); + output( + R"cc( + void $0::delete_$1($2 key) { $5$4_$7_delete(msg_, $6); } + )cc", + class_name, resolved_field_name, CppConstType(key), CppConstType(val), + MessageName(message), optional_conversion_code, converted_key_name, + upbc_name); + } +} + +void WriteUsingAccessorsInHeader(const protobuf::Descriptor* desc, + MessageClassType handle_type, Output& output) { + bool read_only = handle_type == MessageClassType::kMessageCProxy; + + // Generate const methods. + OutputIndenter i(output); + std::string class_name = ClassName(desc); + auto field_names = CreateFieldNameMap(desc); + + for (const auto* field : FieldNumberOrder(desc)) { + std::string resolved_field_name = ResolveFieldName(field, field_names); + // Generate hazzer (if any). + if (field->has_presence()) { + output("using $0Access::has_$1;\n", class_name, resolved_field_name); + output("using $0Access::clear_$1;\n", class_name, resolved_field_name); + } + if (field->is_map()) { + output( + R"cc( + using $0Access::$1_size; + using $0Access::clear_$1; + using $0Access::delete_$1; + using $0Access::get_$1; + using $0Access::set_$1; + )cc", + class_name, resolved_field_name); + } else if (desc->options().map_entry()) { + // TODO(b/237399867) Implement map entry + } else if (field->is_repeated()) { + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output( + R"cc( + using $0Access::$1; + using $0Access::$1_size; + using $0Access::mutable_$1; + )cc", + class_name, resolved_field_name); + if (!read_only) { + output( + R"cc( + using $0Access::add_$1; + using $0Access::clear_$1; + )cc", + class_name, resolved_field_name); + } + } else { + output( + R"cc( + using $0Access::$1; + using $0Access::$1_size; + )cc", + class_name, resolved_field_name); + if (!read_only) { + output( + R"cc( + using $0Access::add_$1; + using $0Access::clear_$1; + using $0Access::resize_$1; + using $0Access::set_$1; + )cc", + class_name, resolved_field_name); + } + } + } else { + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + output("using $0Access::$1;\n", ClassName(desc), resolved_field_name); + if (!read_only) { + output("using $0Access::mutable_$1;\n", class_name, + resolved_field_name); + } + } else { + output("using $0Access::$1;\n", class_name, resolved_field_name); + if (!read_only) { + output("using $0Access::set_$1;\n", class_name, resolved_field_name); + } + } + } + } + output("using $0Access::msg;\n", class_name); +} + +std::string ResolveFieldName(const protobuf::FieldDescriptor* field, + const NameToFieldDescriptorMap& field_names) { + // C++ implementation specific reserved names. + static const auto& kReservedNames = + *new absl::flat_hash_set({ + "msg", + "msg_", + "arena", + "arena_", + }); + + static constexpr absl::string_view kClearAccessor = "clear_"; + static constexpr absl::string_view kSetAccessor = "set_"; + + // List of generated accessor prefixes to check against. + // Example: + // optional repeated string phase = 236; + // optional bool clear_phase = 237; + static constexpr absl::string_view kAccessorPrefixes[] = { + kClearAccessor, "delete_", "add_", "resize_", kSetAccessor, + }; + + absl::string_view field_name = field->name(); + if (kReservedNames.count(field_name) > 0) { + if (absl::EndsWith(field_name, "_")) { + return absl::StrCat(field_name, "_"); + } else { + return absl::StrCat(field_name, "__"); + } + } + for (const auto prefix : kAccessorPrefixes) { + // If field name starts with a prefix such as clear_ and the proto + // contains a field name with trailing end, depending on type of field + // (repeated, map, message) we have a conflict to resolve. + if (absl::StartsWith(field_name, prefix)) { + auto match = field_names.find(field_name.substr(prefix.size())); + if (match != field_names.end()) { + const auto* candidate = match->second; + if (candidate->is_repeated() || candidate->is_map() || + (candidate->cpp_type() == + protobuf::FieldDescriptor::CPPTYPE_STRING && + prefix == kClearAccessor) || + prefix == kSetAccessor) { + return absl::StrCat(field_name, "_"); + } + } + } + } + return upbc::ResolveKeywordConflict(std::string(field_name)); +} + +} // namespace protos_generator diff --git a/third_party/upb/protos_generator/gen_accessors.h b/third_party/upb/protos_generator/gen_accessors.h new file mode 100644 index 00000000000..070cb886d8d --- /dev/null +++ b/third_party/upb/protos_generator/gen_accessors.h @@ -0,0 +1,44 @@ +// Copyright (c) 2009-2021, Google LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of Google LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef UPB_PROTOS_GENERATOR_ACCESSORS_H_ +#define UPB_PROTOS_GENERATOR_ACCESSORS_H_ + +#include "google/protobuf/descriptor.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/output.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +void WriteFieldAccessorsInHeader(const protobuf::Descriptor* desc, + Output& output); +void WriteAccessorsInSource(const protobuf::Descriptor* desc, Output& output); +void WriteUsingAccessorsInHeader(const protobuf::Descriptor* desc, + MessageClassType handle_type, Output& output); +} // namespace protos_generator + +#endif // UPB_PROTOS_GENERATOR_ACCESSORS_H_ diff --git a/third_party/upb/protos_generator/gen_enums.cc b/third_party/upb/protos_generator/gen_enums.cc new file mode 100644 index 00000000000..e6f866a0aef --- /dev/null +++ b/third_party/upb/protos_generator/gen_enums.cc @@ -0,0 +1,137 @@ +// Copyright (c) 2009-2021, Google LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of Google LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "protos_generator/gen_enums.h" + +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/descriptor.h" +#include "protos_generator/gen_utils.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +// Convert enum value to C++ literal. +// +// In C++, an value of -2147483648 gets interpreted as the negative of +// 2147483648, and since 2147483648 can't fit in an integer, this produces a +// compiler warning. This works around that issue. +std::string EnumInt32ToString(int number) { + if (number == std::numeric_limits::min()) { + // This needs to be special-cased, see explanation here: + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661 + return absl::StrCat(number + 1, " - 1"); + } else { + return absl::StrCat(number); + } +} + +std::string EnumTypeName(const protobuf::EnumDescriptor* enum_descriptor) { + auto containing_type = enum_descriptor->containing_type(); + if (containing_type == nullptr) { + // enums types with no package name are prefixed with protos_ to prevent + // conflicts with generated C headers. + if (enum_descriptor->file()->package().empty()) { + return absl::StrCat(kNoPackageNamePrefix, + ToCIdent(enum_descriptor->name())); + } + return ToCIdent(enum_descriptor->name()); + } else { + // Since the enum is in global name space (no package), it will have the + // same classified name as the C header include, to prevent collision + // rename as above. + if (containing_type->file()->package().empty()) { + return ToCIdent(absl::StrCat(containing_type->name(), "_", + kNoPackageNamePrefix, + enum_descriptor->name())); + } else { + return ToCIdent( + absl::StrCat(containing_type->name(), "_", enum_descriptor->name())); + } + } +} + +std::string EnumValueSymbolInNameSpace( + const protobuf::EnumDescriptor* desc, + const protobuf::EnumValueDescriptor* value) { + auto containing_type = desc->containing_type(); + if (containing_type != nullptr) { + return ToCIdent(absl::StrCat(containing_type->name(), "_", desc->name(), + "_", value->name())); + } else { + // protos enum values with no package name are prefixed with protos_ to + // prevent conflicts with generated C headers. + if (desc->file()->package().empty()) { + return absl::StrCat(kNoPackageNamePrefix, ToCIdent(value->name())); + } + return ToCIdent(value->name()); + } +} + +void WriteEnumValues(const protobuf::EnumDescriptor* desc, Output& output) { + std::vector values; + auto value_count = desc->value_count(); + values.reserve(value_count); + for (int i = 0; i < value_count; i++) { + values.push_back(desc->value(i)); + } + std::sort(values.begin(), values.end(), + [](const protobuf::EnumValueDescriptor* a, + const protobuf::EnumValueDescriptor* b) { + return a->number() < b->number(); + }); + + for (size_t i = 0; i < values.size(); i++) { + auto value = values[i]; + output(" $0", EnumValueSymbolInNameSpace(desc, value)); + if (value->options().deprecated()) { + output(" ABSL_DEPRECATED(\"Proto enum $0\")", + EnumValueSymbolInNameSpace(desc, value)); + } + output(" = $0", EnumInt32ToString(value->number())); + if (i != values.size() - 1) { + output(","); + } + output("\n"); + } +} + +void WriteEnumDeclarations( + const std::vector& enums, Output& output) { + for (auto enumdesc : enums) { + output("enum $0 : int {\n", EnumTypeName(enumdesc)); + WriteEnumValues(enumdesc, output); + output("};\n\n"); + } +} + +void WriteHeaderEnumForwardDecls( + std::vector& enums, Output& output) { + for (const auto* enumdesc : enums) { + output("enum $0 : int;\n", EnumTypeName(enumdesc)); + } +} + +} // namespace protos_generator diff --git a/third_party/upb/protos_generator/gen_enums.h b/third_party/upb/protos_generator/gen_enums.h new file mode 100644 index 00000000000..8e7d6ea6784 --- /dev/null +++ b/third_party/upb/protos_generator/gen_enums.h @@ -0,0 +1,44 @@ +// Copyright (c) 2009-2021, Google LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of Google LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef UPB_PROTOS_GENERATOR_ENUMS_H_ +#define UPB_PROTOS_GENERATOR_ENUMS_H_ + +#include "google/protobuf/descriptor.h" +#include "protos_generator/output.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +std::string EnumTypeName(const protobuf::EnumDescriptor* enum_descriptor); +void WriteHeaderEnumForwardDecls( + std::vector& enums, Output& output); +void WriteEnumDeclarations( + const std::vector& enums, Output& output); + +} // namespace protos_generator + +#endif // UPB_PROTOS_GENERATOR_ENUMS_H_ diff --git a/third_party/upb/protos_generator/gen_extensions.cc b/third_party/upb/protos_generator/gen_extensions.cc new file mode 100644 index 00000000000..94a0a125013 --- /dev/null +++ b/third_party/upb/protos_generator/gen_extensions.cc @@ -0,0 +1,110 @@ +// 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 "protos_generator/gen_extensions.h" + +#include "absl/strings/str_cat.h" +#include "protos_generator/gen_utils.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +std::string ExtensionIdentifierBase(const protobuf::FieldDescriptor* ext) { + assert(ext->is_extension()); + std::string ext_scope; + if (ext->extension_scope()) { + return MessageName(ext->extension_scope()); + } else { + return ToCIdent(ext->file()->package()); + } +} + +std::string ContainingTypeName(const protobuf::FieldDescriptor* ext) { + return ext->containing_type()->file() != ext->file() + ? QualifiedClassName(ext->containing_type()) + : ClassName(ext->containing_type()); +} + +void WriteExtensionIdentifierHeader(const protobuf::FieldDescriptor* ext, + Output& output) { + std::string mini_table_name = + absl::StrCat(ExtensionIdentifierBase(ext), "_", ext->name(), "_ext"); + if (ext->extension_scope()) { + output(R"cc( + static ::protos::internal::ExtensionIdentifier<$0, $1> $2; + )cc", + ContainingTypeName(ext), CppTypeParameterName(ext), ext->name()); + } else { + output( + R"cc( + extern ::protos::internal::ExtensionIdentifier<$0, $1> $2; + )cc", + ContainingTypeName(ext), CppTypeParameterName(ext), ext->name()); + } +} + +void WriteExtensionIdentifiersHeader( + const std::vector& extensions, + Output& output) { + for (const auto* ext : extensions) { + if (!ext->extension_scope()) { + WriteExtensionIdentifierHeader(ext, output); + } + } +} + +void WriteExtensionIdentifier(const protobuf::FieldDescriptor* ext, + Output& output) { + std::string mini_table_name = + absl::StrCat(ExtensionIdentifierBase(ext), "_", ext->name(), "_ext"); + if (ext->extension_scope()) { + output( + R"cc( + ::protos::internal::ExtensionIdentifier<$0, $3> $4::$2(&$1); + )cc", + ContainingTypeName(ext), mini_table_name, ext->name(), + CppTypeParameterName(ext), ClassName(ext->extension_scope())); + } else { + output( + R"cc( + ::protos::internal::ExtensionIdentifier<$0, $3> $2(&$1); + )cc", + ContainingTypeName(ext), mini_table_name, ext->name(), + CppTypeParameterName(ext)); + } +} + +void WriteExtensionIdentifiers( + const std::vector& extensions, + Output& output) { + for (const auto* ext : extensions) { + if (!ext->extension_scope()) { + WriteExtensionIdentifier(ext, output); + } + } +} + +} // namespace protos_generator diff --git a/third_party/upb/protos_generator/gen_extensions.h b/third_party/upb/protos_generator/gen_extensions.h new file mode 100644 index 00000000000..7313acbe708 --- /dev/null +++ b/third_party/upb/protos_generator/gen_extensions.h @@ -0,0 +1,49 @@ +// 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_PROTOS_GENERATOR_GEN_EXTENSIONS_H_ +#define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_ + +#include "google/protobuf/descriptor.h" +#include "protos_generator/output.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +void WriteExtensionIdentifiersHeader( + const std::vector& extensions, + Output& output); +void WriteExtensionIdentifierHeader(const protobuf::FieldDescriptor* ext, + Output& output); +void WriteExtensionIdentifiers( + const std::vector& extensions, + Output& output); +void WriteExtensionIdentifier(const protobuf::FieldDescriptor* ext, + Output& output); + +} // namespace protos_generator + +#endif // UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_ diff --git a/third_party/upb/protos_generator/gen_messages.cc b/third_party/upb/protos_generator/gen_messages.cc new file mode 100644 index 00000000000..194fab0a151 --- /dev/null +++ b/third_party/upb/protos_generator/gen_messages.cc @@ -0,0 +1,379 @@ +/* + * 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 "protos_generator/gen_messages.h" + +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/descriptor.h" +#include "protos_generator/gen_accessors.h" +#include "protos_generator/gen_extensions.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/output.h" +#include "upbc/common.h" +#include "upbc/file_layout.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +void WriteModelAccessDeclaration(const protobuf::Descriptor* descriptor, + Output& output); +void WriteModelPublicDeclaration( + const protobuf::Descriptor* descriptor, + const std::vector& file_exts, + Output& output); +void WriteExtensionIdentifiersInClassHeader( + const protobuf::Descriptor* message, + const std::vector& file_exts, + Output& output); +void WriteModelProxyDeclaration(const protobuf::Descriptor* descriptor, + Output& output); +void WriteModelCProxyDeclaration(const protobuf::Descriptor* descriptor, + Output& output); +void WriteInternalForwardDeclarationsInHeader( + const protobuf::Descriptor* message, Output& output); +void WriteDefaultInstanceHeader(const protobuf::Descriptor* message, + Output& output); +void WriteExtensionIdentifiersImplementation( + const protobuf::Descriptor* message, + const std::vector& file_exts, + Output& output); + +// Writes message class declarations into .upb.proto.h. +// +// For each proto Foo, FooAccess and FooProxy/FooCProxy are generated +// that are exposed to users as Foo , Ptr and Ptr. +void WriteMessageClassDeclarations( + const protobuf::Descriptor* descriptor, + const std::vector& file_exts, + Output& output) { + if (IsMapEntryMessage(descriptor)) { + // Skip map entry generation. Low level accessors for maps are + // generated that don't require a separate map type. + return; + } + + // Forward declaration of Proto Class for GCC handling of free friend method. + output("class $0;", ClassName(descriptor)); + output("namespace internal {\n"); + WriteModelAccessDeclaration(descriptor, output); + output("\n"); + WriteInternalForwardDeclarationsInHeader(descriptor, output); + output("\n"); + output("} // namespace internal\n"); + WriteModelPublicDeclaration(descriptor, file_exts, output); + output("namespace internal {\n"); + WriteModelProxyDeclaration(descriptor, output); + WriteModelCProxyDeclaration(descriptor, output); + output("} // namespace internal\n"); +} + +void WriteModelAccessDeclaration(const protobuf::Descriptor* descriptor, + Output& output) { + output( + R"cc( + + class $0Access { + public: + $0Access() {} + $0Access($1* msg, upb_Arena* arena) : msg_(msg), arena_(arena) {} // NOLINT + $0Access(const $1* msg, upb_Arena* arena) + : msg_(const_cast<$1*>(msg)), arena_(arena) {} // NOLINT + void* GetInternalArena() const { return arena_; } + )cc", + ClassName(descriptor), MessageName(descriptor)); + WriteFieldAccessorsInHeader(descriptor, output); + output.Indent(); + output( + R"cc( + private: + void* msg() const { return msg_; } + + friend class $2; + friend class $0Proxy; + friend class $0CProxy; + friend void* ::protos::internal::GetInternalMsg<$2>(const $2& message); + friend void* ::protos::internal::GetInternalMsg<$2>( + const ::protos::Ptr<$2>& message); + $1* msg_; + upb_Arena* arena_; + )cc", + ClassName(descriptor), MessageName(descriptor), + QualifiedClassName(descriptor)); + output.Outdent(); + output("};\n"); +} + +void WriteModelPublicDeclaration( + const protobuf::Descriptor* descriptor, + const std::vector& file_exts, + Output& output) { + output( + R"cc( + class $0 final : private internal::$0Access { + public: + using Access = internal::$0Access; + using Proxy = internal::$0Proxy; + using CProxy = internal::$0CProxy; + $0(); + $0(const $0& m) = delete; + $0& operator=(const $0& m) = delete; + $0($0&& m) + : Access(m.msg_, m.arena_), + owned_arena_(std::move(m.owned_arena_)) {} + $0& operator=($0&& m) { + msg_ = m.msg_; + arena_ = m.arena_; + m.msg_ = nullptr; + m.arena_ = nullptr; + owned_arena_ = std::move(m.owned_arena_); + return *this; + } + )cc", + ClassName(descriptor)); + + WriteUsingAccessorsInHeader(descriptor, MessageClassType::kMessage, output); + WriteDefaultInstanceHeader(descriptor, output); + WriteExtensionIdentifiersInClassHeader(descriptor, file_exts, output); + output.Indent(); + output.Indent(); + if (descriptor->extension_range_count()) { + // for typetrait checking + output("using ExtendableType = $0;\n", ClassName(descriptor)); + } + // Note: free function friends that are templates such as ::protos::Parse + // require explicit <$2> type parameter in declaration to be able to compile + // with gcc otherwise the compiler will fail with + // "has not been declared within namespace" error. Even though there is a + // namespace qualifier, cross namespace matching fails. + output( + R"cc( + static const upb_MiniTable* minitable(); + using $0Access::GetInternalArena; + + private: + $0(upb_Message* msg, upb_Arena* arena) : $0Access() { + msg_ = ($1*)msg; + arena_ = owned_arena_.ptr(); + upb_Arena_Fuse(arena_, arena); + } + ::protos::Arena owned_arena_; + friend Proxy; + friend CProxy; + friend absl::StatusOr<$2>(::protos::Parse<$2>(absl::string_view bytes, + int options)); + friend absl::StatusOr<$2>(::protos::Parse<$2>( + absl::string_view bytes, + const ::protos::ExtensionRegistry& extension_registry, + int options)); + friend upb_Arena* ::protos::internal::GetArena<$0>(const $0& message); + friend upb_Arena* ::protos::internal::GetArena<$0>( + const ::protos::Ptr<$0>& message); + friend $0(::protos::internal::MoveMessage<$0>(upb_Message* msg, + upb_Arena* arena)); + )cc", + ClassName(descriptor), MessageName(descriptor), + QualifiedClassName(descriptor)); + output.Outdent(); + output("};\n\n"); +} + +void WriteModelProxyDeclaration(const protobuf::Descriptor* descriptor, + Output& output) { + // Foo::Proxy. + output( + R"cc( + class $0Proxy final : private internal::$0Access { + public: + $0Proxy() = delete; + $0Proxy(const $0Proxy& m) : internal::$0Access() { + msg_ = m.msg_; + arena_ = m.arena_; + } + $0Proxy operator=(const $0Proxy& m) { + msg_ = m.msg_; + arena_ = m.arena_; + return *this; + } + using $0Access::GetInternalArena; + )cc", + ClassName(descriptor)); + + WriteUsingAccessorsInHeader(descriptor, MessageClassType::kMessageProxy, + output); + output("\n"); + output.Indent(1); + output( + R"cc( + private: + $0Proxy(void* msg, upb_Arena* arena) : internal::$0Access(($1*)msg, arena) {} + friend $0::Proxy(::protos::CreateMessage<$0>(::protos::Arena& arena)); + friend $0::Proxy(::protos::internal::CreateMessageProxy<$0>( + upb_Message*, upb_Arena*)); + friend class $0CProxy; + friend class $0Access; + friend class ::protos::Ptr<$0>; + friend class ::protos::Ptr; + friend upb_Arena* ::protos::internal::GetArena<$2>(const $2& message); + friend upb_Arena* ::protos::internal::GetArena<$2>( + const ::protos::Ptr<$2>& message); + static void Rebind($0Proxy& lhs, const $0Proxy& rhs) { + lhs.msg_ = rhs.msg_; + lhs.arena_ = rhs.arena_; + } + )cc", + ClassName(descriptor), MessageName(descriptor), + QualifiedClassName(descriptor)); + output.Outdent(1); + output("};\n\n"); +} + +void WriteModelCProxyDeclaration(const protobuf::Descriptor* descriptor, + Output& output) { + // Foo::CProxy. + output( + R"cc( + class $0CProxy final : private internal::$0Access { + public: + $0CProxy() = delete; + $0CProxy(const $0* m) : internal::$0Access(m->msg_, nullptr) {} + using $0Access::GetInternalArena; + )cc", + ClassName(descriptor), MessageName(descriptor)); + + WriteUsingAccessorsInHeader(descriptor, MessageClassType::kMessageProxy, + output); + + output.Indent(1); + output( + R"cc( + private: + $0CProxy(void* msg) : internal::$0Access(($1*)msg, nullptr){}; + friend $0::CProxy(::protos::internal::CreateMessage<$0>(upb_Message* msg)); + friend class ::protos::Ptr<$0>; + friend class ::protos::Ptr; + static void Rebind($0CProxy& lhs, const $0CProxy& rhs) { + lhs.msg_ = rhs.msg_; + lhs.arena_ = rhs.arena_; + } + )cc", + ClassName(descriptor), MessageName(descriptor)); + output.Outdent(1); + output("};\n\n"); +} + +void WriteDefaultInstanceHeader(const protobuf::Descriptor* message, + Output& output) { + output(" static ::protos::Ptr default_instance();\n", + ClassName(message)); +} + +void WriteMessageImplementation( + const protobuf::Descriptor* descriptor, + const std::vector& file_exts, + Output& output) { + bool message_is_map_entry = descriptor->options().map_entry(); + if (!message_is_map_entry) { + // Constructor. + output( + R"cc( + $0::$0() : $0Access() { + arena_ = owned_arena_.ptr(); + msg_ = $1_new(arena_); + } + )cc", + ClassName(descriptor), MessageName(descriptor)); + // Minitable + OutputIndenter i(output); + output( + R"cc( + const upb_MiniTable* $0::minitable() { return &$1; } + )cc", + ClassName(descriptor), ::upbc::MessageInit(descriptor->full_name())); + } + + WriteAccessorsInSource(descriptor, output); + + if (!message_is_map_entry) { + output( + R"cc( + struct $0DefaultTypeInternal { + $1* msg; + }; + $0DefaultTypeInternal _$0_default_instance_ = + $0DefaultTypeInternal{$1_new(upb_Arena_New())}; + )cc", + ClassName(descriptor), MessageName(descriptor)); + + output( + R"cc( + ::protos::Ptr $0::default_instance() { + return ::protos::internal::CreateMessage<$0>( + (upb_Message *)_$0_default_instance_.msg); + } + )cc", + ClassName(descriptor)); + } +} + +void WriteInternalForwardDeclarationsInHeader( + const protobuf::Descriptor* message, Output& output) { + // Write declaration for internal re-usable default_instance without + // leaking implementation. + output( + R"cc( + struct $0DefaultTypeInternal; + extern $0DefaultTypeInternal _$0_default_instance_; + )cc", + ClassName(message)); +} + +void WriteExtensionIdentifiersInClassHeader( + const protobuf::Descriptor* message, + const std::vector& file_exts, + Output& output) { + for (auto* ext : file_exts) { + if (ext->extension_scope() && + ext->extension_scope()->full_name() == message->full_name()) { + WriteExtensionIdentifierHeader(ext, output); + } + } +} + +void WriteExtensionIdentifiersImplementation( + const protobuf::Descriptor* message, + const std::vector& file_exts, + Output& output) { + for (auto* ext : file_exts) { + if (ext->extension_scope() && + ext->extension_scope()->full_name() == message->full_name()) { + WriteExtensionIdentifier(ext, output); + } + } +} + +} // namespace protos_generator diff --git a/third_party/upb/protos_generator/gen_messages.h b/third_party/upb/protos_generator/gen_messages.h new file mode 100644 index 00000000000..0b8aa95f1fb --- /dev/null +++ b/third_party/upb/protos_generator/gen_messages.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_ +#define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_ + +#include "google/protobuf/descriptor.h" +#include "protos_generator/output.h" + +namespace protos_generator { +namespace protobuf = ::google::protobuf; + +void WriteMessageClassDeclarations( + const protobuf::Descriptor* descriptor, + const std::vector& file_exts, + Output& output); +void WriteMessageImplementation( + const protobuf::Descriptor* descriptor, + const std::vector& file_exts, + Output& output); +} // namespace protos_generator + +#endif // UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_ diff --git a/third_party/upb/protos_generator/gen_utils.cc b/third_party/upb/protos_generator/gen_utils.cc new file mode 100644 index 00000000000..4ab3572b2e3 --- /dev/null +++ b/third_party/upb/protos_generator/gen_utils.cc @@ -0,0 +1,278 @@ +/* + * 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 "protos_generator/gen_utils.h" + +#include + +#include "absl/log/absl_check.h" +#include "absl/strings/str_cat.h" +// begin:google_only +// #include "absl/strings/str_replace.h" +// end:google_only +#include "absl/strings/str_split.h" +#include "upbc/keywords.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +std::string DotsToColons(const std::string& name) { + return absl::StrReplaceAll(name, {{".", "::"}}); +} + +std::string Namespace(const std::string& package) { + if (package.empty()) return ""; + return "::" + DotsToColons(package); +} + +// Return the qualified C++ name for a file level symbol. +std::string QualifiedFileLevelSymbol(const protobuf::FileDescriptor* file, + const std::string& name) { + if (file->package().empty()) { + return absl::StrCat("::", name); + } + // Append ::protos postfix to package name. + return absl::StrCat(Namespace(file->package()), "::protos::", name); +} + +std::string ClassName(const protobuf::Descriptor* descriptor) { + const protobuf::Descriptor* parent = descriptor->containing_type(); + std::string res; + // Classes in global namespace without package names are prefixed + // by protos_ to avoid collision with C compiler structs defined in + // proto.upb.h. + if ((parent && parent->file()->package().empty()) || + descriptor->file()->package().empty()) { + res = std::string(kNoPackageNamePrefix); + } + if (parent) res += ClassName(parent) + "_"; + absl::StrAppend(&res, descriptor->name()); + return ::upbc::ResolveKeywordConflict(res); +} + +std::string QualifiedClassName(const protobuf::Descriptor* descriptor) { + return QualifiedFileLevelSymbol(descriptor->file(), ClassName(descriptor)); +} + +std::string QualifiedInternalClassName(const protobuf::Descriptor* descriptor) { + return QualifiedFileLevelSymbol( + descriptor->file(), absl::StrCat("internal::", ClassName(descriptor))); +} + +std::string CppSourceFilename(const google::protobuf::FileDescriptor* file) { + return StripExtension(file->name()) + ".upb.proto.cc"; +} + +std::string UpbCFilename(const google::protobuf::FileDescriptor* file) { + return StripExtension(file->name()) + ".upb.h"; +} + +std::string ForwardingHeaderFilename(const google::protobuf::FileDescriptor* file) { + return StripExtension(file->name()) + ".upb.fwd.h"; +} + +std::string CppHeaderFilename(const google::protobuf::FileDescriptor* file) { + return StripExtension(file->name()) + ".upb.proto.h"; +} + +std::string NamespaceFromPackageName(absl::string_view package_name) { + return absl::StrCat(absl::StrReplaceAll(package_name, {{".", "::"}}), + "::protos"); +} + +void WriteStartNamespace(const protobuf::FileDescriptor* file, Output& output) { + // Skip namespace generation if package name is not specified. + if (file->package().empty()) { + return; + } + + output("namespace $0 {\n\n", NamespaceFromPackageName(file->package())); +} + +void WriteEndNamespace(const protobuf::FileDescriptor* file, Output& output) { + if (file->package().empty()) { + return; + } + output("} // namespace $0\n\n", NamespaceFromPackageName(file->package())); +} + +std::string CppTypeInternal(const protobuf::FieldDescriptor* field, + bool is_const, bool is_type_parameter) { + std::string maybe_const = is_const ? "const " : ""; + switch (field->cpp_type()) { + case protobuf::FieldDescriptor::CPPTYPE_MESSAGE: { + if (is_type_parameter) { + return absl::StrCat(maybe_const, + QualifiedClassName(field->message_type())); + } else { + return absl::StrCat(maybe_const, + QualifiedClassName(field->message_type()), "*"); + } + } + case protobuf::FieldDescriptor::CPPTYPE_BOOL: + return "bool"; + case protobuf::FieldDescriptor::CPPTYPE_FLOAT: + return "float"; + case protobuf::FieldDescriptor::CPPTYPE_INT32: + case protobuf::FieldDescriptor::CPPTYPE_ENUM: + return "int32_t"; + case protobuf::FieldDescriptor::CPPTYPE_UINT32: + return "uint32_t"; + case protobuf::FieldDescriptor::CPPTYPE_DOUBLE: + return "double"; + case protobuf::FieldDescriptor::CPPTYPE_INT64: + return "int64_t"; + case protobuf::FieldDescriptor::CPPTYPE_UINT64: + return "uint64_t"; + case protobuf::FieldDescriptor::CPPTYPE_STRING: + return "absl::string_view"; + default: + ABSL_LOG(FATAL) << "Unexpected type: " << field->cpp_type(); + } +} + +std::string CppConstType(const protobuf::FieldDescriptor* field) { + return CppTypeInternal(field, /* is_const= */ true, + /* is_type_parameter= */ false); +} + +std::string CppTypeParameterName(const protobuf::FieldDescriptor* field) { + return CppTypeInternal(field, /* is_const= */ false, + /* is_type_parameter= */ true); +} + +std::string MessageBaseType(const protobuf::FieldDescriptor* field, + bool is_const) { + ABSL_DCHECK(field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE); + std::string maybe_const = is_const ? "const " : ""; + return maybe_const + QualifiedClassName(field->message_type()); +} + +std::string MessagePtrConstType(const protobuf::FieldDescriptor* field, + bool is_const) { + ABSL_DCHECK(field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE); + std::string maybe_const = is_const ? "const " : ""; + return "::protos::Ptr<" + maybe_const + + QualifiedClassName(field->message_type()) + ">"; +} + +std::string MessageCProxyType(const protobuf::FieldDescriptor* field, + bool is_const) { + ABSL_DCHECK(field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE); + std::string maybe_const = is_const ? "const " : ""; + return maybe_const + QualifiedInternalClassName(field->message_type()) + + "CProxy"; +} + +std::string MessageProxyType(const protobuf::FieldDescriptor* field, + bool is_const) { + ABSL_DCHECK(field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE); + std::string maybe_const = is_const ? "const " : ""; + return maybe_const + QualifiedInternalClassName(field->message_type()) + + "Proxy"; +} + +void AddEnums(const protobuf::Descriptor* message, + std::vector* enums) { + enums->reserve(enums->size() + message->enum_type_count()); + for (int i = 0; i < message->enum_type_count(); i++) { + enums->push_back(message->enum_type(i)); + } + for (int i = 0; i < message->nested_type_count(); i++) { + AddEnums(message->nested_type(i), enums); + } +} + +std::vector SortedEnums( + const protobuf::FileDescriptor* file) { + std::vector enums; + enums.reserve(file->enum_type_count()); + for (int i = 0; i < file->enum_type_count(); i++) { + enums.push_back(file->enum_type(i)); + } + for (int i = 0; i < file->message_type_count(); i++) { + AddEnums(file->message_type(i), &enums); + } + return enums; +} + +void AddMessages(const protobuf::Descriptor* message, + std::vector* messages) { + messages->push_back(message); + for (int i = 0; i < message->nested_type_count(); i++) { + AddMessages(message->nested_type(i), messages); + } +} + +std::vector SortedMessages( + const protobuf::FileDescriptor* file) { + std::vector messages; + for (int i = 0; i < file->message_type_count(); i++) { + AddMessages(file->message_type(i), &messages); + } + return messages; +} + +void AddExtensionsFromMessage( + const protobuf::Descriptor* message, + std::vector* exts) { + for (int i = 0; i < message->extension_count(); i++) { + exts->push_back(message->extension(i)); + } + for (int i = 0; i < message->nested_type_count(); i++) { + AddExtensionsFromMessage(message->nested_type(i), exts); + } +} + +std::vector SortedExtensions( + const protobuf::FileDescriptor* file) { + std::vector ret; + for (int i = 0; i < file->extension_count(); i++) { + ret.push_back(file->extension(i)); + } + for (int i = 0; i < file->message_type_count(); i++) { + AddExtensionsFromMessage(file->message_type(i), &ret); + } + return ret; +} + +std::vector FieldNumberOrder( + const protobuf::Descriptor* message) { + std::vector fields; + for (int i = 0; i < message->field_count(); i++) { + fields.push_back(message->field(i)); + } + std::sort(fields.begin(), fields.end(), + [](const protobuf::FieldDescriptor* a, + const protobuf::FieldDescriptor* b) { + return a->number() < b->number(); + }); + return fields; +} + +} // namespace protos_generator diff --git a/third_party/upb/protos_generator/gen_utils.h b/third_party/upb/protos_generator/gen_utils.h new file mode 100644 index 00000000000..5563f9f26aa --- /dev/null +++ b/third_party/upb/protos_generator/gen_utils.h @@ -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. + */ + +#ifndef UPB_PROTOS_GENERATOR_GEN_UTILS_H_ +#define UPB_PROTOS_GENERATOR_GEN_UTILS_H_ + +#include "google/protobuf/descriptor.pb.h" +#include "absl/container/flat_hash_map.h" +#include "absl/strings/string_view.h" +#include "google/protobuf/compiler/code_generator.h" +#include "google/protobuf/compiler/plugin.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/wire_format.h" +#include "protos_generator/output.h" + +namespace protos_generator { + +namespace protobuf = ::google::protobuf; + +enum class MessageClassType { + kMessage, + kMessageCProxy, + kMessageProxy, + kMessageAccess, +}; + +std::string ClassName(const protobuf::Descriptor* descriptor); +std::string QualifiedClassName(const protobuf::Descriptor* descriptor); +std::string QualifiedInternalClassName(const protobuf::Descriptor* descriptor); + +inline bool IsMapEntryMessage(const protobuf::Descriptor* descriptor) { + return descriptor->options().map_entry(); +} +std::string CppSourceFilename(const google::protobuf::FileDescriptor* file); +std::string ForwardingHeaderFilename(const google::protobuf::FileDescriptor* file); +std::string UpbCFilename(const google::protobuf::FileDescriptor* file); +std::string CppHeaderFilename(const google::protobuf::FileDescriptor* file); + +void WriteStartNamespace(const protobuf::FileDescriptor* file, Output& output); +void WriteEndNamespace(const protobuf::FileDescriptor* file, Output& output); + +std::string CppConstType(const protobuf::FieldDescriptor* field); +std::string CppTypeParameterName(const protobuf::FieldDescriptor* field); + +std::string MessageBaseType(const protobuf::FieldDescriptor* field, + bool is_const); +// Generate protos::Ptr to be used in accessors as public +// signatures. +std::string MessagePtrConstType(const protobuf::FieldDescriptor* field, + bool is_const); +std::string MessageCProxyType(const protobuf::FieldDescriptor* field, + bool is_const); +std::string MessageProxyType(const protobuf::FieldDescriptor* field, + bool is_const); + +std::vector SortedEnums( + const protobuf::FileDescriptor* file); +std::vector SortedMessages( + const protobuf::FileDescriptor* file); +std::vector SortedExtensions( + const protobuf::FileDescriptor* file); +std::vector FieldNumberOrder( + const protobuf::Descriptor* message); + +inline constexpr absl::string_view kNoPackageNamePrefix = "protos_"; + +} // namespace protos_generator + +#endif // UPB_PROTOS_GENERATOR_GEN_UTILS_H_ diff --git a/third_party/upb/protos_generator/output.cc b/third_party/upb/protos_generator/output.cc new file mode 100644 index 00000000000..e5a9b79dd5c --- /dev/null +++ b/third_party/upb/protos_generator/output.cc @@ -0,0 +1,85 @@ +// 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 "protos_generator/output.h" + +#include "absl/strings/str_replace.h" + +namespace protos_generator { +namespace { + +namespace protobuf = ::google::protobuf; + +} // namespace + +std::string StripExtension(absl::string_view fname) { + size_t lastdot = fname.find_last_of('.'); + if (lastdot == std::string::npos) { + return std::string(fname); + } + return std::string(fname.substr(0, lastdot)); +} + +std::string ToCIdent(absl::string_view str) { + return absl::StrReplaceAll(str, {{".", "_"}, {"/", "_"}, {"-", "_"}}); +} + +std::string ToPreproc(absl::string_view str) { + return absl::AsciiStrToUpper(ToCIdent(str)); +} + +void EmitFileWarning(const protobuf::FileDescriptor* file, Output& output) { + output( + R"cc( + /* This file was generated by protos_generator (the upb C++ compiler) " + from the input + * file: + * + * $0 + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + )cc", + file->name()); + output("\n"); +} + +std::string MessageName(const protobuf::Descriptor* descriptor) { + return ToCIdent(descriptor->full_name()); +} + +std::string FileLayoutName(const google::protobuf::FileDescriptor* file) { + return ToCIdent(file->name()) + "_upb_file_layout"; +} + +std::string CHeaderFilename(const google::protobuf::FileDescriptor* file) { + return StripExtension(file->name()) + ".upb.h"; +} + +std::string CSourceFilename(const google::protobuf::FileDescriptor* file) { + return StripExtension(file->name()) + ".upb.c"; +} + +} // namespace protos_generator diff --git a/third_party/upb/protos_generator/output.h b/third_party/upb/protos_generator/output.h new file mode 100644 index 00000000000..d0f765321a5 --- /dev/null +++ b/third_party/upb/protos_generator/output.h @@ -0,0 +1,171 @@ +/* + * 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_PROTOS_GENERATOR_OUTPUT_H +#define UPB_PROTOS_GENERATOR_OUTPUT_H + +#include + +#include "absl/log/absl_log.h" +#include "absl/strings/str_replace.h" +#include "absl/strings/substitute.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/io/zero_copy_stream.h" + +namespace protos_generator { + +class Output { + public: + Output(google::protobuf::io::ZeroCopyOutputStream* stream) : stream_(stream) {} + ~Output() { stream_->BackUp((int)buffer_size_); } + + template + void operator()(absl::string_view format, const Arg&... arg) { + Write(absl::Substitute(format, arg...)); + } + + // Indentation size in characters. + static constexpr size_t kIndentationSize = 2; + + void Indent() { Indent(kIndentationSize); } + void Indent(size_t size) { indent_ += size; } + + void Outdent() { Outdent(kIndentationSize); } + void Outdent(size_t size) { + if (indent_ < size) { + ABSL_LOG(FATAL) << "mismatched Output indent/unindent calls"; + } + indent_ -= size; + } + + private: + void Write(absl::string_view data) { + std::string stripped; + if (absl::StartsWith(data, "\n ")) { + size_t indent = data.substr(1).find_first_not_of(' '); + if (indent > indent_) { + indent -= indent_; + } + if (indent != absl::string_view::npos) { + // Remove indentation from all lines. + auto line_prefix = data.substr(0, indent + 1); + // The final line has an extra newline and is indented two less, eg. + // R"cc( + // UPB_INLINE $0 $1_$2(const $1 *msg) { + // return $1_has_$2(msg) ? *UPB_PTR_AT(msg, $3, $0) : $4; + // } + // )cc", + std::string last_line_prefix = std::string(line_prefix); + last_line_prefix.resize(last_line_prefix.size() - 2); + data.remove_prefix(line_prefix.size()); + stripped = absl::StrReplaceAll( + data, {{line_prefix, "\n"}, {last_line_prefix, "\n"}}); + data = stripped; + } + } else { + WriteIndent(); + } + WriteRaw(data); + } + + void WriteRaw(absl::string_view data) { + while (!data.empty()) { + RefreshOutput(); + size_t to_write = std::min(data.size(), buffer_size_); + memcpy(output_buffer_, data.data(), to_write); + data.remove_prefix(to_write); + output_buffer_ += to_write; + buffer_size_ -= to_write; + } + } + + void WriteIndent() { + if (indent_ == 0) { + return; + } + size_t size = indent_; + while (size > buffer_size_) { + if (buffer_size_ > 0) { + memset(output_buffer_, ' ', buffer_size_); + } + size -= buffer_size_; + buffer_size_ = 0; + RefreshOutput(); + } + memset(output_buffer_, ' ', size); + output_buffer_ += size; + buffer_size_ -= size; + } + + void RefreshOutput() { + while (buffer_size_ == 0) { + void* void_buffer; + int size; + if (!stream_->Next(&void_buffer, &size)) { + fprintf(stderr, "upbc: Failed to write to to output\n"); + abort(); + } + output_buffer_ = static_cast(void_buffer); + buffer_size_ = size; + } + } + + google::protobuf::io::ZeroCopyOutputStream* stream_; + char* output_buffer_ = nullptr; + size_t buffer_size_ = 0; + // Current indentation size in characters. + size_t indent_ = 0; + friend class OutputIndenter; +}; + +class OutputIndenter { + public: + OutputIndenter(Output& output) + : OutputIndenter(output, Output::kIndentationSize) {} + OutputIndenter(Output& output, size_t indent_size) + : indent_size_(indent_size), output_(output) { + output.Indent(indent_size); + } + ~OutputIndenter() { output_.Outdent(indent_size_); } + + private: + size_t indent_size_; + Output& output_; +}; + +std::string StripExtension(absl::string_view fname); +std::string ToCIdent(absl::string_view str); +std::string ToPreproc(absl::string_view str); +void EmitFileWarning(const google::protobuf::FileDescriptor* file, Output& output); +std::string MessageName(const google::protobuf::Descriptor* descriptor); +std::string FileLayoutName(const google::protobuf::FileDescriptor* file); +std::string CHeaderFilename(const google::protobuf::FileDescriptor* file); +std::string CSourceFilename(const google::protobuf::FileDescriptor* file); + +} // namespace protos_generator + +#endif // UPB_PROTOS_GENERATOR_OUTPUT_H diff --git a/third_party/upb/protos_generator/protoc-gen-upb-protos.cc b/third_party/upb/protos_generator/protoc-gen-upb-protos.cc new file mode 100644 index 00000000000..2e5fbd4a2ed --- /dev/null +++ b/third_party/upb/protos_generator/protoc-gen-upb-protos.cc @@ -0,0 +1,303 @@ +// 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 + +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/compiler/code_generator.h" +#include "google/protobuf/compiler/plugin.h" +#include "google/protobuf/descriptor.h" +#include "protos_generator/gen_enums.h" +#include "protos_generator/gen_extensions.h" +#include "protos_generator/gen_messages.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/output.h" +#include "upbc/file_layout.h" + +namespace protos_generator { +namespace { + +namespace protoc = ::google::protobuf::compiler; +namespace protobuf = ::google::protobuf; +using FileDescriptor = ::google::protobuf::FileDescriptor; + +void WriteSource(const protobuf::FileDescriptor* file, Output& output, + bool fasttable_enabled); +void WriteHeader(const protobuf::FileDescriptor* file, Output& output); +void WriteForwardingHeader(const protobuf::FileDescriptor* file, + Output& output); +void WriteMessageImplementations(const protobuf::FileDescriptor* file, + Output& output); +void WriteTypedefForwardingHeader( + const protobuf::FileDescriptor* file, + const std::vector& file_messages, + Output& output); +void WriteHeaderMessageForwardDecls( + const protobuf::FileDescriptor* file, + const std::vector& file_messages, + const std::vector& file_exts, + Output& output); + +class Generator : public protoc::CodeGenerator { + public: + ~Generator() override {} + bool Generate(const protobuf::FileDescriptor* file, + const std::string& parameter, protoc::GeneratorContext* context, + std::string* error) const override; + uint64_t GetSupportedFeatures() const override { + return FEATURE_PROTO3_OPTIONAL; + } +}; + +bool Generator::Generate(const protobuf::FileDescriptor* file, + const std::string& parameter, + protoc::GeneratorContext* context, + std::string* error) const { + bool fasttable_enabled = false; + std::vector> params; + google::protobuf::compiler::ParseGeneratorParameter(parameter, ¶ms); + + for (const auto& pair : params) { + if (pair.first == "fasttable") { + fasttable_enabled = true; + } else { + *error = "Unknown parameter: " + pair.first; + return false; + } + } + + // Write model.upb.fwd.h + Output forwarding_header_output( + context->Open(ForwardingHeaderFilename(file))); + WriteForwardingHeader(file, forwarding_header_output); + // Write model.upb.proto.h + Output header_output(context->Open(CppHeaderFilename(file))); + WriteHeader(file, header_output); + // Write model.upb.proto.cc + Output cc_output(context->Open(CppSourceFilename(file))); + WriteSource(file, cc_output, fasttable_enabled); + return true; +} + +// The forwarding header defines Access/Proxy/CProxy for message classes +// used to include when referencing dependencies to prevent transitive +// dependency headers from being included. +void WriteForwardingHeader(const protobuf::FileDescriptor* file, + Output& output) { + EmitFileWarning(file, output); + output( + R"cc( +#ifndef $0_UPB_FWD_H_ +#define $0_UPB_FWD_H_ + )cc", + ToPreproc(file->name())); + output("\n"); + const std::vector this_file_messages = + SortedMessages(file); + WriteTypedefForwardingHeader(file, this_file_messages, output); + output("#endif /* $0_UPB_FWD_H_ */\n", ToPreproc(file->name())); +} + +void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { + EmitFileWarning(file, output); + output( + R"cc( +#ifndef $0_UPB_PROTO_H_ +#define $0_UPB_PROTO_H_ + +#include "protos/protos.h" +#include "protos/protos_internal.h" +#include "upb/upb.hpp" + +#include "absl/strings/string_view.h" +#include "absl/status/statusor.h" +#include "upb/message/internal.h" + )cc", + ToPreproc(file->name())); + + // Import headers for proto public dependencies. + for (int i = 0; i < file->public_dependency_count(); i++) { + if (i == 0) { + output("// Public Imports.\n"); + } + output("#include \"$0\"\n", CppHeaderFilename(file->public_dependency(i))); + if (i == file->public_dependency_count() - 1) { + output("\n"); + } + } + + output("#include \"upb/port/def.inc\"\n"); + + const std::vector this_file_messages = + SortedMessages(file); + const std::vector this_file_exts = + SortedExtensions(file); + + if (!this_file_messages.empty()) { + output("\n"); + } + + WriteHeaderMessageForwardDecls(file, this_file_messages, this_file_exts, + output); + WriteStartNamespace(file, output); + + std::vector this_file_enums = + SortedEnums(file); + + // Write Class and Enums. + WriteEnumDeclarations(this_file_enums, output); + output("\n"); + + for (auto message : this_file_messages) { + WriteMessageClassDeclarations(message, this_file_exts, output); + } + output("\n"); + + WriteExtensionIdentifiersHeader(this_file_exts, output); + output("\n"); + + WriteEndNamespace(file, output); + + output("\n#include \"upb/port/undef.inc\"\n\n"); + // End of "C" section. + + output("#endif /* $0_UPB_PROTO_H_ */\n", ToPreproc(file->name())); +} + +// Writes a .upb.cc source file. +void WriteSource(const protobuf::FileDescriptor* file, Output& output, + bool fasttable_enabled) { + EmitFileWarning(file, output); + + output( + R"cc( +#include +#include "absl/strings/string_view.h" +#include "upb/message/internal.h" +#include "protos/protos.h" +#include "$0" + )cc", + CppHeaderFilename(file)); + + for (int i = 0; i < file->dependency_count(); i++) { + output("#include \"$0\"\n", CppHeaderFilename(file->dependency(i))); + } + output("#include \"upb/port/def.inc\"\n"); + + WriteStartNamespace(file, output); + WriteMessageImplementations(file, output); + const std::vector this_file_exts = + SortedExtensions(file); + WriteExtensionIdentifiers(this_file_exts, output); + WriteEndNamespace(file, output); + + output("#include \"upb/port/undef.inc\"\n\n"); +} + +void WriteMessageImplementations(const protobuf::FileDescriptor* file, + Output& output) { + const std::vector file_exts = + SortedExtensions(file); + const std::vector this_file_messages = + SortedMessages(file); + for (auto message : this_file_messages) { + WriteMessageImplementation(message, file_exts, output); + } +} + +void WriteTypedefForwardingHeader( + const protobuf::FileDescriptor* file, + const std::vector& file_messages, + Output& output) { + WriteStartNamespace(file, output); + + // Forward-declare types defined in this file. + for (auto message : file_messages) { + output( + R"cc( + class $0; + namespace internal { + class $0Access; + class $0Proxy; + class $0CProxy; + } // namespace internal + )cc", + ClassName(message)); + } + output("\n"); + WriteEndNamespace(file, output); +} + +/// Writes includes for upb C minitables and fwd.h for transitive typedefs. +void WriteHeaderMessageForwardDecls( + const protobuf::FileDescriptor* file, + const std::vector& file_messages, + const std::vector& file_exts, + Output& output) { + // Import forward-declaration of types defined in this file. + output("#include \"$0\"\n", UpbCFilename(file)); + output("#include \"$0\"\n", ForwardingHeaderFilename(file)); + // Forward-declare types not in this file, but used as submessages. + // Order by full name for consistent ordering. + std::map forward_messages; + + for (auto* message : file_messages) { + for (int i = 0; i < message->field_count(); i++) { + const protobuf::FieldDescriptor* field = message->field(i); + if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE && + field->file() != field->message_type()->file()) { + forward_messages[field->message_type()->full_name()] = + field->message_type(); + } + } + } + for (auto* ext : file_exts) { + if (ext->file() != ext->containing_type()->file()) { + forward_messages[ext->containing_type()->full_name()] = + ext->containing_type(); + if (ext->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + forward_messages[ext->message_type()->full_name()] = + ext->message_type(); + } + } + } + std::map files_to_import; + for (const auto& pair : forward_messages) { + files_to_import[ForwardingHeaderFilename(pair.second->file())] = file; + } + for (const auto& pair : files_to_import) { + output("#include \"$0\"\n", UpbCFilename(pair.second)); + output("#include \"$0\"\n", pair.first); + } + output("\n"); +} + +} // namespace +} // namespace protos_generator + +int main(int argc, char** argv) { + protos_generator::Generator generator_cc; + return google::protobuf::compiler::PluginMain(argc, argv, &generator_cc); +} diff --git a/third_party/upb/protos_generator/tests/BUILD b/third_party/upb/protos_generator/tests/BUILD new file mode 100644 index 00000000000..1ea227ca472 --- /dev/null +++ b/third_party/upb/protos_generator/tests/BUILD @@ -0,0 +1,135 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +load( + "//bazel:build_defs.bzl", + "UPB_DEFAULT_CPPOPTS", +) +load( + "//protos/bazel:upb_cc_proto_library.bzl", + "upb_cc_proto_library", +) +load( + "//bazel:upb_proto_library.bzl", + "upb_proto_library", +) +load( + "@rules_cc//cc:defs.bzl", + "cc_proto_library", +) + +licenses(["notice"]) + +proto_library( + name = "test_model_proto", + srcs = [ + "child_model.proto", + "test_enum.proto", + "test_extension.proto", + "test_model.proto", + ], +) + +proto_library( + name = "no_package_proto", + srcs = [ + "no_package.proto", + ], +) + +proto_library( + name = "no_package_enum_user_proto", + srcs = [ + "no_package_enum_user.proto", + ], + deps = [":no_package_proto"], +) + +upb_proto_library( + name = "test_model_upb_proto", + visibility = [ + "//protos:__pkg__", + ], + deps = [":test_model_proto"], +) + +upb_cc_proto_library( + name = "test_model_upb_cc_proto", + visibility = ["//protos:__pkg__"], + deps = [":test_model_proto"], +) + +upb_cc_proto_library( + name = "no_package_upb_cc_proto", + deps = [ + ":no_package_proto", + ], +) + +upb_cc_proto_library( + name = "no_package_enum_user_upb_cc_proto", + deps = [ + ":no_package_enum_user_proto", + ], +) + +cc_proto_library( + name = "test_model_cc_proto", + deps = [":test_model_proto"], +) + +# begin:google_only +# proto_library( +# name = "legacy_name_proto", +# srcs = [ +# "legacy-name.proto", +# ], +# ) +# +# upb_cc_proto_library( +# name = "legacy_name_test_proto", +# visibility = [ +# "//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private. +# ], +# deps = [":legacy_name_proto"], +# ) +# end:google_only + +cc_test( + name = "test_generated_cc_code", + srcs = ["test_generated.cc"], + copts = UPB_DEFAULT_CPPOPTS, + deps = [ + # begin:google_only +# ":legacy_name_test_proto", + # end:google_only + ":no_package_upb_cc_proto", + ":test_model_upb_cc_proto", + ":test_model_upb_proto", + "@com_google_googletest//:gtest_main", + "//:upb", + "//protos", + ], +) diff --git a/third_party/upb/protos_generator/tests/child_model.proto b/third_party/upb/protos_generator/tests/child_model.proto new file mode 100644 index 00000000000..05d0c41d4e2 --- /dev/null +++ b/third_party/upb/protos_generator/tests/child_model.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package protos_generator.test; + +import public "protos_generator/tests/test_enum.proto"; + +message ChildModel1 { + optional bool child_b1 = 44; + optional string child_str1 = 56; +} + +message ChildModel3 { + string sub_key = 1; + bool bool1 = 2; + int32 i32 = 3; + optional string opt_str = 4; + optional bool opt_bool = 5; + optional int32 opt_i32 = 6; +} diff --git a/third_party/upb/protos_generator/tests/legacy-name.proto b/third_party/upb/protos_generator/tests/legacy-name.proto new file mode 100644 index 00000000000..86852190088 --- /dev/null +++ b/third_party/upb/protos_generator/tests/legacy-name.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package protos_generator.test; + +// option java_multiple_files = true; + +enum LegacyEnum { + PHASE_DEFAULT = 0; + PHASE_BUSY = 1; +} diff --git a/third_party/upb/protos_generator/tests/no_package.proto b/third_party/upb/protos_generator/tests/no_package.proto new file mode 100644 index 00000000000..d928c4a26e2 --- /dev/null +++ b/third_party/upb/protos_generator/tests/no_package.proto @@ -0,0 +1,18 @@ +syntax = "proto2"; + +// option java_multiple_files = true; + +enum EnumWithNoPackage { + CELSIUS = 1; + FAHRENHEIT = 2; +} + +message MessageWithEnumUpbTest { + enum EnumWithNoPackageInMessage { + UNKNOWN = 0; + AB_1 = 1; + CD_2 = 2; + EF_3 = 3; + GH_4 = 4; + } +} \ No newline at end of file diff --git a/third_party/upb/protos_generator/tests/no_package_enum_user.proto b/third_party/upb/protos_generator/tests/no_package_enum_user.proto new file mode 100644 index 00000000000..43bfb683c9c --- /dev/null +++ b/third_party/upb/protos_generator/tests/no_package_enum_user.proto @@ -0,0 +1,11 @@ +syntax = "proto2"; + +package protos_generator.tests; + +import "protos_generator/tests/no_package.proto"; + +// option java_multiple_files = true; + +message MyMessage { + optional MessageWithEnumUpbTest my_type = 1; +} \ No newline at end of file diff --git a/third_party/upb/protos_generator/tests/test_enum.proto b/third_party/upb/protos_generator/tests/test_enum.proto new file mode 100644 index 00000000000..c5354ccb8da --- /dev/null +++ b/third_party/upb/protos_generator/tests/test_enum.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package protos_generator.test; + +enum TestEnum { + DEVICE_UNKNOWN = 0; + DEVICE_KEYBOARD = 1; + DEVICE_MOUSE = 2; + DEVICE_MONITOR = 3; +} diff --git a/third_party/upb/protos_generator/tests/test_extension.proto b/third_party/upb/protos_generator/tests/test_extension.proto new file mode 100644 index 00000000000..e7207739f10 --- /dev/null +++ b/third_party/upb/protos_generator/tests/test_extension.proto @@ -0,0 +1,12 @@ +syntax = "proto2"; + +package protos_generator.test.someotherpackage; + +import "protos_generator/tests/test_model.proto"; + +// Define extension that is extending proto outside this package with a type +// defined in different file. + +extend TestModel { + optional ThemeExtension styling = 13001; +} diff --git a/third_party/upb/protos_generator/tests/test_generated.cc b/third_party/upb/protos_generator/tests/test_generated.cc new file mode 100644 index 00000000000..d6ca24a00b8 --- /dev/null +++ b/third_party/upb/protos_generator/tests/test_generated.cc @@ -0,0 +1,615 @@ +// 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 + +#include "gtest/gtest.h" +#include "protos/protos.h" +#include "protos_generator/tests/child_model.upb.proto.h" +#include "protos_generator/tests/no_package.upb.proto.h" +#include "protos_generator/tests/test_model.upb.proto.h" + +using ::protos_generator::test::protos::ChildModel1; +using ::protos_generator::test::protos::other_ext; +using ::protos_generator::test::protos::RED; +using ::protos_generator::test::protos::TestEnum; +using ::protos_generator::test::protos::TestModel; +using ::protos_generator::test::protos::TestModel_Category_IMAGES; +using ::protos_generator::test::protos::TestModel_Category_NEWS; +using ::protos_generator::test::protos::TestModel_Category_VIDEO; +using ::protos_generator::test::protos::theme; +using ::protos_generator::test::protos::ThemeExtension; + +TEST(CppGeneratedCode, Constructor) { TestModel test_model; } + +TEST(CppGeneratedCode, MessageEnum) { EXPECT_EQ(5, TestModel_Category_IMAGES); } + +TEST(CppGeneratedCode, ImportedEnum) { EXPECT_EQ(3, TestEnum::DEVICE_MONITOR); } + +TEST(CppGeneratedCode, Enum) { EXPECT_EQ(1, RED); } + +TEST(CppGeneratedCode, EnumNoPackage) { EXPECT_EQ(1, ::protos_CELSIUS); } + +TEST(CppGeneratedCode, ArenaConstructor) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + EXPECT_EQ(false, testModel.has_b1()); +} + +TEST(CppGeneratedCode, Booleans) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + EXPECT_FALSE(testModel.b1()); + testModel.set_b1(true); + EXPECT_TRUE(testModel.b1()); + testModel.set_b1(false); + EXPECT_FALSE(testModel.b1()); + testModel.set_b1(true); + EXPECT_TRUE(testModel.b1()); + testModel.clear_b1(); + EXPECT_FALSE(testModel.has_b1()); +} + +TEST(CppGeneratedCode, ScalarInt32) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + // Test int32 defaults. + EXPECT_EQ(testModel.value(), 0); + EXPECT_FALSE(testModel.has_value()); + // Floating point defautls. + EXPECT_EQ(std::numeric_limits::infinity(), + testModel.float_value_with_default()); + EXPECT_EQ(-std::numeric_limits::infinity(), + testModel.double_value_with_default()); + + // Set value. + testModel.set_value(5); + EXPECT_TRUE(testModel.has_value()); + EXPECT_EQ(testModel.value(), 5); + // Change value. + testModel.set_value(10); + EXPECT_TRUE(testModel.has_value()); + EXPECT_EQ(testModel.value(), 10); + // Clear value. + testModel.clear_value(); + EXPECT_FALSE(testModel.has_value()); + EXPECT_EQ(testModel.value(), 0); +} + +const char kTestStr1[] = "abcdefg"; +const char kTestStr2[] = "just another test string"; + +TEST(CppGeneratedCode, Strings) { + TestModel testModel; + testModel.set_str1(kTestStr1); + testModel.set_str2(kTestStr2); + EXPECT_EQ(testModel.str1(), kTestStr1); + EXPECT_EQ(testModel.str2(), kTestStr2); + EXPECT_TRUE(testModel.has_str1()); + EXPECT_TRUE(testModel.has_str2()); + + testModel.clear_str1(); + EXPECT_FALSE(testModel.has_str1()); + EXPECT_TRUE(testModel.has_str2()); +} + +TEST(CppGeneratedCode, ScalarUInt32) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + // Test defaults. + EXPECT_EQ(testModel.optional_uint32(), 0); + EXPECT_FALSE(testModel.has_optional_uint32()); + // Set value. + testModel.set_optional_uint32(0xA0001000); + EXPECT_TRUE(testModel.has_optional_uint32()); + EXPECT_EQ(testModel.optional_uint32(), 0xA0001000); + // Change value. + testModel.set_optional_uint32(0x70002000); + EXPECT_TRUE(testModel.has_optional_uint32()); + EXPECT_EQ(testModel.optional_uint32(), 0x70002000); + // Clear value. + testModel.clear_optional_uint32(); + EXPECT_FALSE(testModel.has_optional_uint32()); + EXPECT_EQ(testModel.optional_uint32(), 0); +} + +TEST(CppGeneratedCode, ScalarInt64) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + // Test defaults. + EXPECT_EQ(testModel.optional_int64(), 0); + EXPECT_FALSE(testModel.has_optional_int64()); + // Set value. + testModel.set_optional_int64(0xFF00CCDDA0001000); + EXPECT_TRUE(testModel.has_optional_int64()); + EXPECT_EQ(testModel.optional_int64(), 0xFF00CCDDA0001000); + // Change value. + testModel.set_optional_int64(0xFF00CCDD70002000); + EXPECT_TRUE(testModel.has_optional_int64()); + EXPECT_EQ(testModel.optional_int64(), 0xFF00CCDD70002000); + // Clear value. + testModel.clear_optional_int64(); + EXPECT_FALSE(testModel.has_optional_int64()); + EXPECT_EQ(testModel.optional_int64(), 0); + // Set after clear. + testModel.set_optional_int64(0xFF00CCDDA0001000); + EXPECT_TRUE(testModel.has_optional_int64()); + EXPECT_EQ(testModel.optional_int64(), 0xFF00CCDDA0001000); +} + +TEST(CppGeneratedCode, ScalarFloat) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + // Test defaults. + EXPECT_EQ(testModel.optional_float(), 0.0f); + EXPECT_FALSE(testModel.has_optional_float()); + EXPECT_EQ(std::numeric_limits::infinity(), + testModel.float_value_with_default()); + EXPECT_EQ(-std::numeric_limits::infinity(), + testModel.double_value_with_default()); + // Set value. + testModel.set_optional_float(3.14159265f); + EXPECT_TRUE(testModel.has_optional_float()); + EXPECT_NEAR(testModel.optional_float(), 3.14159265f, 1e-9f); + // Change value. + testModel.set_optional_float(-2.0f); + EXPECT_TRUE(testModel.has_optional_float()); + EXPECT_NEAR(testModel.optional_float(), -2, 1e-9f); + // Clear value. + testModel.clear_optional_float(); + EXPECT_FALSE(testModel.has_optional_float()); + EXPECT_EQ(testModel.optional_float(), 0.0f); + // Set after clear. + testModel.set_optional_float(3.14159265f); + EXPECT_TRUE(testModel.has_optional_float()); + EXPECT_NEAR(testModel.optional_float(), 3.14159265f, 1e-9f); +} + +TEST(CppGeneratedCode, ScalarDouble) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + // Test defaults. + EXPECT_EQ(testModel.optional_double(), 0.0); + EXPECT_FALSE(testModel.has_optional_double()); + // Set value. + testModel.set_optional_double(3.141592653589793); + EXPECT_TRUE(testModel.has_optional_double()); + EXPECT_NEAR(testModel.optional_double(), 3.141592653589793, 1e-16f); + // Change value. + testModel.set_optional_double(-1.0); + EXPECT_TRUE(testModel.has_optional_double()); + EXPECT_NEAR(testModel.optional_double(), -1.0, 1e-16f); + // Clear value. + testModel.clear_optional_double(); + EXPECT_FALSE(testModel.has_optional_double()); + EXPECT_EQ(testModel.optional_double(), 0.0f); + // Set after clear. + testModel.set_optional_double(3.141592653589793); + EXPECT_TRUE(testModel.has_optional_double()); + EXPECT_NEAR(testModel.optional_double(), 3.141592653589793, 1e-16f); +} + +TEST(CppGeneratedCode, Enums) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + + // Check enum default value. + EXPECT_EQ(TestModel_Category_IMAGES, 5); + + // Test defaults. + EXPECT_FALSE(testModel.has_category()); + EXPECT_EQ(testModel.category(), TestModel_Category_IMAGES); + // Set value. + testModel.set_category(TestModel_Category_NEWS); + EXPECT_TRUE(testModel.has_category()); + EXPECT_EQ(testModel.category(), TestModel_Category_NEWS); + // Change value. + testModel.set_category(TestModel_Category_VIDEO); + EXPECT_TRUE(testModel.has_category()); + EXPECT_EQ(testModel.category(), TestModel_Category_VIDEO); + // Clear value. + testModel.clear_category(); + EXPECT_FALSE(testModel.has_category()); + EXPECT_EQ(testModel.category(), TestModel_Category_IMAGES); + // Set after clear. + testModel.set_category(TestModel_Category_VIDEO); + EXPECT_TRUE(testModel.has_category()); + EXPECT_EQ(testModel.category(), TestModel_Category_VIDEO); +} + +TEST(CppGeneratedCode, FieldWithDefaultValue) { + ::protos::Arena arena; + auto testModel = ::protos::CreateMessage(arena); + + EXPECT_FALSE(testModel.has_int_value_with_default()); + EXPECT_EQ(testModel.int_value_with_default(), 65); + testModel.set_int_value_with_default(10); + EXPECT_EQ(testModel.int_value_with_default(), 10); + + EXPECT_FALSE(testModel.has_string_value_with_default()); + EXPECT_EQ(testModel.string_value_with_default(), "hello"); + testModel.set_string_value_with_default("new string"); + EXPECT_EQ(testModel.string_value_with_default(), "new string"); +} + +TEST(CppGeneratedCode, OneOfFields) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + + EXPECT_FALSE(test_model.has_oneof_member1()); + EXPECT_FALSE(test_model.has_oneof_member2()); + + test_model.set_oneof_member1("one of string"); + EXPECT_TRUE(test_model.has_oneof_member1()); + EXPECT_FALSE(test_model.has_oneof_member2()); + EXPECT_EQ(test_model.oneof_member1(), "one of string"); + + test_model.set_oneof_member2(true); + EXPECT_FALSE(test_model.has_oneof_member1()); + EXPECT_TRUE(test_model.has_oneof_member2()); + EXPECT_EQ(test_model.oneof_member2(), true); + + test_model.clear_oneof_member2(); + EXPECT_FALSE(test_model.has_oneof_member1()); + EXPECT_FALSE(test_model.has_oneof_member2()); + EXPECT_EQ(test_model.oneof_member1(), ""); + EXPECT_EQ(test_model.oneof_member2(), false); +} + +TEST(CppGeneratedCode, Messages) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(false, test_model.has_child_model_1()); + auto child_model = test_model.child_model_1(); + EXPECT_EQ(false, child_model->has_child_b1()); + EXPECT_EQ(false, child_model->child_b1()); + auto mutable_child = test_model.mutable_child_model_1(); + mutable_child->set_child_b1(true); + EXPECT_EQ(true, mutable_child->has_child_b1()); + EXPECT_EQ(true, mutable_child->child_b1()); + // The View should not change due to mutation since it + // is default_instance. + EXPECT_EQ(false, child_model->has_child_b1()); + // Readonly View should now show change. + child_model = test_model.child_model_1(); + EXPECT_EQ(true, child_model->has_child_b1()); + EXPECT_EQ(true, child_model->child_b1()); + // Clear message field. + EXPECT_EQ(true, test_model.has_child_model_1()); + test_model.clear_child_model_1(); + EXPECT_EQ(false, test_model.has_child_model_1()); +} + +TEST(CppGeneratedCode, NestedMessages) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + auto nested_child = test_model.nested_child_1(); + EXPECT_EQ(0, nested_child->nested_child_name().size()); + auto mutable_nested_child = test_model.mutable_nested_child_1(); + EXPECT_EQ(false, mutable_nested_child->has_nested_child_name()); + mutable_nested_child->set_nested_child_name(kTestStr1); + EXPECT_EQ(true, mutable_nested_child->has_nested_child_name()); +} + +TEST(CppGeneratedCode, RepeatedMessages) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(0, test_model.child_model_2_size()); + // Should be able to clear repeated field when empty. + test_model.clear_child_model_2(); + EXPECT_EQ(0, test_model.child_model_2_size()); + // Add 2 children. + auto new_child = test_model.add_child_model_2(); + EXPECT_EQ(true, new_child.ok()); + new_child.value()->set_child_str1(kTestStr1); + new_child = test_model.add_child_model_2(); + EXPECT_EQ(true, new_child.ok()); + new_child.value()->set_child_str1(kTestStr2); + EXPECT_EQ(2, test_model.child_model_2_size()); + // Mutable access. + auto mutable_first = test_model.mutable_child_model_2(0); + EXPECT_EQ(mutable_first->child_str1(), kTestStr1); + mutable_first->set_child_str1("change1"); + auto mutable_second = test_model.mutable_child_model_2(1); + EXPECT_EQ(mutable_second->child_str1(), kTestStr2); + mutable_second->set_child_str1("change2"); + // Check mutations using views. + auto view_first = test_model.child_model_2(0); + EXPECT_EQ(view_first->child_str1(), "change1"); + auto view_second = test_model.child_model_2(1); + EXPECT_EQ(view_second->child_str1(), "change2"); +} + +TEST(CppGeneratedCode, RepeatedScalar) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(0, test_model.value_array_size()); + // Should be able to clear repeated field when empty. + test_model.clear_value_array(); + EXPECT_EQ(0, test_model.value_array_size()); + // Add 2 children. + EXPECT_EQ(true, test_model.add_value_array(5)); + EXPECT_EQ(true, test_model.add_value_array(6)); + EXPECT_EQ(2, test_model.value_array_size()); + EXPECT_EQ(5, test_model.value_array(0)); + EXPECT_EQ(6, test_model.value_array(1)); + EXPECT_EQ(true, test_model.resize_value_array(3)); + EXPECT_EQ(3, test_model.value_array_size()); + test_model.set_value_array(2, 7); + EXPECT_EQ(5, test_model.value_array(0)); + EXPECT_EQ(6, test_model.value_array(1)); + EXPECT_EQ(7, test_model.value_array(2)); +} + +TEST(CppGeneratedCode, RepeatedStrings) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(0, test_model.repeated_string_size()); + // Should be able to clear repeated field when empty. + test_model.clear_repeated_string(); + EXPECT_EQ(0, test_model.repeated_string_size()); + // Add 2 children. + EXPECT_EQ(true, test_model.add_repeated_string("Hello")); + EXPECT_EQ(true, test_model.add_repeated_string("World")); + EXPECT_EQ(2, test_model.repeated_string_size()); + EXPECT_EQ("Hello", test_model.repeated_string(0)); + EXPECT_EQ("World", test_model.repeated_string(1)); + EXPECT_EQ(true, test_model.resize_repeated_string(3)); + EXPECT_EQ(3, test_model.repeated_string_size()); + test_model.set_repeated_string(2, "Test"); + EXPECT_EQ("Hello", test_model.repeated_string(0)); + EXPECT_EQ("World", test_model.repeated_string(1)); + EXPECT_EQ("Test", test_model.repeated_string(2)); +} + +TEST(CppGeneratedCode, MessageMapInt32KeyMessageValue) { + const int key_test_value = 3; + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(0, test_model.child_map_size()); + test_model.clear_child_map(); + EXPECT_EQ(0, test_model.child_map_size()); + auto child_model1 = ::protos::CreateMessage(arena); + child_model1.set_child_str1("abc"); + test_model.set_child_map(key_test_value, child_model1); + auto map_result = test_model.get_child_map(key_test_value); + EXPECT_EQ(true, map_result.ok()); + EXPECT_EQ("abc", map_result.value()->child_str1()); + test_model.delete_child_map(key_test_value); + auto map_result_after_delete = test_model.get_child_map(key_test_value); + EXPECT_EQ(false, map_result_after_delete.ok()); +} + +TEST(CppGeneratedCode, MessageMapStringKeyAndStringValue) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(0, test_model.str_to_str_map_size()); + test_model.clear_str_to_str_map(); + EXPECT_EQ(0, test_model.str_to_str_map_size()); + test_model.set_str_to_str_map("first", "abc"); + test_model.set_str_to_str_map("second", "def"); + auto result = test_model.get_str_to_str_map("second"); + EXPECT_EQ(true, result.ok()); + EXPECT_EQ("def", result.value()); + test_model.delete_str_to_str_map("first"); + auto result_after_delete = test_model.get_str_to_str_map("first"); + EXPECT_EQ(false, result_after_delete.ok()); +} + +TEST(CppGeneratedCode, MessageMapStringKeyAndInt32Value) { + ::protos::Arena arena; + auto test_model = ::protos::CreateMessage(arena); + EXPECT_EQ(0, test_model.str_to_int_map_size()); + test_model.clear_str_to_int_map(); + EXPECT_EQ(0, test_model.str_to_int_map_size()); + test_model.set_str_to_int_map("first", 10); + EXPECT_EQ(1, test_model.str_to_int_map_size()); + test_model.set_str_to_int_map("second", 20); + EXPECT_EQ(2, test_model.str_to_int_map_size()); + auto result = test_model.get_str_to_int_map("second"); + EXPECT_EQ(true, result.ok()); + EXPECT_EQ(20, result.value()); + test_model.delete_str_to_int_map("first"); + auto result_after_delete = test_model.get_str_to_int_map("first"); + EXPECT_EQ(false, result_after_delete.ok()); +} + +TEST(CppGeneratedCode, HasExtension) { + TestModel model; + EXPECT_EQ(false, ::protos::HasExtension(model, theme)); +} + +TEST(CppGeneratedCode, HasExtensionPtr) { + TestModel model; + EXPECT_EQ(false, ::protos::HasExtension(model.recursive_child(), theme)); +} + +TEST(CppGeneratedCode, ClearExtensionWithEmptyExtension) { + TestModel model; + EXPECT_EQ(false, ::protos::HasExtension(model, theme)); + ::protos::ClearExtension(model, theme); + EXPECT_EQ(false, ::protos::HasExtension(model, theme)); +} + +TEST(CppGeneratedCode, ClearExtensionWithEmptyExtensionPtr) { + TestModel model; + ::protos::Ptr recursive_child = model.mutable_recursive_child(); + ::protos::ClearExtension(recursive_child, theme); + EXPECT_EQ(false, ::protos::HasExtension(recursive_child, theme)); +} + +TEST(CppGeneratedCode, SetExtension) { + TestModel model; + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + EXPECT_EQ(false, ::protos::HasExtension(model, theme)); + EXPECT_EQ(true, ::protos::SetExtension(model, theme, extension1).ok()); + EXPECT_EQ(true, ::protos::HasExtension(model, theme)); +} + +TEST(CppGeneratedCode, SetExtensionOnMutableChild) { + TestModel model; + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + EXPECT_EQ(false, + ::protos::HasExtension(model.mutable_recursive_child(), theme)); + EXPECT_EQ(true, ::protos::SetExtension(model.mutable_recursive_child(), theme, + extension1) + .ok()); + EXPECT_EQ(true, + ::protos::HasExtension(model.mutable_recursive_child(), theme)); +} + +TEST(CppGeneratedCode, GetExtension) { + TestModel model; + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + EXPECT_EQ(false, ::protos::HasExtension(model, theme)); + EXPECT_EQ(true, ::protos::SetExtension(model, theme, extension1).ok()); + EXPECT_EQ("Hello World", + ::protos::GetExtension(model, theme).value()->ext_name()); +} + +TEST(CppGeneratedCode, GetExtensionOnMutableChild) { + TestModel model; + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + ::protos::Ptr mutable_recursive_child = + model.mutable_recursive_child(); + EXPECT_EQ(false, ::protos::HasExtension(mutable_recursive_child, theme)); + EXPECT_EQ( + true, + ::protos::SetExtension(mutable_recursive_child, theme, extension1).ok()); + EXPECT_EQ("Hello World", + ::protos::GetExtension(mutable_recursive_child, theme) + .value() + ->ext_name()); +} + +TEST(CppGeneratedCode, GetExtensionOnImmutableChild) { + TestModel model; + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + ::protos::Ptr mutable_recursive_child = + model.mutable_recursive_child(); + EXPECT_EQ(false, ::protos::HasExtension(mutable_recursive_child, theme)); + EXPECT_EQ( + true, + ::protos::SetExtension(mutable_recursive_child, theme, extension1).ok()); + ::protos::Ptr recursive_child = model.recursive_child(); + EXPECT_EQ("Hello World", + ::protos::GetExtension(recursive_child, theme).value()->ext_name()); +} + +TEST(CppGeneratedCode, SerializeUsingArena) { + TestModel model; + model.set_str1("Hello World"); + ::upb::Arena arena; + absl::StatusOr bytes = ::protos::Serialize(model, arena); + EXPECT_EQ(true, bytes.ok()); + TestModel parsed_model = ::protos::Parse(bytes.value()).value(); + EXPECT_EQ("Hello World", parsed_model.str1()); +} + +TEST(CppGeneratedCode, SerializeNestedMessageUsingArena) { + TestModel model; + model.mutable_recursive_child()->set_str1("Hello World"); + ::upb::Arena arena; + ::protos::Ptr child = model.recursive_child(); + absl::StatusOr bytes = ::protos::Serialize(child, arena); + EXPECT_EQ(true, bytes.ok()); + TestModel parsed_model = ::protos::Parse(bytes.value()).value(); + EXPECT_EQ("Hello World", parsed_model.str1()); +} + +TEST(CppGeneratedCode, Parse) { + TestModel model; + model.set_str1("Test123"); + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + EXPECT_EQ(true, ::protos::SetExtension(model, theme, extension1).ok()); + ::upb::Arena arena; + auto bytes = ::protos::Serialize(model, arena); + EXPECT_EQ(true, bytes.ok()); + TestModel parsed_model = ::protos::Parse(bytes.value()).value(); + EXPECT_EQ("Test123", parsed_model.str1()); + // Should not return an extension since we did not pass ExtensionRegistry. + EXPECT_EQ(false, ::protos::GetExtension(parsed_model, theme).ok()); +} + +TEST(CppGeneratedCode, ParseIntoPtrToModel) { + TestModel model; + model.set_str1("Test123"); + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + EXPECT_EQ(true, ::protos::SetExtension(model, theme, extension1).ok()); + ::upb::Arena arena; + auto bytes = ::protos::Serialize(model, arena); + EXPECT_EQ(true, bytes.ok()); + ::protos::Ptr parsed_model = + ::protos::CreateMessage(arena); + EXPECT_TRUE(::protos::Parse(parsed_model, bytes.value())); + EXPECT_EQ("Test123", parsed_model->str1()); + // Should not return an extension since we did not pass ExtensionRegistry. + EXPECT_EQ(false, ::protos::GetExtension(parsed_model, theme).ok()); +} + +TEST(CppGeneratedCode, ParseWithExtensionRegistry) { + TestModel model; + model.set_str1("Test123"); + ThemeExtension extension1; + extension1.set_ext_name("Hello World"); + EXPECT_EQ(true, ::protos::SetExtension(model, theme, extension1).ok()); + ::upb::Arena arena; + auto bytes = ::protos::Serialize(model, arena); + EXPECT_EQ(true, bytes.ok()); + ::protos::ExtensionRegistry extensions({&theme, &other_ext}, arena); + TestModel parsed_model = + ::protos::Parse(bytes.value(), extensions).value(); + EXPECT_EQ("Test123", parsed_model.str1()); + EXPECT_EQ(true, ::protos::GetExtension(parsed_model, theme).ok()); +} + +TEST(CppGeneratedCode, NameCollisions) { + TestModel model; + model.set_template_("test"); + EXPECT_EQ("test", model.template_()); + model.set_arena__("test"); + EXPECT_EQ("test", model.arena__()); +} + +TEST(CppGeneratedCode, SharedPointer) { + std::shared_ptr model = std::make_shared(); + ::upb::Arena arena; + auto bytes = protos::Serialize(model, arena); + EXPECT_TRUE(protos::Parse(model, bytes.value())); +} + +TEST(CppGeneratedCode, UniquePointer) { + std::unique_ptr model = std::make_unique(); + ::upb::Arena arena; + auto bytes = protos::Serialize(model, arena); + EXPECT_TRUE(protos::Parse(model, bytes.value())); +} diff --git a/third_party/upb/protos_generator/tests/test_model.proto b/third_party/upb/protos_generator/tests/test_model.proto new file mode 100644 index 00000000000..abc2ccb810d --- /dev/null +++ b/third_party/upb/protos_generator/tests/test_model.proto @@ -0,0 +1,151 @@ +syntax = "proto2"; + +package protos_generator.test; + +import "protos_generator/tests/child_model.proto"; + +message TestModelContainer { + repeated TestModel models = 1; + optional ChildModel3 proto_3_child = 2; +} + +message TestModel { + optional int32 value = 1; + repeated int32 value_array = 2; // _UPB_MODE_ARRAY + repeated int32 value_packed_array = 3 + [packed = true]; // _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED + repeated int32 value_deprec = 4 [deprecated = true]; + optional string str1 = 115; + optional bool b1 = 9; + optional bool b2 = 10; + optional string str2 = 50; + optional string str3 = 11; + optional float optional_float = 14; + optional double optional_double = 15; + optional int64 optional_int64 = 16; + optional uint32 optional_uint32 = 17; + optional uint64 optional_uint64 = 18; + optional sint32 optional_sint32 = 19; + optional sint64 optional_sint64 = 20; + optional fixed32 optional_fixed32 = 21; + optional fixed64 optional_fixed64 = 22; + optional sfixed32 optional_sfixed32 = 23; + optional sfixed64 optional_sfixed64 = 24; + repeated int64 repeated_int64 = 25; + repeated uint64 repeated_uint64 = 26; + repeated fixed64 repeated_fixed64 = 27; + repeated sfixed64 repeated_sfixed64 = 28; + repeated bool repeated_bool = 29; + repeated string repeated_string = 35; + optional bytes optional_bytes = 36; + message NestedChild { + optional string nested_child_name = 211; + } + optional NestedChild nested_child_1 = 212; + optional ChildModel1 child_model_1 = 222; + repeated ChildModel1 child_model_2 = 223; + optional ChildModel1 bar = 224; + oneof child_oneof1 { + string oneof_member1 = 98; + bool oneof_member2 = 99; + } + optional int32 int_value_with_default = 31 + [default = 65]; // Not supported yet + optional string string_value_with_default = 32 + [default = "hello"]; // Not supported yet + optional float float_value_with_default = 33 [default = inf]; + optional float double_value_with_default = 34 [default = -inf]; + + map child_map = 225; + optional TestModel recursive_child = 226; + map child_str_map = 227; + map str_to_int_map = 228; + map str_to_str_map = 229; + + extend TestAnnotation { + optional OtherExtension in_message_ext = 15000; + } + + enum Category { + IMAGES = 5; + NEWS = 6; + VIDEO = 7; + RADIO = 8 [deprecated = true]; + } + optional Category category = 37; + + // keyword collisions (double, template, ...) + oneof type { + string string = 230; + int64 int64 = 231; + double double = 232; + } + optional string template = 233; + optional string msg = 234; + optional string arena = 235; + + // Tests publicly imported enum. + optional TestEnum imported_enum = 238; + + optional string phase = 239; + optional bool clear_phase = 240; + + optional string doc_id = 241; + optional bool set_doc_id = 242; + + extensions 10000 to max; +} + +// Old version with fewer fields to test backward/forward compatibility. +message TestModelContainerV1 { + repeated TestModelV1 models = 1; +} + +message TestModelV1 { + optional int32 value = 1; + repeated int32 value2 = 2; + repeated int32 value3 = 3 [packed = true]; + repeated int32 value4 = 4 [deprecated = true]; + optional bool b1 = 9; + optional bool b2 = 10; + optional string str2 = 50; +} + +enum PrimaryColors { + RED = 1; + GREEN = 2; + BLUE = 3; +} + +// TestModel extension. +message ThemeExtension { + optional string ext_name = 1; + optional bool ext_bool = 2; +} + +extend TestModel { + optional ThemeExtension theme = 12001; +} + +message OtherExtension { + optional string ext2_name = 1; +} + +extend TestModel { + optional OtherExtension other_ext = 12002; +} + +message TestAnnotation { + extensions 10000 to max; +} + +message TestMessageHasEnum { + optional EnumDeclaredAfterMessage enum_declared_after_message = 1; +} + +enum EnumDeclaredAfterMessage { + ZERO = 0; + ONE = 1; + TWO = 2; + THREE = 3; +} diff --git a/third_party/upb/python/BUILD b/third_party/upb/python/BUILD index 3bb4a1e2b82..b14c1996061 100644 --- a/third_party/upb/python/BUILD +++ b/third_party/upb/python/BUILD @@ -31,6 +31,10 @@ 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") +# begin:github_only +load("@rules_pkg//:mappings.bzl", "pkg_files") +# end:github_only + licenses(["notice"]) package( @@ -45,7 +49,7 @@ LIMITED_API_FLAG_SELECT = { bool_flag( name = "limited_api", - build_setting_default = False, + build_setting_default = True, ) string_flag( @@ -172,8 +176,29 @@ selects.config_setting_group( ], ) -py_extension( - name = "_message", +# begin:github_only +_message_target_compatible_with = { + "@platforms//os:windows": ["@platforms//:incompatible"], + "@system_python//:none": ["@platforms//:incompatible"], + "@system_python//:unsupported": ["@platforms//:incompatible"], + "//conditions:default": [], +} + +pkg_files( + name = "message_extension", + srcs = [":message_srcs"], + prefix = "python/", +) +# end:github_only +# begin:google_only +# _message_target_compatible_with = { +# "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], +# "//conditions:default": [], +# } +# end:google_only + +filegroup( + name = "message_srcs", srcs = [ "convert.c", "convert.h", @@ -197,18 +222,32 @@ py_extension( "unknown_fields.c", "unknown_fields.h", ], + # begin:google_only +# compatible_with = ["//buildenv/target:non_prod"], + # end:google_only +) + +py_extension( + name = "_message", + srcs = [":message_srcs"], 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", ], + target_compatible_with = select(_message_target_compatible_with), deps = [ "//:collections", "//:descriptor_upb_proto_reflection", + "//:eps_copy_input_stream", + "//:hash", + "//:port", "//:reflection", - "//:table", "//:textformat", "//:upb", + "//:wire", + "//:wire_reader", + "//:wire_types", "//upb/util:compare", "//upb/util:def_to_proto", "//upb/util:required_fields", diff --git a/third_party/upb/python/convert.c b/third_party/upb/python/convert.c index 215b6fe3bfb..43e45138387 100644 --- a/third_party/upb/python/convert.c +++ b/third_party/upb/python/convert.c @@ -29,9 +29,13 @@ #include "python/message.h" #include "python/protobuf.h" -#include "upb/reflection.h" +#include "upb/map.h" +#include "upb/reflection/message.h" #include "upb/util/compare.h" +// Must be last. +#include "upb/port/def.inc" + PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f, PyObject* arena) { switch (upb_FieldDef_CType(f)) { @@ -150,6 +154,34 @@ static upb_MessageValue PyUpb_MaybeCopyString(const char* ptr, size_t size, return ret; } +const char* upb_FieldDef_TypeString(const upb_FieldDef* f) { + switch (upb_FieldDef_CType(f)) { + case kUpb_CType_Double: + return "double"; + case kUpb_CType_Float: + return "float"; + case kUpb_CType_Int64: + return "int64"; + case kUpb_CType_Int32: + return "int32"; + case kUpb_CType_UInt64: + return "uint64"; + case kUpb_CType_UInt32: + return "uint32"; + case kUpb_CType_Enum: + return "enum"; + case kUpb_CType_Bool: + return "bool"; + case kUpb_CType_String: + return "string"; + case kUpb_CType_Bytes: + return "bytes"; + case kUpb_CType_Message: + return "message"; + } + UPB_UNREACHABLE(); +} + static bool PyUpb_PyToUpbEnum(PyObject* obj, const upb_EnumDef* e, upb_MessageValue* val) { if (PyUnicode_Check(obj)) { @@ -176,6 +208,20 @@ static bool PyUpb_PyToUpbEnum(PyObject* obj, const upb_EnumDef* e, } } +bool PyUpb_IsNumpyNdarray(PyObject* obj, const upb_FieldDef* f) { + PyObject* type_name_obj = + PyObject_GetAttrString((PyObject*)Py_TYPE(obj), "__name__"); + bool is_ndarray = false; + if (!strcmp(PyUpb_GetStrData(type_name_obj), "ndarray")) { + PyErr_Format(PyExc_TypeError, + "%S has type ndarray, but expected one of: %s", obj, + upb_FieldDef_TypeString(f)); + is_ndarray = true; + } + Py_DECREF(type_name_obj); + return is_ndarray; +} + bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val, upb_Arena* arena) { switch (upb_FieldDef_CType(f)) { @@ -190,12 +236,15 @@ bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val, case kUpb_CType_UInt64: return PyUpb_GetUint64(obj, &val->uint64_val); case kUpb_CType_Float: + if (PyUpb_IsNumpyNdarray(obj, f)) return false; val->float_val = PyFloat_AsDouble(obj); return !PyErr_Occurred(); case kUpb_CType_Double: + if (PyUpb_IsNumpyNdarray(obj, f)) return false; val->double_val = PyFloat_AsDouble(obj); return !PyErr_Occurred(); case kUpb_CType_Bool: + if (PyUpb_IsNumpyNdarray(obj, f)) return false; val->bool_val = PyLong_AsLong(obj); return !PyErr_Occurred(); case kUpb_CType_Bytes: { @@ -223,8 +272,7 @@ bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val, return true; } case kUpb_CType_Message: - PyErr_Format(PyExc_ValueError, "Message objects may not be assigned", - upb_FieldDef_CType(f)); + PyErr_Format(PyExc_ValueError, "Message objects may not be assigned"); return false; default: PyErr_Format(PyExc_SystemError, @@ -284,9 +332,8 @@ bool PyUpb_Map_IsEqual(const upb_Map* map1, const upb_Map* map2, const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1); size_t iter = kUpb_Map_Begin; - while (upb_MapIterator_Next(map1, &iter)) { - upb_MessageValue key = upb_MapIterator_Key(map1, iter); - upb_MessageValue val1 = upb_MapIterator_Value(map1, iter); + upb_MessageValue key, val1; + while (upb_Map_Next(map1, &key, &val1, &iter)) { upb_MessageValue val2; if (!upb_Map_Get(map2, key, &val2)) return false; if (!PyUpb_ValueEq(val1, val2, val_f)) return false; @@ -348,7 +395,7 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, // using upb_Message_Next(msg2). If the two messages have the same set // of fields, this will yield the same field. // 3. For extension fields, we have to actually search for the corresponding - // field, which we do with upb_Message_Get(msg2, ext_f1). + // field, which we do with upb_Message_GetFieldByDef(msg2, ext_f1). // 4. Once iteration over msg1 is complete, we call upb_Message_Next(msg2) // one // final time to verify that we have visited all of msg2's regular fields @@ -364,7 +411,7 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, size_t iter2 = kUpb_Message_Begin; while (upb_Message_Next(msg1, m, symtab, &f1, &val1, &iter1)) { if (upb_FieldDef_IsExtension(f1)) { - val2 = upb_Message_Get(msg2, f1); + val2 = upb_Message_GetFieldByDef(msg2, f1); } else { if (!upb_Message_Next(msg2, m, NULL, &f2, &val2, &iter2) || f1 != f2) { return false; @@ -392,3 +439,5 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, return upb_Message_UnknownFieldsAreEqual(uf1, usize1, uf2, usize2, 100) == kUpb_UnknownCompareResult_Equal; } + +#include "upb/port/undef.inc" diff --git a/third_party/upb/python/convert.h b/third_party/upb/python/convert.h index d26aeb72a57..c02c1976a35 100644 --- a/third_party/upb/python/convert.h +++ b/third_party/upb/python/convert.h @@ -29,8 +29,8 @@ #define PYUPB_CONVERT_H__ #include "protobuf.h" -#include "upb/def.h" -#include "upb/reflection.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" // Converts `val` to a Python object according to the type information in `f`. // Any newly-created Python objects that reference non-primitive data from `val` diff --git a/third_party/upb/python/descriptor.c b/third_party/upb/python/descriptor.c index b30b3482771..c8e72c8b12b 100644 --- a/third_party/upb/python/descriptor.c +++ b/third_party/upb/python/descriptor.c @@ -32,7 +32,7 @@ #include "python/descriptor_pool.h" #include "python/message.h" #include "python/protobuf.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "upb/util/def_to_proto.h" // ----------------------------------------------------------------------------- @@ -126,10 +126,11 @@ static PyObject* PyUpb_DescriptorBase_GetOptions(PyUpb_DescriptorBase* self, 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); + const upb_MiniTable* opts2_layout = upb_MessageDef_MiniTable(m); + upb_Message* opts2 = upb_Message_New(opts2_layout, arena); assert(opts2); upb_DecodeStatus ds = - upb_Decode(pb, size, opts2, upb_MessageDef_MiniTable(m), + upb_Decode(pb, size, opts2, opts2_layout, upb_DefPool_ExtensionRegistry(symtab), 0, arena); (void)ds; assert(ds == kUpb_DecodeStatus_Ok); @@ -212,7 +213,6 @@ PyObject* PyUpb_Descriptor_Get(const upb_MessageDef* m) { PyObject* PyUpb_Descriptor_GetClass(const upb_MessageDef* m) { PyObject* ret = PyUpb_ObjCache_Get(upb_MessageDef_MiniTable(m)); - assert(ret); return ret; } @@ -324,8 +324,7 @@ static PyObject* PyUpb_Descriptor_GetOneofs(PyObject* _self, void* closure) { static PyObject* PyUpb_Descriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; return PyUpb_DescriptorBase_GetOptions( - self, upb_MessageDef_Options(self->def), - &google_protobuf_MessageOptions_msginit, + self, upb_MessageDef_Options(self->def), &google_protobuf_MessageOptions_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".MessageOptions"); } @@ -333,7 +332,7 @@ static PyObject* PyUpb_Descriptor_CopyToProto(PyObject* _self, PyObject* py_proto) { return PyUpb_DescriptorBase_CopyToProto( _self, (PyUpb_ToProto_Func*)&upb_MessageDef_ToProto, - &google_protobuf_DescriptorProto_msginit, + &google_protobuf_DescriptorProto_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".DescriptorProto", py_proto); } @@ -731,20 +730,25 @@ static PyObject* PyUpb_EnumDescriptor_GetHasOptions(PyObject* _self, return PyBool_FromLong(upb_EnumDef_HasOptions(self->def)); } +static PyObject* PyUpb_EnumDescriptor_GetIsClosed(PyObject* _self, + void* closure) { + const upb_EnumDef* enumdef = PyUpb_EnumDescriptor_GetDef(_self); + return PyBool_FromLong(upb_EnumDef_IsClosed(enumdef)); +} + static PyObject* PyUpb_EnumDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; - return PyUpb_DescriptorBase_GetOptions(self, upb_EnumDef_Options(self->def), - &google_protobuf_EnumOptions_msginit, - PYUPB_DESCRIPTOR_PROTO_PACKAGE - ".EnumOptions"); + return PyUpb_DescriptorBase_GetOptions( + self, upb_EnumDef_Options(self->def), &google_protobuf_EnumOptions_msg_init, + PYUPB_DESCRIPTOR_PROTO_PACKAGE ".EnumOptions"); } static PyObject* PyUpb_EnumDescriptor_CopyToProto(PyObject* _self, PyObject* py_proto) { return PyUpb_DescriptorBase_CopyToProto( _self, (PyUpb_ToProto_Func*)&upb_EnumDef_ToProto, - &google_protobuf_EnumDescriptorProto_msginit, + &google_protobuf_EnumDescriptorProto_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".EnumDescriptorProto", py_proto); } @@ -760,6 +764,8 @@ static PyGetSetDef PyUpb_EnumDescriptor_Getters[] = { {"containing_type", PyUpb_EnumDescriptor_GetContainingType, NULL, "Containing type"}, {"has_options", PyUpb_EnumDescriptor_GetHasOptions, NULL, "Has Options"}, + {"is_closed", PyUpb_EnumDescriptor_GetIsClosed, NULL, + "Checks if the enum is closed"}, {NULL}}; static PyMethodDef PyUpb_EnumDescriptor_Methods[] = { @@ -825,7 +831,7 @@ static PyObject* PyUpb_EnumValueDescriptor_GetOptions(PyObject* _self, PyUpb_DescriptorBase* self = (void*)_self; return PyUpb_DescriptorBase_GetOptions( self, upb_EnumValueDef_Options(self->def), - &google_protobuf_EnumValueOptions_msginit, + &google_protobuf_EnumValueOptions_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".EnumValueOptions"); } @@ -1023,10 +1029,9 @@ static PyObject* PyUpb_FieldDescriptor_GetHasPresence( static PyObject* PyUpb_FieldDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; - return PyUpb_DescriptorBase_GetOptions(self, upb_FieldDef_Options(self->def), - &google_protobuf_FieldOptions_msginit, - PYUPB_DESCRIPTOR_PROTO_PACKAGE - ".FieldOptions"); + return PyUpb_DescriptorBase_GetOptions( + self, upb_FieldDef_Options(self->def), &google_protobuf_FieldOptions_msg_init, + PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FieldOptions"); } static PyGetSetDef PyUpb_FieldDescriptor_Getters[] = { @@ -1108,7 +1113,7 @@ static const void* PyUpb_FileDescriptor_NestedLookup( PyUpb_FileDescriptor_LookupFunc* func) { const upb_DefPool* symtab = upb_FileDef_Pool(filedef); const char* package = upb_FileDef_Package(filedef); - if (package) { + if (strlen(package)) { PyObject* qname = PyUnicode_FromFormat("%s.%s", package, name); const void* ret = func(symtab, PyUnicode_AsUTF8AndSize(qname, NULL)); Py_DECREF(qname); @@ -1163,7 +1168,7 @@ static PyObject* PyUpb_FileDescriptor_GetSerializedPb(PyObject* self, void* closure) { return PyUpb_DescriptorBase_GetSerializedProto( self, (PyUpb_ToProto_Func*)&upb_FileDef_ToProto, - &google_protobuf_FileDescriptorProto_msginit); + &google_protobuf_FileDescriptorProto_msg_init); } static PyObject* PyUpb_FileDescriptor_GetMessageTypesByName(PyObject* _self, @@ -1265,17 +1270,16 @@ static PyObject* PyUpb_FileDescriptor_GetHasOptions(PyObject* _self, static PyObject* PyUpb_FileDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; - return PyUpb_DescriptorBase_GetOptions(self, upb_FileDef_Options(self->def), - &google_protobuf_FileOptions_msginit, - PYUPB_DESCRIPTOR_PROTO_PACKAGE - ".FileOptions"); + return PyUpb_DescriptorBase_GetOptions( + self, upb_FileDef_Options(self->def), &google_protobuf_FileOptions_msg_init, + PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FileOptions"); } static PyObject* PyUpb_FileDescriptor_CopyToProto(PyObject* _self, PyObject* py_proto) { return PyUpb_DescriptorBase_CopyToProto( _self, (PyUpb_ToProto_Func*)&upb_FileDef_ToProto, - &google_protobuf_FileDescriptorProto_msginit, + &google_protobuf_FileDescriptorProto_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FileDescriptorProto", py_proto); } @@ -1379,17 +1383,16 @@ static PyObject* PyUpb_MethodDescriptor_GetOutputType(PyObject* self, static PyObject* PyUpb_MethodDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; - return PyUpb_DescriptorBase_GetOptions(self, upb_MethodDef_Options(self->def), - &google_protobuf_MethodOptions_msginit, - PYUPB_DESCRIPTOR_PROTO_PACKAGE - ".MethodOptions"); + return PyUpb_DescriptorBase_GetOptions( + self, upb_MethodDef_Options(self->def), &google_protobuf_MethodOptions_msg_init, + PYUPB_DESCRIPTOR_PROTO_PACKAGE ".MethodOptions"); } static PyObject* PyUpb_MethodDescriptor_CopyToProto(PyObject* _self, PyObject* py_proto) { return PyUpb_DescriptorBase_CopyToProto( _self, (PyUpb_ToProto_Func*)&upb_MethodDef_ToProto, - &google_protobuf_MethodDescriptorProto_msginit, + &google_protobuf_MethodDescriptorProto_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".MethodDescriptorProto", py_proto); } @@ -1484,10 +1487,9 @@ static PyObject* PyUpb_OneofDescriptor_GetFields(PyObject* _self, static PyObject* PyUpb_OneofDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; - return PyUpb_DescriptorBase_GetOptions(self, upb_OneofDef_Options(self->def), - &google_protobuf_OneofOptions_msginit, - PYUPB_DESCRIPTOR_PROTO_PACKAGE - ".OneofOptions"); + return PyUpb_DescriptorBase_GetOptions( + self, upb_OneofDef_Options(self->def), &google_protobuf_OneofOptions_msg_init, + PYUPB_DESCRIPTOR_PROTO_PACKAGE ".OneofOptions"); } static PyGetSetDef PyUpb_OneofDescriptor_Getters[] = { @@ -1586,8 +1588,7 @@ static PyObject* PyUpb_ServiceDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; return PyUpb_DescriptorBase_GetOptions( - self, upb_ServiceDef_Options(self->def), - &google_protobuf_ServiceOptions_msginit, + self, upb_ServiceDef_Options(self->def), &google_protobuf_ServiceOptions_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".ServiceOptions"); } @@ -1595,7 +1596,7 @@ static PyObject* PyUpb_ServiceDescriptor_CopyToProto(PyObject* _self, PyObject* py_proto) { return PyUpb_DescriptorBase_CopyToProto( _self, (PyUpb_ToProto_Func*)&upb_ServiceDef_ToProto, - &google_protobuf_ServiceDescriptorProto_msginit, + &google_protobuf_ServiceDescriptorProto_msg_init, PYUPB_DESCRIPTOR_PROTO_PACKAGE ".ServiceDescriptorProto", py_proto); } diff --git a/third_party/upb/python/descriptor.h b/third_party/upb/python/descriptor.h index 581e1c7a8cb..9bf6b4258d9 100644 --- a/third_party/upb/python/descriptor.h +++ b/third_party/upb/python/descriptor.h @@ -31,7 +31,7 @@ #include #include "python/python_api.h" -#include "upb/def.h" +#include "upb/reflection/def.h" typedef enum { kPyUpb_Descriptor = 0, @@ -72,7 +72,6 @@ const void* PyUpb_AnyDescriptor_GetDef(PyObject* _self); // Returns the underlying |def| for a given wrapper object. The caller must // have already verified that the given Python object is of the expected type. const upb_FileDef* PyUpb_FileDescriptor_GetDef(PyObject* file); -const void* PyUpb_AnyDescriptor_GetDef(PyObject* _self); // Module-level init. bool PyUpb_InitDescriptor(PyObject* m); diff --git a/third_party/upb/python/descriptor_containers.c b/third_party/upb/python/descriptor_containers.c index ac7158520ac..c750a4a04fb 100644 --- a/third_party/upb/python/descriptor_containers.c +++ b/third_party/upb/python/descriptor_containers.c @@ -25,41 +25,54 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "descriptor_containers.h" +#include "python/descriptor_containers.h" -#include "descriptor.h" -#include "protobuf.h" -#include "upb/def.h" +#include "python/descriptor.h" +#include "python/protobuf.h" +#include "upb/reflection/def.h" + +// Implements __repr__ as str(dict(self)). +static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) { + PyObject* dict = PyDict_New(); + PyObject* ret = NULL; + if (!dict) goto err; + if (PyDict_Merge(dict, _self, 1) != 0) goto err; + ret = PyObject_Str(dict); + +err: + Py_XDECREF(dict); + return ret; +} // ----------------------------------------------------------------------------- -// DescriptorIterator +// ByNameIterator // ----------------------------------------------------------------------------- typedef struct { PyObject_HEAD; - const PyUpb_GenericSequence_Funcs* funcs; + const PyUpb_ByNameMap_Funcs* funcs; const void* parent; // upb_MessageDef*, upb_DefPool*, etc. PyObject* parent_obj; // Python object that keeps parent alive, we own a ref. int index; // Current iterator index. -} PyUpb_DescriptorIterator; +} PyUpb_ByNameIterator; -PyUpb_DescriptorIterator* PyUpb_DescriptorIterator_Self(PyObject* obj) { - assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->descriptor_iterator_type); - return (PyUpb_DescriptorIterator*)obj; +static PyUpb_ByNameIterator* PyUpb_ByNameIterator_Self(PyObject* obj) { + assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_name_iterator_type); + return (PyUpb_ByNameIterator*)obj; } -static void PyUpb_DescriptorIterator_Dealloc(PyObject* _self) { - PyUpb_DescriptorIterator* self = PyUpb_DescriptorIterator_Self(_self); +static void PyUpb_ByNameIterator_Dealloc(PyObject* _self) { + PyUpb_ByNameIterator* self = PyUpb_ByNameIterator_Self(_self); Py_DECREF(self->parent_obj); PyUpb_Dealloc(self); } -PyObject* PyUpb_DescriptorIterator_New(const PyUpb_GenericSequence_Funcs* funcs, - const void* parent, - PyObject* parent_obj) { +static PyObject* PyUpb_ByNameIterator_New(const PyUpb_ByNameMap_Funcs* funcs, + const void* parent, + PyObject* parent_obj) { PyUpb_ModuleState* s = PyUpb_ModuleState_Get(); - PyUpb_DescriptorIterator* iter = - (void*)PyType_GenericAlloc(s->descriptor_iterator_type, 0); + PyUpb_ByNameIterator* iter = + (void*)PyType_GenericAlloc(s->by_name_iterator_type, 0); iter->funcs = funcs; iter->parent = parent; iter->parent_obj = parent_obj; @@ -68,27 +81,87 @@ PyObject* PyUpb_DescriptorIterator_New(const PyUpb_GenericSequence_Funcs* funcs, return &iter->ob_base; } -PyObject* PyUpb_DescriptorIterator_IterNext(PyObject* _self) { - PyUpb_DescriptorIterator* self = PyUpb_DescriptorIterator_Self(_self); - int size = self->funcs->get_elem_count(self->parent); +static PyObject* PyUpb_ByNameIterator_IterNext(PyObject* _self) { + PyUpb_ByNameIterator* self = PyUpb_ByNameIterator_Self(_self); + int size = self->funcs->base.get_elem_count(self->parent); if (self->index >= size) return NULL; - const void* elem = self->funcs->index(self->parent, self->index); + const void* elem = self->funcs->base.index(self->parent, self->index); self->index++; - return self->funcs->get_elem_wrapper(elem); + return PyUnicode_FromString(self->funcs->get_elem_name(elem)); } -static PyType_Slot PyUpb_DescriptorIterator_Slots[] = { - {Py_tp_dealloc, PyUpb_DescriptorIterator_Dealloc}, +static PyType_Slot PyUpb_ByNameIterator_Slots[] = { + {Py_tp_dealloc, PyUpb_ByNameIterator_Dealloc}, {Py_tp_iter, PyObject_SelfIter}, - {Py_tp_iternext, PyUpb_DescriptorIterator_IterNext}, + {Py_tp_iternext, PyUpb_ByNameIterator_IterNext}, {0, NULL}}; -static PyType_Spec PyUpb_DescriptorIterator_Spec = { - PYUPB_MODULE_NAME ".DescriptorIterator", // tp_name - sizeof(PyUpb_DescriptorIterator), // tp_basicsize - 0, // tp_itemsize - Py_TPFLAGS_DEFAULT, // tp_flags - PyUpb_DescriptorIterator_Slots, +static PyType_Spec PyUpb_ByNameIterator_Spec = { + PYUPB_MODULE_NAME "._ByNameIterator", // tp_name + sizeof(PyUpb_ByNameIterator), // tp_basicsize + 0, // tp_itemsize + Py_TPFLAGS_DEFAULT, // tp_flags + PyUpb_ByNameIterator_Slots, +}; + +// ----------------------------------------------------------------------------- +// ByNumberIterator +// ----------------------------------------------------------------------------- + +typedef struct { + PyObject_HEAD; + const PyUpb_ByNumberMap_Funcs* funcs; + const void* parent; // upb_MessageDef*, upb_DefPool*, etc. + PyObject* parent_obj; // Python object that keeps parent alive, we own a ref. + int index; // Current iterator index. +} PyUpb_ByNumberIterator; + +static PyUpb_ByNumberIterator* PyUpb_ByNumberIterator_Self(PyObject* obj) { + assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_number_iterator_type); + return (PyUpb_ByNumberIterator*)obj; +} + +static void PyUpb_ByNumberIterator_Dealloc(PyObject* _self) { + PyUpb_ByNumberIterator* self = PyUpb_ByNumberIterator_Self(_self); + Py_DECREF(self->parent_obj); + PyUpb_Dealloc(self); +} + +static PyObject* PyUpb_ByNumberIterator_New( + const PyUpb_ByNumberMap_Funcs* funcs, const void* parent, + PyObject* parent_obj) { + PyUpb_ModuleState* s = PyUpb_ModuleState_Get(); + PyUpb_ByNumberIterator* iter = + (void*)PyType_GenericAlloc(s->by_number_iterator_type, 0); + iter->funcs = funcs; + iter->parent = parent; + iter->parent_obj = parent_obj; + iter->index = 0; + Py_INCREF(iter->parent_obj); + return &iter->ob_base; +} + +static PyObject* PyUpb_ByNumberIterator_IterNext(PyObject* _self) { + PyUpb_ByNumberIterator* self = PyUpb_ByNumberIterator_Self(_self); + int size = self->funcs->base.get_elem_count(self->parent); + if (self->index >= size) return NULL; + const void* elem = self->funcs->base.index(self->parent, self->index); + self->index++; + return PyLong_FromLong(self->funcs->get_elem_num(elem)); +} + +static PyType_Slot PyUpb_ByNumberIterator_Slots[] = { + {Py_tp_dealloc, PyUpb_ByNumberIterator_Dealloc}, + {Py_tp_iter, PyObject_SelfIter}, + {Py_tp_iternext, PyUpb_ByNumberIterator_IterNext}, + {0, NULL}}; + +static PyType_Spec PyUpb_ByNumberIterator_Spec = { + PYUPB_MODULE_NAME "._ByNumberIterator", // tp_name + sizeof(PyUpb_ByNumberIterator), // tp_basicsize + 0, // tp_itemsize + Py_TPFLAGS_DEFAULT, // tp_flags + PyUpb_ByNumberIterator_Slots, }; // ----------------------------------------------------------------------------- @@ -306,6 +379,8 @@ static PyObject* PyUpb_ByNameMap_Subscript(PyObject* _self, PyObject* key) { const char* name = PyUpb_GetStrData(key); const void* elem = name ? self->funcs->lookup(self->parent, name) : NULL; + if (!name && PyObject_Hash(key) == -1) return NULL; + if (elem) { return self->funcs->base.get_elem_wrapper(elem); } else { @@ -325,6 +400,7 @@ static int PyUpb_ByNameMap_Contains(PyObject* _self, PyObject* key) { PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self); const char* name = PyUpb_GetStrData(key); const void* elem = name ? self->funcs->lookup(self->parent, name) : NULL; + if (!name && PyObject_Hash(key) == -1) return -1; return elem ? 1 : 0; } @@ -339,6 +415,8 @@ static PyObject* PyUpb_ByNameMap_Get(PyObject* _self, PyObject* args) { const char* name = PyUpb_GetStrData(key); const void* elem = name ? self->funcs->lookup(self->parent, name) : NULL; + if (!name && PyObject_Hash(key) == -1) return NULL; + if (elem) { return self->funcs->base.get_elem_wrapper(elem); } else { @@ -349,8 +427,7 @@ static PyObject* PyUpb_ByNameMap_Get(PyObject* _self, PyObject* args) { static PyObject* PyUpb_ByNameMap_GetIter(PyObject* _self) { PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self); - return PyUpb_DescriptorIterator_New(&self->funcs->base, self->parent, - self->parent_obj); + return PyUpb_ByNameIterator_New(self->funcs, self->parent, self->parent_obj); } static PyObject* PyUpb_ByNameMap_Keys(PyObject* _self, PyObject* args) { @@ -460,6 +537,7 @@ static PyType_Slot PyUpb_ByNameMap_Slots[] = { {Py_tp_dealloc, &PyUpb_ByNameMap_Dealloc}, {Py_tp_iter, PyUpb_ByNameMap_GetIter}, {Py_tp_methods, &PyUpb_ByNameMap_Methods}, + {Py_tp_repr, &PyUpb_DescriptorMap_Repr}, {Py_tp_richcompare, &PyUpb_ByNameMap_RichCompare}, {0, NULL}, }; @@ -515,6 +593,8 @@ static const void* PyUpb_ByNumberMap_LookupHelper(PyUpb_ByNumberMap* self, long num = PyLong_AsLong(key); if (num == -1 && PyErr_Occurred()) { PyErr_Clear(); + // Ensure that the key is hashable (this will raise an error if not). + PyObject_Hash(key); return NULL; } else { return self->funcs->lookup(self->parent, num); @@ -527,7 +607,9 @@ static PyObject* PyUpb_ByNumberMap_Subscript(PyObject* _self, PyObject* key) { if (elem) { return self->funcs->base.get_elem_wrapper(elem); } else { - PyErr_SetObject(PyExc_KeyError, key); + if (!PyErr_Occurred()) { + PyErr_SetObject(PyExc_KeyError, key); + } return NULL; } } @@ -550,6 +632,8 @@ static PyObject* PyUpb_ByNumberMap_Get(PyObject* _self, PyObject* args) { const void* elem = PyUpb_ByNumberMap_LookupHelper(self, key); if (elem) { return self->funcs->base.get_elem_wrapper(elem); + } else if (PyErr_Occurred()) { + return NULL; } else { return PyUpb_NewRef(default_value); } @@ -557,8 +641,8 @@ static PyObject* PyUpb_ByNumberMap_Get(PyObject* _self, PyObject* args) { static PyObject* PyUpb_ByNumberMap_GetIter(PyObject* _self) { PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self); - return PyUpb_DescriptorIterator_New(&self->funcs->base, self->parent, - self->parent_obj); + return PyUpb_ByNumberIterator_New(self->funcs, self->parent, + self->parent_obj); } static PyObject* PyUpb_ByNumberMap_Keys(PyObject* _self, PyObject* args) { @@ -626,7 +710,9 @@ error: static int PyUpb_ByNumberMap_Contains(PyObject* _self, PyObject* key) { PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self); const void* elem = PyUpb_ByNumberMap_LookupHelper(self, key); - return elem ? 1 : 0; + if (elem) return 1; + if (PyErr_Occurred()) return -1; + return 0; } // A mapping container can only be equal to another mapping container, or (for @@ -674,6 +760,7 @@ static PyType_Slot PyUpb_ByNumberMap_Slots[] = { {Py_tp_dealloc, &PyUpb_ByNumberMap_Dealloc}, {Py_tp_iter, PyUpb_ByNumberMap_GetIter}, {Py_tp_methods, &PyUpb_ByNumberMap_Methods}, + {Py_tp_repr, &PyUpb_DescriptorMap_Repr}, {Py_tp_richcompare, &PyUpb_ByNumberMap_RichCompare}, {0, NULL}, }; @@ -695,10 +782,11 @@ bool PyUpb_InitDescriptorContainers(PyObject* m) { s->by_name_map_type = PyUpb_AddClass(m, &PyUpb_ByNameMap_Spec); s->by_number_map_type = PyUpb_AddClass(m, &PyUpb_ByNumberMap_Spec); - s->descriptor_iterator_type = - PyUpb_AddClass(m, &PyUpb_DescriptorIterator_Spec); + s->by_name_iterator_type = PyUpb_AddClass(m, &PyUpb_ByNameIterator_Spec); + s->by_number_iterator_type = PyUpb_AddClass(m, &PyUpb_ByNumberIterator_Spec); s->generic_sequence_type = PyUpb_AddClass(m, &PyUpb_GenericSequence_Spec); return s->by_name_map_type && s->by_number_map_type && - s->descriptor_iterator_type && s->generic_sequence_type; + s->by_name_iterator_type && s->by_number_iterator_type && + s->generic_sequence_type; } diff --git a/third_party/upb/python/descriptor_containers.h b/third_party/upb/python/descriptor_containers.h index 8c6b0d9b436..276aea558a2 100644 --- a/third_party/upb/python/descriptor_containers.h +++ b/third_party/upb/python/descriptor_containers.h @@ -43,7 +43,7 @@ #include #include "protobuf.h" -#include "upb/def.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // PyUpb_GenericSequence diff --git a/third_party/upb/python/descriptor_pool.c b/third_party/upb/python/descriptor_pool.c index ea0e8132a61..f6083f7d6bb 100644 --- a/third_party/upb/python/descriptor_pool.c +++ b/third_party/upb/python/descriptor_pool.c @@ -32,7 +32,7 @@ #include "python/descriptor.h" #include "python/message.h" #include "python/protobuf.h" -#include "upb/def.h" +#include "upb/reflection/def.h" #include "upb/util/def_to_proto.h" // ----------------------------------------------------------------------------- @@ -45,7 +45,7 @@ typedef struct { PyObject* db; // The DescriptorDatabase underlying this pool. May be NULL. } PyUpb_DescriptorPool; -PyObject* PyUpb_DescriptorPool_GetDefaultPool() { +PyObject* PyUpb_DescriptorPool_GetDefaultPool(void) { PyUpb_ModuleState* s = PyUpb_ModuleState_Get(); return s->default_pool; } @@ -218,8 +218,7 @@ static PyObject* PyUpb_DescriptorPool_DoAddSerializedFile( } const upb_MessageDef* m = PyUpb_DescriptorPool_GetFileProtoDef(); if (upb_Message_IsEqual(proto, existing, m)) { - Py_INCREF(Py_None); - result = Py_None; + result = PyUpb_FileDescriptor_Get(file); goto done; } } diff --git a/third_party/upb/python/extension_dict.c b/third_party/upb/python/extension_dict.c index 076364d96b0..aa714a34d1c 100644 --- a/third_party/upb/python/extension_dict.c +++ b/third_party/upb/python/extension_dict.c @@ -29,6 +29,7 @@ #include "python/message.h" #include "python/protobuf.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // ExtensionDict @@ -72,10 +73,10 @@ static PyObject* PyUpb_ExtensionDict_FindExtensionByNumber(PyObject* _self, const upb_DefPool* symtab = upb_FileDef_Pool(file); const upb_ExtensionRegistry* reg = upb_DefPool_ExtensionRegistry(symtab); int64_t number = PyLong_AsLong(arg); - const upb_MiniTable_Extension* ext = - (upb_MiniTable_Extension*)_upb_extreg_get(reg, l, number); + const upb_MiniTableExtension* ext = + (upb_MiniTableExtension*)upb_ExtensionRegistry_Lookup(reg, l, number); if (ext) { - const upb_FieldDef* f = _upb_DefPool_FindExtensionByMiniTable(symtab, ext); + const upb_FieldDef* f = upb_DefPool_FindExtensionByMiniTable(symtab, ext); return PyUpb_FieldDescriptor_Get(f); } else { Py_RETURN_NONE; @@ -112,10 +113,10 @@ static int PyUpb_ExtensionDict_Contains(PyObject* _self, PyObject* key) { 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); + upb_MessageValue val = upb_Message_GetFieldByDef(msg, f); return upb_Array_Size(val.array_val) > 0; } else { - return upb_Message_Has(msg, f); + return upb_Message_HasFieldByDef(msg, f); } } diff --git a/third_party/upb/python/map.c b/third_party/upb/python/map.c index 5e0f6abfbe6..eea57e63d45 100644 --- a/third_party/upb/python/map.c +++ b/third_party/upb/python/map.c @@ -31,6 +31,7 @@ #include "python/message.h" #include "python/protobuf.h" #include "upb/map.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // MapContainer @@ -84,8 +85,11 @@ static void PyUpb_MapContainer_Dealloc(void* _self) { PyTypeObject* PyUpb_MapContainer_GetClass(const upb_FieldDef* f) { assert(upb_FieldDef_IsMap(f)); PyUpb_ModuleState* state = PyUpb_ModuleState_Get(); - return upb_FieldDef_IsSubMessage(f) ? state->message_map_container_type - : state->scalar_map_container_type; + const upb_FieldDef* val = + upb_MessageDef_Field(upb_FieldDef_MessageSubDef(f), 1); + assert(upb_FieldDef_Number(val) == 2); + return upb_FieldDef_IsSubMessage(val) ? state->message_map_container_type + : state->scalar_map_container_type; } PyObject* PyUpb_MapContainer_NewStub(PyObject* parent, const upb_FieldDef* f, @@ -178,7 +182,7 @@ int PyUpb_MapContainer_AssignSubscript(PyObject* _self, PyObject* key, if (!PyUpb_PyToUpb(val, val_f, &u_val, arena)) return -1; if (!PyUpb_MapContainer_Set(self, map, u_key, u_val, arena)) return -1; } else { - if (!upb_Map_Delete(map, u_key)) { + if (!upb_Map_Delete(map, u_key, NULL)) { PyErr_Format(PyExc_KeyError, "Key not present in map"); return -1; } @@ -200,7 +204,9 @@ PyObject* PyUpb_MapContainer_Subscript(PyObject* _self, PyObject* key) { map = PyUpb_MapContainer_EnsureReified(_self); upb_Arena* arena = PyUpb_Arena_Get(self->arena); if (upb_FieldDef_IsSubMessage(val_f)) { - u_val.msg_val = upb_Message_New(upb_FieldDef_MessageSubDef(val_f), arena); + const upb_Message* m = upb_FieldDef_MessageSubDef(val_f); + const upb_MiniTable* layout = upb_MessageDef_MiniTable(m); + u_val.msg_val = upb_Message_New(layout, arena); } else { memset(&u_val, 0, sizeof(u_val)); } @@ -312,11 +318,10 @@ static PyObject* PyUpb_MapContainer_Repr(PyObject* _self) { const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0); const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1); size_t iter = kUpb_Map_Begin; - while (upb_MapIterator_Next(map, &iter)) { - PyObject* key = - PyUpb_UpbToPy(upb_MapIterator_Key(map, iter), key_f, self->arena); - PyObject* val = - PyUpb_UpbToPy(upb_MapIterator_Value(map, iter), val_f, self->arena); + upb_MessageValue map_key, map_val; + while (upb_Map_Next(map, &map_key, &map_val, &iter)) { + PyObject* key = PyUpb_UpbToPy(map_key, key_f, self->arena); + PyObject* val = PyUpb_UpbToPy(map_val, val_f, self->arena); if (!key || !val) { Py_XDECREF(key); Py_XDECREF(val); @@ -382,7 +387,6 @@ static PyType_Slot PyUpb_ScalarMapContainer_Slots[] = { {Py_tp_methods, PyUpb_ScalarMapContainer_Methods}, {Py_tp_iter, PyUpb_MapIterator_New}, {Py_tp_repr, PyUpb_MapContainer_Repr}, - {Py_tp_hash, PyObject_HashNotImplemented}, {0, NULL}, }; @@ -428,7 +432,6 @@ static PyType_Slot PyUpb_MessageMapContainer_Slots[] = { {Py_tp_methods, PyUpb_MessageMapContainer_Methods}, {Py_tp_iter, PyUpb_MapIterator_New}, {Py_tp_repr, PyUpb_MapContainer_Repr}, - {Py_tp_hash, PyObject_HashNotImplemented}, {0, NULL}}; static PyType_Spec PyUpb_MessageMapContainer_Spec = { @@ -470,8 +473,8 @@ PyObject* PyUpb_MapIterator_IterNext(PyObject* _self) { } upb_Map* map = PyUpb_MapContainer_GetIfReified(self->map); if (!map) return NULL; - if (!upb_MapIterator_Next(map, &self->iter)) return NULL; - upb_MessageValue key = upb_MapIterator_Key(map, self->iter); + upb_MessageValue key, val; + if (!upb_Map_Next(map, &key, &val, &self->iter)) return NULL; const upb_FieldDef* f = PyUpb_MapContainer_GetField(self->map); const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f); const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0); diff --git a/third_party/upb/python/map.h b/third_party/upb/python/map.h index aaa4e203857..e69ff9fe283 100644 --- a/third_party/upb/python/map.h +++ b/third_party/upb/python/map.h @@ -31,7 +31,7 @@ #include #include "python/python_api.h" -#include "upb/def.h" +#include "upb/reflection/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. // Precondition: `parent` must be a stub. diff --git a/third_party/upb/python/message.c b/third_party/upb/python/message.c index 68efb19816e..6bd39416465 100644 --- a/third_party/upb/python/message.c +++ b/third_party/upb/python/message.c @@ -32,9 +32,9 @@ #include "python/extension_dict.h" #include "python/map.h" #include "python/repeated.h" -#include "upb/def.h" -#include "upb/reflection.h" -#include "upb/text_encode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" +#include "upb/text/encode.h" #include "upb/util/required_fields.h" static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls); @@ -251,10 +251,11 @@ upb_Message* PyUpb_Message_GetIfReified(PyObject* _self) { static PyObject* PyUpb_Message_New(PyObject* cls, PyObject* unused_args, PyObject* unused_kwargs) { const upb_MessageDef* msgdef = PyUpb_MessageMeta_GetMsgdef(cls); + const upb_MiniTable* layout = upb_MessageDef_MiniTable(msgdef); 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)); + msg->ptr.msg = upb_Message_New(layout, PyUpb_Arena_Get(msg->arena)); msg->unset_subobj_map = NULL; msg->ext_dict = NULL; msg->version = 0; @@ -476,7 +477,7 @@ static bool PyUpb_Message_InitScalarAttribute(upb_Message* msg, upb_MessageValue msgval; assert(!PyErr_Occurred()); if (!PyUpb_PyToUpb(value, f, &msgval, arena)) return false; - upb_Message_Set(msg, f, msgval, arena); + upb_Message_SetFieldByDef(msg, f, msgval, arena); return true; } @@ -556,6 +557,21 @@ static PyObject* PyUpb_Message_NewStub(PyObject* parent, const upb_FieldDef* f, return &msg->ob_base; } +static bool PyUpb_Message_IsEmpty(const upb_Message* msg, + const upb_MessageDef* m, + const upb_DefPool* ext_pool) { + if (!msg) return true; + + size_t iter = kUpb_Message_Begin; + const upb_FieldDef* f; + upb_MessageValue val; + if (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) return false; + + size_t len; + (void)upb_Message_GetUnknown(msg, &len); + return len == 0; +} + static bool PyUpb_Message_IsEqual(PyUpb_Message* m1, PyObject* _m2) { PyUpb_Message* m2 = (void*)_m2; if (m1 == m2) return true; @@ -569,14 +585,21 @@ static bool PyUpb_Message_IsEqual(PyUpb_Message* m1, PyObject* _m2) { #endif const upb_Message* m1_msg = PyUpb_Message_GetIfReified((PyObject*)m1); const upb_Message* m2_msg = PyUpb_Message_GetIfReified(_m2); + const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m1_msgdef)); + + const bool e1 = PyUpb_Message_IsEmpty(m1_msg, m1_msgdef, symtab); + const bool e2 = PyUpb_Message_IsEmpty(m2_msg, m1_msgdef, symtab); + if (e1 || e2) return e1 && e2; + return upb_Message_IsEqual(m1_msg, m2_msg, m1_msgdef); } 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); + const upb_MessageDef* m2 = upb_FieldDef_MessageSubDef(f); + m->ptr.msg = upb_Message_New(upb_MessageDef_MiniTable(m2), arena); + m->def = (uintptr_t)m2; PyUpb_ObjCache_Add(m->ptr.msg, &m->ob_base); return f; } @@ -584,7 +607,7 @@ static const upb_FieldDef* PyUpb_Message_InitAsMsg(PyUpb_Message* m, 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); + upb_Message_SetFieldByDef(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); @@ -650,7 +673,8 @@ static void PyUpb_Message_Reify(PyUpb_Message* self, const upb_FieldDef* f, assert(f == PyUpb_Message_GetFieldDef(self)); if (!msg) { const upb_MessageDef* msgdef = PyUpb_Message_GetMsgdef((PyObject*)self); - msg = upb_Message_New(msgdef, PyUpb_Arena_Get(self->arena)); + const upb_MiniTable* layout = upb_MessageDef_MiniTable(msgdef); + msg = upb_Message_New(layout, PyUpb_Arena_Get(self->arena)); } PyUpb_ObjCache_Add(msg, &self->ob_base); Py_DECREF(&self->ptr.parent->ob_base); @@ -695,8 +719,9 @@ static void PyUpb_Message_SyncSubobjs(PyUpb_Message* self) { while (PyUpb_WeakMap_Next(subobj_map, &key, &obj, &iter)) { const upb_FieldDef* f = key; - if (upb_FieldDef_HasPresence(f) && !upb_Message_Has(msg, f)) continue; - upb_MessageValue msgval = upb_Message_Get(msg, f); + if (upb_FieldDef_HasPresence(f) && !upb_Message_HasFieldByDef(msg, f)) + continue; + upb_MessageValue msgval = upb_Message_GetFieldByDef(msg, f); PyUpb_WeakMap_DeleteIter(subobj_map, &iter); if (upb_FieldDef_IsMap(f)) { if (!msgval.map_val) continue; @@ -761,7 +786,8 @@ void PyUpb_Message_SetConcreteSubobj(PyObject* _self, const upb_FieldDef* f, 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)); + upb_Message_SetFieldByDef(self->ptr.msg, f, subobj, + PyUpb_Arena_Get(self->arena)); } static void PyUpb_Message_Dealloc(PyObject* _self) { @@ -881,7 +907,7 @@ PyObject* PyUpb_Message_GetScalarValue(PyUpb_Message* self, // Unset message always returns default values. val = upb_FieldDef_Default(field); } else { - val = upb_Message_Get(self->ptr.msg, field); + val = upb_Message_GetFieldByDef(self->ptr.msg, field); } return PyUpb_UpbToPy(val, field, self->arena); } @@ -905,7 +931,7 @@ PyObject* PyUpb_Message_GetFieldValue(PyObject* _self, bool seq = upb_FieldDef_IsRepeated(field); if ((PyUpb_Message_IsStub(self) && (submsg || seq)) || - (submsg && !seq && !upb_Message_Has(self->ptr.msg, field))) { + (submsg && !seq && !upb_Message_HasFieldByDef(self->ptr.msg, field))) { return PyUpb_Message_GetStub(self, field); } else if (seq) { return PyUpb_Message_GetPresentWrapper(self, field); @@ -935,7 +961,7 @@ int PyUpb_Message_SetFieldValue(PyObject* _self, const upb_FieldDef* field, return -1; } - upb_Message_Set(self->ptr.msg, field, val, arena); + upb_Message_SetFieldByDef(self->ptr.msg, field, val, arena); return 0; } @@ -1017,7 +1043,7 @@ static PyObject* PyUpb_Message_HasField(PyObject* _self, PyObject* arg) { if (PyUpb_Message_IsStub(self)) Py_RETURN_FALSE; - return PyBool_FromLong(field ? upb_Message_Has(self->ptr.msg, field) + return PyBool_FromLong(field ? upb_Message_HasFieldByDef(self->ptr.msg, field) : upb_Message_WhichOneof(self->ptr.msg, oneof) != NULL); } @@ -1264,13 +1290,13 @@ static PyObject* PyUpb_Message_Clear(PyUpb_Message* self, PyObject* args) { const upb_FieldDef* f = key; PyUpb_WeakMap_DeleteIter(subobj_map, &iter); if (upb_FieldDef_IsMap(f)) { - assert(upb_Message_Get(msg, f).map_val == NULL); + assert(upb_Message_GetFieldByDef(msg, f).map_val == NULL); PyUpb_MapContainer_Reify(obj, NULL); } else if (upb_FieldDef_IsRepeated(f)) { - assert(upb_Message_Get(msg, f).array_val == NULL); + assert(upb_Message_GetFieldByDef(msg, f).array_val == NULL); PyUpb_RepeatedContainer_Reify(obj, NULL); } else { - assert(!upb_Message_Has(msg, f)); + assert(!upb_Message_HasFieldByDef(msg, f)); PyUpb_Message* sub = (void*)obj; assert(self == sub->ptr.parent); PyUpb_Message_Reify(sub, f, NULL); @@ -1278,7 +1304,7 @@ static PyObject* PyUpb_Message_Clear(PyUpb_Message* self, PyObject* args) { } } - upb_Message_Clear(self->ptr.msg, msgdef); + upb_Message_ClearByDef(self->ptr.msg, msgdef); Py_RETURN_NONE; } @@ -1311,7 +1337,7 @@ void PyUpb_Message_DoClearField(PyObject* _self, const upb_FieldDef* f) { } Py_XDECREF(sub); - upb_Message_ClearField(self->ptr.msg, f); + upb_Message_ClearFieldByDef(self->ptr.msg, f); } static PyObject* PyUpb_Message_ClearExtension(PyObject* _self, PyObject* arg) { @@ -1340,7 +1366,7 @@ static PyObject* PyUpb_Message_ClearField(PyObject* _self, PyObject* arg) { } if (o) f = upb_Message_WhichOneof(self->ptr.msg, o); - PyUpb_Message_DoClearField(_self, f); + if (f) PyUpb_Message_DoClearField(_self, f); Py_RETURN_NONE; } @@ -1436,7 +1462,7 @@ static PyObject* PyUpb_Message_HasExtension(PyObject* _self, return NULL; } if (!msg) Py_RETURN_FALSE; - return PyBool_FromLong(upb_Message_Has(msg, f)); + return PyBool_FromLong(upb_Message_HasFieldByDef(msg, f)); } void PyUpb_Message_ReportInitializationErrors(const upb_MessageDef* msgdef, diff --git a/third_party/upb/python/message.h b/third_party/upb/python/message.h index f296d5ce93e..f10f15f02a9 100644 --- a/third_party/upb/python/message.h +++ b/third_party/upb/python/message.h @@ -31,7 +31,7 @@ #include #include "python/protobuf.h" -#include "upb/reflection.h" +#include "upb/reflection/message.h" // Removes the wrapper object for this field from the unset subobject cache. void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f); diff --git a/third_party/upb/python/pb_unit_tests/BUILD b/third_party/upb/python/pb_unit_tests/BUILD index 81f3cbcb4b6..bf0a34e7339 100644 --- a/third_party/upb/python/pb_unit_tests/BUILD +++ b/third_party/upb/python/pb_unit_tests/BUILD @@ -24,6 +24,9 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. load(":pyproto_test_wrapper.bzl", "pyproto_test_wrapper") +# begin:github_only +load("@pip_deps//:requirements.bzl", "requirement") +# end:github_only licenses(["notice"]) @@ -43,7 +46,12 @@ pyproto_test_wrapper(name = "keywords_test") pyproto_test_wrapper(name = "message_factory_test") -pyproto_test_wrapper(name = "message_test") +# begin:github_only +pyproto_test_wrapper( + name = "numpy_test", + deps = [requirement("numpy")], +) +# end:github_only # begin:google_only # pyproto_test_wrapper(name = "numpy_test") @@ -51,14 +59,16 @@ pyproto_test_wrapper(name = "message_test") pyproto_test_wrapper(name = "proto_builder_test") -pyproto_test_wrapper(name = "reflection_test") - pyproto_test_wrapper(name = "service_reflection_test") pyproto_test_wrapper(name = "symbol_database_test") pyproto_test_wrapper(name = "text_encoding_test") +pyproto_test_wrapper(name = "message_test") + +pyproto_test_wrapper(name = "reflection_test") + pyproto_test_wrapper(name = "text_format_test") pyproto_test_wrapper(name = "unknown_fields_test") @@ -70,5 +80,7 @@ pyproto_test_wrapper(name = "wire_format_test") filegroup( name = "test_files", srcs = glob(["*.py"]), - visibility = ["//python/dist:__pkg__"], + visibility = [ + "//python/dist:__pkg__", # Scheuklappen: keep + ], ) 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 06f01a69ca3..8b33899b70e 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 @@ -26,11 +26,6 @@ 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. -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. MakeDescriptorTest.testCamelcaseName.__unittest_expecting_failure__ = True 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 8318dcd9ba1..f537a97d351 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 @@ -26,7 +26,6 @@ from google.protobuf.internal.message_factory_test import * import unittest -MessageFactoryTest.testCreatePrototypeOverride.__unittest_expecting_failure__ = True MessageFactoryTest.testDuplicateExtensionNumber.__unittest_expecting_failure__ = True MessageFactoryTest.testGetMessages.__unittest_expecting_failure__ = True MessageFactoryTest.testGetPrototype.__unittest_expecting_failure__ = True 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 index 58fecac0aa9..10fd149398a 100644 --- a/third_party/upb/python/pb_unit_tests/numpy_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/numpy_test_wrapper.py @@ -25,15 +25,7 @@ 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 +from google.protobuf.internal.numpy_test import * if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl b/third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl index aa573777d2d..01189152956 100644 --- a/third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl +++ b/third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl @@ -1,20 +1,24 @@ # begin:github_only -def pyproto_test_wrapper(name): +def pyproto_test_wrapper(name, deps = []): src = name + "_wrapper.py" native.py_test( name = name, srcs = [src], legacy_create_init = False, main = src, - data = ["@com_google_protobuf//:testdata"], + data = ["@com_google_protobuf//src/google/protobuf:testdata"], deps = [ "//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", - ], + ] + deps, + target_compatible_with = select({ + "@system_python//:supported": [], + "//conditions:default": ["@platforms//:incompatible"], + }), ) # end:github_only @@ -28,9 +32,13 @@ def pyproto_test_wrapper(name): # srcs = [src], # main = src, # deps = [ -# "//net/proto2/python/internal:" + name + "_for_deps", +# "//third_party/py/google/protobuf/internal:" + name + "_for_deps", # "//net/proto2/python/public:use_upb_protos", # ], +# target_compatible_with = select({ +# "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], +# "//conditions:default": [], +# }), # ) # # end:google_only 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 f9fdf6f756f..a1f458f4375 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 @@ -41,5 +41,8 @@ SerializationTest.testFieldDataDescriptor.__unittest_expecting_failure__ = True SerializationTest.testFieldProperties.__unittest_expecting_failure__ = True +# TODO(259423340) Python Docker image on MacOS failing. +ClassAPITest.testParsingNestedClass.__unittest_skip__ = True + if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/third_party/upb/python/protobuf.c b/third_party/upb/python/protobuf.c index d3b6677728a..5e039f1d488 100644 --- a/third_party/upb/python/protobuf.c +++ b/third_party/upb/python/protobuf.c @@ -173,7 +173,7 @@ bool PyUpb_WeakMap_Next(PyUpb_WeakMap* map, const void** key, PyObject** obj, intptr_t* iter) { uintptr_t u_key; upb_value val; - if (!upb_inttable_next2(&map->table, &u_key, &val, iter)) return false; + if (!upb_inttable_next(&map->table, &u_key, &val, iter)) return false; *key = (void*)(u_key << PyUpb_PtrShift); *obj = upb_value_getptr(val); return true; diff --git a/third_party/upb/python/protobuf.h b/third_party/upb/python/protobuf.h index 2169a60e47b..66fe1f06f78 100644 --- a/third_party/upb/python/protobuf.h +++ b/third_party/upb/python/protobuf.h @@ -32,6 +32,7 @@ #include "python/descriptor.h" #include "python/python_api.h" +#include "upb/hash/int_table.h" // begin:github_only #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf" @@ -67,8 +68,9 @@ typedef struct { // From descriptor_containers.c PyTypeObject* by_name_map_type; + PyTypeObject* by_name_iterator_type; PyTypeObject* by_number_map_type; - PyTypeObject* descriptor_iterator_type; + PyTypeObject* by_number_iterator_type; PyTypeObject* generic_sequence_type; // From descriptor_pool.c diff --git a/third_party/upb/python/py_extension.bzl b/third_party/upb/python/py_extension.bzl index a363808d61e..7b918bc78e4 100644 --- a/third_party/upb/python/py_extension.bzl +++ b/third_party/upb/python/py_extension.bzl @@ -2,7 +2,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects") -def py_extension(name, srcs, copts, deps = []): +def py_extension(name, srcs, copts, deps = [], **kwargs): """Creates a C++ library to extend python Args: @@ -18,10 +18,10 @@ def py_extension(name, srcs, copts, deps = []): copts = copts + ["-fvisibility=hidden"], linkopts = selects.with_or({ ( - "//python/dist:osx-x86_64_cpu", - "//python/dist:osx-aarch64_cpu", + "//python/dist:osx_x86_64", + "//python/dist:osx_aarch64", ): ["-undefined", "dynamic_lookup"], - "//python/dist:win32_cpu": ["-static-libgcc"], + "//python/dist:windows_x86_32": ["-static-libgcc"], "//conditions:default": [], }), linkshared = True, @@ -38,6 +38,7 @@ def py_extension(name, srcs, copts, deps = []): "//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"], "//conditions:default": ["@system_python//:python_headers"], }), + **kwargs ) EXT_SUFFIX = ".abi3.so" diff --git a/third_party/upb/python/repeated.c b/third_party/upb/python/repeated.c index 1c2378fcb8d..2c09f7c33b1 100644 --- a/third_party/upb/python/repeated.c +++ b/third_party/upb/python/repeated.c @@ -577,7 +577,8 @@ static PyObject* PyUpb_RepeatedCompositeContainer_AppendNew(PyObject* _self) { const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self); upb_Arena* arena = PyUpb_Arena_Get(self->arena); const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f); - upb_Message* msg = upb_Message_New(m, arena); + const upb_MiniTable* layout = upb_MessageDef_MiniTable(m); + upb_Message* msg = upb_Message_New(layout, arena); upb_MessageValue msgval = {.msg_val = msg}; upb_Array_Append(arr, msgval, arena); return PyUpb_Message_Get(msg, m, self->arena); @@ -631,7 +632,8 @@ static PyObject* PyUpb_RepeatedContainer_Insert(PyObject* _self, if (upb_FieldDef_IsSubMessage(f)) { // Create message. const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f); - upb_Message* msg = upb_Message_New(m, arena); + const upb_MiniTable* layout = upb_MessageDef_MiniTable(m); + upb_Message* msg = upb_Message_New(layout, arena); PyObject* py_msg = PyUpb_Message_Get(msg, m, self->arena); PyObject* ret = PyUpb_Message_MergeFrom(py_msg, value); Py_DECREF(py_msg); diff --git a/third_party/upb/python/repeated.h b/third_party/upb/python/repeated.h index 5d74bd2edb0..8cd38721a56 100644 --- a/third_party/upb/python/repeated.h +++ b/third_party/upb/python/repeated.h @@ -31,7 +31,7 @@ #include #include "python/python_api.h" -#include "upb/def.h" +#include "upb/reflection/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. // Precondition: `parent` must be a stub. diff --git a/third_party/upb/python/requirements.txt b/third_party/upb/python/requirements.txt new file mode 100644 index 00000000000..ee6dfb448a7 --- /dev/null +++ b/third_party/upb/python/requirements.txt @@ -0,0 +1 @@ +numpy==1.21.6 diff --git a/third_party/upb/python/requirements_311.txt b/third_party/upb/python/requirements_311.txt new file mode 100644 index 00000000000..1f2c987a7e4 --- /dev/null +++ b/third_party/upb/python/requirements_311.txt @@ -0,0 +1 @@ +numpy==1.23.5 diff --git a/third_party/upb/python/unknown_fields.c b/third_party/upb/python/unknown_fields.c index 3074632487d..fd7716d7321 100644 --- a/third_party/upb/python/unknown_fields.c +++ b/third_party/upb/python/unknown_fields.c @@ -29,19 +29,9 @@ #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; -} +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/types.h" // ----------------------------------------------------------------------------- // UnknownFieldSet @@ -65,60 +55,6 @@ PyUpb_UnknownFieldSet* PyUpb_UnknownFieldSet_NewBare(void) { 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 { @@ -142,40 +78,43 @@ enum { }; static const char* PyUpb_UnknownFieldSet_BuildMessageSetItem( - PyUpb_UnknownFieldSet* self, const char* ptr, const char* end) { + PyUpb_UnknownFieldSet* self, upb_EpsCopyInputStream* stream, + const char* ptr) { 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); + while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { + uint32_t tag; + ptr = upb_WireReader_ReadTag(ptr, &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); + ptr = upb_WireReader_ReadVarint(ptr, &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; + int size; + ptr = upb_WireReader_ReadSize(ptr, &size); + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(stream, ptr, size)) { + goto err; + } + const char* str = ptr; + ptr = upb_EpsCopyInputStream_ReadStringAliased(stream, &str, size); if (!msg) { - msg = PyBytes_FromStringAndSize(ptr, size); + msg = PyBytes_FromStringAndSize(str, 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); + ptr = upb_WireReader_SkipValue(ptr, tag, stream); if (!ptr) goto err; } } @@ -197,19 +136,21 @@ err: } static const char* PyUpb_UnknownFieldSet_BuildMessageSet( - PyUpb_UnknownFieldSet* self, const char* ptr, const char* end) { + PyUpb_UnknownFieldSet* self, upb_EpsCopyInputStream* stream, + const char* ptr) { self->fields = PyList_New(0); - while (ptr < end) { - uint64_t tag; - ptr = PyUpb_DecodeVarint(ptr, end, &tag); + while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { + uint32_t tag; + ptr = upb_WireReader_ReadTag(ptr, &tag); if (!ptr) goto err; if (tag == kUpb_MessageSet_StartItemTag) { - ptr = PyUpb_UnknownFieldSet_BuildMessageSetItem(self, ptr, end); + ptr = PyUpb_UnknownFieldSet_BuildMessageSetItem(self, stream, ptr); } else { - ptr = PyUpb_UnknownFieldSet_SkipField(ptr, end, tag); + ptr = upb_WireReader_SkipValue(ptr, tag, stream); } if (!ptr) goto err; } + if (upb_EpsCopyInputStream_IsError(stream)) goto err; return ptr; err: @@ -219,46 +160,50 @@ err: } static const char* PyUpb_UnknownFieldSet_Build(PyUpb_UnknownFieldSet* self, - const char* ptr, const char* end, + upb_EpsCopyInputStream* stream, + const char* ptr, 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) { + PyUpb_UnknownFieldSet* self, upb_EpsCopyInputStream* stream, + const char* ptr, 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); + ptr = upb_WireReader_ReadVarint(ptr, &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); + ptr = upb_WireReader_ReadFixed64(ptr, &val); *data = PyLong_FromUnsignedLongLong(val); - return ptr + 8; + return ptr; } case kUpb_WireType_32Bit: { - if (end - ptr < 4) return NULL; uint32_t val; - memcpy(&val, ptr, 4); + ptr = upb_WireReader_ReadFixed32(ptr, &val); *data = PyLong_FromUnsignedLongLong(val); - return ptr + 4; + return ptr; } 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; + int size; + ptr = upb_WireReader_ReadSize(ptr, &size); + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(stream, ptr, size)) { + return NULL; + } + const char* str = ptr; + ptr = upb_EpsCopyInputStream_ReadStringAliased(stream, &str, size); + *data = PyBytes_FromStringAndSize(str, size); + return ptr; } 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); + return PyUpb_UnknownFieldSet_Build(sub, stream, ptr, field_number); } default: assert(0); @@ -270,22 +215,23 @@ static const char* PyUpb_UnknownFieldSet_BuildValue( // 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, + upb_EpsCopyInputStream* stream, + const char* ptr, 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); + while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { + uint32_t tag; + ptr = upb_WireReader_ReadTag(ptr, &tag); if (!ptr) goto err; PyObject* data = NULL; - int field_number = tag >> 3; - int wire_type = tag & 7; + int field_number = upb_WireReader_GetFieldNumber(tag); + int wire_type = upb_WireReader_GetWireType(tag); if (wire_type == kUpb_WireType_EndGroup) { if (field_number != group_number) return NULL; return ptr; } - ptr = PyUpb_UnknownFieldSet_BuildValue(self, ptr, end, field_number, + ptr = PyUpb_UnknownFieldSet_BuildValue(self, stream, ptr, field_number, wire_type, group_number, &data); if (!ptr) { Py_XDECREF(data); @@ -297,6 +243,7 @@ static const char* PyUpb_UnknownFieldSet_Build(PyUpb_UnknownFieldSet* self, PyList_Append(self->fields, field); Py_DECREF(field); } + if (upb_EpsCopyInputStream_IsError(stream)) goto err; return ptr; err: @@ -323,14 +270,15 @@ static PyObject* PyUpb_UnknownFieldSet_New(PyTypeObject* type, PyObject* args, const char* ptr = upb_Message_GetUnknown(msg, &size); if (size == 0) return &self->ob_base; - const char* end = ptr + size; + upb_EpsCopyInputStream stream; + upb_EpsCopyInputStream_Init(&stream, &ptr, size, true); const upb_MessageDef* msgdef = PyUpb_Message_GetMsgdef(py_msg); bool ok; if (upb_MessageDef_IsMessageSet(msgdef)) { - ok = PyUpb_UnknownFieldSet_BuildMessageSet(self, ptr, end) == end; + ok = PyUpb_UnknownFieldSet_BuildMessageSet(self, &stream, ptr) != NULL; } else { - ok = PyUpb_UnknownFieldSet_Build(self, ptr, end, -1) == end; + ok = PyUpb_UnknownFieldSet_Build(self, &stream, ptr, -1) != NULL; } if (!ok) { diff --git a/third_party/upb/third_party/utf8_range/BUILD b/third_party/upb/third_party/utf8_range/BUILD deleted file mode 100644 index 4a8a82b5024..00000000000 --- a/third_party/upb/third_party/utf8_range/BUILD +++ /dev/null @@ -1,19 +0,0 @@ - -# Pulled from: https://github.com/cyb70289/utf8 - -cc_library( - name = "utf8_range", - hdrs = ["utf8_range.h"], - srcs = [ - "naive.c", - "range2-neon.c", - "range2-sse.c", - ], - visibility = ["//:__pkg__"], -) - -filegroup( - name = "cmake_files", - srcs = glob(["*"]), - visibility = ["//cmake:__pkg__"], -) diff --git a/third_party/upb/third_party/utf8_range/LICENSE b/third_party/upb/third_party/utf8_range/LICENSE deleted file mode 100644 index c1f087ecc82..00000000000 --- a/third_party/upb/third_party/utf8_range/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Yibo Cai - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/third_party/upb/third_party/utf8_range/naive.c b/third_party/upb/third_party/utf8_range/naive.c deleted file mode 100644 index 9b7e5bb4be9..00000000000 --- a/third_party/upb/third_party/utf8_range/naive.c +++ /dev/null @@ -1,92 +0,0 @@ -#include - -/* - * http://www.unicode.org/versions/Unicode6.0.0/ch03.pdf - page 94 - * - * Table 3-7. Well-Formed UTF-8 Byte Sequences - * - * +--------------------+------------+-------------+------------+-------------+ - * | Code Points | First Byte | Second Byte | Third Byte | Fourth Byte | - * +--------------------+------------+-------------+------------+-------------+ - * | U+0000..U+007F | 00..7F | | | | - * +--------------------+------------+-------------+------------+-------------+ - * | U+0080..U+07FF | C2..DF | 80..BF | | | - * +--------------------+------------+-------------+------------+-------------+ - * | U+0800..U+0FFF | E0 | A0..BF | 80..BF | | - * +--------------------+------------+-------------+------------+-------------+ - * | U+1000..U+CFFF | E1..EC | 80..BF | 80..BF | | - * +--------------------+------------+-------------+------------+-------------+ - * | U+D000..U+D7FF | ED | 80..9F | 80..BF | | - * +--------------------+------------+-------------+------------+-------------+ - * | U+E000..U+FFFF | EE..EF | 80..BF | 80..BF | | - * +--------------------+------------+-------------+------------+-------------+ - * | U+10000..U+3FFFF | F0 | 90..BF | 80..BF | 80..BF | - * +--------------------+------------+-------------+------------+-------------+ - * | U+40000..U+FFFFF | F1..F3 | 80..BF | 80..BF | 80..BF | - * +--------------------+------------+-------------+------------+-------------+ - * | U+100000..U+10FFFF | F4 | 80..8F | 80..BF | 80..BF | - * +--------------------+------------+-------------+------------+-------------+ - */ - -/* Return 0 - success, >0 - index(1 based) of first error char */ -int utf8_naive(const unsigned char *data, int len) -{ - int err_pos = 1; - - while (len) { - int bytes; - const unsigned char byte1 = data[0]; - - /* 00..7F */ - if (byte1 <= 0x7F) { - bytes = 1; - /* C2..DF, 80..BF */ - } else if (len >= 2 && byte1 >= 0xC2 && byte1 <= 0xDF && - (signed char)data[1] <= (signed char)0xBF) { - bytes = 2; - } else if (len >= 3) { - const unsigned char byte2 = data[1]; - - /* Is byte2, byte3 between 0x80 ~ 0xBF */ - const int byte2_ok = (signed char)byte2 <= (signed char)0xBF; - const int byte3_ok = (signed char)data[2] <= (signed char)0xBF; - - if (byte2_ok && byte3_ok && - /* E0, A0..BF, 80..BF */ - ((byte1 == 0xE0 && byte2 >= 0xA0) || - /* E1..EC, 80..BF, 80..BF */ - (byte1 >= 0xE1 && byte1 <= 0xEC) || - /* ED, 80..9F, 80..BF */ - (byte1 == 0xED && byte2 <= 0x9F) || - /* EE..EF, 80..BF, 80..BF */ - (byte1 >= 0xEE && byte1 <= 0xEF))) { - bytes = 3; - } else if (len >= 4) { - /* Is byte4 between 0x80 ~ 0xBF */ - const int byte4_ok = (signed char)data[3] <= (signed char)0xBF; - - if (byte2_ok && byte3_ok && byte4_ok && - /* F0, 90..BF, 80..BF, 80..BF */ - ((byte1 == 0xF0 && byte2 >= 0x90) || - /* F1..F3, 80..BF, 80..BF, 80..BF */ - (byte1 >= 0xF1 && byte1 <= 0xF3) || - /* F4, 80..8F, 80..BF, 80..BF */ - (byte1 == 0xF4 && byte2 <= 0x8F))) { - bytes = 4; - } else { - return err_pos; - } - } else { - return err_pos; - } - } else { - return err_pos; - } - - len -= bytes; - err_pos += bytes; - data += bytes; - } - - return 0; -} diff --git a/third_party/upb/third_party/utf8_range/range2-neon.c b/third_party/upb/third_party/utf8_range/range2-neon.c deleted file mode 100644 index 683396540c4..00000000000 --- a/third_party/upb/third_party/utf8_range/range2-neon.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Process 2x16 bytes in each iteration. - * Comments removed for brevity. See range-neon.c for details. - */ -#if defined(__aarch64__) && defined(__ARM_NEON) - -#include -#include -#include - -int utf8_naive(const unsigned char *data, int len); - -static const uint8_t _first_len_tbl[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, -}; - -static const uint8_t _first_range_tbl[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, -}; - -static const uint8_t _range_min_tbl[] = { - 0x00, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x90, 0x80, - 0xC2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; -static const uint8_t _range_max_tbl[] = { - 0x7F, 0xBF, 0xBF, 0xBF, 0xBF, 0x9F, 0xBF, 0x8F, - 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const uint8_t _range_adjust_tbl[] = { - 2, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, -}; - -/* Return 0 on success, -1 on error */ -int utf8_range2(const unsigned char *data, int len) -{ - if (len >= 32) { - uint8x16_t prev_input = vdupq_n_u8(0); - uint8x16_t prev_first_len = vdupq_n_u8(0); - - const uint8x16_t first_len_tbl = vld1q_u8(_first_len_tbl); - const uint8x16_t first_range_tbl = vld1q_u8(_first_range_tbl); - const uint8x16_t range_min_tbl = vld1q_u8(_range_min_tbl); - const uint8x16_t range_max_tbl = vld1q_u8(_range_max_tbl); - const uint8x16x2_t range_adjust_tbl = vld2q_u8(_range_adjust_tbl); - - const uint8x16_t const_1 = vdupq_n_u8(1); - const uint8x16_t const_2 = vdupq_n_u8(2); - const uint8x16_t const_e0 = vdupq_n_u8(0xE0); - - uint8x16_t error1 = vdupq_n_u8(0); - uint8x16_t error2 = vdupq_n_u8(0); - uint8x16_t error3 = vdupq_n_u8(0); - uint8x16_t error4 = vdupq_n_u8(0); - - while (len >= 32) { - /******************* two blocks interleaved **********************/ - -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 8) - /* gcc doesn't support vldq1_u8_x2 until version 8 */ - const uint8x16_t input_a = vld1q_u8(data); - const uint8x16_t input_b = vld1q_u8(data + 16); -#else - /* Forces a double load on Clang */ - const uint8x16x2_t input_pair = vld1q_u8_x2(data); - const uint8x16_t input_a = input_pair.val[0]; - const uint8x16_t input_b = input_pair.val[1]; -#endif - - const uint8x16_t high_nibbles_a = vshrq_n_u8(input_a, 4); - const uint8x16_t high_nibbles_b = vshrq_n_u8(input_b, 4); - - const uint8x16_t first_len_a = - vqtbl1q_u8(first_len_tbl, high_nibbles_a); - const uint8x16_t first_len_b = - vqtbl1q_u8(first_len_tbl, high_nibbles_b); - - uint8x16_t range_a = vqtbl1q_u8(first_range_tbl, high_nibbles_a); - uint8x16_t range_b = vqtbl1q_u8(first_range_tbl, high_nibbles_b); - - range_a = - vorrq_u8(range_a, vextq_u8(prev_first_len, first_len_a, 15)); - range_b = - vorrq_u8(range_b, vextq_u8(first_len_a, first_len_b, 15)); - - uint8x16_t tmp1_a, tmp2_a, tmp1_b, tmp2_b; - tmp1_a = vextq_u8(prev_first_len, first_len_a, 14); - tmp1_a = vqsubq_u8(tmp1_a, const_1); - range_a = vorrq_u8(range_a, tmp1_a); - - tmp1_b = vextq_u8(first_len_a, first_len_b, 14); - tmp1_b = vqsubq_u8(tmp1_b, const_1); - range_b = vorrq_u8(range_b, tmp1_b); - - tmp2_a = vextq_u8(prev_first_len, first_len_a, 13); - tmp2_a = vqsubq_u8(tmp2_a, const_2); - range_a = vorrq_u8(range_a, tmp2_a); - - tmp2_b = vextq_u8(first_len_a, first_len_b, 13); - tmp2_b = vqsubq_u8(tmp2_b, const_2); - range_b = vorrq_u8(range_b, tmp2_b); - - uint8x16_t shift1_a = vextq_u8(prev_input, input_a, 15); - uint8x16_t pos_a = vsubq_u8(shift1_a, const_e0); - range_a = vaddq_u8(range_a, vqtbl2q_u8(range_adjust_tbl, pos_a)); - - uint8x16_t shift1_b = vextq_u8(input_a, input_b, 15); - uint8x16_t pos_b = vsubq_u8(shift1_b, const_e0); - range_b = vaddq_u8(range_b, vqtbl2q_u8(range_adjust_tbl, pos_b)); - - uint8x16_t minv_a = vqtbl1q_u8(range_min_tbl, range_a); - uint8x16_t maxv_a = vqtbl1q_u8(range_max_tbl, range_a); - - uint8x16_t minv_b = vqtbl1q_u8(range_min_tbl, range_b); - uint8x16_t maxv_b = vqtbl1q_u8(range_max_tbl, range_b); - - error1 = vorrq_u8(error1, vcltq_u8(input_a, minv_a)); - error2 = vorrq_u8(error2, vcgtq_u8(input_a, maxv_a)); - - error3 = vorrq_u8(error3, vcltq_u8(input_b, minv_b)); - error4 = vorrq_u8(error4, vcgtq_u8(input_b, maxv_b)); - - /************************ next iteration *************************/ - prev_input = input_b; - prev_first_len = first_len_b; - - data += 32; - len -= 32; - } - error1 = vorrq_u8(error1, error2); - error1 = vorrq_u8(error1, error3); - error1 = vorrq_u8(error1, error4); - - if (vmaxvq_u8(error1)) - return -1; - - uint32_t token4; - vst1q_lane_u32(&token4, vreinterpretq_u32_u8(prev_input), 3); - - const int8_t *token = (const int8_t *)&token4; - int lookahead = 0; - if (token[3] > (int8_t)0xBF) - lookahead = 1; - else if (token[2] > (int8_t)0xBF) - lookahead = 2; - else if (token[1] > (int8_t)0xBF) - lookahead = 3; - - data -= lookahead; - len += lookahead; - } - - return utf8_naive(data, len); -} - -#endif diff --git a/third_party/upb/third_party/utf8_range/range2-sse.c b/third_party/upb/third_party/utf8_range/range2-sse.c deleted file mode 100644 index f3deb860061..00000000000 --- a/third_party/upb/third_party/utf8_range/range2-sse.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Process 2x16 bytes in each iteration. - * Comments removed for brevity. See range-sse.c for details. - */ -#ifdef __SSE4_1__ - -#include -#include -#include - -int utf8_naive(const unsigned char *data, int len); - -static const int8_t _first_len_tbl[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, -}; - -static const int8_t _first_range_tbl[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, -}; - -static const int8_t _range_min_tbl[] = { - 0x00, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x90, 0x80, - 0xC2, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, -}; -static const int8_t _range_max_tbl[] = { - 0x7F, 0xBF, 0xBF, 0xBF, 0xBF, 0x9F, 0xBF, 0x8F, - 0xF4, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -}; - -static const int8_t _df_ee_tbl[] = { - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, -}; -static const int8_t _ef_fe_tbl[] = { - 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -/* Return 0 on success, -1 on error */ -int utf8_range2(const unsigned char *data, int len) -{ - if (len >= 32) { - __m128i prev_input = _mm_set1_epi8(0); - __m128i prev_first_len = _mm_set1_epi8(0); - - const __m128i first_len_tbl = - _mm_loadu_si128((const __m128i *)_first_len_tbl); - const __m128i first_range_tbl = - _mm_loadu_si128((const __m128i *)_first_range_tbl); - const __m128i range_min_tbl = - _mm_loadu_si128((const __m128i *)_range_min_tbl); - const __m128i range_max_tbl = - _mm_loadu_si128((const __m128i *)_range_max_tbl); - const __m128i df_ee_tbl = - _mm_loadu_si128((const __m128i *)_df_ee_tbl); - const __m128i ef_fe_tbl = - _mm_loadu_si128((const __m128i *)_ef_fe_tbl); - - __m128i error = _mm_set1_epi8(0); - - while (len >= 32) { - /***************************** block 1 ****************************/ - const __m128i input_a = _mm_loadu_si128((const __m128i *)data); - - __m128i high_nibbles = - _mm_and_si128(_mm_srli_epi16(input_a, 4), _mm_set1_epi8(0x0F)); - - __m128i first_len_a = _mm_shuffle_epi8(first_len_tbl, high_nibbles); - - __m128i range_a = _mm_shuffle_epi8(first_range_tbl, high_nibbles); - - range_a = _mm_or_si128( - range_a, _mm_alignr_epi8(first_len_a, prev_first_len, 15)); - - __m128i tmp; - tmp = _mm_alignr_epi8(first_len_a, prev_first_len, 14); - tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(1)); - range_a = _mm_or_si128(range_a, tmp); - - tmp = _mm_alignr_epi8(first_len_a, prev_first_len, 13); - tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(2)); - range_a = _mm_or_si128(range_a, tmp); - - __m128i shift1, pos, range2; - shift1 = _mm_alignr_epi8(input_a, prev_input, 15); - pos = _mm_sub_epi8(shift1, _mm_set1_epi8(0xEF)); - tmp = _mm_subs_epu8(pos, _mm_set1_epi8(0xF0)); - range2 = _mm_shuffle_epi8(df_ee_tbl, tmp); - tmp = _mm_adds_epu8(pos, _mm_set1_epi8(0x70)); - range2 = _mm_add_epi8(range2, _mm_shuffle_epi8(ef_fe_tbl, tmp)); - - range_a = _mm_add_epi8(range_a, range2); - - __m128i minv = _mm_shuffle_epi8(range_min_tbl, range_a); - __m128i maxv = _mm_shuffle_epi8(range_max_tbl, range_a); - - tmp = _mm_or_si128( - _mm_cmplt_epi8(input_a, minv), - _mm_cmpgt_epi8(input_a, maxv) - ); - error = _mm_or_si128(error, tmp); - - /***************************** block 2 ****************************/ - const __m128i input_b = _mm_loadu_si128((const __m128i *)(data+16)); - - high_nibbles = - _mm_and_si128(_mm_srli_epi16(input_b, 4), _mm_set1_epi8(0x0F)); - - __m128i first_len_b = _mm_shuffle_epi8(first_len_tbl, high_nibbles); - - __m128i range_b = _mm_shuffle_epi8(first_range_tbl, high_nibbles); - - range_b = _mm_or_si128( - range_b, _mm_alignr_epi8(first_len_b, first_len_a, 15)); - - - tmp = _mm_alignr_epi8(first_len_b, first_len_a, 14); - tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(1)); - range_b = _mm_or_si128(range_b, tmp); - - tmp = _mm_alignr_epi8(first_len_b, first_len_a, 13); - tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(2)); - range_b = _mm_or_si128(range_b, tmp); - - shift1 = _mm_alignr_epi8(input_b, input_a, 15); - pos = _mm_sub_epi8(shift1, _mm_set1_epi8(0xEF)); - tmp = _mm_subs_epu8(pos, _mm_set1_epi8(0xF0)); - range2 = _mm_shuffle_epi8(df_ee_tbl, tmp); - tmp = _mm_adds_epu8(pos, _mm_set1_epi8(0x70)); - range2 = _mm_add_epi8(range2, _mm_shuffle_epi8(ef_fe_tbl, tmp)); - - range_b = _mm_add_epi8(range_b, range2); - - minv = _mm_shuffle_epi8(range_min_tbl, range_b); - maxv = _mm_shuffle_epi8(range_max_tbl, range_b); - - - tmp = _mm_or_si128( - _mm_cmplt_epi8(input_b, minv), - _mm_cmpgt_epi8(input_b, maxv) - ); - error = _mm_or_si128(error, tmp); - - /************************ next iteration **************************/ - prev_input = input_b; - prev_first_len = first_len_b; - - data += 32; - len -= 32; - } - - if (!_mm_testz_si128(error, error)) - return -1; - - int32_t token4 = _mm_extract_epi32(prev_input, 3); - const int8_t *token = (const int8_t *)&token4; - int lookahead = 0; - if (token[3] > (int8_t)0xBF) - lookahead = 1; - else if (token[2] > (int8_t)0xBF) - lookahead = 2; - else if (token[1] > (int8_t)0xBF) - lookahead = 3; - - data -= lookahead; - len += lookahead; - } - - return utf8_naive(data, len); -} - -#endif diff --git a/third_party/upb/third_party/utf8_range/utf8_range.h b/third_party/upb/third_party/utf8_range/utf8_range.h deleted file mode 100644 index 3695587d5ee..00000000000 --- a/third_party/upb/third_party/utf8_range/utf8_range.h +++ /dev/null @@ -1,9 +0,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); -static inline int utf8_range2(const unsigned char* data, int len) { - return utf8_naive(data, len); -} -#endif diff --git a/third_party/upb/upb/upb_internal.h b/third_party/upb/upb/alloc.h similarity index 88% rename from third_party/upb/upb/upb_internal.h rename to third_party/upb/upb/alloc.h index 6c1fec3398b..b276b935ca4 100644 --- a/third_party/upb/upb/upb_internal.h +++ b/third_party/upb/upb/alloc.h @@ -25,12 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_INT_H_ -#define UPB_INT_H_ +// This header is deprecated, use upb/mem/alloc.h instead +// IWYU pragma: private, include "upb/mem/alloc.h" -// TODO(b/232091617): Delete this entire header which currently exists only for -// temporary backwards compatibility. +#ifndef UPB_ALLOC_H_ +#define UPB_ALLOC_H_ -#include "upb/internal/upb.h" +#include "upb/mem/alloc.h" -#endif /* UPB_INT_H_ */ +#endif /* UPB_ALLOC_H_ */ diff --git a/third_party/upb/upb/arena.h b/third_party/upb/upb/arena.h index 0c4fd1b83c0..3d849e09fde 100644 --- a/third_party/upb/upb/arena.h +++ b/third_party/upb/upb/arena.h @@ -25,201 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/mem/arena.h instead +// IWYU pragma: private, include "upb/mem/arena.h" + #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 +#include "upb/mem/arena.h" #endif /* UPB_ARENA_H_ */ diff --git a/third_party/upb/upb/array.h b/third_party/upb/upb/array.h index 0715d58430a..dafaedf5370 100644 --- a/third_party/upb/upb/array.h +++ b/third_party/upb/upb/array.h @@ -25,59 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/collections/array.h instead +// IWYU pragma: private, include "upb/collections/array.h" + #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" +#include "upb/collections/array.h" #endif /* UPB_ARRAY_H_ */ diff --git a/third_party/upb/upb/base/descriptor_constants.h b/third_party/upb/upb/base/descriptor_constants.h new file mode 100644 index 00000000000..d2807c99454 --- /dev/null +++ b/third_party/upb/upb/base/descriptor_constants.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_BASE_DESCRIPTOR_CONSTANTS_H_ +#define UPB_BASE_DESCRIPTOR_CONSTANTS_H_ + +// The types a field can have. Note that this list is not identical to the +// types defined in descriptor.proto, which gives INT32 and SINT32 separate +// types (we distinguish the two with the "integer encoding" enum below). +// This enum is an internal convenience only and has no meaning outside of upb. +typedef enum { + kUpb_CType_Bool = 1, + kUpb_CType_Float = 2, + kUpb_CType_Int32 = 3, + kUpb_CType_UInt32 = 4, + kUpb_CType_Enum = 5, // Enum values are int32. + kUpb_CType_Message = 6, + kUpb_CType_Double = 7, + kUpb_CType_Int64 = 8, + kUpb_CType_UInt64 = 9, + kUpb_CType_String = 10, + kUpb_CType_Bytes = 11 +} upb_CType; + +// The repeated-ness of each field; this matches descriptor.proto. +typedef enum { + kUpb_Label_Optional = 1, + kUpb_Label_Required = 2, + kUpb_Label_Repeated = 3 +} upb_Label; + +// Descriptor types, as defined in descriptor.proto. +typedef enum { + kUpb_FieldType_Double = 1, + kUpb_FieldType_Float = 2, + kUpb_FieldType_Int64 = 3, + kUpb_FieldType_UInt64 = 4, + kUpb_FieldType_Int32 = 5, + kUpb_FieldType_Fixed64 = 6, + kUpb_FieldType_Fixed32 = 7, + kUpb_FieldType_Bool = 8, + kUpb_FieldType_String = 9, + kUpb_FieldType_Group = 10, + kUpb_FieldType_Message = 11, + kUpb_FieldType_Bytes = 12, + kUpb_FieldType_UInt32 = 13, + kUpb_FieldType_Enum = 14, + kUpb_FieldType_SFixed32 = 15, + kUpb_FieldType_SFixed64 = 16, + kUpb_FieldType_SInt32 = 17, + kUpb_FieldType_SInt64 = 18, +} upb_FieldType; + +#define kUpb_FieldType_SizeOf 19 + +#endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */ diff --git a/third_party/upb/upb/base/log2.h b/third_party/upb/upb/base/log2.h new file mode 100644 index 00000000000..d825e8b97f6 --- /dev/null +++ b/third_party/upb/upb/base/log2.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_BASE_LOG2_H_ +#define UPB_BASE_LOG2_H_ + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE int upb_Log2Ceiling(int x) { + if (x <= 1) return 0; +#ifdef __GNUC__ + return 32 - __builtin_clz(x - 1); +#else + int lg2 = 0; + while (1 << lg2 < x) lg2++; + return lg2; +#endif +} + +UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); } + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_BASE_LOG2_H_ */ diff --git a/third_party/upb/upb/status.c b/third_party/upb/upb/base/status.c similarity index 95% rename from third_party/upb/upb/status.c rename to third_party/upb/upb/base/status.c index c00b9c86b2f..234754c868d 100644 --- a/third_party/upb/upb/status.c +++ b/third_party/upb/upb/base/status.c @@ -25,21 +25,16 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/status.h" +#include "upb/base/status.h" #include #include #include -#include -#include -#include #include #include -#include "upb/internal/upb.h" - // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" void upb_Status_Clear(upb_Status* status) { if (!status) return; diff --git a/third_party/upb/upb/base/status.h b/third_party/upb/upb/base/status.h new file mode 100644 index 00000000000..b0b7ebe9231 --- /dev/null +++ b/third_party/upb/upb/base/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_BASE_STATUS_H_ +#define UPB_BASE_STATUS_H_ + +#include + +// Must be last. +#include "upb/port/def.inc" + +#define _kUpb_Status_MaxMessage 127 + +typedef struct { + bool ok; + char msg[_kUpb_Status_MaxMessage]; // Error message; NULL-terminated. +} upb_Status; + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status); +UPB_API bool upb_Status_IsOk(const upb_Status* status); + +// These are no-op if |status| is NULL. +UPB_API 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); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_BASE_STATUS_H_ */ diff --git a/third_party/upb/upb/base/string_view.h b/third_party/upb/upb/base/string_view.h new file mode 100644 index 00000000000..36195bff531 --- /dev/null +++ b/third_party/upb/upb/base/string_view.h @@ -0,0 +1,75 @@ +/* + * 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_BASE_STRING_VIEW_H_ +#define UPB_BASE_STRING_VIEW_H_ + +#include + +// Must be last. +#include "upb/port/def.inc" + +#define UPB_STRINGVIEW_INIT(ptr, len) \ + { ptr, len } + +#define UPB_STRINGVIEW_FORMAT "%.*s" +#define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data + +// LINT.IfChange(struct_definition) +typedef struct { + const char* data; + size_t size; +} upb_StringView; +// LINT.ThenChange(GoogleInternalName0) + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_API_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data, + size_t size) { + upb_StringView ret; + ret.data = data; + ret.size = size; + return ret; +} + +UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) { + return upb_StringView_FromDataAndSize(data, strlen(data)); +} + +UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) { + return a.size == b.size && memcmp(a.data, b.data, a.size) == 0; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_BASE_STRING_VIEW_H_ */ diff --git a/third_party/upb/upb/bindings/lua/README.md b/third_party/upb/upb/bindings/lua/README.md deleted file mode 100644 index 9d50e4feb28..00000000000 --- a/third_party/upb/upb/bindings/lua/README.md +++ /dev/null @@ -1,8 +0,0 @@ - -# upb Lua bindings - -These are some bare-bones upb bindings for Lua. - -These bindings exist primarily for experimentation and testing. They are -incomplete and are not really intended for use in any application. This is by -no means a complete or supported protobuf library. diff --git a/third_party/upb/upb/collections.h b/third_party/upb/upb/collections.h index 81558dc5c96..a865f3d948f 100644 --- a/third_party/upb/upb/collections.h +++ b/third_party/upb/upb/collections.h @@ -30,7 +30,7 @@ // TODO(b/232091617): Delete this entire header which currently exists only for // temporary backwards compatibility. -#include "upb/array.h" -#include "upb/map.h" +#include "upb/collections/array.h" +#include "upb/collections/map.h" #endif /* UPB_COLLECTIONS_H_ */ diff --git a/third_party/upb/upb/array.c b/third_party/upb/upb/collections/array.c similarity index 56% rename from third_party/upb/upb/array.c rename to third_party/upb/upb/collections/array.c index b4cdc49924e..fdb1bd206c4 100644 --- a/third_party/upb/upb/array.c +++ b/third_party/upb/upb/collections/array.c @@ -25,40 +25,38 @@ * 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" +#include "upb/collections/array_internal.h" -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 */ +// Must be last. +#include "upb/port/def.inc" + +const char _upb_Array_CTypeSizeLg2Table[] = { + [kUpb_CType_Bool] = 0, + [kUpb_CType_Float] = 2, + [kUpb_CType_Int32] = 2, + [kUpb_CType_UInt32] = 2, + [kUpb_CType_Enum] = 2, + [kUpb_CType_Message] = UPB_SIZE(2, 3), + [kUpb_CType_Double] = 3, + [kUpb_CType_Int64] = 3, + [kUpb_CType_UInt64] = 3, + [kUpb_CType_String] = UPB_SIZE(3, 4), + [kUpb_CType_Bytes] = UPB_SIZE(3, 4), }; upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) { - return _upb_Array_New(a, 4, _upb_CTypeo_sizelg2[type]); + return _upb_Array_New(a, 4, _upb_Array_CTypeSizeLg2(type)); } -size_t upb_Array_Size(const upb_Array* arr) { return arr->len; } +size_t upb_Array_Size(const upb_Array* arr) { return arr->size; } 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); + UPB_ASSERT(i < arr->size); memcpy(&ret, data + (i << lg2), 1 << lg2); return ret; } @@ -66,31 +64,31 @@ upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) { 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); + UPB_ASSERT(i < arr->size); 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)) { + if (!upb_Array_Resize(arr, arr->size + 1, arena)) { return false; } - upb_Array_Set(arr, arr->len - 1, val); + upb_Array_Set(arr, arr->size - 1, val); return true; } void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx, size_t count) { + const int lg2 = arr->data & 7; 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)) { + UPB_ASSERT(i <= arr->size); + UPB_ASSERT(count + arr->size >= count); + const size_t oldsize = arr->size; + if (!upb_Array_Resize(arr, arr->size + count, arena)) { return false; } upb_Array_Move(arr, i + count, i, oldsize - i); @@ -98,17 +96,48 @@ bool upb_Array_Insert(upb_Array* arr, size_t i, size_t count, } /* - * i end arr->len + * i end arr->size * |------------|XXXXXXXX|--------| */ void upb_Array_Delete(upb_Array* arr, size_t i, size_t count) { - size_t end = i + count; + const 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; + UPB_ASSERT(end <= arr->size); + upb_Array_Move(arr, i, end, arr->size - end); + arr->size -= count; } bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) { - return _upb_Array_Resize(arr, size, arena); + const size_t oldsize = arr->size; + if (UPB_UNLIKELY(!_upb_Array_ResizeUninitialized(arr, size, arena))) { + return false; + } + const size_t newsize = arr->size; + if (newsize > oldsize) { + const int lg2 = arr->data & 7; + char* data = _upb_array_ptr(arr); + memset(data + (oldsize << lg2), 0, (newsize - oldsize) << lg2); + } + return true; +} + +// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// + +bool _upb_array_realloc(upb_Array* arr, size_t min_capacity, upb_Arena* arena) { + size_t new_capacity = UPB_MAX(arr->capacity, 4); + int elem_size_lg2 = arr->data & 7; + size_t old_bytes = arr->capacity << elem_size_lg2; + size_t new_bytes; + void* ptr = _upb_array_ptr(arr); + + // Log2 ceiling of size. + while (new_capacity < min_capacity) new_capacity *= 2; + + new_bytes = new_capacity << elem_size_lg2; + ptr = upb_Arena_Realloc(arena, ptr, old_bytes, new_bytes); + if (!ptr) return false; + + arr->data = _upb_tag_arrptr(ptr, elem_size_lg2); + arr->capacity = new_capacity; + return true; } diff --git a/third_party/upb/upb/collections/array.h b/third_party/upb/upb/collections/array.h new file mode 100644 index 00000000000..2e73e7ab6a9 --- /dev/null +++ b/third_party/upb/upb/collections/array.h @@ -0,0 +1,85 @@ +/* + * 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_COLLECTIONS_ARRAY_H_ +#define UPB_COLLECTIONS_ARRAY_H_ + +#include "upb/base/descriptor_constants.h" +#include "upb/collections/message_value.h" +#include "upb/mem/arena.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_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type); + +// Returns the number of elements in the array. +UPB_API size_t upb_Array_Size(const upb_Array* arr); + +// Returns the given element, which must be within the array's current size. +UPB_API 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. +UPB_API void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val); + +// Appends an element to the array. Returns false on allocation failure. +UPB_API 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. +UPB_API 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)` +UPB_API 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)` +UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count); + +// Changes the size of a vector. New elements are initialized to NULL/0. +// Returns false on allocation failure. +UPB_API 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_COLLECTIONS_ARRAY_H_ */ diff --git a/third_party/upb/upb/collections/array_internal.h b/third_party/upb/upb/collections/array_internal.h new file mode 100644 index 00000000000..0c126eb6424 --- /dev/null +++ b/third_party/upb/upb/collections/array_internal.h @@ -0,0 +1,134 @@ +/* + * 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_ARRAY_INTERNAL_H_ +#define UPB_INTERNAL_ARRAY_INTERNAL_H_ + +#include + +#include "upb/collections/array.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// LINT.IfChange(struct_definition) +// Our internal representation for repeated fields. +struct upb_Array { + uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */ + size_t size; /* The number of elements in the array. */ + size_t capacity; /* Allocated storage. Measured in elements. */ +}; +// LINT.ThenChange(GoogleInternalName1) + +UPB_INLINE size_t _upb_Array_ElementSizeLg2(const upb_Array* arr) { + size_t ret = arr->data & 7; + UPB_ASSERT(ret <= 4); + return ret; +} + +UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) { + _upb_Array_ElementSizeLg2(arr); // Check assertion. + return (void*)(arr->data & ~(uintptr_t)7); +} + +UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) { + UPB_ASSERT(elem_size_lg2 <= 4); + return (uintptr_t)ptr | elem_size_lg2; +} + +UPB_INLINE void* _upb_array_ptr(upb_Array* arr) { + return (void*)_upb_array_constptr(arr); +} + +UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) { + UPB_ASSERT(elem_size_lg2 <= 4); + UPB_ASSERT(((uintptr_t)ptr & 7) == 0); + return (uintptr_t)ptr | (unsigned)elem_size_lg2; +} + +extern const char _upb_Array_CTypeSizeLg2Table[]; + +UPB_INLINE size_t _upb_Array_CTypeSizeLg2(upb_CType ctype) { + return _upb_Array_CTypeSizeLg2Table[ctype]; +} + +UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_capacity, + int elem_size_lg2) { + UPB_ASSERT(elem_size_lg2 <= 4); + const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN); + const size_t bytes = arr_size + (init_capacity << elem_size_lg2); + upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes); + if (!arr) return NULL; + arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2); + arr->size = 0; + arr->capacity = init_capacity; + return arr; +} + +// Resizes the capacity of the array to be at least min_size. +bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena); + +UPB_INLINE bool _upb_array_reserve(upb_Array* arr, size_t size, + upb_Arena* arena) { + if (arr->capacity < size) return _upb_array_realloc(arr, size, arena); + return true; +} + +// Resize without initializing new elements. +UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* arr, size_t size, + upb_Arena* arena) { + if (!_upb_array_reserve(arr, size, arena)) return false; + arr->size = size; + return true; +} + +// This function is intended for situations where elem_size is compile-time +// constant or a known expression of the form (1 << lg2), so that the expression +// i*elem_size does not result in an actual multiplication. +UPB_INLINE void _upb_Array_Set(upb_Array* arr, size_t i, const void* data, + size_t elem_size) { + UPB_ASSERT(i < arr->size); + UPB_ASSERT(elem_size == 1U << _upb_Array_ElementSizeLg2(arr)); + char* arr_data = (char*)_upb_array_ptr(arr); + memcpy(arr_data + (i * elem_size), data, elem_size); +} + +UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) { + *UPB_PTR_AT(msg, ofs, upb_Array*) = NULL; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_INTERNAL_ARRAY_INTERNAL_H_ */ diff --git a/third_party/upb/upb/map.c b/third_party/upb/upb/collections/map.c similarity index 64% rename from third_party/upb/upb/map.c rename to third_party/upb/upb/collections/map.c index d92776f546d..fb6aedba4b4 100644 --- a/third_party/upb/upb/map.c +++ b/third_party/upb/upb/collections/map.c @@ -25,33 +25,34 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/map.h" +#include "upb/collections/map.h" #include -#include "upb/internal/table.h" -#include "upb/msg.h" -#include "upb/port_def.inc" +#include "upb/collections/map_internal.h" +#include "upb/mem/arena.h" -/* 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 */ +// Must be last. +#include "upb/port/def.inc" + +// Strings/bytes are special-cased in maps. +char _upb_Map_CTypeSizeTable[12] = { + [kUpb_CType_Bool] = 1, + [kUpb_CType_Float] = 4, + [kUpb_CType_Int32] = 4, + [kUpb_CType_UInt32] = 4, + [kUpb_CType_Enum] = 4, + [kUpb_CType_Message] = sizeof(void*), + [kUpb_CType_Double] = 8, + [kUpb_CType_Int64] = 8, + [kUpb_CType_UInt64] = 8, + [kUpb_CType_String] = UPB_MAPTYPE_STRING, + [kUpb_CType_Bytes] = UPB_MAPTYPE_STRING, }; 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]); + return _upb_Map_New(a, _upb_Map_CTypeSize(key_type), + _upb_Map_CTypeSize(value_type)); } size_t upb_Map_Size(const upb_Map* map) { return _upb_Map_Size(map); } @@ -69,8 +70,23 @@ upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key, 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_Map_Delete(upb_Map* map, upb_MessageValue key, upb_MessageValue* val) { + upb_value v; + const bool ok = _upb_Map_Delete(map, &key, map->key_size, &v); + if (val) val->uint64_val = v.val; + return ok; +} + +bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key, + upb_MessageValue* val, size_t* iter) { + upb_StringView k; + upb_value v; + const bool ok = upb_strtable_next2(&map->table, &k, &v, (intptr_t*)iter); + if (ok) { + _upb_map_fromkey(k, key, map->key_size); + _upb_map_fromvalue(v, val, map->val_size); + } + return ok; } bool upb_MapIterator_Next(const upb_Map* map, size_t* iter) { @@ -85,7 +101,7 @@ bool upb_MapIterator_Done(const upb_Map* map, size_t iter) { return upb_strtable_done(&i); } -/* Returns the key and value for this entry of the map. */ +// 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; @@ -104,5 +120,15 @@ upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter) { return ret; } -/* void upb_MapIterator_SetValue(upb_Map *map, size_t iter, upb_MessageValue - * value); */ +// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// + +upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size) { + upb_Map* map = upb_Arena_Malloc(a, sizeof(upb_Map)); + if (!map) return NULL; + + upb_strtable_init(&map->table, 4, a); + map->key_size = key_size; + map->val_size = value_size; + + return map; +} diff --git a/third_party/upb/upb/collections/map.h b/third_party/upb/upb/collections/map.h new file mode 100644 index 00000000000..920a5019c6b --- /dev/null +++ b/third_party/upb/upb/collections/map.h @@ -0,0 +1,135 @@ +/* + * 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_COLLECTIONS_MAP_H_ +#define UPB_COLLECTIONS_MAP_H_ + +#include "upb/base/descriptor_constants.h" +#include "upb/collections/message_value.h" +#include "upb/mem/arena.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_API upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, + upb_CType value_type); + +// Returns the number of entries in the map. +UPB_API 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. +UPB_API bool upb_Map_Get(const upb_Map* map, upb_MessageValue key, + upb_MessageValue* val); + +// Removes all entries in the map. +UPB_API void upb_Map_Clear(upb_Map* map); + +typedef enum { + kUpb_MapInsertStatus_Inserted = 0, + kUpb_MapInsertStatus_Replaced = 1, + kUpb_MapInsertStatus_OutOfMemory = 2, +} 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_API 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_API_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. +// If present and |val| is non-NULL, stores the deleted value. +UPB_API bool upb_Map_Delete(upb_Map* map, upb_MessageValue key, + upb_MessageValue* val); + +// (DEPRECATED and going away soon. Do not use.) +UPB_INLINE bool upb_Map_Delete2(upb_Map* map, upb_MessageValue key, + upb_MessageValue* val) { + return upb_Map_Delete(map, key, val); +} + +// Map iteration: +// +// size_t iter = kUpb_Map_Begin; +// upb_MessageValue key, val; +// while (upb_Map_Next(map, &key, &val, &iter)) { +// ... +// } + +#define kUpb_Map_Begin ((size_t)-1) + +// Advances to the next entry. Returns false if no more entries are present. +// Otherwise returns true and populates both *key and *value. +UPB_API bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key, + upb_MessageValue* val, size_t* iter); + +// DEPRECATED iterator, slated for removal. + +/* 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); + * } + */ + +// 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); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_COLLECTIONS_MAP_H_ */ diff --git a/third_party/upb/upb/collections/map_gencode_util.h b/third_party/upb/upb/collections/map_gencode_util.h new file mode 100644 index 00000000000..794d76b9f4a --- /dev/null +++ b/third_party/upb/upb/collections/map_gencode_util.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// These functions are only used by generated code. + +#ifndef UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ +#define UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ + +#include "upb/collections/map_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Message map operations, these get the map from the message first. + +UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) { + const upb_tabent* ent = (const upb_tabent*)msg; + uint32_t u32len; + upb_StringView k; + k.data = upb_tabstr(ent->key, &u32len); + k.size = u32len; + _upb_map_fromkey(k, key, size); +} + +UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) { + const upb_tabent* ent = (const upb_tabent*)msg; + upb_value v = {ent->val.val}; + _upb_map_fromvalue(v, val, size); +} + +UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, + size_t size) { + upb_tabent* ent = (upb_tabent*)msg; + // This is like _upb_map_tovalue() except the entry already exists + // so we can reuse the allocated upb_StringView for string fields. + if (size == UPB_MAPTYPE_STRING) { + upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val; + memcpy(strp, val, sizeof(*strp)); + } else { + memcpy(&ent->val.val, val, size); + } +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ */ diff --git a/third_party/upb/upb/collections/map_internal.h b/third_party/upb/upb/collections/map_internal.h new file mode 100644 index 00000000000..ceadf83359c --- /dev/null +++ b/third_party/upb/upb/collections/map_internal.h @@ -0,0 +1,170 @@ +/* + * 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. + */ + +// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// + +#ifndef UPB_COLLECTIONS_MAP_INTERNAL_H_ +#define UPB_COLLECTIONS_MAP_INTERNAL_H_ + +#include "upb/base/string_view.h" +#include "upb/collections/map.h" +#include "upb/hash/str_table.h" +#include "upb/mem/arena.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_Map { + // Size of key and val, based on the map type. + // Strings are represented as '0' because they must be handled specially. + char key_size; + char val_size; + + upb_strtable table; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +// Converting between internal table representation and user values. +// +// _upb_map_tokey() and _upb_map_fromkey() are inverses. +// _upb_map_tovalue() and _upb_map_fromvalue() are inverses. +// +// These functions account for the fact that strings are treated differently +// from other types when stored in a map. + +UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) { + if (size == UPB_MAPTYPE_STRING) { + return *(upb_StringView*)key; + } else { + return upb_StringView_FromDataAndSize((const char*)key, size); + } +} + +UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) { + if (size == UPB_MAPTYPE_STRING) { + memcpy(out, &key, sizeof(key)); + } else { + memcpy(out, key.data, size); + } +} + +UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size, + upb_value* msgval, upb_Arena* a) { + if (size == UPB_MAPTYPE_STRING) { + upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp)); + if (!strp) return false; + *strp = *(upb_StringView*)val; + *msgval = upb_value_ptr(strp); + } else { + memcpy(msgval, val, size); + } + return true; +} + +UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) { + if (size == UPB_MAPTYPE_STRING) { + const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val); + memcpy(out, strp, sizeof(upb_StringView)); + } else { + memcpy(out, &val, size); + } +} + +UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) { + upb_strtable_iter it; + it.t = &map->table; + it.index = *iter; + upb_strtable_next(&it); + *iter = it.index; + if (upb_strtable_done(&it)) return NULL; + return (void*)str_tabent(&it); +} + +UPB_INLINE void _upb_Map_Clear(upb_Map* map) { + upb_strtable_clear(&map->table); +} + +UPB_INLINE bool _upb_Map_Delete(upb_Map* map, const void* key, size_t key_size, + upb_value* val) { + upb_StringView k = _upb_map_tokey(key, key_size); + return upb_strtable_remove2(&map->table, k.data, k.size, val); +} + +UPB_INLINE bool _upb_Map_Get(const upb_Map* map, const void* key, + size_t key_size, void* val, size_t val_size) { + upb_value tabval; + upb_StringView k = _upb_map_tokey(key, key_size); + bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval); + if (ret && val) { + _upb_map_fromvalue(tabval, val, val_size); + } + return ret; +} + +UPB_INLINE 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 kUpb_MapInsertStatus_OutOfMemory; + } + + // TODO(haberman): add overwrite operation to minimize number of lookups. + 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 size_t _upb_Map_Size(const upb_Map* map) { + return map->table.t.count; +} + +// Strings/bytes are special-cased in maps. +extern char _upb_Map_CTypeSizeTable[12]; + +UPB_INLINE size_t _upb_Map_CTypeSize(upb_CType ctype) { + return _upb_Map_CTypeSizeTable[ctype]; +} + +// Creates a new map on the given arena with this key/value type. +upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_COLLECTIONS_MAP_INTERNAL_H_ */ diff --git a/third_party/upb/upb/collections/map_sorter.c b/third_party/upb/upb/collections/map_sorter.c new file mode 100644 index 00000000000..c18e03c7848 --- /dev/null +++ b/third_party/upb/upb/collections/map_sorter.c @@ -0,0 +1,166 @@ +/* + * 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/base/log2.h" +#include "upb/collections/map_sorter_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key, + void* b_key, size_t size) { + const upb_tabent* const* a = _a; + const upb_tabent* const* b = _b; + upb_StringView a_tabkey = upb_tabstrview((*a)->key); + upb_StringView b_tabkey = upb_tabstrview((*b)->key); + _upb_map_fromkey(a_tabkey, a_key, size); + _upb_map_fromkey(b_tabkey, b_key, size); +} + +static int _upb_mapsorter_cmpi64(const void* _a, const void* _b) { + int64_t a, b; + _upb_mapsorter_getkeys(_a, _b, &a, &b, 8); + return a < b ? -1 : a > b; +} + +static int _upb_mapsorter_cmpu64(const void* _a, const void* _b) { + uint64_t a, b; + _upb_mapsorter_getkeys(_a, _b, &a, &b, 8); + return a < b ? -1 : a > b; +} + +static int _upb_mapsorter_cmpi32(const void* _a, const void* _b) { + int32_t a, b; + _upb_mapsorter_getkeys(_a, _b, &a, &b, 4); + return a < b ? -1 : a > b; +} + +static int _upb_mapsorter_cmpu32(const void* _a, const void* _b) { + uint32_t a, b; + _upb_mapsorter_getkeys(_a, _b, &a, &b, 4); + return a < b ? -1 : a > b; +} + +static int _upb_mapsorter_cmpbool(const void* _a, const void* _b) { + bool a, b; + _upb_mapsorter_getkeys(_a, _b, &a, &b, 1); + return a < b ? -1 : a > b; +} + +static int _upb_mapsorter_cmpstr(const void* _a, const void* _b) { + upb_StringView a, b; + _upb_mapsorter_getkeys(_a, _b, &a, &b, UPB_MAPTYPE_STRING); + size_t common_size = UPB_MIN(a.size, b.size); + int cmp = memcmp(a.data, b.data, common_size); + if (cmp) return -cmp; + return a.size < b.size ? -1 : a.size > b.size; +} + +static int (*const compar[kUpb_FieldType_SizeOf])(const void*, const void*) = { + [kUpb_FieldType_Int64] = _upb_mapsorter_cmpi64, + [kUpb_FieldType_SFixed64] = _upb_mapsorter_cmpi64, + [kUpb_FieldType_SInt64] = _upb_mapsorter_cmpi64, + + [kUpb_FieldType_UInt64] = _upb_mapsorter_cmpu64, + [kUpb_FieldType_Fixed64] = _upb_mapsorter_cmpu64, + + [kUpb_FieldType_Int32] = _upb_mapsorter_cmpi32, + [kUpb_FieldType_SInt32] = _upb_mapsorter_cmpi32, + [kUpb_FieldType_SFixed32] = _upb_mapsorter_cmpi32, + [kUpb_FieldType_Enum] = _upb_mapsorter_cmpi32, + + [kUpb_FieldType_UInt32] = _upb_mapsorter_cmpu32, + [kUpb_FieldType_Fixed32] = _upb_mapsorter_cmpu32, + + [kUpb_FieldType_Bool] = _upb_mapsorter_cmpbool, + + [kUpb_FieldType_String] = _upb_mapsorter_cmpstr, + [kUpb_FieldType_Bytes] = _upb_mapsorter_cmpstr, +}; + +static bool _upb_mapsorter_resize(_upb_mapsorter* s, _upb_sortedmap* sorted, + int size) { + sorted->start = s->size; + sorted->pos = sorted->start; + sorted->end = sorted->start + size; + + if (sorted->end > s->cap) { + s->cap = upb_Log2CeilingSize(sorted->end); + s->entries = realloc(s->entries, s->cap * sizeof(*s->entries)); + if (!s->entries) return false; + } + + s->size = sorted->end; + return true; +} + +bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, + const upb_Map* map, _upb_sortedmap* sorted) { + int map_size = _upb_Map_Size(map); + + if (!_upb_mapsorter_resize(s, sorted, map_size)) return false; + + // Copy non-empty entries from the table to s->entries. + const void** dst = &s->entries[sorted->start]; + const upb_tabent* src = map->table.t.entries; + const upb_tabent* end = src + upb_table_size(&map->table.t); + for (; src < end; src++) { + if (!upb_tabent_isempty(src)) { + *dst = src; + dst++; + } + } + UPB_ASSERT(dst == &s->entries[sorted->end]); + + // Sort entries according to the key type. + qsort(&s->entries[sorted->start], map_size, sizeof(*s->entries), + compar[key_type]); + return true; +} + +static int _upb_mapsorter_cmpext(const void* _a, const void* _b) { + const upb_Message_Extension* const* a = _a; + const upb_Message_Extension* const* b = _b; + uint32_t a_num = (*a)->ext->field.number; + uint32_t b_num = (*b)->ext->field.number; + assert(a_num != b_num); + return a_num < b_num ? -1 : 1; +} + +bool _upb_mapsorter_pushexts(_upb_mapsorter* s, + const upb_Message_Extension* exts, size_t count, + _upb_sortedmap* sorted) { + if (!_upb_mapsorter_resize(s, sorted, count)) return false; + + for (size_t i = 0; i < count; i++) { + s->entries[sorted->start + i] = &exts[i]; + } + + qsort(&s->entries[sorted->start], count, sizeof(*s->entries), + _upb_mapsorter_cmpext); + return true; +} diff --git a/third_party/upb/upb/collections/map_sorter_internal.h b/third_party/upb/upb/collections/map_sorter_internal.h new file mode 100644 index 00000000000..8e9f1294ac1 --- /dev/null +++ b/third_party/upb/upb/collections/map_sorter_internal.h @@ -0,0 +1,109 @@ +/* + * 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. + */ + +// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// + +#ifndef UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ +#define UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ + +#include + +#include "upb/collections/map_internal.h" +#include "upb/message/extension_internal.h" +#include "upb/mini_table/message_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// _upb_mapsorter sorts maps and provides ordered iteration over the entries. +// Since maps can be recursive (map values can be messages which contain other +// maps), _upb_mapsorter can contain a stack of maps. + +typedef struct { + void const** entries; + int size; + int cap; +} _upb_mapsorter; + +typedef struct { + int start; + int pos; + int end; +} _upb_sortedmap; + +UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) { + s->entries = NULL; + s->size = 0; + s->cap = 0; +} + +UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) { + if (s->entries) free(s->entries); +} + +UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map, + _upb_sortedmap* sorted, upb_MapEntry* ent) { + if (sorted->pos == sorted->end) return false; + const upb_tabent* tabent = (const upb_tabent*)s->entries[sorted->pos++]; + upb_StringView key = upb_tabstrview(tabent->key); + _upb_map_fromkey(key, &ent->data.k, map->key_size); + upb_value val = {tabent->val.val}; + _upb_map_fromvalue(val, &ent->data.v, map->val_size); + return true; +} + +UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s, + _upb_sortedmap* sorted, + const upb_Message_Extension** ext) { + if (sorted->pos == sorted->end) return false; + *ext = (const upb_Message_Extension*)s->entries[sorted->pos++]; + return true; +} + +UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s, + _upb_sortedmap* sorted) { + s->size = sorted->start; +} + +bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, + const upb_Map* map, _upb_sortedmap* sorted); + +bool _upb_mapsorter_pushexts(_upb_mapsorter* s, + const upb_Message_Extension* exts, size_t count, + _upb_sortedmap* sorted); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */ diff --git a/third_party/upb/upb/message_value.h b/third_party/upb/upb/collections/message_value.h similarity index 86% rename from third_party/upb/upb/message_value.h rename to third_party/upb/upb/collections/message_value.h index a08b90fc1ee..4d722962a9c 100644 --- a/third_party/upb/upb/message_value.h +++ b/third_party/upb/upb/collections/message_value.h @@ -25,17 +25,20 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// Users should include array.h or map.h instead. +// IWYU pragma: private, include "upb/collections/array.h" + #ifndef UPB_MESSAGE_VALUE_H_ #define UPB_MESSAGE_VALUE_H_ -#include "google/protobuf/descriptor.upb.h" -#include "upb/port_def.inc" +#include "upb/base/string_view.h" +#include "upb/mini_table/types.h" -#ifdef __cplusplus -extern "C" { -#endif +// Must be last. +#include "upb/port/def.inc" -// Definitions commn to both upb_Array and upb_Map. +typedef struct upb_Array upb_Array; +typedef struct upb_Map upb_Map; typedef union { bool bool_val; @@ -45,22 +48,18 @@ typedef union { int64_t int64_val; uint32_t uint32_val; uint64_t uint64_val; + const upb_Array* array_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_Array* array; upb_Map* map; upb_Message* msg; - upb_Array* array; } upb_MutableMessageValue; -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MESSAGE_VALUE_H_ */ diff --git a/third_party/upb/upb/collections/test.cc b/third_party/upb/upb/collections/test.cc new file mode 100644 index 00000000000..d82c7f8a2ca --- /dev/null +++ b/third_party/upb/upb/collections/test.cc @@ -0,0 +1,60 @@ +/* + * 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 "gtest/gtest.h" +#include "upb/base/descriptor_constants.h" +#include "upb/collections/array.h" +#include "upb/upb.hpp" + +TEST(CollectionsTest, Arrays) { + upb::Arena arena; + upb::Status status; + + upb_Array* array = upb_Array_New(arena.ptr(), kUpb_CType_Int32); + EXPECT_TRUE(array); + + for (int i = 0; i < 10; i++) { + upb_MessageValue mv = {.int32_val = 3 * i}; + upb_Array_Append(array, mv, arena.ptr()); + EXPECT_EQ(upb_Array_Size(array), i + 1); + EXPECT_EQ(upb_Array_Get(array, i).int32_val, 3 * i); + } + + upb_Array_Resize(array, 12, arena.ptr()); + EXPECT_EQ(upb_Array_Get(array, 10).int32_val, 0); + EXPECT_EQ(upb_Array_Get(array, 11).int32_val, 0); + + upb_Array_Resize(array, 4, arena.ptr()); + EXPECT_EQ(upb_Array_Size(array), 4); + + upb_Array_Resize(array, 6, arena.ptr()); + EXPECT_EQ(upb_Array_Size(array), 6); + + EXPECT_EQ(upb_Array_Get(array, 3).int32_val, 9); + EXPECT_EQ(upb_Array_Get(array, 4).int32_val, 0); + EXPECT_EQ(upb_Array_Get(array, 5).int32_val, 0); +} diff --git a/third_party/upb/upb/conformance/BUILD b/third_party/upb/upb/conformance/BUILD new file mode 100644 index 00000000000..1c5d3e628ce --- /dev/null +++ b/third_party/upb/upb/conformance/BUILD @@ -0,0 +1,161 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +load( + "//bazel:build_defs.bzl", + "UPB_DEFAULT_COPTS", + "make_shell_script", +) +load( + "//bazel:upb_proto_library.bzl", + "upb_proto_library", + "upb_proto_reflection_library", +) + +licenses(["notice"]) + +config_setting( + name = "windows", + constraint_values = ["@platforms//os:windows"], + visibility = ["//visibility:public"], +) + +upb_proto_library( + name = "conformance_upb_proto", + testonly = 1, + deps = ["@com_google_protobuf//conformance:conformance_proto"], +) + +upb_proto_reflection_library( + name = "conformance_upb_proto_reflection", + testonly = 1, + deps = ["@com_google_protobuf//conformance:conformance_proto"], +) + +upb_proto_reflection_library( + name = "test_messages_proto2_upbdefs", + testonly = 1, + visibility = ["//:__subpackages__"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], +) + +upb_proto_reflection_library( + name = "test_messages_proto3_upbdefs", + testonly = 1, + visibility = ["//:__subpackages__"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], +) + +cc_binary( + name = "conformance_upb", + testonly = 1, + srcs = ["conformance_upb.c"], + copts = UPB_DEFAULT_COPTS, + data = ["conformance_upb_failures.txt"], + target_compatible_with = select({ + "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":conformance_upb_proto", + ":conformance_upb_proto_reflection", + ":test_messages_proto2_upbdefs", + ":test_messages_proto3_upbdefs", + "//:json", + "//:port", + "//:reflection", + "//:textformat", + "//:wire", + ], +) + +make_shell_script( + name = "gen_test_conformance_upb", + out = "test_conformance_upb.sh", + contents = "external/com_google_protobuf/conformance/conformance_test_runner" + + " --enforce_recommended" + + " --failure_list upb/conformance/conformance_upb_failures.txt" + + " upb/conformance/conformance_upb", +) + +sh_test( + name = "test_conformance_upb", + srcs = ["test_conformance_upb.sh"], + data = [ + "conformance_upb_failures.txt", + ":conformance_upb", + "@com_google_protobuf//conformance:conformance_test_runner", + ], + target_compatible_with = select({ + "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], + "//conditions:default": [], + }), + deps = ["@bazel_tools//tools/bash/runfiles"], +) + +cc_binary( + name = "conformance_upb_dynamic_minitable", + testonly = 1, + srcs = ["conformance_upb.c"], + copts = UPB_DEFAULT_COPTS + [ + "-DREBUILD_MINITABLES", + ], + data = ["conformance_upb_failures.txt"], + target_compatible_with = select({ + "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":conformance_upb_proto", + ":conformance_upb_proto_reflection", + ":test_messages_proto2_upbdefs", + ":test_messages_proto3_upbdefs", + "//:json", + "//:port", + "//:reflection", + "//:textformat", + "//:wire", + ], +) + +make_shell_script( + name = "gen_test_conformance_upb_dynamic_minitable", + out = "test_conformance_upb_dynamic_minitable.sh", + contents = "external/com_google_protobuf/conformance/conformance_test_runner" + + " --enforce_recommended" + + " --failure_list upb/conformance/conformance_upb_failures.txt" + + " upb/conformance/conformance_upb_dynamic_minitable", +) + +sh_test( + name = "test_conformance_upb_dynamic_minitable", + srcs = ["test_conformance_upb_dynamic_minitable.sh"], + data = [ + "conformance_upb_failures.txt", + ":conformance_upb_dynamic_minitable", + "@com_google_protobuf//conformance:conformance_test_runner", + ], + deps = ["@bazel_tools//tools/bash/runfiles"], +) diff --git a/third_party/upb/upb/conformance_upb.c b/third_party/upb/upb/conformance/conformance_upb.c similarity index 97% rename from third_party/upb/upb/conformance_upb.c rename to third_party/upb/upb/conformance/conformance_upb.c index be5ce9c7dc3..c124e1b4cf0 100644 --- a/third_party/upb/upb/conformance_upb.c +++ b/third_party/upb/upb/conformance/conformance_upb.c @@ -31,7 +31,6 @@ #include #include -#include #include #include @@ -39,15 +38,15 @@ #include "conformance/conformance.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" -#include "upb/json_encode.h" -#include "upb/reflection.h" -#include "upb/text_encode.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/reflection/message.h" +#include "upb/text/encode.h" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" int test_count = 0; bool verbose = false; /* Set to true to get req/resp printed on stderr. */ @@ -254,7 +253,7 @@ void DoTest(const ctx* c) { return; } - msg = upb_Message_New(m, c->arena); + msg = upb_Message_New(upb_MessageDef_MiniTable(m), c->arena); if (parse_input(msg, m, c)) { write_output(msg, m, c); diff --git a/third_party/upb/upb/conformance/conformance_upb_failures.txt b/third_party/upb/upb/conformance/conformance_upb_failures.txt new file mode 100644 index 00000000000..2fb4dc881f1 --- /dev/null +++ b/third_party/upb/upb/conformance/conformance_upb_failures.txt @@ -0,0 +1,2 @@ +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInRepeatedField.ProtobufOutput diff --git a/third_party/upb/upb/conformance_upb_failures.txt b/third_party/upb/upb/conformance_upb_failures.txt deleted file mode 100644 index ee965b22136..00000000000 --- a/third_party/upb/upb/conformance_upb_failures.txt +++ /dev/null @@ -1 +0,0 @@ -# No conformance tests are failing, thus the failure list is empty. diff --git a/third_party/upb/upb/decode.c b/third_party/upb/upb/decode.c deleted file mode 100644 index d3148753133..00000000000 --- a/third_party/upb/upb/decode.c +++ /dev/null @@ -1,1221 +0,0 @@ -/* - * Copyright (c) 2009-2021, Google LLC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Google LLC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "upb/decode.h" - -#include -#include - -#include "upb/internal/decode.h" -#include "upb/internal/upb.h" -#include "upb/upb.h" - -/* Must be last. */ -#include "upb/port_def.inc" - -/* Maps descriptor type -> elem_size_lg2. */ -static const uint8_t desctype_to_elem_size_lg2[] = { - -1, /* invalid descriptor type */ - 3, /* DOUBLE */ - 2, /* FLOAT */ - 3, /* INT64 */ - 3, /* UINT64 */ - 2, /* INT32 */ - 3, /* FIXED64 */ - 2, /* FIXED32 */ - 0, /* BOOL */ - UPB_SIZE(3, 4), /* STRING */ - UPB_SIZE(2, 3), /* GROUP */ - UPB_SIZE(2, 3), /* MESSAGE */ - UPB_SIZE(3, 4), /* BYTES */ - 2, /* UINT32 */ - 2, /* ENUM */ - 2, /* SFIXED32 */ - 3, /* SFIXED64 */ - 2, /* SINT32 */ - 3, /* SINT64 */ -}; - -/* Maps descriptor type -> upb map size. */ -static const uint8_t desctype_to_mapsize[] = { - -1, /* invalid descriptor type */ - 8, /* DOUBLE */ - 4, /* FLOAT */ - 8, /* INT64 */ - 8, /* UINT64 */ - 4, /* INT32 */ - 8, /* FIXED64 */ - 4, /* FIXED32 */ - 1, /* BOOL */ - UPB_MAPTYPE_STRING, /* STRING */ - sizeof(void*), /* GROUP */ - sizeof(void*), /* MESSAGE */ - UPB_MAPTYPE_STRING, /* BYTES */ - 4, /* UINT32 */ - 4, /* ENUM */ - 4, /* SFIXED32 */ - 8, /* SFIXED64 */ - 4, /* SINT32 */ - 8, /* SINT64 */ -}; - -static const unsigned FIXED32_OK_MASK = (1 << kUpb_FieldType_Float) | - (1 << kUpb_FieldType_Fixed32) | - (1 << kUpb_FieldType_SFixed32); - -static const unsigned FIXED64_OK_MASK = (1 << kUpb_FieldType_Double) | - (1 << kUpb_FieldType_Fixed64) | - (1 << kUpb_FieldType_SFixed64); - -/* Three fake field types for MessageSet. */ -#define TYPE_MSGSET_ITEM 19 -#define TYPE_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_SCALAR_LG2(n) (n) /* n in [0, 2, 3] => op in [0, 2, 3] */ -#define OP_ENUM 1 -#define OP_STRING 4 -#define OP_BYTES 5 -#define OP_SUBMSG 6 -/* Scalar fields use only ops above. Repeated fields can use any op. */ -#define OP_FIXPCK_LG2(n) (n + 5) /* n in [2, 3] => op in [7, 8] */ -#define OP_VARPCK_LG2(n) (n + 9) /* n in [0, 2, 3] => op in [9, 11, 12] */ -#define OP_PACKED_ENUM 13 - -static const int8_t varint_ops[] = { - OP_UNKNOWN, /* field not found */ - OP_UNKNOWN, /* DOUBLE */ - OP_UNKNOWN, /* FLOAT */ - OP_SCALAR_LG2(3), /* INT64 */ - OP_SCALAR_LG2(3), /* UINT64 */ - OP_SCALAR_LG2(2), /* INT32 */ - OP_UNKNOWN, /* FIXED64 */ - OP_UNKNOWN, /* FIXED32 */ - OP_SCALAR_LG2(0), /* BOOL */ - OP_UNKNOWN, /* STRING */ - OP_UNKNOWN, /* GROUP */ - OP_UNKNOWN, /* MESSAGE */ - OP_UNKNOWN, /* BYTES */ - OP_SCALAR_LG2(2), /* UINT32 */ - OP_ENUM, /* ENUM */ - OP_UNKNOWN, /* SFIXED32 */ - OP_UNKNOWN, /* SFIXED64 */ - OP_SCALAR_LG2(2), /* SINT32 */ - OP_SCALAR_LG2(3), /* SINT64 */ - OP_UNKNOWN, /* MSGSET_ITEM */ -}; - -static const int8_t delim_ops[] = { - /* For non-repeated field type. */ - OP_UNKNOWN, /* field not found */ - OP_UNKNOWN, /* DOUBLE */ - OP_UNKNOWN, /* FLOAT */ - OP_UNKNOWN, /* INT64 */ - OP_UNKNOWN, /* UINT64 */ - OP_UNKNOWN, /* INT32 */ - OP_UNKNOWN, /* FIXED64 */ - OP_UNKNOWN, /* FIXED32 */ - OP_UNKNOWN, /* BOOL */ - OP_STRING, /* STRING */ - OP_UNKNOWN, /* GROUP */ - OP_SUBMSG, /* MESSAGE */ - OP_BYTES, /* BYTES */ - OP_UNKNOWN, /* UINT32 */ - OP_UNKNOWN, /* ENUM */ - OP_UNKNOWN, /* SFIXED32 */ - OP_UNKNOWN, /* SFIXED64 */ - OP_UNKNOWN, /* SINT32 */ - OP_UNKNOWN, /* SINT64 */ - OP_UNKNOWN, /* MSGSET_ITEM */ - /* For repeated field type. */ - OP_FIXPCK_LG2(3), /* REPEATED DOUBLE */ - OP_FIXPCK_LG2(2), /* REPEATED FLOAT */ - OP_VARPCK_LG2(3), /* REPEATED INT64 */ - OP_VARPCK_LG2(3), /* REPEATED UINT64 */ - OP_VARPCK_LG2(2), /* REPEATED INT32 */ - OP_FIXPCK_LG2(3), /* REPEATED FIXED64 */ - OP_FIXPCK_LG2(2), /* REPEATED FIXED32 */ - OP_VARPCK_LG2(0), /* REPEATED BOOL */ - OP_STRING, /* REPEATED STRING */ - OP_SUBMSG, /* REPEATED GROUP */ - OP_SUBMSG, /* REPEATED MESSAGE */ - OP_BYTES, /* REPEATED BYTES */ - OP_VARPCK_LG2(2), /* REPEATED UINT32 */ - OP_PACKED_ENUM, /* REPEATED ENUM */ - OP_FIXPCK_LG2(2), /* REPEATED SFIXED32 */ - OP_FIXPCK_LG2(3), /* REPEATED SFIXED64 */ - OP_VARPCK_LG2(2), /* REPEATED SINT32 */ - OP_VARPCK_LG2(3), /* REPEATED SINT64 */ - /* Omitting MSGSET_*, because we never emit a repeated msgset type */ -}; - -typedef union { - bool bool_val; - uint32_t uint32_val; - uint64_t uint64_val; - uint32_t size; -} wireval; - -static const char* decode_msg(upb_Decoder* d, const char* ptr, upb_Message* msg, - const upb_MiniTable* layout); - -UPB_NORETURN static void* decode_err(upb_Decoder* d, upb_DecodeStatus status) { - assert(status != kUpb_DecodeStatus_Ok); - UPB_LONGJMP(d->err, status); -} - -const char* fastdecode_err(upb_Decoder* d, int status) { - assert(status != kUpb_DecodeStatus_Ok); - UPB_LONGJMP(d->err, status); - return NULL; -} -static void decode_verifyutf8(upb_Decoder* d, const char* buf, int len) { - if (!decode_verifyutf8_inl(buf, len)) - decode_err(d, kUpb_DecodeStatus_BadUtf8); -} - -static bool decode_reserve(upb_Decoder* d, upb_Array* arr, size_t elem) { - bool need_realloc = arr->size - arr->len < elem; - if (need_realloc && !_upb_array_realloc(arr, arr->len + elem, &d->arena)) { - decode_err(d, kUpb_DecodeStatus_OutOfMemory); - } - return need_realloc; -} - -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(upb_Decoder* d, const char* ptr, - uint64_t* val) { - uint64_t byte = (uint8_t)*ptr; - if (UPB_LIKELY((byte & 0x80) == 0)) { - *val = byte; - return ptr + 1; - } else { - decode_vret res = decode_longvarint64(ptr, byte); - if (!res.ptr) return decode_err(d, kUpb_DecodeStatus_Malformed); - *val = res.val; - return res.ptr; - } -} - -UPB_FORCEINLINE -static const char* decode_tag(upb_Decoder* d, const char* ptr, uint32_t* val) { - uint64_t byte = (uint8_t)*ptr; - if (UPB_LIKELY((byte & 0x80) == 0)) { - *val = byte; - return ptr + 1; - } else { - const char* start = ptr; - decode_vret res = decode_longvarint64(ptr, byte); - if (!res.ptr || res.ptr - start > 5 || res.val > UINT32_MAX) { - return decode_err(d, kUpb_DecodeStatus_Malformed); - } - *val = res.val; - return res.ptr; - } -} - -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) */ - val->uint32_val = val->uint64_val; - } -} - -static void decode_munge(int type, wireval* val) { - switch (type) { - case kUpb_FieldType_Bool: - val->bool_val = val->uint64_val != 0; - break; - case kUpb_FieldType_SInt32: { - uint32_t n = val->uint64_val; - val->uint32_val = (n >> 1) ^ -(int32_t)(n & 1); - break; - } - case kUpb_FieldType_SInt64: { - uint64_t n = val->uint64_val; - val->uint64_val = (n >> 1) ^ -(int64_t)(n & 1); - break; - } - case kUpb_FieldType_Int32: - case kUpb_FieldType_UInt32: - case kUpb_FieldType_Enum: - decode_munge_int32(val); - break; - } -} - -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; - upb_Message* msg = _upb_Message_New_inl(subl, &d->arena); - if (!msg) decode_err(d, kUpb_DecodeStatus_OutOfMemory); - return msg; -} - -UPB_NOINLINE -const char* decode_isdonefallback(upb_Decoder* d, const char* ptr, - int overrun) { - int status; - ptr = decode_isdonefallback_inl(d, ptr, overrun, &status); - if (ptr == NULL) { - return decode_err(d, status); - } - return ptr; -} - -static const char* decode_readstr(upb_Decoder* d, const char* ptr, int size, - upb_StringView* str) { - if (d->options & kUpb_DecodeOption_AliasString) { - str->data = ptr; - } else { - char* data = upb_Arena_Malloc(&d->arena, size); - if (!data) return decode_err(d, kUpb_DecodeStatus_OutOfMemory); - memcpy(data, ptr, size); - str->data = data; - } - str->size = size; - return ptr + size; -} - -UPB_FORCEINLINE -static const char* decode_tosubmsg2(upb_Decoder* d, const char* ptr, - upb_Message* submsg, - const upb_MiniTable* subl, int size) { - int saved_delta = decode_pushlimit(d, ptr, size); - if (--d->depth < 0) return decode_err(d, kUpb_DecodeStatus_MaxDepthExceeded); - ptr = decode_msg(d, ptr, submsg, subl); - if (d->end_group != DECODE_NOGROUP) - return decode_err(d, kUpb_DecodeStatus_Malformed); - decode_poplimit(d, ptr, saved_delta); - d->depth++; - return ptr; -} - -UPB_FORCEINLINE -static const char* decode_tosubmsg(upb_Decoder* d, const char* ptr, - upb_Message* submsg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field, int size) { - return decode_tosubmsg2(d, ptr, submsg, subs[field->submsg_index].submsg, - size); -} - -UPB_FORCEINLINE -static const char* decode_group(upb_Decoder* d, const char* ptr, - upb_Message* submsg, const upb_MiniTable* subl, - uint32_t number) { - if (--d->depth < 0) return decode_err(d, kUpb_DecodeStatus_MaxDepthExceeded); - if (decode_isdone(d, &ptr)) { - return decode_err(d, kUpb_DecodeStatus_Malformed); - } - ptr = decode_msg(d, ptr, submsg, subl); - if (d->end_group != number) return decode_err(d, kUpb_DecodeStatus_Malformed); - d->end_group = DECODE_NOGROUP; - d->depth++; - return ptr; -} - -UPB_FORCEINLINE -static const char* decode_togroup(upb_Decoder* d, const char* ptr, - upb_Message* submsg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field) { - const upb_MiniTable* subl = subs[field->submsg_index].submsg; - return decode_group(d, ptr, submsg, subl, field->number); -} - -static char* upb_Decoder_EncodeVarint32(uint32_t val, char* ptr) { - do { - uint8_t byte = val & 0x7fU; - val >>= 7; - if (val) byte |= 0x80U; - *(ptr++) = byte; - } while (val); - return ptr; -} - -static void upb_Decode_AddUnknownVarints(upb_Decoder* d, upb_Message* msg, - uint32_t val1, uint32_t val2) { - char buf[20]; - char* end = buf; - end = 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); - } -} - -UPB_NOINLINE -static bool decode_checkenum_slow(upb_Decoder* d, const char* ptr, - upb_Message* msg, const upb_MiniTable_Enum* e, - const upb_MiniTable_Field* field, - uint32_t v) { - // OPT: binary search long lists? - int n = e->value_count; - for (int i = 0; i < n; i++) { - if ((uint32_t)e->values[i] == v) return true; - } - - // Unrecognized enum goes into unknown fields. - // For packed fields the tag could be arbitrarily far in the past, so we - // just re-encode the tag and value here. - uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Varint; - upb_Decode_AddUnknownVarints(d, msg, tag, v); - return false; -} - -UPB_FORCEINLINE -static bool decode_checkenum(upb_Decoder* d, const char* ptr, upb_Message* msg, - const upb_MiniTable_Enum* e, - const upb_MiniTable_Field* field, wireval* val) { - uint32_t v = val->uint32_val; - - if (UPB_LIKELY(v < 64) && UPB_LIKELY(((1ULL << v) & e->mask))) return true; - - return decode_checkenum_slow(d, ptr, msg, e, field, v); -} - -UPB_NOINLINE -static const char* decode_enum_toarray(upb_Decoder* d, const char* ptr, - upb_Message* msg, upb_Array* arr, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field, - wireval* val) { - const upb_MiniTable_Enum* e = subs[field->submsg_index].subenum; - if (!decode_checkenum(d, ptr, msg, e, field, val)) return ptr; - void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len * 4, void); - arr->len++; - memcpy(mem, val, 4); - return ptr; -} - -UPB_FORCEINLINE -static const char* decode_fixed_packed(upb_Decoder* d, const char* ptr, - upb_Array* arr, wireval* val, - const upb_MiniTable_Field* field, - int lg2) { - int mask = (1 << lg2) - 1; - size_t count = val->size >> lg2; - if ((val->size & mask) != 0) { - // Length isn't a round multiple of elem size. - return decode_err(d, kUpb_DecodeStatus_Malformed); - } - decode_reserve(d, arr, count); - void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void); - arr->len += count; - // Note: if/when the decoder supports multi-buffer input, we will need to - // handle buffer seams here. - if (_upb_IsLittleEndian()) { - memcpy(mem, ptr, val->size); - ptr += val->size; - } else { - const char* end = ptr + val->size; - char* dst = mem; - while (ptr < end) { - if (lg2 == 2) { - uint32_t val; - memcpy(&val, ptr, sizeof(val)); - val = _upb_BigEndian_Swap32(val); - memcpy(dst, &val, sizeof(val)); - } else { - UPB_ASSERT(lg2 == 3); - uint64_t val; - memcpy(&val, ptr, sizeof(val)); - val = _upb_BigEndian_Swap64(val); - memcpy(dst, &val, sizeof(val)); - } - ptr += 1 << lg2; - dst += 1 << lg2; - } - } - - return ptr; -} - -UPB_FORCEINLINE -static const char* decode_varint_packed(upb_Decoder* d, const char* ptr, - upb_Array* arr, wireval* val, - const upb_MiniTable_Field* field, - int lg2) { - int scale = 1 << lg2; - int saved_limit = decode_pushlimit(d, ptr, val->size); - char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void); - while (!decode_isdone(d, &ptr)) { - wireval elem; - ptr = decode_varint64(d, ptr, &elem.uint64_val); - decode_munge(field->descriptortype, &elem); - if (decode_reserve(d, arr, 1)) { - out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void); - } - arr->len++; - memcpy(out, &elem, scale); - out += scale; - } - decode_poplimit(d, ptr, saved_limit); - return ptr; -} - -UPB_NOINLINE -static const char* decode_enum_packed(upb_Decoder* d, const char* ptr, - upb_Message* msg, upb_Array* arr, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field, - wireval* val) { - const upb_MiniTable_Enum* e = subs[field->submsg_index].subenum; - int saved_limit = decode_pushlimit(d, ptr, val->size); - char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len * 4, void); - while (!decode_isdone(d, &ptr)) { - wireval elem; - ptr = decode_varint64(d, ptr, &elem.uint64_val); - decode_munge_int32(&elem); - if (!decode_checkenum(d, ptr, msg, e, field, &elem)) { - continue; - } - if (decode_reserve(d, arr, 1)) { - out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len * 4, void); - } - arr->len++; - memcpy(out, &elem, 4); - out += 4; - } - decode_poplimit(d, ptr, saved_limit); - return ptr; -} - -static const char* decode_toarray(upb_Decoder* d, const char* ptr, - upb_Message* msg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field, - wireval* val, int op) { - upb_Array** arrp = UPB_PTR_AT(msg, field->offset, void); - upb_Array* arr = *arrp; - void* mem; - - if (arr) { - decode_reserve(d, arr, 1); - } else { - size_t lg2 = desctype_to_elem_size_lg2[field->descriptortype]; - arr = _upb_Array_New(&d->arena, 4, lg2); - if (!arr) return decode_err(d, kUpb_DecodeStatus_OutOfMemory); - *arrp = arr; - } - - switch (op) { - case OP_SCALAR_LG2(0): - case OP_SCALAR_LG2(2): - case OP_SCALAR_LG2(3): - /* Append scalar value. */ - mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << op, void); - arr->len++; - memcpy(mem, val, 1 << op); - return ptr; - case OP_STRING: - decode_verifyutf8(d, ptr, val->size); - /* Fallthrough. */ - case OP_BYTES: { - /* Append bytes. */ - upb_StringView* str = (upb_StringView*)_upb_array_ptr(arr) + arr->len; - arr->len++; - return decode_readstr(d, ptr, val->size, str); - } - case OP_SUBMSG: { - /* Append submessage / group. */ - upb_Message* submsg = decode_newsubmsg(d, subs, field); - *UPB_PTR_AT(_upb_array_ptr(arr), arr->len * sizeof(void*), upb_Message*) = - submsg; - arr->len++; - if (UPB_UNLIKELY(field->descriptortype == kUpb_FieldType_Group)) { - return decode_togroup(d, ptr, submsg, subs, field); - } else { - return decode_tosubmsg(d, ptr, submsg, subs, field, val->size); - } - } - case OP_FIXPCK_LG2(2): - case OP_FIXPCK_LG2(3): - return decode_fixed_packed(d, ptr, arr, val, field, - op - OP_FIXPCK_LG2(0)); - case OP_VARPCK_LG2(0): - case OP_VARPCK_LG2(2): - case OP_VARPCK_LG2(3): - return decode_varint_packed(d, ptr, arr, val, field, - op - OP_VARPCK_LG2(0)); - case OP_ENUM: - return decode_enum_toarray(d, ptr, msg, arr, subs, field, val); - case OP_PACKED_ENUM: - return decode_enum_packed(d, ptr, msg, arr, subs, field, val); - default: - UPB_UNREACHABLE(); - } -} - -static const char* decode_tomap(upb_Decoder* d, const char* ptr, - upb_Message* msg, const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field, - wireval* val) { - upb_Map** map_p = UPB_PTR_AT(msg, field->offset, upb_Map*); - upb_Map* map = *map_p; - upb_MapEntry ent; - const upb_MiniTable* entry = subs[field->submsg_index].submsg; - - if (!map) { - /* Lazily create map. */ - const upb_MiniTable_Field* key_field = &entry->fields[0]; - const upb_MiniTable_Field* val_field = &entry->fields[1]; - char key_size = desctype_to_mapsize[key_field->descriptortype]; - char val_size = desctype_to_mapsize[val_field->descriptortype]; - UPB_ASSERT(key_field->offset == 0); - UPB_ASSERT(val_field->offset == sizeof(upb_StringView)); - map = _upb_Map_New(&d->arena, key_size, val_size); - *map_p = map; - } - - /* Parse map entry. */ - memset(&ent, 0, sizeof(ent)); - - if (entry->fields[1].descriptortype == kUpb_FieldType_Message || - entry->fields[1].descriptortype == kUpb_FieldType_Group) { - /* Create proactively to handle the case where it doesn't appear. */ - ent.v.val = - upb_value_ptr(_upb_Message_New(entry->subs[0].submsg, &d->arena)); - } - - const char* start = ptr; - ptr = decode_tosubmsg(d, ptr, &ent.k, subs, field, val->size); - // check if ent had any unknown fields - size_t size; - upb_Message_GetUnknown(&ent.k, &size); - if (size != 0) { - uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Delimited; - upb_Decode_AddUnknownVarints(d, msg, tag, (uint32_t)(ptr - start)); - if (!_upb_Message_AddUnknown(msg, start, ptr - start, &d->arena)) { - decode_err(d, kUpb_DecodeStatus_OutOfMemory); - } - } else { - 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; -} - -static const char* decode_tomsg(upb_Decoder* d, const char* ptr, - upb_Message* msg, const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field, wireval* val, - int op) { - void* mem = UPB_PTR_AT(msg, field->offset, void); - int type = field->descriptortype; - - if (UPB_UNLIKELY(op == OP_ENUM) && - !decode_checkenum(d, ptr, msg, subs[field->submsg_index].subenum, field, - val)) { - return ptr; - } - - /* Set presence if necessary. */ - if (field->presence > 0) { - _upb_sethas_field(msg, field); - } else if (field->presence < 0) { - /* Oneof case */ - uint32_t* oneof_case = _upb_oneofcase_field(msg, field); - if (op == OP_SUBMSG && *oneof_case != field->number) { - memset(mem, 0, sizeof(void*)); - } - *oneof_case = field->number; - } - - /* Store into message. */ - switch (op) { - case OP_SUBMSG: { - upb_Message** submsgp = mem; - upb_Message* submsg = *submsgp; - if (!submsg) { - submsg = decode_newsubmsg(d, subs, field); - *submsgp = submsg; - } - if (UPB_UNLIKELY(type == kUpb_FieldType_Group)) { - ptr = decode_togroup(d, ptr, submsg, subs, field); - } else { - ptr = decode_tosubmsg(d, ptr, submsg, subs, field, val->size); - } - break; - } - case OP_STRING: - decode_verifyutf8(d, ptr, val->size); - /* Fallthrough. */ - case OP_BYTES: - return decode_readstr(d, ptr, val->size, mem); - case OP_SCALAR_LG2(3): - memcpy(mem, val, 8); - break; - case OP_ENUM: - case OP_SCALAR_LG2(2): - memcpy(mem, val, 4); - break; - case OP_SCALAR_LG2(0): - memcpy(mem, val, 1); - break; - default: - UPB_UNREACHABLE(); - } - - return ptr; -} - -UPB_NOINLINE -const char* decode_checkrequired(upb_Decoder* d, const char* ptr, - const upb_Message* msg, - const upb_MiniTable* l) { - assert(l->required_count); - if (UPB_LIKELY((d->options & kUpb_DecodeOption_CheckRequired) == 0)) { - return ptr; - } - uint64_t msg_head; - memcpy(&msg_head, msg, 8); - msg_head = _upb_BigEndian_Swap64(msg_head); - if (upb_MiniTable_requiredmask(l) & ~msg_head) { - d->missing_required = true; - } - return ptr; -} - -UPB_FORCEINLINE -static bool decode_tryfastdispatch(upb_Decoder* d, const char** ptr, - upb_Message* msg, - const upb_MiniTable* layout) { -#if UPB_FASTTABLE - if (layout && layout->table_mask != (unsigned char)-1) { - uint16_t tag = fastdecode_loadtag(*ptr); - intptr_t table = decode_totable(layout); - *ptr = fastdecode_tagdispatch(d, *ptr, msg, table, 0, tag); - return true; - } -#endif - return false; -} - -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, - const upb_MiniTable* l, - uint32_t field_number, - int* last_field_index) { - static upb_MiniTable_Field none = {0, 0, 0, 0, 0, 0}; - if (l == NULL) return &none; - - size_t idx = ((size_t)field_number) - 1; // 0 wraps to SIZE_MAX - if (idx < l->dense_below) { - /* Fastest case: index into dense fields. */ - goto found; - } - - if (l->dense_below < l->field_count) { - /* Linear search non-dense fields. Resume scanning from last_field_index - * since fields are usually in order. */ - int last = *last_field_index; - for (idx = last; idx < l->field_count; idx++) { - if (l->fields[idx].number == field_number) { - goto found; - } - } - - for (idx = l->dense_below; idx < last; idx++) { - if (l->fields[idx].number == field_number) { - goto found; - } - } - } - - if (d->extreg) { - switch (l->ext) { - case kUpb_ExtMode_Extendable: { - const upb_MiniTable_Extension* ext = - _upb_extreg_get(d->extreg, l, field_number); - if (ext) return &ext->field; - break; - } - case kUpb_ExtMode_IsMessageSet: - if (field_number == _UPB_MSGSET_ITEM) { - static upb_MiniTable_Field item = {0, 0, 0, 0, TYPE_MSGSET_ITEM, 0}; - return &item; - } - break; - } - } - - return &none; /* Unknown field. */ - -found: - UPB_ASSERT(l->fields[idx].number == field_number); - *last_field_index = idx; - return &l->fields[idx]; -} - -UPB_FORCEINLINE -static const char* decode_wireval(upb_Decoder* d, const char* ptr, - const upb_MiniTable_Field* field, - int wire_type, wireval* val, int* op) { - switch (wire_type) { - case kUpb_WireType_Varint: - ptr = decode_varint64(d, ptr, &val->uint64_val); - *op = varint_ops[field->descriptortype]; - decode_munge(field->descriptortype, val); - return ptr; - case kUpb_WireType_32Bit: - memcpy(&val->uint32_val, ptr, 4); - val->uint32_val = _upb_BigEndian_Swap32(val->uint32_val); - *op = OP_SCALAR_LG2(2); - if (((1 << field->descriptortype) & FIXED32_OK_MASK) == 0) { - *op = OP_UNKNOWN; - } - return ptr + 4; - case kUpb_WireType_64Bit: - memcpy(&val->uint64_val, ptr, 8); - val->uint64_val = _upb_BigEndian_Swap64(val->uint64_val); - *op = OP_SCALAR_LG2(3); - if (((1 << field->descriptortype) & FIXED64_OK_MASK) == 0) { - *op = OP_UNKNOWN; - } - return ptr + 8; - case kUpb_WireType_Delimited: { - int ndx = field->descriptortype; - if (upb_FieldMode_Get(field) == kUpb_FieldMode_Array) ndx += TYPE_COUNT; - ptr = upb_Decoder_DecodeSize(d, ptr, &val->size); - *op = delim_ops[ndx]; - return ptr; - } - case kUpb_WireType_StartGroup: - val->uint32_val = field->number; - if (field->descriptortype == kUpb_FieldType_Group) { - *op = OP_SUBMSG; - } else if (field->descriptortype == TYPE_MSGSET_ITEM) { - *op = OP_MSGSET_ITEM; - } else { - *op = OP_UNKNOWN; - } - return ptr; - default: - break; - } - return decode_err(d, kUpb_DecodeStatus_Malformed); -} - -UPB_FORCEINLINE -static const char* decode_known(upb_Decoder* d, const char* ptr, - upb_Message* msg, const upb_MiniTable* layout, - const upb_MiniTable_Field* field, int op, - wireval* val) { - const upb_MiniTable_Sub* subs = layout->subs; - uint8_t mode = field->mode; - - if (UPB_UNLIKELY(mode & kUpb_LabelFlags_IsExtension)) { - const upb_MiniTable_Extension* ext_layout = - (const upb_MiniTable_Extension*)field; - upb_Message_Extension* ext = - _upb_Message_GetOrCreateExtension(msg, ext_layout, &d->arena); - if (UPB_UNLIKELY(!ext)) return decode_err(d, kUpb_DecodeStatus_OutOfMemory); - msg = &ext->data; - subs = &ext->ext->sub; - } - - switch (mode & kUpb_FieldMode_Mask) { - case kUpb_FieldMode_Array: - return decode_toarray(d, ptr, msg, subs, field, val, op); - case kUpb_FieldMode_Map: - return decode_tomap(d, ptr, msg, subs, field, val); - case kUpb_FieldMode_Scalar: - return decode_tomsg(d, ptr, msg, subs, field, val, op); - default: - UPB_UNREACHABLE(); - } -} - -static const char* decode_reverse_skip_varint(const char* ptr, uint32_t val) { - uint32_t seen = 0; - do { - ptr--; - seen <<= 7; - seen |= *ptr & 0x7f; - } while (seen != val); - return ptr; -} - -static const char* decode_unknown(upb_Decoder* d, const char* ptr, - upb_Message* msg, int field_number, - int wire_type, wireval val) { - if (field_number == 0) return decode_err(d, kUpb_DecodeStatus_Malformed); - - // Since unknown fields are the uncommon case, we do a little extra work here - // to walk backwards through the buffer to find the field start. This frees - // up a register in the fast paths (when the field is known), which leads to - // significant speedups in benchmarks. - const char* start = ptr; - - if (wire_type == kUpb_WireType_Delimited) ptr += val.size; - if (msg) { - switch (wire_type) { - case kUpb_WireType_Varint: - case kUpb_WireType_Delimited: - start--; - while (start[-1] & 0x80) start--; - break; - case kUpb_WireType_32Bit: - start -= 4; - break; - case kUpb_WireType_64Bit: - start -= 8; - break; - default: - break; - } - - assert(start == d->debug_valstart); - uint32_t tag = ((uint32_t)field_number << 3) | wire_type; - start = decode_reverse_skip_varint(start, tag); - assert(start == d->debug_tagstart); - - if (wire_type == kUpb_WireType_StartGroup) { - d->unknown = start; - d->unknown_msg = msg; - ptr = decode_group(d, ptr, NULL, NULL, field_number); - start = d->unknown; - d->unknown_msg = NULL; - d->unknown = NULL; - } - if (!_upb_Message_AddUnknown(msg, start, ptr - start, &d->arena)) { - return decode_err(d, kUpb_DecodeStatus_OutOfMemory); - } - } else if (wire_type == kUpb_WireType_StartGroup) { - ptr = decode_group(d, ptr, NULL, NULL, field_number); - } - return ptr; -} - -UPB_NOINLINE -static const char* decode_msg(upb_Decoder* d, const char* ptr, upb_Message* msg, - const upb_MiniTable* layout) { - int last_field_index = 0; - -#if UPB_FASTTABLE - // The first time we want to skip fast dispatch, because we may have just been - // invoked by the fast parser to handle a case that it bailed on. - if (!decode_isdone(d, &ptr)) goto nofast; -#endif - - while (!decode_isdone(d, &ptr)) { - uint32_t tag; - const upb_MiniTable_Field* field; - int field_number; - int wire_type; - wireval val; - int op; - - if (decode_tryfastdispatch(d, &ptr, msg, layout)) break; - -#if UPB_FASTTABLE - nofast: -#endif - -#ifndef NDEBUG - d->debug_tagstart = ptr; -#endif - - UPB_ASSERT(ptr < d->limit_ptr); - ptr = decode_tag(d, ptr, &tag); - field_number = tag >> 3; - wire_type = tag & 7; - -#ifndef NDEBUG - d->debug_valstart = ptr; -#endif - - if (wire_type == kUpb_WireType_EndGroup) { - d->end_group = field_number; - return ptr; - } - - field = decode_findfield(d, layout, field_number, &last_field_index); - ptr = decode_wireval(d, ptr, field, wire_type, &val, &op); - - if (op >= 0) { - ptr = decode_known(d, ptr, msg, layout, field, op, &val); - } else { - switch (op) { - case OP_UNKNOWN: - ptr = decode_unknown(d, ptr, msg, field_number, wire_type, val); - break; - case OP_MSGSET_ITEM: - ptr = upb_Decoder_DecodeMessageSetItem(d, ptr, msg, layout); - break; - } - } - } - - return UPB_UNLIKELY(layout && layout->required_count) - ? decode_checkrequired(d, ptr, msg, layout) - : ptr; -} - -const char* fastdecode_generic(struct upb_Decoder* d, const char* ptr, - upb_Message* msg, intptr_t table, - uint64_t hasbits, uint64_t data) { - (void)data; - *(uint32_t*)msg |= hasbits; - return decode_msg(d, ptr, msg, decode_totablep(table)); -} - -static upb_DecodeStatus decode_top(struct upb_Decoder* d, const char* buf, - void* msg, const upb_MiniTable* l) { - if (!decode_tryfastdispatch(d, &buf, msg, l)) { - decode_msg(d, buf, msg, l); - } - if (d->end_group != DECODE_NOGROUP) return kUpb_DecodeStatus_Malformed; - if (d->missing_required) return kUpb_DecodeStatus_MissingRequired; - return kUpb_DecodeStatus_Ok; -} - -upb_DecodeStatus upb_Decode(const char* buf, size_t size, void* msg, - const upb_MiniTable* l, - const upb_ExtensionRegistry* extreg, int options, - upb_Arena* arena) { - upb_Decoder state; - unsigned depth = (unsigned)options >> 16; - - if (size <= 16) { - memset(&state.patch, 0, 32); - if (size) memcpy(&state.patch, buf, size); - buf = state.patch; - state.end = buf + size; - state.limit = 0; - options &= ~kUpb_DecodeOption_AliasString; // Can't alias patch buf. - } else { - state.end = buf + size - 16; - state.limit = 16; - } - - state.extreg = extreg; - state.limit_ptr = state.end; - state.unknown_msg = NULL; - state.depth = depth ? depth : 64; - state.end_group = DECODE_NOGROUP; - state.options = (uint16_t)options; - state.missing_required = false; - state.arena.head = arena->head; - state.arena.last_size = arena->last_size; - state.arena.cleanup_metadata = arena->cleanup_metadata; - state.arena.parent = arena; - - upb_DecodeStatus status = UPB_SETJMP(state.err); - if (UPB_LIKELY(status == kUpb_DecodeStatus_Ok)) { - status = decode_top(&state, buf, msg, l); - } - - arena->head.ptr = state.arena.head.ptr; - arena->head.end = state.arena.head.end; - arena->cleanup_metadata = state.arena.cleanup_metadata; - return status; -} - -#undef OP_UNKNOWN -#undef OP_SKIP -#undef OP_SCALAR_LG2 -#undef OP_FIXPCK_LG2 -#undef OP_VARPCK_LG2 -#undef OP_STRING -#undef OP_BYTES -#undef OP_SUBMSG diff --git a/third_party/upb/upb/decode.h b/third_party/upb/upb/decode.h index 0c09497feb1..2e554969784 100644 --- a/third_party/upb/upb/decode.h +++ b/third_party/upb/upb/decode.h @@ -25,71 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * upb_decode: parsing into a upb_Message using a upb_MiniTable. - */ +// This header is deprecated, use upb/wire/decode.h instead +// IWYU pragma: private, include "upb/wire/decode.h" #ifndef UPB_DECODE_H_ #define UPB_DECODE_H_ -#include "upb/extension_registry.h" -#include "upb/msg.h" - -/* Must be last. */ -#include "upb/port_def.inc" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - /* If set, strings will alias the input buffer instead of copying into the - * arena. */ - kUpb_DecodeOption_AliasString = 1, - - /* If set, the parse will return failure if any message is missing any - * required fields when the message data ends. The parse will still continue, - * and the failure will only be reported at the end. - * - * IMPORTANT CAVEATS: - * - * 1. This can throw a false positive failure if an incomplete message is seen - * on the wire but is later completed when the sub-message occurs again. - * For this reason, a second pass is required to verify a failure, to be - * truly robust. - * - * 2. This can return a false success if you are decoding into a message that - * already has some sub-message fields present. If the sub-message does - * not occur in the binary payload, we will never visit it and discover the - * incomplete sub-message. For this reason, this check is only useful for - * implemting ParseFromString() semantics. For MergeFromString(), a - * post-parse validation step will always be necessary. */ - kUpb_DecodeOption_CheckRequired = 2, -}; - -#define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16) - -typedef enum { - kUpb_DecodeStatus_Ok = 0, - kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt - kUpb_DecodeStatus_OutOfMemory = 2, // Arena alloc failed - kUpb_DecodeStatus_BadUtf8 = 3, // String field had bad UTF-8 - kUpb_DecodeStatus_MaxDepthExceeded = 4, // Exceeded UPB_DECODE_MAXDEPTH - - // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise - // succeeded. - kUpb_DecodeStatus_MissingRequired = 5, -} upb_DecodeStatus; - -upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg, - const upb_MiniTable* l, - const upb_ExtensionRegistry* extreg, int options, - upb_Arena* arena); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#include "upb/port_undef.inc" +#include "upb/wire/decode.h" #endif /* UPB_DECODE_H_ */ diff --git a/third_party/upb/upb/decode_fast.h b/third_party/upb/upb/decode_fast.h index b04aeedb85e..2e927350bea 100644 --- a/third_party/upb/upb/decode_fast.h +++ b/third_party/upb/upb/decode_fast.h @@ -25,129 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// These are the specialized field parser functions for the fast parser. -// Generated tables will refer to these by name. -// -// The function names are encoded with names like: -// -// // 123 4 -// upb_pss_1bt(); // Parse singular string, 1 byte tag. -// -// In position 1: -// - 'p' for parse, most function use this -// - 'c' for copy, for when we are copying strings instead of aliasing -// -// In position 2 (cardinality): -// - 's' for singular, with or without hasbit -// - 'o' for oneof -// - 'r' for non-packed repeated -// - 'p' for packed repeated -// -// In position 3 (type): -// - 'b1' for bool -// - 'v4' for 4-byte varint -// - 'v8' for 8-byte varint -// - 'z4' for zig-zag-encoded 4-byte varint -// - 'z8' for zig-zag-encoded 8-byte varint -// - 'f4' for 4-byte fixed -// - 'f8' for 8-byte fixed -// - 'm' for sub-message -// - 's' for string (validate UTF-8) -// - 'b' for bytes -// -// In position 4 (tag length): -// - '1' for one-byte tags (field numbers 1-15) -// - '2' for two-byte tags (field numbers 16-2048) +// This header is deprecated, use upb/wire/decode_fast.h instead +// IWYU pragma: private, include "upb/wire/decode_fast.h" #ifndef UPB_DECODE_FAST_H_ #define UPB_DECODE_FAST_H_ -#include "upb/msg.h" - -struct upb_Decoder; - -// The fallback, generic parsing function that can handle any field type. -// This just uses the regular (non-fast) parser to parse a single field. -const char* fastdecode_generic(struct upb_Decoder* d, const char* ptr, - upb_Message* msg, intptr_t table, - uint64_t hasbits, uint64_t data); - -#define UPB_PARSE_PARAMS \ - struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \ - uint64_t hasbits, uint64_t data - -/* primitive fields ***********************************************************/ - -#define F(card, type, valbytes, tagbytes) \ - const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS); - -#define TYPES(card, tagbytes) \ - F(card, b, 1, tagbytes) \ - F(card, v, 4, tagbytes) \ - F(card, v, 8, tagbytes) \ - F(card, z, 4, tagbytes) \ - F(card, z, 8, tagbytes) \ - F(card, f, 4, tagbytes) \ - F(card, f, 8, tagbytes) - -#define TAGBYTES(card) \ - TYPES(card, 1) \ - TYPES(card, 2) - -TAGBYTES(s) -TAGBYTES(o) -TAGBYTES(r) -TAGBYTES(p) - -#undef F -#undef TYPES -#undef TAGBYTES - -/* string fields **************************************************************/ - -#define F(card, tagbytes, type) \ - const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \ - const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); - -#define UTF8(card, tagbytes) \ - F(card, tagbytes, s) \ - F(card, tagbytes, b) - -#define TAGBYTES(card) \ - UTF8(card, 1) \ - UTF8(card, 2) - -TAGBYTES(s) -TAGBYTES(o) -TAGBYTES(r) - -#undef F -#undef TAGBYTES - -/* sub-message fields *********************************************************/ - -#define F(card, tagbytes, size_ceil, ceil_arg) \ - const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS); - -#define SIZES(card, tagbytes) \ - F(card, tagbytes, 64, 64) \ - F(card, tagbytes, 128, 128) \ - F(card, tagbytes, 192, 192) \ - F(card, tagbytes, 256, 256) \ - F(card, tagbytes, max, -1) - -#define TAGBYTES(card) \ - SIZES(card, 1) \ - SIZES(card, 2) - -TAGBYTES(s) -TAGBYTES(o) -TAGBYTES(r) - -#undef TAGBYTES -#undef SIZES -#undef F - -#undef UPB_PARSE_PARAMS +#include "upb/wire/decode_fast.h" #endif /* UPB_DECODE_FAST_H_ */ diff --git a/third_party/upb/upb/def.c b/third_party/upb/upb/def.c deleted file mode 100644 index 6ddc45bbbb2..00000000000 --- a/third_party/upb/upb/def.c +++ /dev/null @@ -1,3269 +0,0 @@ -/* - * Copyright (c) 2009-2021, Google LLC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Google LLC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "upb/def.h" - -#include -#include -#include -#include -#include - -#include "google/protobuf/descriptor.upb.h" -#include "upb/mini_table.h" -#include "upb/reflection.h" - -/* Must be last. */ -#include "upb/port_def.inc" - -typedef struct { - size_t len; - char str[1]; /* Null-terminated string data follows. */ -} str_t; - -/* The upb core does not generally have a concept of default instances. However - * for descriptor options we make an exception since the max size is known and - * modest (<200 bytes). All types can share a default instance since it is - * initialized to zeroes. - * - * We have to allocate an extra pointer for upb's internal metadata. */ -static const char opt_default_buf[_UPB_MAXOPT_SIZE + sizeof(void*)] = {0}; -static const char* opt_default = &opt_default_buf[sizeof(void*)]; - -struct upb_FieldDef { - const google_protobuf_FieldOptions* opts; - const upb_FileDef* file; - const upb_MessageDef* msgdef; - const char* full_name; - const char* json_name; - union { - int64_t sint; - uint64_t uint; - double dbl; - float flt; - bool boolean; - str_t* str; - } defaultval; - union { - const upb_OneofDef* oneof; - const upb_MessageDef* extension_scope; - } scope; - union { - const upb_MessageDef* msgdef; - const upb_EnumDef* enumdef; - const google_protobuf_FieldDescriptorProto* unresolved; - } sub; - uint32_t number_; - uint16_t index_; - uint16_t layout_index; /* Index into msgdef->layout->fields or file->exts */ - bool has_default; - bool is_extension_; - bool packed_; - bool proto3_optional_; - bool has_json_name_; - upb_FieldType type_; - upb_Label label_; -#if UINTPTR_MAX == 0xffffffff - uint32_t padding; // Increase size to a multiple of 8. -#endif -}; - -struct upb_ExtensionRange { - const google_protobuf_ExtensionRangeOptions* opts; - int32_t start; - int32_t end; -}; - -struct upb_MessageDef { - const google_protobuf_MessageOptions* opts; - const upb_MiniTable* layout; - const upb_FileDef* file; - const upb_MessageDef* containing_type; - const char* full_name; - - /* Tables for looking up fields by number and name. */ - upb_inttable itof; - upb_strtable ntof; - - /* All nested defs. - * MEM: We could save some space here by putting nested defs in a contiguous - * region and calculating counts from offsets or vice-versa. */ - const upb_FieldDef* fields; - const upb_OneofDef* oneofs; - const upb_ExtensionRange* ext_ranges; - const upb_MessageDef* nested_msgs; - const upb_EnumDef* nested_enums; - const upb_FieldDef* nested_exts; - int field_count; - int real_oneof_count; - int oneof_count; - int ext_range_count; - int nested_msg_count; - int nested_enum_count; - int nested_ext_count; - bool in_message_set; - upb_WellKnown well_known_type; -#if UINTPTR_MAX == 0xffffffff - uint32_t padding; // Increase size to a multiple of 8. -#endif -}; - -struct upb_EnumDef { - const google_protobuf_EnumOptions* opts; - const upb_MiniTable_Enum* layout; // Only for proto2. - const upb_FileDef* file; - const upb_MessageDef* containing_type; // Could be merged with "file". - const char* full_name; - upb_strtable ntoi; - upb_inttable iton; - const upb_EnumValueDef* values; - int value_count; - int32_t defaultval; -#if UINTPTR_MAX == 0xffffffff - uint32_t padding; // Increase size to a multiple of 8. -#endif -}; - -struct upb_EnumValueDef { - const google_protobuf_EnumValueOptions* opts; - const upb_EnumDef* parent; - const char* full_name; - int32_t number; -}; - -struct upb_OneofDef { - const google_protobuf_OneofOptions* opts; - const upb_MessageDef* parent; - const char* full_name; - int field_count; - bool synthetic; - const upb_FieldDef** fields; - upb_strtable ntof; - upb_inttable itof; -#if UINTPTR_MAX == 0xffffffff - uint32_t padding; // Increase size to a multiple of 8. -#endif -}; - -struct upb_FileDef { - const google_protobuf_FileOptions* opts; - const char* name; - const char* package; - - const upb_FileDef** deps; - const int32_t* public_deps; - const int32_t* weak_deps; - const upb_MessageDef* top_lvl_msgs; - const upb_EnumDef* top_lvl_enums; - const upb_FieldDef* top_lvl_exts; - const upb_ServiceDef* services; - const upb_MiniTable_Extension** ext_layouts; - const upb_DefPool* symtab; - - int dep_count; - int public_dep_count; - int weak_dep_count; - int top_lvl_msg_count; - int top_lvl_enum_count; - int top_lvl_ext_count; - int service_count; - int ext_count; /* All exts in the file. */ - upb_Syntax syntax; -}; - -struct upb_MethodDef { - const google_protobuf_MethodOptions* opts; - upb_ServiceDef* service; - const char* full_name; - const upb_MessageDef* input_type; - const upb_MessageDef* output_type; - int index; - bool client_streaming; - bool server_streaming; -}; - -struct upb_ServiceDef { - const google_protobuf_ServiceOptions* opts; - const upb_FileDef* file; - const char* full_name; - upb_MethodDef* methods; - int method_count; - int index; -}; - -struct upb_DefPool { - upb_Arena* arena; - upb_strtable syms; /* full_name -> packed def ptr */ - upb_strtable files; /* file_name -> upb_FileDef* */ - upb_inttable exts; /* upb_MiniTable_Extension* -> upb_FieldDef* */ - upb_ExtensionRegistry* extreg; - size_t bytes_loaded; -}; - -/* Inside a symtab we store tagged pointers to specific def types. */ -typedef enum { - UPB_DEFTYPE_MASK = 7, - - /* Only inside symtab table. */ - UPB_DEFTYPE_EXT = 0, - UPB_DEFTYPE_MSG = 1, - UPB_DEFTYPE_ENUM = 2, - UPB_DEFTYPE_ENUMVAL = 3, - UPB_DEFTYPE_SERVICE = 4, - - /* Only inside message table. */ - UPB_DEFTYPE_FIELD = 0, - UPB_DEFTYPE_ONEOF = 1, - UPB_DEFTYPE_FIELD_JSONNAME = 2, - - /* Only inside file table. */ - UPB_DEFTYPE_FILE = 0, - UPB_DEFTYPE_LAYOUT = 1 -} upb_deftype_t; - -#define FIELD_TYPE_UNSPECIFIED 0 - -static upb_deftype_t deftype(upb_value v) { - uintptr_t num = (uintptr_t)upb_value_getconstptr(v); - return num & UPB_DEFTYPE_MASK; -} - -static const void* unpack_def(upb_value v, upb_deftype_t type) { - uintptr_t num = (uintptr_t)upb_value_getconstptr(v); - return (num & UPB_DEFTYPE_MASK) == type - ? (const void*)(num & ~UPB_DEFTYPE_MASK) - : NULL; -} - -static upb_value pack_def(const void* ptr, upb_deftype_t type) { - // Our 3-bit pointer tagging requires all pointers to be multiples of 8. - // The arena will always yield 8-byte-aligned addresses, however we put - // the defs into arrays. For each element in the array to be 8-byte-aligned, - // the sizes of each def type must also be a multiple of 8. - // - // If any of these asserts fail, we need to add or remove padding on 32-bit - // machines (64-bit machines will have 8-byte alignment already due to - // pointers, which all of these structs have). - UPB_ASSERT((sizeof(upb_FieldDef) & UPB_DEFTYPE_MASK) == 0); - UPB_ASSERT((sizeof(upb_MessageDef) & UPB_DEFTYPE_MASK) == 0); - UPB_ASSERT((sizeof(upb_EnumDef) & UPB_DEFTYPE_MASK) == 0); - UPB_ASSERT((sizeof(upb_EnumValueDef) & UPB_DEFTYPE_MASK) == 0); - UPB_ASSERT((sizeof(upb_ServiceDef) & UPB_DEFTYPE_MASK) == 0); - UPB_ASSERT((sizeof(upb_OneofDef) & UPB_DEFTYPE_MASK) == 0); - uintptr_t num = (uintptr_t)ptr; - UPB_ASSERT((num & UPB_DEFTYPE_MASK) == 0); - num |= type; - return upb_value_constptr((const void*)num); -} - -/* isalpha() etc. from are locale-dependent, which we don't want. */ -static bool upb_isbetween(uint8_t c, uint8_t low, uint8_t high) { - return c >= low && c <= high; -} - -static char upb_ascii_lower(char ch) { - // Per ASCII this will lower-case a letter. If the result is a letter, the - // input was definitely a letter. If the output is not a letter, this may - // have transformed the character unpredictably. - return ch | 0x20; -} - -static bool upb_isletter(char c) { - char lower = upb_ascii_lower(c); - return upb_isbetween(lower, 'a', 'z') || c == '_'; -} - -static bool upb_isalphanum(char c) { - return upb_isletter(c) || upb_isbetween(c, '0', '9'); -} - -static const char* shortdefname(const char* fullname) { - const char* p; - - if (fullname == NULL) { - return NULL; - } else if ((p = strrchr(fullname, '.')) == NULL) { - /* No '.' in the name, return the full string. */ - return fullname; - } else { - /* Return one past the last '.'. */ - return p + 1; - } -} - -/* All submessage fields are lower than all other fields. - * Secondly, fields are increasing in order. */ -uint32_t field_rank(const upb_FieldDef* f) { - uint32_t ret = upb_FieldDef_Number(f); - const uint32_t high_bit = 1 << 30; - UPB_ASSERT(ret < high_bit); - if (!upb_FieldDef_IsSubMessage(f)) ret |= high_bit; - return ret; -} - -int cmp_fields(const void* p1, const void* p2) { - const upb_FieldDef* f1 = *(upb_FieldDef* const*)p1; - const upb_FieldDef* f2 = *(upb_FieldDef* const*)p2; - return field_rank(f1) - field_rank(f2); -} - -static void upb_Status_setoom(upb_Status* status) { - upb_Status_SetErrorMessage(status, "out of memory"); -} - -static void assign_msg_wellknowntype(upb_MessageDef* m) { - const char* name = upb_MessageDef_FullName(m); - if (name == NULL) { - m->well_known_type = kUpb_WellKnown_Unspecified; - return; - } - if (!strcmp(name, "google.protobuf.Any")) { - m->well_known_type = kUpb_WellKnown_Any; - } else if (!strcmp(name, "google.protobuf.FieldMask")) { - m->well_known_type = kUpb_WellKnown_FieldMask; - } else if (!strcmp(name, "google.protobuf.Duration")) { - m->well_known_type = kUpb_WellKnown_Duration; - } else if (!strcmp(name, "google.protobuf.Timestamp")) { - m->well_known_type = kUpb_WellKnown_Timestamp; - } else if (!strcmp(name, "google.protobuf.DoubleValue")) { - m->well_known_type = kUpb_WellKnown_DoubleValue; - } else if (!strcmp(name, "google.protobuf.FloatValue")) { - m->well_known_type = kUpb_WellKnown_FloatValue; - } else if (!strcmp(name, "google.protobuf.Int64Value")) { - m->well_known_type = kUpb_WellKnown_Int64Value; - } else if (!strcmp(name, "google.protobuf.UInt64Value")) { - m->well_known_type = kUpb_WellKnown_UInt64Value; - } else if (!strcmp(name, "google.protobuf.Int32Value")) { - m->well_known_type = kUpb_WellKnown_Int32Value; - } else if (!strcmp(name, "google.protobuf.UInt32Value")) { - m->well_known_type = kUpb_WellKnown_UInt32Value; - } else if (!strcmp(name, "google.protobuf.BoolValue")) { - m->well_known_type = kUpb_WellKnown_BoolValue; - } else if (!strcmp(name, "google.protobuf.StringValue")) { - m->well_known_type = kUpb_WellKnown_StringValue; - } else if (!strcmp(name, "google.protobuf.BytesValue")) { - m->well_known_type = kUpb_WellKnown_BytesValue; - } else if (!strcmp(name, "google.protobuf.Value")) { - m->well_known_type = kUpb_WellKnown_Value; - } else if (!strcmp(name, "google.protobuf.ListValue")) { - m->well_known_type = kUpb_WellKnown_ListValue; - } else if (!strcmp(name, "google.protobuf.Struct")) { - m->well_known_type = kUpb_WellKnown_Struct; - } else { - m->well_known_type = kUpb_WellKnown_Unspecified; - } -} - -/* upb_EnumDef ****************************************************************/ - -const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e) { - return e->opts; -} - -bool upb_EnumDef_HasOptions(const upb_EnumDef* e) { - return e->opts != (void*)opt_default; -} - -const char* upb_EnumDef_FullName(const upb_EnumDef* e) { return e->full_name; } - -const char* upb_EnumDef_Name(const upb_EnumDef* e) { - return shortdefname(e->full_name); -} - -const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e) { return e->file; } - -const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e) { - return e->containing_type; -} - -int32_t upb_EnumDef_Default(const upb_EnumDef* e) { - UPB_ASSERT(upb_EnumDef_FindValueByNumber(e, e->defaultval)); - return e->defaultval; -} - -int upb_EnumDef_ValueCount(const upb_EnumDef* e) { return e->value_count; } - -const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize( - const upb_EnumDef* def, const char* name, size_t len) { - upb_value v; - return upb_strtable_lookup2(&def->ntoi, name, len, &v) - ? upb_value_getconstptr(v) - : NULL; -} - -const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* def, - int32_t num) { - upb_value v; - return upb_inttable_lookup(&def->iton, num, &v) ? upb_value_getconstptr(v) - : NULL; -} - -bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num) { - // We could use upb_EnumDef_FindValueByNumber(e, num) != NULL, but we expect - // this to be faster (especially for small numbers). - return upb_MiniTable_Enum_CheckValue(e->layout, num); -} - -const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i) { - UPB_ASSERT(0 <= i && i < e->value_count); - return &e->values[i]; -} - -/* upb_EnumValueDef ***********************************************************/ - -const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options( - const upb_EnumValueDef* e) { - return e->opts; -} - -bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* e) { - return e->opts != (void*)opt_default; -} - -const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* ev) { - return ev->parent; -} - -const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* ev) { - return ev->full_name; -} - -const char* upb_EnumValueDef_Name(const upb_EnumValueDef* ev) { - return shortdefname(ev->full_name); -} - -int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* ev) { - return ev->number; -} - -uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* ev) { - // Compute index in our parent's array. - return ev - ev->parent->values; -} - -/* upb_ExtensionRange - * ***************************************************************/ - -const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options( - const upb_ExtensionRange* r) { - return r->opts; -} - -bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r) { - return r->opts != (void*)opt_default; -} - -int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* e) { - return e->start; -} - -int32_t upb_ExtensionRange_End(const upb_ExtensionRange* e) { return e->end; } - -/* upb_FieldDef ***************************************************************/ - -const google_protobuf_FieldOptions* upb_FieldDef_Options( - const upb_FieldDef* f) { - return f->opts; -} - -bool upb_FieldDef_HasOptions(const upb_FieldDef* f) { - return f->opts != (void*)opt_default; -} - -const char* upb_FieldDef_FullName(const upb_FieldDef* f) { - return f->full_name; -} - -upb_CType upb_FieldDef_CType(const upb_FieldDef* f) { - switch (f->type_) { - case kUpb_FieldType_Double: - return kUpb_CType_Double; - case kUpb_FieldType_Float: - return kUpb_CType_Float; - case kUpb_FieldType_Int64: - case kUpb_FieldType_SInt64: - case kUpb_FieldType_SFixed64: - return kUpb_CType_Int64; - case kUpb_FieldType_Int32: - case kUpb_FieldType_SFixed32: - case kUpb_FieldType_SInt32: - return kUpb_CType_Int32; - case kUpb_FieldType_UInt64: - case kUpb_FieldType_Fixed64: - return kUpb_CType_UInt64; - case kUpb_FieldType_UInt32: - case kUpb_FieldType_Fixed32: - return kUpb_CType_UInt32; - case kUpb_FieldType_Enum: - return kUpb_CType_Enum; - case kUpb_FieldType_Bool: - return kUpb_CType_Bool; - case kUpb_FieldType_String: - return kUpb_CType_String; - case kUpb_FieldType_Bytes: - return kUpb_CType_Bytes; - case kUpb_FieldType_Group: - case kUpb_FieldType_Message: - return kUpb_CType_Message; - } - UPB_UNREACHABLE(); -} - -upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) { return f->type_; } - -uint32_t upb_FieldDef_Index(const upb_FieldDef* f) { return f->index_; } - -upb_Label upb_FieldDef_Label(const upb_FieldDef* f) { return f->label_; } - -uint32_t upb_FieldDef_Number(const upb_FieldDef* f) { return f->number_; } - -bool upb_FieldDef_IsExtension(const upb_FieldDef* f) { - return f->is_extension_; -} - -bool upb_FieldDef_IsPacked(const upb_FieldDef* f) { return f->packed_; } - -const char* upb_FieldDef_Name(const upb_FieldDef* f) { - return shortdefname(f->full_name); -} - -const char* upb_FieldDef_JsonName(const upb_FieldDef* f) { - return f->json_name; -} - -bool upb_FieldDef_HasJsonName(const upb_FieldDef* f) { - return f->has_json_name_; -} - -const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f) { return f->file; } - -const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f) { - return f->msgdef; -} - -const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f) { - return f->is_extension_ ? f->scope.extension_scope : NULL; -} - -const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f) { - return f->is_extension_ ? NULL : f->scope.oneof; -} - -const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f) { - const upb_OneofDef* oneof = upb_FieldDef_ContainingOneof(f); - if (!oneof || upb_OneofDef_IsSynthetic(oneof)) return NULL; - return oneof; -} - -upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f) { - UPB_ASSERT(!upb_FieldDef_IsSubMessage(f)); - upb_MessageValue ret; - - switch (upb_FieldDef_CType(f)) { - case kUpb_CType_Bool: - return (upb_MessageValue){.bool_val = f->defaultval.boolean}; - case kUpb_CType_Int64: - return (upb_MessageValue){.int64_val = f->defaultval.sint}; - case kUpb_CType_UInt64: - return (upb_MessageValue){.uint64_val = f->defaultval.uint}; - case kUpb_CType_Enum: - case kUpb_CType_Int32: - return (upb_MessageValue){.int32_val = (int32_t)f->defaultval.sint}; - case kUpb_CType_UInt32: - return (upb_MessageValue){.uint32_val = (uint32_t)f->defaultval.uint}; - case kUpb_CType_Float: - return (upb_MessageValue){.float_val = f->defaultval.flt}; - case kUpb_CType_Double: - return (upb_MessageValue){.double_val = f->defaultval.dbl}; - case kUpb_CType_String: - case kUpb_CType_Bytes: { - str_t* str = f->defaultval.str; - if (str) { - return (upb_MessageValue){ - .str_val = (upb_StringView){.data = str->str, .size = str->len}}; - } else { - return (upb_MessageValue){ - .str_val = (upb_StringView){.data = NULL, .size = 0}}; - } - } - default: - UPB_UNREACHABLE(); - } - - return ret; -} - -const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f) { - return upb_FieldDef_CType(f) == kUpb_CType_Message ? f->sub.msgdef : NULL; -} - -const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f) { - return upb_FieldDef_CType(f) == kUpb_CType_Enum ? f->sub.enumdef : NULL; -} - -const upb_MiniTable_Field* upb_FieldDef_MiniTable(const upb_FieldDef* f) { - UPB_ASSERT(!upb_FieldDef_IsExtension(f)); - return &f->msgdef->layout->fields[f->layout_index]; -} - -const upb_MiniTable_Extension* _upb_FieldDef_ExtensionMiniTable( - const upb_FieldDef* f) { - UPB_ASSERT(upb_FieldDef_IsExtension(f)); - return f->file->ext_layouts[f->layout_index]; -} - -bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f) { - return f->proto3_optional_; -} - -bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f) { - return upb_FieldDef_CType(f) == kUpb_CType_Message; -} - -bool upb_FieldDef_IsString(const upb_FieldDef* f) { - return upb_FieldDef_CType(f) == kUpb_CType_String || - 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; -} - -bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f) { - return !upb_FieldDef_IsString(f) && !upb_FieldDef_IsSubMessage(f); -} - -bool upb_FieldDef_IsMap(const upb_FieldDef* f) { - return upb_FieldDef_IsRepeated(f) && upb_FieldDef_IsSubMessage(f) && - upb_MessageDef_IsMapEntry(upb_FieldDef_MessageSubDef(f)); -} - -bool upb_FieldDef_HasDefault(const upb_FieldDef* f) { return f->has_default; } - -bool upb_FieldDef_HasSubDef(const upb_FieldDef* f) { - return upb_FieldDef_IsSubMessage(f) || - upb_FieldDef_CType(f) == kUpb_CType_Enum; -} - -bool upb_FieldDef_HasPresence(const upb_FieldDef* f) { - if (upb_FieldDef_IsRepeated(f)) return false; - return upb_FieldDef_IsSubMessage(f) || upb_FieldDef_ContainingOneof(f) || - f->file->syntax == kUpb_Syntax_Proto2; -} - -static bool between(int32_t x, int32_t low, int32_t high) { - return x >= low && x <= high; -} - -bool upb_FieldDef_checklabel(int32_t label) { return between(label, 1, 3); } -bool upb_FieldDef_checktype(int32_t type) { return between(type, 1, 11); } -bool upb_FieldDef_checkintfmt(int32_t fmt) { return between(fmt, 1, 3); } - -bool upb_FieldDef_checkdescriptortype(int32_t type) { - return between(type, 1, 18); -} - -/* upb_MessageDef - * *****************************************************************/ - -const google_protobuf_MessageOptions* upb_MessageDef_Options( - const upb_MessageDef* m) { - return m->opts; -} - -bool upb_MessageDef_HasOptions(const upb_MessageDef* m) { - return m->opts != (void*)opt_default; -} - -const char* upb_MessageDef_FullName(const upb_MessageDef* m) { - return m->full_name; -} - -const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m) { - return m->file; -} - -const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m) { - return m->containing_type; -} - -const char* upb_MessageDef_Name(const upb_MessageDef* m) { - return shortdefname(m->full_name); -} - -upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m) { - return m->file->syntax; -} - -const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m, - uint32_t i) { - upb_value val; - return upb_inttable_lookup(&m->itof, i, &val) ? upb_value_getconstptr(val) - : NULL; -} - -const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize( - const upb_MessageDef* m, const char* name, size_t len) { - upb_value val; - - if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) { - return NULL; - } - - return unpack_def(val, UPB_DEFTYPE_FIELD); -} - -const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize( - const upb_MessageDef* m, const char* name, size_t len) { - upb_value val; - - if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) { - return NULL; - } - - return unpack_def(val, UPB_DEFTYPE_ONEOF); -} - -bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m, - const char* name, size_t len, - const upb_FieldDef** out_f, - const upb_OneofDef** out_o) { - upb_value val; - - if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) { - return false; - } - - const upb_FieldDef* f = unpack_def(val, UPB_DEFTYPE_FIELD); - const upb_OneofDef* o = unpack_def(val, UPB_DEFTYPE_ONEOF); - if (out_f) *out_f = f; - if (out_o) *out_o = o; - return f || o; /* False if this was a JSON name. */ -} - -const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize( - const upb_MessageDef* m, const char* name, size_t len) { - upb_value val; - const upb_FieldDef* f; - - if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) { - return NULL; - } - - f = unpack_def(val, UPB_DEFTYPE_FIELD); - if (!f) f = unpack_def(val, UPB_DEFTYPE_FIELD_JSONNAME); - - return f; -} - -int upb_MessageDef_numfields(const upb_MessageDef* m) { return m->field_count; } - -int upb_MessageDef_numoneofs(const upb_MessageDef* m) { return m->oneof_count; } - -int upb_MessageDef_numrealoneofs(const upb_MessageDef* m) { - return m->real_oneof_count; -} - -int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m) { - return m->ext_range_count; -} - -int upb_MessageDef_FieldCount(const upb_MessageDef* m) { - return m->field_count; -} - -int upb_MessageDef_OneofCount(const upb_MessageDef* m) { - return m->oneof_count; -} - -int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m) { - return m->nested_msg_count; -} - -int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m) { - return m->nested_enum_count; -} - -int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m) { - return m->nested_ext_count; -} - -int upb_MessageDef_realoneofcount(const upb_MessageDef* m) { - return m->real_oneof_count; -} - -const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m) { - return m->layout; -} - -const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m, - int i) { - UPB_ASSERT(0 <= i && i < m->ext_range_count); - return &m->ext_ranges[i]; -} - -const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i) { - UPB_ASSERT(0 <= i && i < m->field_count); - return &m->fields[i]; -} - -const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i) { - UPB_ASSERT(0 <= i && i < m->oneof_count); - return &m->oneofs[i]; -} - -const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m, - int i) { - UPB_ASSERT(0 <= i && i < m->nested_msg_count); - return &m->nested_msgs[i]; -} - -const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i) { - UPB_ASSERT(0 <= i && i < m->nested_enum_count); - return &m->nested_enums[i]; -} - -const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m, - int i) { - UPB_ASSERT(0 <= i && i < m->nested_ext_count); - return &m->nested_exts[i]; -} - -upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m) { - return m->well_known_type; -} - -/* upb_OneofDef ***************************************************************/ - -const google_protobuf_OneofOptions* upb_OneofDef_Options( - const upb_OneofDef* o) { - return o->opts; -} - -bool upb_OneofDef_HasOptions(const upb_OneofDef* o) { - return o->opts != (void*)opt_default; -} - -const char* upb_OneofDef_Name(const upb_OneofDef* o) { - return shortdefname(o->full_name); -} - -const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o) { - return o->parent; -} - -int upb_OneofDef_FieldCount(const upb_OneofDef* o) { return o->field_count; } - -const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i) { - UPB_ASSERT(i < o->field_count); - return o->fields[i]; -} - -int upb_OneofDef_numfields(const upb_OneofDef* o) { return o->field_count; } - -uint32_t upb_OneofDef_Index(const upb_OneofDef* o) { - // Compute index in our parent's array. - return o - o->parent->oneofs; -} - -bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o) { return o->synthetic; } - -const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o, - const char* name, - size_t length) { - upb_value val; - return upb_strtable_lookup2(&o->ntof, name, length, &val) - ? upb_value_getptr(val) - : NULL; -} - -const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, - uint32_t num) { - upb_value val; - return upb_inttable_lookup(&o->itof, num, &val) ? upb_value_getptr(val) - : NULL; -} - -/* upb_FileDef ****************************************************************/ - -const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f) { - return f->opts; -} - -bool upb_FileDef_HasOptions(const upb_FileDef* f) { - return f->opts != (void*)opt_default; -} - -const char* upb_FileDef_Name(const upb_FileDef* f) { return f->name; } - -const char* upb_FileDef_Package(const upb_FileDef* f) { return f->package; } - -upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f) { return f->syntax; } - -int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f) { - return f->top_lvl_msg_count; -} - -int upb_FileDef_DependencyCount(const upb_FileDef* f) { return f->dep_count; } - -int upb_FileDef_PublicDependencyCount(const upb_FileDef* f) { - return f->public_dep_count; -} - -int upb_FileDef_WeakDependencyCount(const upb_FileDef* f) { - return f->weak_dep_count; -} - -const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f) { - return f->public_deps; -} - -const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f) { - return f->weak_deps; -} - -int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f) { - return f->top_lvl_enum_count; -} - -int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f) { - return f->top_lvl_ext_count; -} - -int upb_FileDef_ServiceCount(const upb_FileDef* f) { return f->service_count; } - -const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->dep_count); - return f->deps[i]; -} - -const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->public_dep_count); - return f->deps[f->public_deps[i]]; -} - -const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->public_dep_count); - return f->deps[f->weak_deps[i]]; -} - -const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->top_lvl_msg_count); - return &f->top_lvl_msgs[i]; -} - -const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->top_lvl_enum_count); - return &f->top_lvl_enums[i]; -} - -const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->top_lvl_ext_count); - return &f->top_lvl_exts[i]; -} - -const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i) { - UPB_ASSERT(0 <= i && i < f->service_count); - return &f->services[i]; -} - -const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f) { return f->symtab; } - -/* upb_MethodDef **************************************************************/ - -const google_protobuf_MethodOptions* upb_MethodDef_Options( - const upb_MethodDef* m) { - return m->opts; -} - -bool upb_MethodDef_HasOptions(const upb_MethodDef* m) { - return m->opts != (void*)opt_default; -} - -const char* upb_MethodDef_FullName(const upb_MethodDef* m) { - return m->full_name; -} - -int upb_MethodDef_Index(const upb_MethodDef* m) { return m->index; } - -const char* upb_MethodDef_Name(const upb_MethodDef* m) { - return shortdefname(m->full_name); -} - -const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m) { - return m->service; -} - -const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m) { - return m->input_type; -} - -const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m) { - return m->output_type; -} - -bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m) { - return m->client_streaming; -} - -bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m) { - return m->server_streaming; -} - -/* upb_ServiceDef *************************************************************/ - -const google_protobuf_ServiceOptions* upb_ServiceDef_Options( - const upb_ServiceDef* s) { - return s->opts; -} - -bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s) { - return s->opts != (void*)opt_default; -} - -const char* upb_ServiceDef_FullName(const upb_ServiceDef* s) { - return s->full_name; -} - -const char* upb_ServiceDef_Name(const upb_ServiceDef* s) { - return shortdefname(s->full_name); -} - -int upb_ServiceDef_Index(const upb_ServiceDef* s) { return s->index; } - -const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s) { - return s->file; -} - -int upb_ServiceDef_MethodCount(const upb_ServiceDef* s) { - return s->method_count; -} - -const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i) { - return i < 0 || i >= s->method_count ? NULL : &s->methods[i]; -} - -const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, - const char* name) { - for (int i = 0; i < s->method_count; i++) { - if (strcmp(name, upb_MethodDef_Name(&s->methods[i])) == 0) { - return &s->methods[i]; - } - } - return NULL; -} - -/* upb_DefPool ****************************************************************/ - -void upb_DefPool_Free(upb_DefPool* s) { - upb_Arena_Free(s->arena); - upb_gfree(s); -} - -upb_DefPool* upb_DefPool_New(void) { - upb_DefPool* s = upb_gmalloc(sizeof(*s)); - - if (!s) { - return NULL; - } - - s->arena = upb_Arena_New(); - s->bytes_loaded = 0; - - if (!upb_strtable_init(&s->syms, 32, s->arena) || - !upb_strtable_init(&s->files, 4, s->arena) || - !upb_inttable_init(&s->exts, s->arena)) { - goto err; - } - - s->extreg = upb_ExtensionRegistry_New(s->arena); - if (!s->extreg) goto err; - return s; - -err: - upb_Arena_Free(s->arena); - upb_gfree(s); - return NULL; -} - -static const void* symtab_lookup(const upb_DefPool* s, const char* sym, - upb_deftype_t type) { - upb_value v; - return upb_strtable_lookup(&s->syms, sym, &v) ? unpack_def(v, type) : NULL; -} - -static const void* symtab_lookup2(const upb_DefPool* s, const char* sym, - size_t size, upb_deftype_t type) { - upb_value v; - return upb_strtable_lookup2(&s->syms, sym, size, &v) ? unpack_def(v, type) - : NULL; -} - -const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s, - const char* sym) { - return symtab_lookup(s, sym, UPB_DEFTYPE_MSG); -} - -const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize( - const upb_DefPool* s, const char* sym, size_t len) { - return symtab_lookup2(s, sym, len, UPB_DEFTYPE_MSG); -} - -const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s, - const char* sym) { - return symtab_lookup(s, sym, UPB_DEFTYPE_ENUM); -} - -const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s, - const char* sym) { - return symtab_lookup(s, sym, UPB_DEFTYPE_ENUMVAL); -} - -const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s, - const char* name) { - upb_value v; - return upb_strtable_lookup(&s->files, name, &v) - ? unpack_def(v, UPB_DEFTYPE_FILE) - : NULL; -} - -const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s, - const char* name, - size_t len) { - upb_value v; - return upb_strtable_lookup2(&s->files, name, len, &v) - ? unpack_def(v, UPB_DEFTYPE_FILE) - : NULL; -} - -const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( - const upb_DefPool* s, const char* name, size_t size) { - upb_value v; - if (!upb_strtable_lookup2(&s->syms, name, size, &v)) return NULL; - - switch (deftype(v)) { - case UPB_DEFTYPE_FIELD: - return unpack_def(v, UPB_DEFTYPE_FIELD); - case UPB_DEFTYPE_MSG: { - const upb_MessageDef* m = unpack_def(v, UPB_DEFTYPE_MSG); - return m->in_message_set ? &m->nested_exts[0] : NULL; - } - default: - break; - } - - return NULL; -} - -const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s, - const char* sym) { - return upb_DefPool_FindExtensionByNameWithSize(s, sym, strlen(sym)); -} - -const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s, - const char* name) { - return symtab_lookup(s, name, UPB_DEFTYPE_SERVICE); -} - -const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( - const upb_DefPool* s, const char* name, size_t size) { - return symtab_lookup2(s, name, size, UPB_DEFTYPE_SERVICE); -} - -const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, - const char* name) { - upb_value v; - // TODO(haberman): non-extension fields and oneofs. - if (upb_strtable_lookup(&s->syms, name, &v)) { - switch (deftype(v)) { - case UPB_DEFTYPE_EXT: { - const upb_FieldDef* f = unpack_def(v, UPB_DEFTYPE_EXT); - return upb_FieldDef_File(f); - } - case UPB_DEFTYPE_MSG: { - const upb_MessageDef* m = unpack_def(v, UPB_DEFTYPE_MSG); - return upb_MessageDef_File(m); - } - case UPB_DEFTYPE_ENUM: { - const upb_EnumDef* e = unpack_def(v, UPB_DEFTYPE_ENUM); - return upb_EnumDef_File(e); - } - case UPB_DEFTYPE_ENUMVAL: { - const upb_EnumValueDef* ev = unpack_def(v, UPB_DEFTYPE_ENUMVAL); - return upb_EnumDef_File(upb_EnumValueDef_Enum(ev)); - } - case UPB_DEFTYPE_SERVICE: { - const upb_ServiceDef* service = unpack_def(v, UPB_DEFTYPE_SERVICE); - return upb_ServiceDef_File(service); - } - default: - UPB_UNREACHABLE(); - } - } - - const char* last_dot = strrchr(name, '.'); - if (last_dot) { - const upb_MessageDef* parent = - upb_DefPool_FindMessageByNameWithSize(s, name, last_dot - name); - if (parent) { - const char* shortname = last_dot + 1; - if (upb_MessageDef_FindByNameWithSize(parent, shortname, - strlen(shortname), NULL, NULL)) { - return upb_MessageDef_File(parent); - } - } - } - - return NULL; -} - -/* Code to build defs from descriptor protos. *********************************/ - -/* There is a question of how much validation to do here. It will be difficult - * to perfectly match the amount of validation performed by proto2. But since - * this code is used to directly build defs from Ruby (for example) we do need - * to validate important constraints like uniqueness of names and numbers. */ - -#define CHK_OOM(x) \ - if (!(x)) { \ - symtab_oomerr(ctx); \ - } - -typedef struct { - upb_DefPool* symtab; - upb_FileDef* file; /* File we are building. */ - upb_Arena* arena; /* Allocate defs here. */ - upb_Arena* tmp_arena; /* For temporary allocations. */ - const upb_MiniTable_File* layout; /* NULL if we should build layouts. */ - int enum_count; /* Count of enums built so far. */ - int msg_count; /* Count of messages built so far. */ - int ext_count; /* Count of extensions built so far. */ - upb_Status* status; /* Record errors here. */ - jmp_buf err; /* longjmp() on error. */ -} symtab_addctx; - -UPB_NORETURN UPB_NOINLINE UPB_PRINTF(2, 3) static void symtab_errf( - symtab_addctx* ctx, const char* fmt, ...) { - va_list argp; - va_start(argp, fmt); - upb_Status_VSetErrorFormat(ctx->status, fmt, argp); - va_end(argp); - UPB_LONGJMP(ctx->err, 1); -} - -UPB_NORETURN UPB_NOINLINE static void symtab_oomerr(symtab_addctx* ctx) { - upb_Status_setoom(ctx->status); - UPB_LONGJMP(ctx->err, 1); -} - -void* symtab_alloc(symtab_addctx* ctx, size_t bytes) { - if (bytes == 0) return NULL; - void* ret = upb_Arena_Malloc(ctx->arena, bytes); - if (!ret) symtab_oomerr(ctx); - return ret; -} - -// We want to copy the options verbatim into the destination options proto. -// We use serialize+parse as our deep copy. -#define SET_OPTIONS(target, desc_type, options_type, proto) \ - if (google_protobuf_##desc_type##_has_options(proto)) { \ - size_t size; \ - char* pb = google_protobuf_##options_type##_serialize( \ - google_protobuf_##desc_type##_options(proto), ctx->tmp_arena, &size); \ - CHK_OOM(pb); \ - target = google_protobuf_##options_type##_parse(pb, size, ctx->arena); \ - CHK_OOM(target); \ - } else { \ - target = (const google_protobuf_##options_type*)opt_default; \ - } - -static void check_ident(symtab_addctx* ctx, upb_StringView name, bool full) { - const char* str = name.data; - size_t len = name.size; - bool start = true; - size_t i; - for (i = 0; i < len; i++) { - char c = str[i]; - if (c == '.') { - if (start || !full) { - symtab_errf(ctx, "invalid name: unexpected '.' (%.*s)", (int)len, str); - } - start = true; - } else if (start) { - if (!upb_isletter(c)) { - symtab_errf( - ctx, - "invalid name: path components must start with a letter (%.*s)", - (int)len, str); - } - start = false; - } else { - if (!upb_isalphanum(c)) { - symtab_errf(ctx, "invalid name: non-alphanumeric character (%.*s)", - (int)len, str); - } - } - } - if (start) { - symtab_errf(ctx, "invalid name: empty part (%.*s)", (int)len, str); - } -} - -static size_t div_round_up(size_t n, size_t d) { return (n + d - 1) / d; } - -static size_t upb_MessageValue_sizeof(upb_CType type) { - switch (type) { - case kUpb_CType_Double: - case kUpb_CType_Int64: - case kUpb_CType_UInt64: - return 8; - case kUpb_CType_Enum: - case kUpb_CType_Int32: - case kUpb_CType_UInt32: - case kUpb_CType_Float: - return 4; - case kUpb_CType_Bool: - return 1; - case kUpb_CType_Message: - return sizeof(void*); - case kUpb_CType_Bytes: - case kUpb_CType_String: - return sizeof(upb_StringView); - } - UPB_UNREACHABLE(); -} - -static uint8_t upb_msg_fielddefsize(const upb_FieldDef* f) { - if (upb_MessageDef_IsMapEntry(upb_FieldDef_ContainingType(f))) { - upb_MapEntry ent; - UPB_ASSERT(sizeof(ent.k) == sizeof(ent.v)); - return sizeof(ent.k); - } else if (upb_FieldDef_IsRepeated(f)) { - return sizeof(void*); - } else { - return upb_MessageValue_sizeof(upb_FieldDef_CType(f)); - } -} - -static uint32_t upb_MiniTable_place(symtab_addctx* ctx, upb_MiniTable* l, - size_t size, const upb_MessageDef* m) { - size_t ofs = UPB_ALIGN_UP(l->size, size); - size_t next = ofs + size; - - if (next > UINT16_MAX) { - symtab_errf(ctx, "size of message %s exceeded max size of %zu bytes", - upb_MessageDef_FullName(m), (size_t)UINT16_MAX); - } - - l->size = next; - return ofs; -} - -static int field_number_cmp(const void* p1, const void* p2) { - const upb_MiniTable_Field* f1 = p1; - const upb_MiniTable_Field* f2 = p2; - return f1->number - f2->number; -} - -static void assign_layout_indices(const upb_MessageDef* m, upb_MiniTable* l, - upb_MiniTable_Field* fields) { - int i; - int n = upb_MessageDef_numfields(m); - int dense_below = 0; - for (i = 0; i < n; i++) { - upb_FieldDef* f = - (upb_FieldDef*)upb_MessageDef_FindFieldByNumber(m, fields[i].number); - UPB_ASSERT(f); - f->layout_index = i; - if (i < UINT8_MAX && fields[i].number == i + 1 && - (i == 0 || fields[i - 1].number == i)) { - dense_below = i + 1; - } - } - l->dense_below = dense_below; -} - -static uint8_t map_descriptortype(const upb_FieldDef* f) { - uint8_t type = upb_FieldDef_Type(f); - /* See TableDescriptorType() in upbc/generator.cc for details and - * rationale of these exceptions. */ - if (type == kUpb_FieldType_String && f->file->syntax == kUpb_Syntax_Proto2) { - return kUpb_FieldType_Bytes; - } else if (type == kUpb_FieldType_Enum && - (f->sub.enumdef->file->syntax == kUpb_Syntax_Proto3 || - UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 || - // TODO(https://github.com/protocolbuffers/upb/issues/541): - // fix map enum values to check for unknown enum values and put - // them in the unknown field set. - upb_MessageDef_IsMapEntry(upb_FieldDef_ContainingType(f)))) { - return kUpb_FieldType_Int32; - } - return type; -} - -static void fill_fieldlayout(upb_MiniTable_Field* field, - const upb_FieldDef* f) { - field->number = upb_FieldDef_Number(f); - field->descriptortype = map_descriptortype(f); - - if (upb_FieldDef_IsMap(f)) { - field->mode = - kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift); - } else if (upb_FieldDef_IsRepeated(f)) { - field->mode = - kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift); - } else { - /* Maps descriptor type -> elem_size_lg2. */ - static const uint8_t sizes[] = { - -1, /* invalid descriptor type */ - kUpb_FieldRep_8Byte, /* DOUBLE */ - kUpb_FieldRep_4Byte, /* FLOAT */ - kUpb_FieldRep_8Byte, /* INT64 */ - kUpb_FieldRep_8Byte, /* UINT64 */ - kUpb_FieldRep_4Byte, /* INT32 */ - kUpb_FieldRep_8Byte, /* FIXED64 */ - kUpb_FieldRep_4Byte, /* FIXED32 */ - kUpb_FieldRep_1Byte, /* BOOL */ - kUpb_FieldRep_StringView, /* STRING */ - kUpb_FieldRep_Pointer, /* GROUP */ - kUpb_FieldRep_Pointer, /* MESSAGE */ - kUpb_FieldRep_StringView, /* BYTES */ - kUpb_FieldRep_4Byte, /* UINT32 */ - kUpb_FieldRep_4Byte, /* ENUM */ - kUpb_FieldRep_4Byte, /* SFIXED32 */ - kUpb_FieldRep_8Byte, /* SFIXED64 */ - kUpb_FieldRep_4Byte, /* SINT32 */ - kUpb_FieldRep_8Byte, /* SINT64 */ - }; - field->mode = kUpb_FieldMode_Scalar | - (sizes[field->descriptortype] << kUpb_FieldRep_Shift); - } - - if (upb_FieldDef_IsPacked(f)) { - field->mode |= kUpb_LabelFlags_IsPacked; - } - - if (upb_FieldDef_IsExtension(f)) { - field->mode |= kUpb_LabelFlags_IsExtension; - } -} - -/* This function is the dynamic equivalent of message_layout.{cc,h} in upbc. - * It computes a dynamic layout for all of the fields in |m|. */ -static void make_layout(symtab_addctx* ctx, const upb_MessageDef* m) { - upb_MiniTable* l = (upb_MiniTable*)m->layout; - size_t field_count = upb_MessageDef_numfields(m); - size_t sublayout_count = 0; - upb_MiniTable_Sub* subs; - upb_MiniTable_Field* fields; - - memset(l, 0, sizeof(*l) + sizeof(_upb_FastTable_Entry)); - - /* Count sub-messages. */ - for (size_t i = 0; i < field_count; i++) { - const upb_FieldDef* f = &m->fields[i]; - if (upb_FieldDef_IsSubMessage(f)) { - sublayout_count++; - } - if (upb_FieldDef_CType(f) == kUpb_CType_Enum && - f->sub.enumdef->file->syntax == kUpb_Syntax_Proto2) { - sublayout_count++; - } - } - - fields = symtab_alloc(ctx, field_count * sizeof(*fields)); - subs = symtab_alloc(ctx, sublayout_count * sizeof(*subs)); - - l->field_count = upb_MessageDef_numfields(m); - l->fields = fields; - l->subs = subs; - l->table_mask = 0; - l->required_count = 0; - - if (upb_MessageDef_ExtensionRangeCount(m) > 0) { - if (google_protobuf_MessageOptions_message_set_wire_format(m->opts)) { - l->ext = kUpb_ExtMode_IsMessageSet; - } else { - l->ext = kUpb_ExtMode_Extendable; - } - } else { - l->ext = kUpb_ExtMode_NonExtendable; - } - - /* TODO(haberman): initialize fast tables so that reflection-based parsing - * can get the same speeds as linked-in types. */ - l->fasttable[0].field_parser = &fastdecode_generic; - l->fasttable[0].field_data = 0; - - if (upb_MessageDef_IsMapEntry(m)) { - /* TODO(haberman): refactor this method so this special case is more - * elegant. */ - const upb_FieldDef* key = upb_MessageDef_FindFieldByNumber(m, 1); - const upb_FieldDef* val = upb_MessageDef_FindFieldByNumber(m, 2); - fields[0].number = 1; - fields[1].number = 2; - fields[0].mode = kUpb_FieldMode_Scalar; - fields[1].mode = kUpb_FieldMode_Scalar; - fields[0].presence = 0; - fields[1].presence = 0; - fields[0].descriptortype = map_descriptortype(key); - fields[1].descriptortype = map_descriptortype(val); - fields[0].offset = 0; - fields[1].offset = sizeof(upb_StringView); - fields[1].submsg_index = 0; - - if (upb_FieldDef_CType(val) == kUpb_CType_Message) { - subs[0].submsg = upb_FieldDef_MessageSubDef(val)->layout; - } - - upb_FieldDef* fielddefs = (upb_FieldDef*)&m->fields[0]; - UPB_ASSERT(fielddefs[0].number_ == 1); - UPB_ASSERT(fielddefs[1].number_ == 2); - fielddefs[0].layout_index = 0; - fielddefs[1].layout_index = 1; - - l->field_count = 2; - l->size = 2 * sizeof(upb_StringView); - l->size = UPB_ALIGN_UP(l->size, 8); - l->dense_below = 2; - return; - } - - /* Allocate data offsets in three stages: - * - * 1. hasbits. - * 2. regular fields. - * 3. oneof fields. - * - * OPT: There is a lot of room for optimization here to minimize the size. - */ - - /* Assign hasbits for required fields first. */ - size_t hasbit = 0; - - for (int i = 0; i < m->field_count; i++) { - const upb_FieldDef* f = &m->fields[i]; - upb_MiniTable_Field* field = &fields[upb_FieldDef_Index(f)]; - if (upb_FieldDef_Label(f) == kUpb_Label_Required) { - field->presence = ++hasbit; - if (hasbit >= 63) { - symtab_errf(ctx, "Message with >=63 required fields: %s", - upb_MessageDef_FullName(m)); - } - l->required_count++; - } - } - - /* Allocate hasbits and set basic field attributes. */ - sublayout_count = 0; - for (int i = 0; i < m->field_count; i++) { - const upb_FieldDef* f = &m->fields[i]; - upb_MiniTable_Field* field = &fields[upb_FieldDef_Index(f)]; - - fill_fieldlayout(field, f); - - if (field->descriptortype == kUpb_FieldType_Message || - field->descriptortype == kUpb_FieldType_Group) { - field->submsg_index = sublayout_count++; - subs[field->submsg_index].submsg = upb_FieldDef_MessageSubDef(f)->layout; - } else if (field->descriptortype == kUpb_FieldType_Enum) { - field->submsg_index = sublayout_count++; - subs[field->submsg_index].subenum = upb_FieldDef_EnumSubDef(f)->layout; - UPB_ASSERT(subs[field->submsg_index].subenum); - } - - if (upb_FieldDef_Label(f) == kUpb_Label_Required) { - /* Hasbit was already assigned. */ - } else if (upb_FieldDef_HasPresence(f) && - !upb_FieldDef_RealContainingOneof(f)) { - /* We don't use hasbit 0, so that 0 can indicate "no presence" in the - * table. This wastes one hasbit, but we don't worry about it for now. */ - field->presence = ++hasbit; - } else { - field->presence = 0; - } - } - - /* Account for space used by hasbits. */ - l->size = hasbit ? div_round_up(hasbit + 1, 8) : 0; - - /* Allocate non-oneof fields. */ - for (int i = 0; i < m->field_count; i++) { - const upb_FieldDef* f = &m->fields[i]; - size_t field_size = upb_msg_fielddefsize(f); - size_t index = upb_FieldDef_Index(f); - - if (upb_FieldDef_RealContainingOneof(f)) { - /* Oneofs are handled separately below. */ - continue; - } - - fields[index].offset = upb_MiniTable_place(ctx, l, field_size, m); - } - - /* Allocate oneof fields. Each oneof field consists of a uint32 for the case - * and space for the actual data. */ - for (int i = 0; i < m->oneof_count; i++) { - const upb_OneofDef* o = &m->oneofs[i]; - size_t case_size = sizeof(uint32_t); /* Could potentially optimize this. */ - size_t field_size = 0; - uint32_t case_offset; - uint32_t data_offset; - - if (upb_OneofDef_IsSynthetic(o)) continue; - - if (o->field_count == 0) { - symtab_errf(ctx, "Oneof must have at least one field (%s)", o->full_name); - } - - /* Calculate field size: the max of all field sizes. */ - for (int j = 0; j < o->field_count; j++) { - const upb_FieldDef* f = o->fields[j]; - field_size = UPB_MAX(field_size, upb_msg_fielddefsize(f)); - } - - /* Align and allocate case offset. */ - case_offset = upb_MiniTable_place(ctx, l, case_size, m); - data_offset = upb_MiniTable_place(ctx, l, field_size, m); - - for (int i = 0; i < o->field_count; i++) { - const upb_FieldDef* f = o->fields[i]; - fields[upb_FieldDef_Index(f)].offset = data_offset; - fields[upb_FieldDef_Index(f)].presence = ~case_offset; - } - } - - /* Size of the entire structure should be a multiple of its greatest - * alignment. TODO: track overall alignment for real? */ - l->size = UPB_ALIGN_UP(l->size, 8); - - /* Sort fields by number. */ - if (fields) { - qsort(fields, upb_MessageDef_numfields(m), sizeof(*fields), - field_number_cmp); - } - assign_layout_indices(m, l, fields); -} - -static char* strviewdup(symtab_addctx* ctx, upb_StringView view) { - char* ret = upb_strdup2(view.data, view.size, ctx->arena); - CHK_OOM(ret); - return ret; -} - -static bool streql2(const char* a, size_t n, const char* b) { - return n == strlen(b) && memcmp(a, b, n) == 0; -} - -static bool streql_view(upb_StringView view, const char* b) { - return streql2(view.data, view.size, b); -} - -static const char* makefullname(symtab_addctx* ctx, const char* prefix, - upb_StringView name) { - if (prefix) { - /* ret = prefix + '.' + name; */ - size_t n = strlen(prefix); - char* ret = symtab_alloc(ctx, n + name.size + 2); - strcpy(ret, prefix); - ret[n] = '.'; - memcpy(&ret[n + 1], name.data, name.size); - ret[n + 1 + name.size] = '\0'; - return ret; - } else { - return strviewdup(ctx, name); - } -} - -static void finalize_oneofs(symtab_addctx* ctx, upb_MessageDef* m) { - int i; - int synthetic_count = 0; - upb_OneofDef* mutable_oneofs = (upb_OneofDef*)m->oneofs; - - for (i = 0; i < m->oneof_count; i++) { - upb_OneofDef* o = &mutable_oneofs[i]; - - if (o->synthetic && o->field_count != 1) { - symtab_errf(ctx, "Synthetic oneofs must have one field, not %d: %s", - o->field_count, upb_OneofDef_Name(o)); - } - - if (o->synthetic) { - synthetic_count++; - } else if (synthetic_count != 0) { - symtab_errf(ctx, "Synthetic oneofs must be after all other oneofs: %s", - upb_OneofDef_Name(o)); - } - - o->fields = symtab_alloc(ctx, sizeof(upb_FieldDef*) * o->field_count); - o->field_count = 0; - } - - for (i = 0; i < m->field_count; i++) { - const upb_FieldDef* f = &m->fields[i]; - upb_OneofDef* o = (upb_OneofDef*)upb_FieldDef_ContainingOneof(f); - if (o) { - o->fields[o->field_count++] = f; - } - } - - m->real_oneof_count = m->oneof_count - synthetic_count; -} - -size_t getjsonname(const char* name, char* buf, size_t len) { - size_t src, dst = 0; - bool ucase_next = false; - -#define WRITE(byte) \ - ++dst; \ - if (dst < len) \ - buf[dst - 1] = byte; \ - else if (dst == len) \ - buf[dst - 1] = '\0' - - if (!name) { - WRITE('\0'); - return 0; - } - - /* Implement the transformation as described in the spec: - * 1. upper case all letters after an underscore. - * 2. remove all underscores. - */ - for (src = 0; name[src]; src++) { - if (name[src] == '_') { - ucase_next = true; - continue; - } - - if (ucase_next) { - WRITE(toupper(name[src])); - ucase_next = false; - } else { - WRITE(name[src]); - } - } - - WRITE('\0'); - return dst; - -#undef WRITE -} - -static char* makejsonname(symtab_addctx* ctx, const char* name) { - size_t size = getjsonname(name, NULL, 0); - char* json_name = symtab_alloc(ctx, size); - getjsonname(name, json_name, size); - return json_name; -} - -/* Adds a symbol |v| to the symtab, which must be a def pointer previously - * packed with pack_def(). The def's pointer to upb_FileDef* must be set before - * adding, so we know which entries to remove if building this file fails. */ -static void symtab_add(symtab_addctx* ctx, const char* name, upb_value v) { - // TODO: table should support an operation "tryinsert" to avoid the double - // lookup. - if (upb_strtable_lookup(&ctx->symtab->syms, name, NULL)) { - symtab_errf(ctx, "duplicate symbol '%s'", name); - } - size_t len = strlen(name); - CHK_OOM(upb_strtable_insert(&ctx->symtab->syms, name, len, v, - ctx->symtab->arena)); -} - -static bool remove_component(char* base, size_t* len) { - if (*len == 0) return false; - - for (size_t i = *len - 1; i > 0; i--) { - if (base[i] == '.') { - *len = i; - return true; - } - } - - *len = 0; - return true; -} - -/* Given a symbol and the base symbol inside which it is defined, find the - * symbol's definition in t. */ -static const void* symtab_resolveany(symtab_addctx* ctx, - const char* from_name_dbg, - const char* base, upb_StringView sym, - upb_deftype_t* type) { - const upb_strtable* t = &ctx->symtab->syms; - if (sym.size == 0) goto notfound; - upb_value v; - if (sym.data[0] == '.') { - /* Symbols starting with '.' are absolute, so we do a single lookup. - * Slice to omit the leading '.' */ - if (!upb_strtable_lookup2(t, sym.data + 1, sym.size - 1, &v)) { - goto notfound; - } - } else { - /* Remove components from base until we find an entry or run out. */ - size_t baselen = base ? strlen(base) : 0; - char* tmp = malloc(sym.size + baselen + 1); - while (1) { - char* p = tmp; - if (baselen) { - memcpy(p, base, baselen); - p[baselen] = '.'; - p += baselen + 1; - } - memcpy(p, sym.data, sym.size); - p += sym.size; - if (upb_strtable_lookup2(t, tmp, p - tmp, &v)) { - break; - } - if (!remove_component(tmp, &baselen)) { - free(tmp); - goto notfound; - } - } - free(tmp); - } - - *type = deftype(v); - return unpack_def(v, *type); - -notfound: - symtab_errf(ctx, "couldn't resolve name '" UPB_STRINGVIEW_FORMAT "'", - UPB_STRINGVIEW_ARGS(sym)); -} - -static const void* symtab_resolve(symtab_addctx* ctx, const char* from_name_dbg, - const char* base, upb_StringView sym, - upb_deftype_t type) { - upb_deftype_t found_type; - const void* ret = - symtab_resolveany(ctx, from_name_dbg, base, sym, &found_type); - if (ret && found_type != type) { - symtab_errf(ctx, - "type mismatch when resolving %s: couldn't find " - "name " UPB_STRINGVIEW_FORMAT " with type=%d", - from_name_dbg, UPB_STRINGVIEW_ARGS(sym), (int)type); - } - return ret; -} - -static void create_oneofdef( - symtab_addctx* ctx, upb_MessageDef* m, - const google_protobuf_OneofDescriptorProto* oneof_proto, - const upb_OneofDef* _o) { - upb_OneofDef* o = (upb_OneofDef*)_o; - upb_StringView name = google_protobuf_OneofDescriptorProto_name(oneof_proto); - upb_value v; - - o->parent = m; - o->full_name = makefullname(ctx, m->full_name, name); - o->field_count = 0; - o->synthetic = false; - - SET_OPTIONS(o->opts, OneofDescriptorProto, OneofOptions, oneof_proto); - - upb_value existing_v; - if (upb_strtable_lookup2(&m->ntof, name.data, name.size, &existing_v)) { - symtab_errf(ctx, "duplicate oneof name (%s)", o->full_name); - } - - v = pack_def(o, UPB_DEFTYPE_ONEOF); - CHK_OOM(upb_strtable_insert(&m->ntof, name.data, name.size, v, ctx->arena)); - - CHK_OOM(upb_inttable_init(&o->itof, ctx->arena)); - CHK_OOM(upb_strtable_init(&o->ntof, 4, ctx->arena)); -} - -static str_t* newstr(symtab_addctx* ctx, const char* data, size_t len) { - str_t* ret = symtab_alloc(ctx, sizeof(*ret) + len); - CHK_OOM(ret); - ret->len = len; - if (len) memcpy(ret->str, data, len); - ret->str[len] = '\0'; - return ret; -} - -static bool upb_DefPool_TryGetChar(const char** src, const char* end, - char* ch) { - if (*src == end) return false; - *ch = **src; - *src += 1; - return true; -} - -static char upb_DefPool_TryGetHexDigit(symtab_addctx* ctx, - const upb_FieldDef* f, const char** src, - const char* end) { - char ch; - if (!upb_DefPool_TryGetChar(src, end, &ch)) return -1; - if ('0' <= ch && ch <= '9') { - return ch - '0'; - } - ch = upb_ascii_lower(ch); - if ('a' <= ch && ch <= 'f') { - return ch - 'a' + 0xa; - } - *src -= 1; // Char wasn't actually a hex digit. - return -1; -} - -static char upb_DefPool_ParseHexEscape(symtab_addctx* ctx, - const upb_FieldDef* f, const char** src, - const char* end) { - char hex_digit = upb_DefPool_TryGetHexDigit(ctx, f, src, end); - if (hex_digit < 0) { - symtab_errf(ctx, - "\\x cannot be followed by non-hex digit in field '%s' default", - upb_FieldDef_FullName(f)); - return 0; - } - unsigned int ret = hex_digit; - while ((hex_digit = upb_DefPool_TryGetHexDigit(ctx, f, src, end)) >= 0) { - ret = (ret << 4) | hex_digit; - } - if (ret > 0xff) { - symtab_errf(ctx, "Value of hex escape in field %s exceeds 8 bits", - upb_FieldDef_FullName(f)); - return 0; - } - return ret; -} - -char upb_DefPool_TryGetOctalDigit(const char** src, const char* end) { - char ch; - if (!upb_DefPool_TryGetChar(src, end, &ch)) return -1; - if ('0' <= ch && ch <= '7') { - return ch - '0'; - } - *src -= 1; // Char wasn't actually an octal digit. - return -1; -} - -static char upb_DefPool_ParseOctalEscape(symtab_addctx* ctx, - const upb_FieldDef* f, - const char** src, const char* end) { - char ch = 0; - for (int i = 0; i < 3; i++) { - char digit; - if ((digit = upb_DefPool_TryGetOctalDigit(src, end)) >= 0) { - ch = (ch << 3) | digit; - } - } - return ch; -} - -static char upb_DefPool_ParseEscape(symtab_addctx* ctx, const upb_FieldDef* f, - const char** src, const char* end) { - char ch; - if (!upb_DefPool_TryGetChar(src, end, &ch)) { - symtab_errf(ctx, "unterminated escape sequence in field %s", - upb_FieldDef_FullName(f)); - return 0; - } - switch (ch) { - case 'a': - return '\a'; - case 'b': - return '\b'; - case 'f': - return '\f'; - case 'n': - return '\n'; - case 'r': - return '\r'; - case 't': - return '\t'; - case 'v': - return '\v'; - case '\\': - return '\\'; - case '\'': - return '\''; - case '\"': - return '\"'; - case '?': - return '\?'; - case 'x': - case 'X': - return upb_DefPool_ParseHexEscape(ctx, f, src, end); - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - *src -= 1; - return upb_DefPool_ParseOctalEscape(ctx, f, src, end); - } - symtab_errf(ctx, "Unknown escape sequence: \\%c", ch); -} - -static str_t* unescape(symtab_addctx* ctx, const upb_FieldDef* f, - const char* data, size_t len) { - // Size here is an upper bound; escape sequences could ultimately shrink it. - str_t* ret = symtab_alloc(ctx, sizeof(*ret) + len); - char* dst = &ret->str[0]; - const char* src = data; - const char* end = data + len; - - while (src < end) { - if (*src == '\\') { - src++; - *dst++ = upb_DefPool_ParseEscape(ctx, f, &src, end); - } else { - *dst++ = *src++; - } - } - - ret->len = dst - &ret->str[0]; - return ret; -} - -static void parse_default(symtab_addctx* ctx, const char* str, size_t len, - upb_FieldDef* f) { - char* end; - char nullz[64]; - errno = 0; - - switch (upb_FieldDef_CType(f)) { - case kUpb_CType_Int32: - case kUpb_CType_Int64: - case kUpb_CType_UInt32: - case kUpb_CType_UInt64: - case kUpb_CType_Double: - case kUpb_CType_Float: - /* Standard C number parsing functions expect null-terminated strings. */ - if (len >= sizeof(nullz) - 1) { - symtab_errf(ctx, "Default too long: %.*s", (int)len, str); - } - memcpy(nullz, str, len); - nullz[len] = '\0'; - str = nullz; - break; - default: - break; - } - - switch (upb_FieldDef_CType(f)) { - case kUpb_CType_Int32: { - long val = strtol(str, &end, 0); - if (val > INT32_MAX || val < INT32_MIN || errno == ERANGE || *end) { - goto invalid; - } - f->defaultval.sint = val; - break; - } - case kUpb_CType_Enum: { - const upb_EnumDef* e = f->sub.enumdef; - const upb_EnumValueDef* ev = - upb_EnumDef_FindValueByNameWithSize(e, str, len); - if (!ev) { - goto invalid; - } - f->defaultval.sint = ev->number; - break; - } - case kUpb_CType_Int64: { - long long val = strtoll(str, &end, 0); - if (val > INT64_MAX || val < INT64_MIN || errno == ERANGE || *end) { - goto invalid; - } - f->defaultval.sint = val; - break; - } - case kUpb_CType_UInt32: { - unsigned long val = strtoul(str, &end, 0); - if (val > UINT32_MAX || errno == ERANGE || *end) { - goto invalid; - } - f->defaultval.uint = val; - break; - } - case kUpb_CType_UInt64: { - unsigned long long val = strtoull(str, &end, 0); - if (val > UINT64_MAX || errno == ERANGE || *end) { - goto invalid; - } - f->defaultval.uint = val; - break; - } - case kUpb_CType_Double: { - double val = strtod(str, &end); - if (errno == ERANGE || *end) { - goto invalid; - } - f->defaultval.dbl = val; - break; - } - case kUpb_CType_Float: { - float val = strtof(str, &end); - if (errno == ERANGE || *end) { - goto invalid; - } - f->defaultval.flt = val; - break; - } - case kUpb_CType_Bool: { - if (streql2(str, len, "false")) { - f->defaultval.boolean = false; - } else if (streql2(str, len, "true")) { - f->defaultval.boolean = true; - } else { - goto invalid; - } - break; - } - case kUpb_CType_String: - f->defaultval.str = newstr(ctx, str, len); - break; - case kUpb_CType_Bytes: - f->defaultval.str = unescape(ctx, f, str, len); - break; - case kUpb_CType_Message: - /* Should not have a default value. */ - symtab_errf(ctx, "Message should not have a default (%s)", - upb_FieldDef_FullName(f)); - } - - return; - -invalid: - symtab_errf(ctx, "Invalid default '%.*s' for field %s of type %d", (int)len, - str, upb_FieldDef_FullName(f), (int)upb_FieldDef_Type(f)); -} - -static void set_default_default(symtab_addctx* ctx, upb_FieldDef* f) { - switch (upb_FieldDef_CType(f)) { - case kUpb_CType_Int32: - case kUpb_CType_Int64: - f->defaultval.sint = 0; - break; - case kUpb_CType_UInt64: - case kUpb_CType_UInt32: - f->defaultval.uint = 0; - break; - case kUpb_CType_Double: - case kUpb_CType_Float: - f->defaultval.dbl = 0; - break; - case kUpb_CType_String: - case kUpb_CType_Bytes: - f->defaultval.str = newstr(ctx, NULL, 0); - break; - case kUpb_CType_Bool: - f->defaultval.boolean = false; - break; - case kUpb_CType_Enum: - f->defaultval.sint = f->sub.enumdef->values[0].number; - case kUpb_CType_Message: - break; - } -} - -static void create_fielddef( - symtab_addctx* ctx, const char* prefix, upb_MessageDef* m, - const google_protobuf_FieldDescriptorProto* field_proto, - const upb_FieldDef* _f, bool is_extension) { - upb_FieldDef* f = (upb_FieldDef*)_f; - upb_StringView name; - const char* full_name; - const char* json_name; - const char* shortname; - int32_t field_number; - - f->file = ctx->file; /* Must happen prior to symtab_add(). */ - - if (!google_protobuf_FieldDescriptorProto_has_name(field_proto)) { - symtab_errf(ctx, "field has no name"); - } - - name = google_protobuf_FieldDescriptorProto_name(field_proto); - check_ident(ctx, name, false); - full_name = makefullname(ctx, prefix, name); - shortname = shortdefname(full_name); - - if (google_protobuf_FieldDescriptorProto_has_json_name(field_proto)) { - json_name = strviewdup( - ctx, google_protobuf_FieldDescriptorProto_json_name(field_proto)); - f->has_json_name_ = true; - } else { - json_name = makejsonname(ctx, shortname); - f->has_json_name_ = false; - } - - field_number = google_protobuf_FieldDescriptorProto_number(field_proto); - - f->full_name = full_name; - f->json_name = json_name; - f->label_ = (int)google_protobuf_FieldDescriptorProto_label(field_proto); - f->number_ = field_number; - f->scope.oneof = NULL; - f->proto3_optional_ = - google_protobuf_FieldDescriptorProto_proto3_optional(field_proto); - - bool has_type = google_protobuf_FieldDescriptorProto_has_type(field_proto); - bool has_type_name = - google_protobuf_FieldDescriptorProto_has_type_name(field_proto); - - f->type_ = (int)google_protobuf_FieldDescriptorProto_type(field_proto); - - if (has_type) { - switch (f->type_) { - case kUpb_FieldType_Message: - case kUpb_FieldType_Group: - case kUpb_FieldType_Enum: - if (!has_type_name) { - symtab_errf(ctx, "field of type %d requires type name (%s)", - (int)f->type_, full_name); - } - break; - default: - if (has_type_name) { - symtab_errf(ctx, "invalid type for field with type_name set (%s, %d)", - full_name, (int)f->type_); - } - } - } else if (has_type_name) { - f->type_ = - FIELD_TYPE_UNSPECIFIED; // We'll fill this in in resolve_fielddef(). - } - - if (!is_extension) { - /* direct message field. */ - upb_value v, field_v, json_v, existing_v; - size_t json_size; - - if (field_number <= 0 || field_number > kUpb_MaxFieldNumber) { - symtab_errf(ctx, "invalid field number (%u)", field_number); - } - - f->index_ = f - m->fields; - f->msgdef = m; - f->is_extension_ = false; - - field_v = pack_def(f, UPB_DEFTYPE_FIELD); - json_v = pack_def(f, UPB_DEFTYPE_FIELD_JSONNAME); - v = upb_value_constptr(f); - json_size = strlen(json_name); - - if (upb_strtable_lookup(&m->ntof, shortname, &existing_v)) { - symtab_errf(ctx, "duplicate field name (%s)", shortname); - } - - CHK_OOM(upb_strtable_insert(&m->ntof, name.data, name.size, field_v, - ctx->arena)); - - if (strcmp(shortname, json_name) != 0) { - if (upb_strtable_lookup(&m->ntof, json_name, &v)) { - symtab_errf(ctx, "duplicate json_name (%s)", json_name); - } else { - CHK_OOM(upb_strtable_insert(&m->ntof, json_name, json_size, json_v, - ctx->arena)); - } - } - - if (upb_inttable_lookup(&m->itof, field_number, NULL)) { - symtab_errf(ctx, "duplicate field number (%u)", field_number); - } - - CHK_OOM(upb_inttable_insert(&m->itof, field_number, v, ctx->arena)); - - if (ctx->layout) { - const upb_MiniTable_Field* fields = m->layout->fields; - int count = m->layout->field_count; - bool found = false; - for (int i = 0; i < count; i++) { - if (fields[i].number == field_number) { - f->layout_index = i; - found = true; - break; - } - } - UPB_ASSERT(found); - } - } else { - /* extension field. */ - f->is_extension_ = true; - f->scope.extension_scope = m; - symtab_add(ctx, full_name, pack_def(f, UPB_DEFTYPE_EXT)); - f->layout_index = ctx->ext_count++; - if (ctx->layout) { - UPB_ASSERT(ctx->file->ext_layouts[f->layout_index]->field.number == - field_number); - } - } - - if (f->type_ < kUpb_FieldType_Double || f->type_ > kUpb_FieldType_SInt64) { - symtab_errf(ctx, "invalid type for field %s (%d)", f->full_name, f->type_); - } - - if (f->label_ < kUpb_Label_Optional || f->label_ > kUpb_Label_Repeated) { - symtab_errf(ctx, "invalid label for field %s (%d)", f->full_name, - f->label_); - } - - /* We can't resolve the subdef or (in the case of extensions) the containing - * message yet, because it may not have been defined yet. We stash a pointer - * to the field_proto until later when we can properly resolve it. */ - f->sub.unresolved = field_proto; - - if (f->label_ == kUpb_Label_Required && - f->file->syntax == kUpb_Syntax_Proto3) { - symtab_errf(ctx, "proto3 fields cannot be required (%s)", f->full_name); - } - - if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { - uint32_t oneof_index = google_protobuf_FieldDescriptorProto_oneof_index(field_proto); - upb_OneofDef* oneof; - upb_value v = upb_value_constptr(f); - - if (upb_FieldDef_Label(f) != kUpb_Label_Optional) { - symtab_errf(ctx, "fields in oneof must have OPTIONAL label (%s)", - f->full_name); - } - - if (!m) { - symtab_errf(ctx, "oneof_index provided for extension field (%s)", - f->full_name); - } - - if (oneof_index >= m->oneof_count) { - symtab_errf(ctx, "oneof_index out of range (%s)", f->full_name); - } - - oneof = (upb_OneofDef*)&m->oneofs[oneof_index]; - f->scope.oneof = oneof; - - oneof->field_count++; - if (f->proto3_optional_) { - oneof->synthetic = true; - } - CHK_OOM(upb_inttable_insert(&oneof->itof, f->number_, v, ctx->arena)); - CHK_OOM( - upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena)); - } else { - if (f->proto3_optional_) { - symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)", - f->full_name); - } - } - - SET_OPTIONS(f->opts, FieldDescriptorProto, FieldOptions, field_proto); - - if (google_protobuf_FieldOptions_has_packed(f->opts)) { - f->packed_ = google_protobuf_FieldOptions_packed(f->opts); - } else { - /* Repeated fields default to packed for proto3 only. */ - f->packed_ = upb_FieldDef_IsPrimitive(f) && - f->label_ == kUpb_Label_Repeated && - f->file->syntax == kUpb_Syntax_Proto3; - } -} - -static void create_service( - symtab_addctx* ctx, const google_protobuf_ServiceDescriptorProto* svc_proto, - const upb_ServiceDef* _s) { - upb_ServiceDef* s = (upb_ServiceDef*)_s; - upb_StringView name; - const google_protobuf_MethodDescriptorProto* const* methods; - size_t i, n; - - s->file = ctx->file; /* Must happen prior to symtab_add. */ - - name = google_protobuf_ServiceDescriptorProto_name(svc_proto); - check_ident(ctx, name, false); - s->full_name = makefullname(ctx, ctx->file->package, name); - symtab_add(ctx, s->full_name, pack_def(s, UPB_DEFTYPE_SERVICE)); - - methods = google_protobuf_ServiceDescriptorProto_method(svc_proto, &n); - - s->method_count = n; - s->methods = symtab_alloc(ctx, sizeof(*s->methods) * n); - - SET_OPTIONS(s->opts, ServiceDescriptorProto, ServiceOptions, svc_proto); - - for (i = 0; i < n; i++) { - const google_protobuf_MethodDescriptorProto* method_proto = methods[i]; - upb_MethodDef* m = (upb_MethodDef*)&s->methods[i]; - upb_StringView name = - google_protobuf_MethodDescriptorProto_name(method_proto); - - m->service = s; - m->full_name = makefullname(ctx, s->full_name, name); - m->index = i; - m->client_streaming = - google_protobuf_MethodDescriptorProto_client_streaming(method_proto); - m->server_streaming = - google_protobuf_MethodDescriptorProto_server_streaming(method_proto); - m->input_type = symtab_resolve( - ctx, m->full_name, m->full_name, - google_protobuf_MethodDescriptorProto_input_type(method_proto), - UPB_DEFTYPE_MSG); - m->output_type = symtab_resolve( - ctx, m->full_name, m->full_name, - google_protobuf_MethodDescriptorProto_output_type(method_proto), - UPB_DEFTYPE_MSG); - - SET_OPTIONS(m->opts, MethodDescriptorProto, MethodOptions, method_proto); - } -} - -static int count_bits_debug(uint64_t x) { - // For assertions only, speed does not matter. - int n = 0; - while (x) { - if (x & 1) n++; - x >>= 1; - } - return n; -} - -static int compare_int32(const void* a_ptr, const void* b_ptr) { - int32_t a = *(int32_t*)a_ptr; - int32_t b = *(int32_t*)b_ptr; - return a < b ? -1 : (a == b ? 0 : 1); -} - -upb_MiniTable_Enum* create_enumlayout(symtab_addctx* ctx, - const upb_EnumDef* e) { - int n = 0; - uint64_t mask = 0; - - for (int i = 0; i < e->value_count; i++) { - uint32_t val = (uint32_t)e->values[i].number; - if (val < 64) { - mask |= 1ULL << val; - } else { - n++; - } - } - - int32_t* values = symtab_alloc(ctx, sizeof(*values) * n); - - if (n) { - int32_t* p = values; - - // Add values outside the bitmask range to the list, as described in the - // comments for upb_MiniTable_Enum. - for (int i = 0; i < e->value_count; i++) { - int32_t val = e->values[i].number; - if ((uint32_t)val >= 64) { - *p++ = val; - } - } - UPB_ASSERT(p == values + n); - } - - // Enums can have duplicate values; we must sort+uniq them. - if (values) qsort(values, n, sizeof(*values), &compare_int32); - - int dst = 0; - for (int i = 0; i < n; dst++) { - int32_t val = values[i]; - while (i < n && values[i] == val) i++; // Skip duplicates. - values[dst] = val; - } - n = dst; - - UPB_ASSERT(upb_inttable_count(&e->iton) == n + count_bits_debug(mask)); - - upb_MiniTable_Enum* layout = symtab_alloc(ctx, sizeof(*layout)); - layout->value_count = n; - layout->mask = mask; - layout->values = values; - - return layout; -} - -static void create_enumvaldef( - symtab_addctx* ctx, const char* prefix, - const google_protobuf_EnumValueDescriptorProto* val_proto, upb_EnumDef* e, - int i) { - upb_EnumValueDef* val = (upb_EnumValueDef*)&e->values[i]; - upb_StringView name = - google_protobuf_EnumValueDescriptorProto_name(val_proto); - upb_value v = upb_value_constptr(val); - - val->parent = e; /* Must happen prior to symtab_add(). */ - val->full_name = makefullname(ctx, prefix, name); - val->number = google_protobuf_EnumValueDescriptorProto_number(val_proto); - symtab_add(ctx, val->full_name, pack_def(val, UPB_DEFTYPE_ENUMVAL)); - - SET_OPTIONS(val->opts, EnumValueDescriptorProto, EnumValueOptions, val_proto); - - if (i == 0 && e->file->syntax == kUpb_Syntax_Proto3 && val->number != 0) { - symtab_errf(ctx, "for proto3, the first enum value must be zero (%s)", - e->full_name); - } - - CHK_OOM(upb_strtable_insert(&e->ntoi, name.data, name.size, v, ctx->arena)); - - // Multiple enumerators can have the same number, first one wins. - if (!upb_inttable_lookup(&e->iton, val->number, NULL)) { - CHK_OOM(upb_inttable_insert(&e->iton, val->number, v, ctx->arena)); - } -} - -static void create_enumdef( - symtab_addctx* ctx, const char* prefix, - const google_protobuf_EnumDescriptorProto* enum_proto, - const upb_MessageDef* containing_type, const upb_EnumDef* _e) { - upb_EnumDef* e = (upb_EnumDef*)_e; - ; - const google_protobuf_EnumValueDescriptorProto* const* values; - upb_StringView name; - size_t i, n; - - e->file = ctx->file; /* Must happen prior to symtab_add() */ - e->containing_type = containing_type; - - name = google_protobuf_EnumDescriptorProto_name(enum_proto); - check_ident(ctx, name, false); - - e->full_name = makefullname(ctx, prefix, name); - symtab_add(ctx, e->full_name, pack_def(e, UPB_DEFTYPE_ENUM)); - - values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n); - CHK_OOM(upb_strtable_init(&e->ntoi, n, ctx->arena)); - CHK_OOM(upb_inttable_init(&e->iton, ctx->arena)); - - e->defaultval = 0; - e->value_count = n; - e->values = symtab_alloc(ctx, sizeof(*e->values) * n); - - if (n == 0) { - symtab_errf(ctx, "enums must contain at least one value (%s)", - e->full_name); - } - - SET_OPTIONS(e->opts, EnumDescriptorProto, EnumOptions, enum_proto); - - for (i = 0; i < n; i++) { - create_enumvaldef(ctx, prefix, values[i], e, i); - } - - upb_inttable_compact(&e->iton, ctx->arena); - - if (e->file->syntax == kUpb_Syntax_Proto2) { - if (ctx->layout) { - UPB_ASSERT(ctx->enum_count < ctx->layout->enum_count); - e->layout = ctx->layout->enums[ctx->enum_count++]; - UPB_ASSERT(upb_inttable_count(&e->iton) == - e->layout->value_count + count_bits_debug(e->layout->mask)); - } else { - e->layout = create_enumlayout(ctx, e); - } - } else { - e->layout = NULL; - } -} - -static void msgdef_create_nested( - symtab_addctx* ctx, const google_protobuf_DescriptorProto* msg_proto, - upb_MessageDef* m); - -static void create_msgdef(symtab_addctx* ctx, const char* prefix, - const google_protobuf_DescriptorProto* msg_proto, - const upb_MessageDef* containing_type, - const upb_MessageDef* _m) { - upb_MessageDef* m = (upb_MessageDef*)_m; - const google_protobuf_OneofDescriptorProto* const* oneofs; - const google_protobuf_FieldDescriptorProto* const* fields; - const google_protobuf_DescriptorProto_ExtensionRange* const* ext_ranges; - size_t i, n_oneof, n_field, n_ext_range; - upb_StringView name; - - m->file = ctx->file; /* Must happen prior to symtab_add(). */ - m->containing_type = containing_type; - - name = google_protobuf_DescriptorProto_name(msg_proto); - check_ident(ctx, name, false); - - m->full_name = makefullname(ctx, prefix, name); - symtab_add(ctx, m->full_name, pack_def(m, UPB_DEFTYPE_MSG)); - - oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n_oneof); - fields = google_protobuf_DescriptorProto_field(msg_proto, &n_field); - ext_ranges = - google_protobuf_DescriptorProto_extension_range(msg_proto, &n_ext_range); - - CHK_OOM(upb_inttable_init(&m->itof, ctx->arena)); - CHK_OOM(upb_strtable_init(&m->ntof, n_oneof + n_field, ctx->arena)); - - if (ctx->layout) { - /* create_fielddef() below depends on this being set. */ - UPB_ASSERT(ctx->msg_count < ctx->layout->msg_count); - m->layout = ctx->layout->msgs[ctx->msg_count++]; - UPB_ASSERT(n_field == m->layout->field_count); - } else { - /* Allocate now (to allow cross-linking), populate later. */ - m->layout = - symtab_alloc(ctx, sizeof(*m->layout) + sizeof(_upb_FastTable_Entry)); - } - - SET_OPTIONS(m->opts, DescriptorProto, MessageOptions, msg_proto); - - m->oneof_count = n_oneof; - m->oneofs = symtab_alloc(ctx, sizeof(*m->oneofs) * n_oneof); - for (i = 0; i < n_oneof; i++) { - create_oneofdef(ctx, m, oneofs[i], &m->oneofs[i]); - } - - m->field_count = n_field; - m->fields = symtab_alloc(ctx, sizeof(*m->fields) * n_field); - for (i = 0; i < n_field; i++) { - create_fielddef(ctx, m->full_name, m, fields[i], &m->fields[i], - /* is_extension= */ false); - } - - m->ext_range_count = n_ext_range; - m->ext_ranges = symtab_alloc(ctx, sizeof(*m->ext_ranges) * n_ext_range); - for (i = 0; i < n_ext_range; i++) { - const google_protobuf_DescriptorProto_ExtensionRange* r = ext_ranges[i]; - upb_ExtensionRange* r_def = (upb_ExtensionRange*)&m->ext_ranges[i]; - int32_t start = google_protobuf_DescriptorProto_ExtensionRange_start(r); - int32_t end = google_protobuf_DescriptorProto_ExtensionRange_end(r); - int32_t max = - google_protobuf_MessageOptions_message_set_wire_format(m->opts) - ? INT32_MAX - : kUpb_MaxFieldNumber + 1; - - // A full validation would also check that each range is disjoint, and that - // none of the fields overlap with the extension ranges, but we are just - // sanity checking here. - if (start < 1 || end <= start || end > max) { - symtab_errf(ctx, "Extension range (%d, %d) is invalid, message=%s\n", - (int)start, (int)end, m->full_name); - } - - r_def->start = start; - r_def->end = end; - SET_OPTIONS(r_def->opts, DescriptorProto_ExtensionRange, - ExtensionRangeOptions, r); - } - - finalize_oneofs(ctx, m); - assign_msg_wellknowntype(m); - upb_inttable_compact(&m->itof, ctx->arena); - msgdef_create_nested(ctx, msg_proto, m); -} - -static void msgdef_create_nested( - symtab_addctx* ctx, const google_protobuf_DescriptorProto* msg_proto, - upb_MessageDef* m) { - size_t n; - - const google_protobuf_EnumDescriptorProto* const* enums = - google_protobuf_DescriptorProto_enum_type(msg_proto, &n); - m->nested_enum_count = n; - m->nested_enums = symtab_alloc(ctx, sizeof(*m->nested_enums) * n); - for (size_t i = 0; i < n; i++) { - m->nested_enum_count = i + 1; - create_enumdef(ctx, m->full_name, enums[i], m, &m->nested_enums[i]); - } - - const google_protobuf_FieldDescriptorProto* const* exts = - google_protobuf_DescriptorProto_extension(msg_proto, &n); - m->nested_ext_count = n; - m->nested_exts = symtab_alloc(ctx, sizeof(*m->nested_exts) * n); - for (size_t i = 0; i < n; i++) { - create_fielddef(ctx, m->full_name, m, exts[i], &m->nested_exts[i], - /* is_extension= */ true); - ((upb_FieldDef*)&m->nested_exts[i])->index_ = i; - } - - const google_protobuf_DescriptorProto* const* msgs = - google_protobuf_DescriptorProto_nested_type(msg_proto, &n); - m->nested_msg_count = n; - m->nested_msgs = symtab_alloc(ctx, sizeof(*m->nested_msgs) * n); - for (size_t i = 0; i < n; i++) { - create_msgdef(ctx, m->full_name, msgs[i], m, &m->nested_msgs[i]); - } -} - -static void resolve_subdef(symtab_addctx* ctx, const char* prefix, - upb_FieldDef* f) { - const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved; - upb_StringView name = - google_protobuf_FieldDescriptorProto_type_name(field_proto); - bool has_name = - google_protobuf_FieldDescriptorProto_has_type_name(field_proto); - switch ((int)f->type_) { - case FIELD_TYPE_UNSPECIFIED: { - // Type was not specified and must be inferred. - UPB_ASSERT(has_name); - upb_deftype_t type; - const void* def = - symtab_resolveany(ctx, f->full_name, prefix, name, &type); - switch (type) { - case UPB_DEFTYPE_ENUM: - f->sub.enumdef = def; - f->type_ = kUpb_FieldType_Enum; - break; - case UPB_DEFTYPE_MSG: - f->sub.msgdef = def; - f->type_ = kUpb_FieldType_Message; // It appears there is no way of - // this being a group. - break; - default: - symtab_errf(ctx, "Couldn't resolve type name for field %s", - f->full_name); - } - } - case kUpb_FieldType_Message: - case kUpb_FieldType_Group: - UPB_ASSERT(has_name); - f->sub.msgdef = - symtab_resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG); - break; - case kUpb_FieldType_Enum: - UPB_ASSERT(has_name); - f->sub.enumdef = - symtab_resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_ENUM); - break; - default: - // No resolution necessary. - break; - } -} - -static void resolve_extension( - symtab_addctx* ctx, const char* prefix, upb_FieldDef* f, - const google_protobuf_FieldDescriptorProto* field_proto) { - if (!google_protobuf_FieldDescriptorProto_has_extendee(field_proto)) { - symtab_errf(ctx, "extension for field '%s' had no extendee", f->full_name); - } - - upb_StringView name = - google_protobuf_FieldDescriptorProto_extendee(field_proto); - const upb_MessageDef* m = - symtab_resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG); - f->msgdef = m; - - bool found = false; - - for (int i = 0, n = m->ext_range_count; i < n; i++) { - const upb_ExtensionRange* r = &m->ext_ranges[i]; - if (r->start <= f->number_ && f->number_ < r->end) { - found = true; - break; - } - } - - if (!found) { - symtab_errf(ctx, - "field number %u in extension %s has no extension range in " - "message %s", - (unsigned)f->number_, f->full_name, f->msgdef->full_name); - } - - const upb_MiniTable_Extension* ext = ctx->file->ext_layouts[f->layout_index]; - if (ctx->layout) { - UPB_ASSERT(upb_FieldDef_Number(f) == ext->field.number); - } else { - upb_MiniTable_Extension* mut_ext = (upb_MiniTable_Extension*)ext; - fill_fieldlayout(&mut_ext->field, f); - mut_ext->field.presence = 0; - mut_ext->field.offset = 0; - mut_ext->field.submsg_index = 0; - mut_ext->extendee = f->msgdef->layout; - mut_ext->sub.submsg = f->sub.msgdef->layout; - } - - CHK_OOM(upb_inttable_insert(&ctx->symtab->exts, (uintptr_t)ext, - upb_value_constptr(f), ctx->arena)); -} - -static void resolve_default( - symtab_addctx* ctx, upb_FieldDef* f, - const google_protobuf_FieldDescriptorProto* field_proto) { - // Have to delay resolving of the default value until now because of the enum - // case, since enum defaults are specified with a label. - if (google_protobuf_FieldDescriptorProto_has_default_value(field_proto)) { - upb_StringView defaultval = - google_protobuf_FieldDescriptorProto_default_value(field_proto); - - if (f->file->syntax == kUpb_Syntax_Proto3) { - symtab_errf(ctx, "proto3 fields cannot have explicit defaults (%s)", - f->full_name); - } - - if (upb_FieldDef_IsSubMessage(f)) { - symtab_errf(ctx, "message fields cannot have explicit defaults (%s)", - f->full_name); - } - - parse_default(ctx, defaultval.data, defaultval.size, f); - f->has_default = true; - } else { - set_default_default(ctx, f); - f->has_default = false; - } -} - -static void resolve_fielddef(symtab_addctx* ctx, const char* prefix, - upb_FieldDef* f) { - // We have to stash this away since resolve_subdef() may overwrite it. - const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved; - - resolve_subdef(ctx, prefix, f); - resolve_default(ctx, f, field_proto); - - if (f->is_extension_) { - resolve_extension(ctx, prefix, f, field_proto); - } -} - -static void resolve_msgdef(symtab_addctx* ctx, upb_MessageDef* m) { - for (int i = 0; i < m->field_count; i++) { - resolve_fielddef(ctx, m->full_name, (upb_FieldDef*)&m->fields[i]); - } - - m->in_message_set = false; - for (int i = 0; i < m->nested_ext_count; i++) { - upb_FieldDef* ext = (upb_FieldDef*)&m->nested_exts[i]; - resolve_fielddef(ctx, m->full_name, ext); - if (ext->type_ == kUpb_FieldType_Message && - ext->label_ == kUpb_Label_Optional && ext->sub.msgdef == m && - google_protobuf_MessageOptions_message_set_wire_format( - ext->msgdef->opts)) { - m->in_message_set = true; - } - } - - if (!ctx->layout) make_layout(ctx, m); - - for (int i = 0; i < m->nested_msg_count; i++) { - resolve_msgdef(ctx, (upb_MessageDef*)&m->nested_msgs[i]); - } -} - -static int count_exts_in_msg(const google_protobuf_DescriptorProto* msg_proto) { - size_t n; - google_protobuf_DescriptorProto_extension(msg_proto, &n); - int ext_count = n; - - const google_protobuf_DescriptorProto* const* nested_msgs = - google_protobuf_DescriptorProto_nested_type(msg_proto, &n); - for (size_t i = 0; i < n; i++) { - ext_count += count_exts_in_msg(nested_msgs[i]); - } - - return ext_count; -} - -static void build_filedef( - symtab_addctx* ctx, upb_FileDef* file, - const google_protobuf_FileDescriptorProto* file_proto) { - const google_protobuf_DescriptorProto* const* msgs; - const google_protobuf_EnumDescriptorProto* const* enums; - const google_protobuf_FieldDescriptorProto* const* exts; - const google_protobuf_ServiceDescriptorProto* const* services; - const upb_StringView* strs; - const int32_t* public_deps; - const int32_t* weak_deps; - size_t i, n; - - file->symtab = ctx->symtab; - - /* Count all extensions in the file, to build a flat array of layouts. */ - google_protobuf_FileDescriptorProto_extension(file_proto, &n); - int ext_count = n; - msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); - for (int i = 0; i < n; i++) { - ext_count += count_exts_in_msg(msgs[i]); - } - file->ext_count = ext_count; - - if (ctx->layout) { - /* We are using the ext layouts that were passed in. */ - file->ext_layouts = ctx->layout->exts; - if (ctx->layout->ext_count != file->ext_count) { - symtab_errf(ctx, "Extension count did not match layout (%d vs %d)", - ctx->layout->ext_count, file->ext_count); - } - } else { - /* We are building ext layouts from scratch. */ - file->ext_layouts = - symtab_alloc(ctx, sizeof(*file->ext_layouts) * file->ext_count); - upb_MiniTable_Extension* ext = - symtab_alloc(ctx, sizeof(*ext) * file->ext_count); - for (int i = 0; i < file->ext_count; i++) { - file->ext_layouts[i] = &ext[i]; - } - } - - if (!google_protobuf_FileDescriptorProto_has_name(file_proto)) { - symtab_errf(ctx, "File has no name"); - } - - file->name = - strviewdup(ctx, google_protobuf_FileDescriptorProto_name(file_proto)); - - if (google_protobuf_FileDescriptorProto_has_package(file_proto)) { - upb_StringView package = - google_protobuf_FileDescriptorProto_package(file_proto); - check_ident(ctx, package, true); - file->package = strviewdup(ctx, package); - } else { - file->package = NULL; - } - - if (google_protobuf_FileDescriptorProto_has_syntax(file_proto)) { - upb_StringView syntax = - google_protobuf_FileDescriptorProto_syntax(file_proto); - - if (streql_view(syntax, "proto2")) { - file->syntax = kUpb_Syntax_Proto2; - } else if (streql_view(syntax, "proto3")) { - file->syntax = kUpb_Syntax_Proto3; - } else { - symtab_errf(ctx, "Invalid syntax '" UPB_STRINGVIEW_FORMAT "'", - UPB_STRINGVIEW_ARGS(syntax)); - } - } else { - file->syntax = kUpb_Syntax_Proto2; - } - - /* Read options. */ - SET_OPTIONS(file->opts, FileDescriptorProto, FileOptions, file_proto); - - /* Verify dependencies. */ - strs = google_protobuf_FileDescriptorProto_dependency(file_proto, &n); - file->dep_count = n; - file->deps = symtab_alloc(ctx, sizeof(*file->deps) * n); - - for (i = 0; i < n; i++) { - upb_StringView str = strs[i]; - file->deps[i] = - upb_DefPool_FindFileByNameWithSize(ctx->symtab, str.data, str.size); - if (!file->deps[i]) { - symtab_errf(ctx, - "Depends on file '" UPB_STRINGVIEW_FORMAT - "', but it has not been loaded", - UPB_STRINGVIEW_ARGS(str)); - } - } - - public_deps = - google_protobuf_FileDescriptorProto_public_dependency(file_proto, &n); - file->public_dep_count = n; - file->public_deps = symtab_alloc(ctx, sizeof(*file->public_deps) * n); - int32_t* mutable_public_deps = (int32_t*)file->public_deps; - for (i = 0; i < n; i++) { - if (public_deps[i] >= file->dep_count) { - symtab_errf(ctx, "public_dep %d is out of range", (int)public_deps[i]); - } - mutable_public_deps[i] = public_deps[i]; - } - - weak_deps = - google_protobuf_FileDescriptorProto_weak_dependency(file_proto, &n); - file->weak_dep_count = n; - file->weak_deps = symtab_alloc(ctx, sizeof(*file->weak_deps) * n); - int32_t* mutable_weak_deps = (int32_t*)file->weak_deps; - for (i = 0; i < n; i++) { - if (weak_deps[i] >= file->dep_count) { - symtab_errf(ctx, "weak_dep %d is out of range", (int)weak_deps[i]); - } - mutable_weak_deps[i] = weak_deps[i]; - } - - /* Create enums. */ - enums = google_protobuf_FileDescriptorProto_enum_type(file_proto, &n); - file->top_lvl_enum_count = n; - file->top_lvl_enums = symtab_alloc(ctx, sizeof(*file->top_lvl_enums) * n); - for (i = 0; i < n; i++) { - create_enumdef(ctx, file->package, enums[i], NULL, &file->top_lvl_enums[i]); - } - - /* Create extensions. */ - exts = google_protobuf_FileDescriptorProto_extension(file_proto, &n); - file->top_lvl_ext_count = n; - file->top_lvl_exts = symtab_alloc(ctx, sizeof(*file->top_lvl_exts) * n); - for (i = 0; i < n; i++) { - create_fielddef(ctx, file->package, NULL, exts[i], &file->top_lvl_exts[i], - /* is_extension= */ true); - ((upb_FieldDef*)&file->top_lvl_exts[i])->index_ = i; - } - - /* Create messages. */ - msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); - file->top_lvl_msg_count = n; - file->top_lvl_msgs = symtab_alloc(ctx, sizeof(*file->top_lvl_msgs) * n); - for (i = 0; i < n; i++) { - create_msgdef(ctx, file->package, msgs[i], NULL, &file->top_lvl_msgs[i]); - } - - /* Create services. */ - services = google_protobuf_FileDescriptorProto_service(file_proto, &n); - file->service_count = n; - file->services = symtab_alloc(ctx, sizeof(*file->services) * n); - for (i = 0; i < n; i++) { - create_service(ctx, services[i], &file->services[i]); - ((upb_ServiceDef*)&file->services[i])->index = i; - } - - /* Now that all names are in the table, build layouts and resolve refs. */ - for (i = 0; i < (size_t)file->top_lvl_ext_count; i++) { - resolve_fielddef(ctx, file->package, (upb_FieldDef*)&file->top_lvl_exts[i]); - } - - for (i = 0; i < (size_t)file->top_lvl_msg_count; i++) { - resolve_msgdef(ctx, (upb_MessageDef*)&file->top_lvl_msgs[i]); - } - - if (file->ext_count) { - CHK_OOM(_upb_extreg_add(ctx->symtab->extreg, file->ext_layouts, - file->ext_count)); - } -} - -static void remove_filedef(upb_DefPool* s, upb_FileDef* file) { - intptr_t iter = UPB_INTTABLE_BEGIN; - upb_StringView key; - upb_value val; - while (upb_strtable_next2(&s->syms, &key, &val, &iter)) { - const upb_FileDef* f; - switch (deftype(val)) { - case UPB_DEFTYPE_EXT: - f = upb_FieldDef_File(unpack_def(val, UPB_DEFTYPE_EXT)); - break; - case UPB_DEFTYPE_MSG: - f = upb_MessageDef_File(unpack_def(val, UPB_DEFTYPE_MSG)); - break; - case UPB_DEFTYPE_ENUM: - f = upb_EnumDef_File(unpack_def(val, UPB_DEFTYPE_ENUM)); - break; - case UPB_DEFTYPE_ENUMVAL: - f = upb_EnumDef_File( - upb_EnumValueDef_Enum(unpack_def(val, UPB_DEFTYPE_ENUMVAL))); - break; - case UPB_DEFTYPE_SERVICE: - f = upb_ServiceDef_File(unpack_def(val, UPB_DEFTYPE_SERVICE)); - break; - default: - UPB_UNREACHABLE(); - } - - if (f == file) upb_strtable_removeiter(&s->syms, &iter); - } -} - -static const upb_FileDef* _upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, - const upb_MiniTable_File* layout, upb_Status* status) { - symtab_addctx ctx; - upb_StringView name = google_protobuf_FileDescriptorProto_name(file_proto); - upb_value v; - - if (upb_strtable_lookup2(&s->files, name.data, name.size, &v)) { - if (unpack_def(v, UPB_DEFTYPE_FILE)) { - upb_Status_SetErrorFormat(status, "duplicate file name (%.*s)", - UPB_STRINGVIEW_ARGS(name)); - return NULL; - } - const upb_MiniTable_File* registered = unpack_def(v, UPB_DEFTYPE_LAYOUT); - UPB_ASSERT(registered); - if (layout && layout != registered) { - upb_Status_SetErrorFormat( - status, "tried to build with a different layout (filename=%.*s)", - UPB_STRINGVIEW_ARGS(name)); - return NULL; - } - layout = registered; - } - - ctx.symtab = s; - ctx.layout = layout; - ctx.msg_count = 0; - ctx.enum_count = 0; - ctx.ext_count = 0; - ctx.status = status; - ctx.file = NULL; - ctx.arena = upb_Arena_New(); - ctx.tmp_arena = upb_Arena_New(); - - if (!ctx.arena || !ctx.tmp_arena) { - if (ctx.arena) upb_Arena_Free(ctx.arena); - if (ctx.tmp_arena) upb_Arena_Free(ctx.tmp_arena); - upb_Status_setoom(status); - return NULL; - } - - if (UPB_UNLIKELY(UPB_SETJMP(ctx.err))) { - UPB_ASSERT(!upb_Status_IsOk(status)); - if (ctx.file) { - remove_filedef(s, ctx.file); - ctx.file = NULL; - } - } else { - ctx.file = symtab_alloc(&ctx, sizeof(*ctx.file)); - build_filedef(&ctx, ctx.file, file_proto); - upb_strtable_insert(&s->files, name.data, name.size, - pack_def(ctx.file, UPB_DEFTYPE_FILE), ctx.arena); - UPB_ASSERT(upb_Status_IsOk(status)); - upb_Arena_Fuse(s->arena, ctx.arena); - } - - upb_Arena_Free(ctx.arena); - upb_Arena_Free(ctx.tmp_arena); - return ctx.file; -} - -const upb_FileDef* upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, - upb_Status* status) { - return _upb_DefPool_AddFile(s, file_proto, NULL, status); -} - -/* Include here since we want most of this file to be stdio-free. */ -#include - -bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, - bool rebuild_minitable) { - /* Since this function should never fail (it would indicate a bug in upb) we - * print errors to stderr instead of returning error status to the user. */ - _upb_DefPool_Init** deps = init->deps; - google_protobuf_FileDescriptorProto* file; - upb_Arena* arena; - upb_Status status; - - upb_Status_Clear(&status); - - if (upb_DefPool_FindFileByName(s, init->filename)) { - return true; - } - - arena = upb_Arena_New(); - - for (; *deps; deps++) { - if (!_upb_DefPool_LoadDefInitEx(s, *deps, rebuild_minitable)) goto err; - } - - file = google_protobuf_FileDescriptorProto_parse_ex( - init->descriptor.data, init->descriptor.size, NULL, - kUpb_DecodeOption_AliasString, arena); - s->bytes_loaded += init->descriptor.size; - - if (!file) { - upb_Status_SetErrorFormat( - &status, - "Failed to parse compiled-in descriptor for file '%s'. This should " - "never happen.", - init->filename); - goto err; - } - - const upb_MiniTable_File* mt = rebuild_minitable ? NULL : init->layout; - if (!_upb_DefPool_AddFile(s, file, mt, &status)) { - goto err; - } - - upb_Arena_Free(arena); - return true; - -err: - fprintf(stderr, - "Error loading compiled-in descriptor for file '%s' (this should " - "never happen): %s\n", - init->filename, upb_Status_ErrorMessage(&status)); - upb_Arena_Free(arena); - return false; -} - -size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s) { - return s->bytes_loaded; -} - -upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s) { return s->arena; } - -const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable( - const upb_DefPool* s, const upb_MiniTable_Extension* ext) { - upb_value v; - bool ok = upb_inttable_lookup(&s->exts, (uintptr_t)ext, &v); - UPB_ASSERT(ok); - return upb_value_getconstptr(v); -} - -const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, - const upb_MessageDef* m, - int32_t fieldnum) { - const upb_MiniTable* l = upb_MessageDef_MiniTable(m); - const upb_MiniTable_Extension* ext = _upb_extreg_get(s->extreg, l, fieldnum); - return ext ? _upb_DefPool_FindExtensionByMiniTable(s, ext) : NULL; -} - -bool _upb_DefPool_registerlayout(upb_DefPool* s, const char* filename, - const upb_MiniTable_File* file) { - if (upb_DefPool_FindFileByName(s, filename)) return false; - upb_value v = pack_def(file, UPB_DEFTYPE_LAYOUT); - return upb_strtable_insert(&s->files, filename, strlen(filename), v, - s->arena); -} - -const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( - const upb_DefPool* s) { - return s->extreg; -} - -const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s, - const upb_MessageDef* m, - size_t* count) { - size_t n = 0; - intptr_t iter = UPB_INTTABLE_BEGIN; - uintptr_t key; - upb_value val; - // This is O(all exts) instead of O(exts for m). If we need this to be - // efficient we may need to make extreg into a two-level table, or have a - // second per-message index. - while (upb_inttable_next2(&s->exts, &key, &val, &iter)) { - const upb_FieldDef* f = upb_value_getconstptr(val); - if (upb_FieldDef_ContainingType(f) == m) n++; - } - const upb_FieldDef** exts = malloc(n * sizeof(*exts)); - iter = UPB_INTTABLE_BEGIN; - size_t i = 0; - while (upb_inttable_next2(&s->exts, &key, &val, &iter)) { - const upb_FieldDef* f = upb_value_getconstptr(val); - if (upb_FieldDef_ContainingType(f) == m) exts[i++] = f; - } - *count = n; - return exts; -} - -#undef CHK_OOM diff --git a/third_party/upb/upb/def.h b/third_party/upb/upb/def.h index 2cb312df1a2..ebf1d9d3bdd 100644 --- a/third_party/upb/upb/def.h +++ b/third_party/upb/upb/def.h @@ -25,392 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/reflection/def.h instead +// IWYU pragma: private, include "upb/reflection/def.h" + #ifndef UPB_DEF_H_ #define UPB_DEF_H_ -#include "google/protobuf/descriptor.upb.h" -#include "upb/internal/table.h" -#include "upb/upb.h" - -/* Must be last. */ -#include "upb/port_def.inc" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct upb_EnumDef; -typedef struct upb_EnumDef upb_EnumDef; -struct upb_EnumValueDef; -typedef struct upb_EnumValueDef upb_EnumValueDef; -struct upb_ExtensionRange; -typedef struct upb_ExtensionRange upb_ExtensionRange; -struct upb_FieldDef; -typedef struct upb_FieldDef upb_FieldDef; -struct upb_FileDef; -typedef struct upb_FileDef upb_FileDef; -struct upb_MethodDef; -typedef struct upb_MethodDef upb_MethodDef; -struct upb_MessageDef; -typedef struct upb_MessageDef upb_MessageDef; -struct upb_OneofDef; -typedef struct upb_OneofDef upb_OneofDef; -struct upb_ServiceDef; -typedef struct upb_ServiceDef upb_ServiceDef; -struct upb_streamdef; -typedef struct upb_streamdef upb_streamdef; -struct upb_DefPool; -typedef struct upb_DefPool upb_DefPool; - -typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax; - -/* All the different kind of well known type messages. For simplicity of check, - * number wrappers and string wrappers are grouped together. Make sure the - * order and merber of these groups are not changed. - */ -typedef enum { - kUpb_WellKnown_Unspecified, - kUpb_WellKnown_Any, - kUpb_WellKnown_FieldMask, - kUpb_WellKnown_Duration, - kUpb_WellKnown_Timestamp, - /* number wrappers */ - kUpb_WellKnown_DoubleValue, - kUpb_WellKnown_FloatValue, - kUpb_WellKnown_Int64Value, - kUpb_WellKnown_UInt64Value, - kUpb_WellKnown_Int32Value, - kUpb_WellKnown_UInt32Value, - /* string wrappers */ - kUpb_WellKnown_StringValue, - kUpb_WellKnown_BytesValue, - kUpb_WellKnown_BoolValue, - kUpb_WellKnown_Value, - kUpb_WellKnown_ListValue, - kUpb_WellKnown_Struct -} upb_WellKnown; - -/* upb_FieldDef ***************************************************************/ - -/* Maximum field number allowed for FieldDefs. This is an inherent limit of the - * protobuf wire format. */ -#define kUpb_MaxFieldNumber ((1 << 29) - 1) - -const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f); -bool upb_FieldDef_HasOptions(const upb_FieldDef* f); -const char* upb_FieldDef_FullName(const upb_FieldDef* f); -upb_CType upb_FieldDef_CType(const upb_FieldDef* f); -upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); -upb_Label upb_FieldDef_Label(const upb_FieldDef* f); -uint32_t upb_FieldDef_Number(const upb_FieldDef* f); -const char* upb_FieldDef_Name(const upb_FieldDef* f); -const char* upb_FieldDef_JsonName(const upb_FieldDef* f); -bool upb_FieldDef_HasJsonName(const upb_FieldDef* f); -bool upb_FieldDef_IsExtension(const upb_FieldDef* f); -bool upb_FieldDef_IsPacked(const upb_FieldDef* f); -const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f); -const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f); -const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f); -const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f); -const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f); -uint32_t upb_FieldDef_Index(const upb_FieldDef* f); -bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f); -bool upb_FieldDef_IsString(const upb_FieldDef* f); -bool upb_FieldDef_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); -bool upb_FieldDef_HasDefault(const upb_FieldDef* f); -bool upb_FieldDef_HasSubDef(const upb_FieldDef* f); -bool upb_FieldDef_HasPresence(const upb_FieldDef* f); -const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f); -const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f); -const upb_MiniTable_Field* upb_FieldDef_MiniTable(const upb_FieldDef* f); -const upb_MiniTable_Extension* _upb_FieldDef_ExtensionMiniTable( - const upb_FieldDef* f); -bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f); - -/* upb_OneofDef ***************************************************************/ - -const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o); -bool upb_OneofDef_HasOptions(const upb_OneofDef* o); -const char* upb_OneofDef_Name(const upb_OneofDef* o); -const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o); -uint32_t upb_OneofDef_Index(const upb_OneofDef* o); -bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o); -int upb_OneofDef_FieldCount(const upb_OneofDef* o); -const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i); - -/* Oneof lookups: - * - ntof: look up a field by name. - * - ntofz: look up a field by name (as a null-terminated string). - * - itof: look up a field by number. */ -const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o, - const char* name, - size_t length); -UPB_INLINE const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o, - const char* name) { - return upb_OneofDef_LookupNameWithSize(o, name, strlen(name)); -} -const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, - uint32_t num); - -/* upb_MessageDef *************************************************************/ - -/* Well-known field tag numbers for map-entry messages. */ -#define kUpb_MapEntry_KeyFieldNumber 1 -#define kUpb_MapEntry_ValueFieldNumber 2 - -/* Well-known field tag numbers for Any messages. */ -#define kUpb_Any_TypeFieldNumber 1 -#define kUpb_Any_ValueFieldNumber 2 - -/* Well-known field tag numbers for duration messages. */ -#define kUpb_Duration_SecondsFieldNumber 1 -#define kUpb_Duration_NanosFieldNumber 2 - -/* Well-known field tag numbers for timestamp messages. */ -#define kUpb_Timestamp_SecondsFieldNumber 1 -#define kUpb_Timestamp_NanosFieldNumber 2 - -const google_protobuf_MessageOptions* upb_MessageDef_Options( - const upb_MessageDef* m); -bool upb_MessageDef_HasOptions(const upb_MessageDef* m); -const char* upb_MessageDef_FullName(const upb_MessageDef* m); -const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m); -const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m); -const char* upb_MessageDef_Name(const upb_MessageDef* m); -upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m); -upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m); -int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m); -int upb_MessageDef_FieldCount(const upb_MessageDef* m); -int upb_MessageDef_OneofCount(const upb_MessageDef* m); -const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m, - int i); -const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i); -const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i); -const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m, - uint32_t i); -const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize( - const upb_MessageDef* m, const char* name, size_t len); -const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize( - const upb_MessageDef* m, const char* name, size_t len); -const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m); - -UPB_INLINE const upb_OneofDef* upb_MessageDef_FindOneofByName( - const upb_MessageDef* m, const char* name) { - return upb_MessageDef_FindOneofByNameWithSize(m, name, strlen(name)); -} - -UPB_INLINE const upb_FieldDef* upb_MessageDef_FindFieldByName( - const upb_MessageDef* m, const char* name) { - return upb_MessageDef_FindFieldByNameWithSize(m, name, strlen(name)); -} - -UPB_INLINE 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); -int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m); -const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m, - int i); -const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i); -const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m, - int i); - -/* Lookup of either field or oneof by name. Returns whether either was found. - * If the return is true, then the found def will be set, and the non-found - * one set to NULL. */ -bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m, - const char* name, size_t len, - const upb_FieldDef** f, - const upb_OneofDef** o); - -UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m, - const char* name, - const upb_FieldDef** f, - const upb_OneofDef** o) { - return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o); -} - -/* Returns a field by either JSON name or regular proto name. */ -const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize( - const upb_MessageDef* m, const char* name, size_t len); -UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName( - const upb_MessageDef* m, const char* name) { - return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name)); -} - -/* upb_ExtensionRange *********************************************************/ - -const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options( - const upb_ExtensionRange* r); -bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r); -int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r); -int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r); - -/* upb_EnumDef ****************************************************************/ - -const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e); -bool upb_EnumDef_HasOptions(const upb_EnumDef* e); -const char* upb_EnumDef_FullName(const upb_EnumDef* e); -const char* upb_EnumDef_Name(const upb_EnumDef* e); -const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e); -const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e); -int32_t upb_EnumDef_Default(const upb_EnumDef* e); -int upb_EnumDef_ValueCount(const upb_EnumDef* e); -const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i); - -const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize( - const upb_EnumDef* e, const char* name, size_t len); -const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* e, - int32_t num); -bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num); - -// Convenience wrapper. -UPB_INLINE const upb_EnumValueDef* upb_EnumDef_FindValueByName( - const upb_EnumDef* e, const char* name) { - return upb_EnumDef_FindValueByNameWithSize(e, name, strlen(name)); -} - -/* upb_EnumValueDef ***********************************************************/ - -const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options( - const upb_EnumValueDef* e); -bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* e); -const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* e); -const char* upb_EnumValueDef_Name(const upb_EnumValueDef* e); -int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* e); -uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* e); -const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* e); - -/* upb_FileDef ****************************************************************/ - -const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f); -bool upb_FileDef_HasOptions(const upb_FileDef* f); -const char* upb_FileDef_Name(const upb_FileDef* f); -const char* upb_FileDef_Package(const upb_FileDef* f); -upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f); -int upb_FileDef_DependencyCount(const upb_FileDef* f); -int upb_FileDef_PublicDependencyCount(const upb_FileDef* f); -int upb_FileDef_WeakDependencyCount(const upb_FileDef* f); -int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f); -int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f); -int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f); -int upb_FileDef_ServiceCount(const upb_FileDef* f); -const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i); -const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i); -const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i); -const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i); -const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i); -const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i); -const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i); -const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f); -const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f); -const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f); - -/* upb_MethodDef **************************************************************/ - -const google_protobuf_MethodOptions* upb_MethodDef_Options( - const upb_MethodDef* m); -bool upb_MethodDef_HasOptions(const upb_MethodDef* m); -const char* upb_MethodDef_FullName(const upb_MethodDef* m); -int upb_MethodDef_Index(const upb_MethodDef* m); -const char* upb_MethodDef_Name(const upb_MethodDef* m); -const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); -const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m); -const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m); -bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m); -bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m); - -/* upb_ServiceDef *************************************************************/ - -const google_protobuf_ServiceOptions* upb_ServiceDef_Options( - const upb_ServiceDef* s); -bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s); -const char* upb_ServiceDef_FullName(const upb_ServiceDef* s); -const char* upb_ServiceDef_Name(const upb_ServiceDef* s); -int upb_ServiceDef_Index(const upb_ServiceDef* s); -const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s); -int upb_ServiceDef_MethodCount(const upb_ServiceDef* s); -const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i); -const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, - const char* name); - -/* upb_DefPool ****************************************************************/ - -upb_DefPool* upb_DefPool_New(void); -void upb_DefPool_Free(upb_DefPool* s); -const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s, - const char* sym); -const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize( - const upb_DefPool* s, const char* sym, size_t len); -const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s, - const char* sym); -const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s, - const char* sym); -const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s, - const char* sym); -const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( - const upb_DefPool* s, const char* sym, size_t len); -const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s, - const char* name); -const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s, - const char* name); -const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( - const upb_DefPool* s, const char* name, size_t size); -const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, - const char* name); -const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s, - const char* name, - size_t len); -const upb_FileDef* upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file, - upb_Status* status); -size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s); -upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s); -const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable( - const upb_DefPool* s, const upb_MiniTable_Extension* ext); -const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, - const upb_MessageDef* m, - int32_t fieldnum); -const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( - const upb_DefPool* s); -const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s, - const upb_MessageDef* m, - size_t* count); - -/* For generated code only: loads a generated descriptor. */ -typedef struct _upb_DefPool_Init { - struct _upb_DefPool_Init** deps; /* Dependencies of this file. */ - const upb_MiniTable_File* layout; - const char* filename; - upb_StringView descriptor; /* Serialized descriptor. */ -} _upb_DefPool_Init; - -// Should only be directly called by tests. This variant lets us suppress -// the use of compiled-in tables, forcing a rebuild of the tables at runtime. -bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, - bool rebuild_minitable); - -UPB_INLINE bool _upb_DefPool_LoadDefInit(upb_DefPool* s, - const _upb_DefPool_Init* init) { - return _upb_DefPool_LoadDefInitEx(s, init, false); -} - -#include "upb/port_undef.inc" - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +#include "upb/reflection/def.h" #endif /* UPB_DEF_H_ */ diff --git a/third_party/upb/upb/def.hpp b/third_party/upb/upb/def.hpp index 49cc5608162..4a62909ab2f 100644 --- a/third_party/upb/upb/def.hpp +++ b/third_party/upb/upb/def.hpp @@ -23,419 +23,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// This header is deprecated, use upb/reflection/def.hpp instead + #ifndef UPB_DEF_HPP_ #define UPB_DEF_HPP_ -#include -#include -#include -#include - -#include "upb/def.h" -#include "upb/reflection.h" -#include "upb/upb.hpp" - -namespace upb { - -typedef upb_MessageValue MessageValue; - -class EnumDefPtr; -class FileDefPtr; -class MessageDefPtr; -class OneofDefPtr; - -// A upb::FieldDefPtr describes a single field in a message. It is most often -// found as a part of a upb_MessageDef, but can also stand alone to represent -// an extension. -class FieldDefPtr { - public: - FieldDefPtr() : ptr_(nullptr) {} - explicit FieldDefPtr(const upb_FieldDef* ptr) : ptr_(ptr) {} - - const upb_FieldDef* ptr() const { return ptr_; } - explicit operator bool() const { return ptr_ != nullptr; } - - typedef upb_CType Type; - typedef upb_Label Label; - typedef upb_FieldType DescriptorType; - - const char* full_name() const { return upb_FieldDef_FullName(ptr_); } - - Type type() const { return upb_FieldDef_CType(ptr_); } - Label label() const { return upb_FieldDef_Label(ptr_); } - const char* name() const { return upb_FieldDef_Name(ptr_); } - const char* json_name() const { return upb_FieldDef_JsonName(ptr_); } - uint32_t number() const { return upb_FieldDef_Number(ptr_); } - bool is_extension() const { return upb_FieldDef_IsExtension(ptr_); } - - // For non-string, non-submessage fields, this indicates whether binary - // protobufs are encoded in packed or non-packed format. - // - // Note: this accessor reflects the fact that "packed" has different defaults - // depending on whether the proto is proto2 or proto3. - bool packed() const { return upb_FieldDef_IsPacked(ptr_); } - - // An integer that can be used as an index into an array of fields for - // whatever message this field belongs to. Guaranteed to be less than - // f->containing_type()->field_count(). May only be accessed once the def has - // been finalized. - uint32_t index() const { return upb_FieldDef_Index(ptr_); } - - // The MessageDef to which this field belongs. - // - // If this field has been added to a MessageDef, that message can be retrieved - // directly (this is always the case for frozen FieldDefs). - // - // If the field has not yet been added to a MessageDef, you can set the name - // of the containing type symbolically instead. This is mostly useful for - // extensions, where the extension is declared separately from the message. - MessageDefPtr containing_type() const; - - // The OneofDef to which this field belongs, or NULL if this field is not part - // of a oneof. - OneofDefPtr containing_oneof() const; - - // The field's type according to the enum in descriptor.proto. This is not - // the same as UPB_TYPE_*, because it distinguishes between (for example) - // INT32 and SINT32, whereas our "type" enum does not. This return of - // descriptor_type() is a function of type(), integer_format(), and - // is_tag_delimited(). - DescriptorType descriptor_type() const { return upb_FieldDef_Type(ptr_); } - - // Convenient field type tests. - bool IsSubMessage() const { return upb_FieldDef_IsSubMessage(ptr_); } - bool IsString() const { return upb_FieldDef_IsString(ptr_); } - bool IsSequence() const { return upb_FieldDef_IsRepeated(ptr_); } - bool IsPrimitive() const { return upb_FieldDef_IsPrimitive(ptr_); } - bool IsMap() const { return upb_FieldDef_IsMap(ptr_); } - - MessageValue default_value() const { return upb_FieldDef_Default(ptr_); } - - // Returns the enum or submessage def for this field, if any. The field's - // type must match (ie. you may only call enum_subdef() for fields where - // type() == kUpb_CType_Enum). - EnumDefPtr enum_subdef() const; - MessageDefPtr message_subdef() const; - - private: - const upb_FieldDef* ptr_; -}; - -// Class that represents a oneof. -class OneofDefPtr { - public: - OneofDefPtr() : ptr_(nullptr) {} - explicit OneofDefPtr(const upb_OneofDef* ptr) : ptr_(ptr) {} - - const upb_OneofDef* ptr() const { return ptr_; } - explicit operator bool() const { return ptr_ != nullptr; } - - // Returns the MessageDef that contains this OneofDef. - MessageDefPtr containing_type() const; - - // Returns the name of this oneof. - const char* name() const { return upb_OneofDef_Name(ptr_); } - - // Returns the number of fields in the oneof. - int field_count() const { return upb_OneofDef_FieldCount(ptr_); } - FieldDefPtr field(int i) const { - return FieldDefPtr(upb_OneofDef_Field(ptr_, i)); - } - - // Looks up by name. - FieldDefPtr FindFieldByName(const char* name, size_t len) const { - return FieldDefPtr(upb_OneofDef_LookupNameWithSize(ptr_, name, len)); - } - FieldDefPtr FindFieldByName(const char* name) const { - return FieldDefPtr(upb_OneofDef_LookupName(ptr_, name)); - } - - template - FieldDefPtr FindFieldByName(const T& str) const { - return FindFieldByName(str.c_str(), str.size()); - } - - // Looks up by tag number. - FieldDefPtr FindFieldByNumber(uint32_t num) const { - return FieldDefPtr(upb_OneofDef_LookupNumber(ptr_, num)); - } - - private: - const upb_OneofDef* ptr_; -}; - -// Structure that describes a single .proto message type. -class MessageDefPtr { - public: - MessageDefPtr() : ptr_(nullptr) {} - explicit MessageDefPtr(const upb_MessageDef* ptr) : ptr_(ptr) {} - - const upb_MessageDef* ptr() const { return ptr_; } - explicit operator bool() const { return ptr_ != nullptr; } - - FileDefPtr file() const; - - const char* full_name() const { return upb_MessageDef_FullName(ptr_); } - const char* name() const { return upb_MessageDef_Name(ptr_); } - - // The number of fields that belong to the MessageDef. - int field_count() const { return upb_MessageDef_FieldCount(ptr_); } - FieldDefPtr field(int i) const { - return FieldDefPtr(upb_MessageDef_Field(ptr_, i)); - } - - // The number of oneofs that belong to the MessageDef. - int oneof_count() const { return upb_MessageDef_OneofCount(ptr_); } - OneofDefPtr oneof(int i) const { - return OneofDefPtr(upb_MessageDef_Oneof(ptr_, i)); - } - - upb_Syntax syntax() const { return upb_MessageDef_Syntax(ptr_); } - - // These return null pointers if the field is not found. - FieldDefPtr FindFieldByNumber(uint32_t number) const { - return FieldDefPtr(upb_MessageDef_FindFieldByNumber(ptr_, number)); - } - FieldDefPtr FindFieldByName(const char* name, size_t len) const { - return FieldDefPtr(upb_MessageDef_FindFieldByNameWithSize(ptr_, name, len)); - } - FieldDefPtr FindFieldByName(const char* name) const { - return FieldDefPtr(upb_MessageDef_FindFieldByName(ptr_, name)); - } - - template - FieldDefPtr FindFieldByName(const T& str) const { - return FindFieldByName(str.c_str(), str.size()); - } - - OneofDefPtr FindOneofByName(const char* name, size_t len) const { - return OneofDefPtr(upb_MessageDef_FindOneofByNameWithSize(ptr_, name, len)); - } - - OneofDefPtr FindOneofByName(const char* name) const { - return OneofDefPtr(upb_MessageDef_FindOneofByName(ptr_, name)); - } - - template - OneofDefPtr FindOneofByName(const T& str) const { - return FindOneofByName(str.c_str(), str.size()); - } - - // Is this message a map entry? - bool mapentry() const { return upb_MessageDef_IsMapEntry(ptr_); } - - // Return the type of well known type message. kUpb_WellKnown_Unspecified for - // non-well-known message. - upb_WellKnown wellknowntype() const { - return upb_MessageDef_WellKnownType(ptr_); - } - - private: - class FieldIter { - public: - explicit FieldIter(const upb_MessageDef* m, int i) : m_(m), i_(i) {} - void operator++() { i_++; } - - FieldDefPtr operator*() { - return FieldDefPtr(upb_MessageDef_Field(m_, i_)); - } - bool operator!=(const FieldIter& other) { return i_ != other.i_; } - bool operator==(const FieldIter& other) { return i_ == other.i_; } - - private: - const upb_MessageDef* m_; - int i_; - }; - - class FieldAccessor { - public: - explicit FieldAccessor(const upb_MessageDef* md) : md_(md) {} - FieldIter begin() { return FieldIter(md_, 0); } - FieldIter end() { return FieldIter(md_, upb_MessageDef_FieldCount(md_)); } - - private: - const upb_MessageDef* md_; - }; - - class OneofIter { - public: - explicit OneofIter(const upb_MessageDef* m, int i) : m_(m), i_(i) {} - void operator++() { i_++; } - - OneofDefPtr operator*() { - return OneofDefPtr(upb_MessageDef_Oneof(m_, i_)); - } - bool operator!=(const OneofIter& other) { return i_ != other.i_; } - bool operator==(const OneofIter& other) { return i_ == other.i_; } - - private: - const upb_MessageDef* m_; - int i_; - }; - - class OneofAccessor { - public: - explicit OneofAccessor(const upb_MessageDef* md) : md_(md) {} - OneofIter begin() { return OneofIter(md_, 0); } - OneofIter end() { return OneofIter(md_, upb_MessageDef_OneofCount(md_)); } - - private: - const upb_MessageDef* md_; - }; - - public: - FieldAccessor fields() const { return FieldAccessor(ptr()); } - OneofAccessor oneofs() const { return OneofAccessor(ptr()); } - - private: - const upb_MessageDef* ptr_; -}; - -class EnumValDefPtr { - public: - EnumValDefPtr() : ptr_(nullptr) {} - explicit EnumValDefPtr(const upb_EnumValueDef* ptr) : ptr_(ptr) {} - - int32_t number() const { return upb_EnumValueDef_Number(ptr_); } - const char* full_name() const { return upb_EnumValueDef_FullName(ptr_); } - const char* name() const { return upb_EnumValueDef_Name(ptr_); } - - private: - const upb_EnumValueDef* ptr_; -}; - -class EnumDefPtr { - public: - EnumDefPtr() : ptr_(nullptr) {} - explicit EnumDefPtr(const upb_EnumDef* ptr) : ptr_(ptr) {} - - const upb_EnumDef* ptr() const { return ptr_; } - explicit operator bool() const { return ptr_ != nullptr; } - - const char* full_name() const { return upb_EnumDef_FullName(ptr_); } - const char* name() const { return upb_EnumDef_Name(ptr_); } - - // The value that is used as the default when no field default is specified. - // If not set explicitly, the first value that was added will be used. - // The default value must be a member of the enum. - // Requires that value_count() > 0. - int32_t default_value() const { return upb_EnumDef_Default(ptr_); } - - // Returns the number of values currently defined in the enum. Note that - // multiple names can refer to the same number, so this may be greater than - // the total number of unique numbers. - int value_count() const { return upb_EnumDef_ValueCount(ptr_); } - - // Lookups from name to integer, returning true if found. - EnumValDefPtr FindValueByName(const char* name) const { - return EnumValDefPtr(upb_EnumDef_FindValueByName(ptr_, name)); - } - - // Finds the name corresponding to the given number, or NULL if none was - // found. If more than one name corresponds to this number, returns the - // first one that was added. - EnumValDefPtr FindValueByNumber(int32_t num) const { - return EnumValDefPtr(upb_EnumDef_FindValueByNumber(ptr_, num)); - } - - private: - const upb_EnumDef* ptr_; -}; - -// Class that represents a .proto file with some things defined in it. -// -// Many users won't care about FileDefs, but they are necessary if you want to -// read the values of file-level options. -class FileDefPtr { - public: - explicit FileDefPtr(const upb_FileDef* ptr) : ptr_(ptr) {} - - const upb_FileDef* ptr() const { return ptr_; } - explicit operator bool() const { return ptr_ != nullptr; } - - // Get/set name of the file (eg. "foo/bar.proto"). - const char* name() const { return upb_FileDef_Name(ptr_); } - - // Package name for definitions inside the file (eg. "foo.bar"). - const char* package() const { return upb_FileDef_Package(ptr_); } - - // Syntax for the file. Defaults to proto2. - upb_Syntax syntax() const { return upb_FileDef_Syntax(ptr_); } - - // Get the list of dependencies from the file. These are returned in the - // order that they were added to the FileDefPtr. - int dependency_count() const { return upb_FileDef_DependencyCount(ptr_); } - const FileDefPtr dependency(int index) const { - return FileDefPtr(upb_FileDef_Dependency(ptr_, index)); - } - - private: - const upb_FileDef* ptr_; -}; - -// Non-const methods in upb::DefPool are NOT thread-safe. -class DefPool { - public: - 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(); } - - // Finds an entry in the symbol table with this exact name. If not found, - // returns NULL. - MessageDefPtr FindMessageByName(const char* sym) const { - return MessageDefPtr(upb_DefPool_FindMessageByName(ptr_.get(), sym)); - } - - EnumDefPtr FindEnumByName(const char* sym) const { - return EnumDefPtr(upb_DefPool_FindEnumByName(ptr_.get(), sym)); - } - - FileDefPtr FindFileByName(const char* name) const { - return FileDefPtr(upb_DefPool_FindFileByName(ptr_.get(), name)); - } - - // TODO: iteration? - - // Adds the given serialized FileDescriptorProto to the pool. - FileDefPtr AddFile(const google_protobuf_FileDescriptorProto* file_proto, - Status* status) { - return FileDefPtr( - upb_DefPool_AddFile(ptr_.get(), file_proto, status->ptr())); - } - - private: - 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_)); -} - -inline MessageDefPtr FieldDefPtr::message_subdef() const { - return MessageDefPtr(upb_FieldDef_MessageSubDef(ptr_)); -} - -inline MessageDefPtr FieldDefPtr::containing_type() const { - return MessageDefPtr(upb_FieldDef_ContainingType(ptr_)); -} - -inline MessageDefPtr OneofDefPtr::containing_type() const { - return MessageDefPtr(upb_OneofDef_ContainingType(ptr_)); -} - -inline OneofDefPtr FieldDefPtr::containing_oneof() const { - return OneofDefPtr(upb_FieldDef_ContainingOneof(ptr_)); -} - -inline EnumDefPtr FieldDefPtr::enum_subdef() const { - return EnumDefPtr(upb_FieldDef_EnumSubDef(ptr_)); -} - -} // namespace upb +#include "upb/reflection/def.hpp" #endif // UPB_DEF_HPP_ diff --git a/third_party/upb/upb/encode.h b/third_party/upb/upb/encode.h index 791d84a74c7..37d424fd9cb 100644 --- a/third_party/upb/upb/encode.h +++ b/third_party/upb/upb/encode.h @@ -25,57 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * upb_Encode: parsing from a upb_Message using a upb_MiniTable. - */ +// This header is deprecated, use upb/wire/encode.h instead +// IWYU pragma: private, include "upb/wire/encode.h" #ifndef UPB_ENCODE_H_ #define UPB_ENCODE_H_ -#include "upb/msg.h" - -/* Must be last. */ -#include "upb/port_def.inc" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - /* If set, the results of serializing will be deterministic across all - * instances of this binary. There are no guarantees across different - * binary builds. - * - * If your proto contains maps, the encoder will need to malloc()/free() - * memory during encode. */ - kUpb_EncodeOption_Deterministic = 1, - - /* When set, unknown fields are not printed. */ - kUpb_EncodeOption_SkipUnknown = 2, - - /* When set, the encode will fail if any required fields are missing. */ - kUpb_EncodeOption_CheckRequired = 4, -}; - -#define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16) - -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" - -#ifdef __cplusplus -} /* extern "C" */ -#endif +#include "upb/wire/encode.h" #endif /* UPB_ENCODE_H_ */ diff --git a/third_party/upb/upb/extension_registry.h b/third_party/upb/upb/extension_registry.h index 0e0a4440ca6..5a9564fb8b0 100644 --- a/third_party/upb/upb/extension_registry.h +++ b/third_party/upb/upb/extension_registry.h @@ -25,60 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/mini_table/extension_registry.h instead + #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 +#include "upb/mini_table/extension_registry.h" #endif /* UPB_EXTENSION_REGISTRY_H_ */ diff --git a/third_party/upb/upb/table.c b/third_party/upb/upb/hash/common.c similarity index 87% rename from third_party/upb/upb/table.c rename to third_party/upb/upb/hash/common.c index e8e55f7e340..1e32f36f8a2 100644 --- a/third_party/upb/upb/table.c +++ b/third_party/upb/upb/hash/common.c @@ -31,16 +31,18 @@ * Implementation is heavily inspired by Lua's ltable.c. */ -#include "upb/internal/table.h" - #include -/* Must be last. */ -#include "upb/port_def.inc" +#include "upb/base/log2.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" -#define UPB_MAXARRSIZE 16 /* 64k. */ +// Must be last. +#include "upb/port/def.inc" -/* From Chromium. */ +#define UPB_MAXARRSIZE 16 // 2**16 = 64k. + +// From Chromium. #define ARRAY_SIZE(x) \ ((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x]))))) @@ -63,7 +65,7 @@ static int log2ceil(uint64_t v) { int ret = 0; bool pow2 = is_pow2(v); while (v >>= 1) ret++; - ret = pow2 ? ret : ret + 1; /* Ceiling. */ + ret = pow2 ? ret : ret + 1; // Ceiling. return UPB_MIN(UPB_MAXARRSIZE, ret); } @@ -78,7 +80,7 @@ char* upb_strdup2(const char* s, size_t len, upb_Arena* a) { n = len + 1; p = upb_Arena_Malloc(a, n); if (p) { - memcpy(p, s, len); + if (len != 0) memcpy(p, s, len); p[len] = 0; } return p; @@ -458,7 +460,7 @@ bool upb_strtable_init(upb_strtable* t, size_t expected_size, upb_Arena* a) { // denominator. size_t need_entries = (expected_size + 1) * 1204 / 1024; UPB_ASSERT(need_entries >= expected_size * 0.85); - int size_lg2 = _upb_Log2Ceiling(need_entries); + int size_lg2 = upb_Log2Ceiling(need_entries); return init(&t->t, size_lg2, a); } @@ -470,14 +472,13 @@ void upb_strtable_clear(upb_strtable* t) { bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a) { upb_strtable new_table; - upb_strtable_iter i; - if (!init(&new_table.t, size_lg2, a)) return false; - upb_strtable_begin(&i, t); - for (; !upb_strtable_done(&i); upb_strtable_next(&i)) { - upb_StringView key = upb_strtable_iter_key(&i); - upb_strtable_insert(&new_table, key.data, key.size, - upb_strtable_iter_value(&i), a); + + intptr_t iter = UPB_STRTABLE_BEGIN; + upb_StringView key; + upb_value val; + while (upb_strtable_next2(t, &key, &val, &iter)) { + upb_strtable_insert(&new_table, key.data, key.size, val, a); } *t = new_table; return true; @@ -596,12 +597,13 @@ static void check(upb_inttable* t) { UPB_UNUSED(t); #if defined(UPB_DEBUG_TABLE) && !defined(NDEBUG) { - /* This check is very expensive (makes inserts/deletes O(N)). */ + // This check is very expensive (makes inserts/deletes O(N)). size_t count = 0; - upb_inttable_iter i; - upb_inttable_begin(&i, t); - for (; !upb_inttable_done(&i); upb_inttable_next(&i), count++) { - UPB_ASSERT(upb_inttable_lookup(t, upb_inttable_iter_key(&i), NULL)); + intptr_t iter = UPB_INTTABLE_BEGIN; + uintptr_t key; + upb_value val; + while (upb_inttable_next(t, &key, &val, &iter)) { + UPB_ASSERT(upb_inttable_lookup(t, key, NULL)); } UPB_ASSERT(count == upb_inttable_count(t)); } @@ -714,22 +716,22 @@ void upb_inttable_compact(upb_inttable* t, upb_Arena* a) { /* The max key in each bucket. */ uintptr_t max[UPB_MAXARRSIZE + 1] = {0}; - upb_inttable_iter i; - size_t arr_count; - int size_lg2; - upb_inttable new_t; - - upb_inttable_begin(&i, t); - for (; !upb_inttable_done(&i); upb_inttable_next(&i)) { - uintptr_t key = upb_inttable_iter_key(&i); - int bucket = log2ceil(key); - max[bucket] = UPB_MAX(max[bucket], key); - counts[bucket]++; + { + intptr_t iter = UPB_INTTABLE_BEGIN; + uintptr_t key; + upb_value val; + while (upb_inttable_next(t, &key, &val, &iter)) { + int bucket = log2ceil(key); + max[bucket] = UPB_MAX(max[bucket], key); + counts[bucket]++; + } } /* Find the largest power of two that satisfies the MIN_DENSITY * definition (while actually having some keys). */ - arr_count = upb_inttable_count(t); + size_t arr_count = upb_inttable_count(t); + int size_lg2; + upb_inttable new_t; for (size_lg2 = ARRAY_SIZE(counts) - 1; size_lg2 > 0; size_lg2--) { if (counts[size_lg2] == 0) { @@ -752,55 +754,28 @@ void upb_inttable_compact(upb_inttable* t, upb_Arena* a) { int hashsize_lg2 = log2ceil(hash_size); upb_inttable_sizedinit(&new_t, arr_size, hashsize_lg2, a); - upb_inttable_begin(&i, t); - for (; !upb_inttable_done(&i); upb_inttable_next(&i)) { - uintptr_t k = upb_inttable_iter_key(&i); - upb_inttable_insert(&new_t, k, upb_inttable_iter_value(&i), a); + + { + intptr_t iter = UPB_INTTABLE_BEGIN; + uintptr_t key; + upb_value val; + while (upb_inttable_next(t, &key, &val, &iter)) { + upb_inttable_insert(&new_t, key, val, a); + } } + UPB_ASSERT(new_t.array_size == arr_size); UPB_ASSERT(new_t.t.size_lg2 == hashsize_lg2); } *t = new_t; } -/* Iteration. */ +// Iteration. -static const upb_tabent* int_tabent(const upb_inttable_iter* i) { - UPB_ASSERT(!i->array_part); - return &i->t->t.entries[i->index]; -} - -static upb_tabval int_arrent(const upb_inttable_iter* i) { - UPB_ASSERT(i->array_part); - return i->t->array[i->index]; -} - -void upb_inttable_begin(upb_inttable_iter* i, const upb_inttable* t) { - i->t = t; - i->index = -1; - i->array_part = true; - upb_inttable_next(i); -} - -void upb_inttable_next(upb_inttable_iter* iter) { - const upb_inttable* t = iter->t; - if (iter->array_part) { - while (++iter->index < t->array_size) { - if (upb_arrhas(int_arrent(iter))) { - return; - } - } - iter->array_part = false; - iter->index = begin(&t->t); - } else { - iter->index = next(&t->t, iter->index); - } -} - -bool upb_inttable_next2(const upb_inttable* t, uintptr_t* key, upb_value* val, - intptr_t* iter) { +bool upb_inttable_next(const upb_inttable* t, uintptr_t* key, upb_value* val, + intptr_t* iter) { intptr_t i = *iter; - if (i < t->array_size) { + if ((size_t)(i + 1) <= t->array_size) { while (++i < t->array_size) { upb_tabval ent = t->array[i]; if (upb_arrhas(ent)) { @@ -810,9 +785,10 @@ bool upb_inttable_next2(const upb_inttable* t, uintptr_t* key, upb_value* val, return true; } } + i--; // Back up to exactly one position before the start of the table. } - size_t tab_idx = next(&t->t, i == -1 ? -1 : i - t->array_size); + size_t tab_idx = next(&t->t, i - t->array_size); if (tab_idx < upb_table_size(&t->t)) { upb_tabent* ent = &t->t.entries[tab_idx]; *key = ent->key; @@ -890,37 +866,3 @@ void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter) { ent->key = 0; ent->next = NULL; } - -bool upb_inttable_done(const upb_inttable_iter* i) { - if (!i->t) return true; - if (i->array_part) { - return i->index >= i->t->array_size || !upb_arrhas(int_arrent(i)); - } else { - return i->index >= upb_table_size(&i->t->t) || - upb_tabent_isempty(int_tabent(i)); - } -} - -uintptr_t upb_inttable_iter_key(const upb_inttable_iter* i) { - UPB_ASSERT(!upb_inttable_done(i)); - return i->array_part ? i->index : int_tabent(i)->key; -} - -upb_value upb_inttable_iter_value(const upb_inttable_iter* i) { - UPB_ASSERT(!upb_inttable_done(i)); - return _upb_value_val(i->array_part ? i->t->array[i->index].val - : int_tabent(i)->val.val); -} - -void upb_inttable_iter_setdone(upb_inttable_iter* i) { - i->t = NULL; - i->index = SIZE_MAX; - i->array_part = false; -} - -bool upb_inttable_iter_isequal(const upb_inttable_iter* i1, - const upb_inttable_iter* i2) { - if (upb_inttable_done(i1) && upb_inttable_done(i2)) return true; - return i1->t == i2->t && i1->index == i2->index && - i1->array_part == i2->array_part; -} diff --git a/third_party/upb/upb/hash/common.h b/third_party/upb/upb/hash/common.h new file mode 100644 index 00000000000..dfe398588b7 --- /dev/null +++ b/third_party/upb/upb/hash/common.h @@ -0,0 +1,199 @@ +/* + * 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_HASH_COMMON_H_ +#define UPB_HASH_COMMON_H_ + +#include + +#include "upb/base/string_view.h" +#include "upb/mem/arena.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; + +UPB_INLINE size_t upb_table_size(const upb_table* t) { + return t->size_lg2 ? 1 << t->size_lg2 : 0; +} + +// Internal-only functions, in .h file only out of necessity. + +UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; } + +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_HASH_COMMON_H_ */ diff --git a/third_party/upb/upb/hash/int_table.h b/third_party/upb/upb/hash/int_table.h new file mode 100644 index 00000000000..7b1d6ccbc56 --- /dev/null +++ b/third_party/upb/upb/hash/int_table.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_HASH_INT_TABLE_H_ +#define UPB_HASH_INT_TABLE_H_ + +#include "upb/hash/common.h" + +// Must be last. +#include "upb/port/def.inc" + +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; + +#ifdef __cplusplus +extern "C" { +#endif + +// Initialize a table. If memory allocation failed, false is returned and +// the table is uninitialized. +bool upb_inttable_init(upb_inttable* table, upb_Arena* a); + +// Returns the number of values in the table. +size_t upb_inttable_count(const upb_inttable* t); + +// Inserts the given key into the hashtable with the given value. +// The key must not already exist in the hash table. +// The value must not be 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); + +// 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); + +// 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); + +// 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); + +// Iteration over inttable: +// +// intptr_t iter = UPB_INTTABLE_BEGIN; +// uintptr_t key; +// upb_value val; +// while (upb_inttable_next(t, &key, &val, &iter)) { +// // ... +// } + +#define UPB_INTTABLE_BEGIN -1 + +bool upb_inttable_next(const upb_inttable* t, uintptr_t* key, upb_value* val, + intptr_t* iter); +void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_HASH_INT_TABLE_H_ */ diff --git a/third_party/upb/upb/hash/str_table.h b/third_party/upb/upb/hash/str_table.h new file mode 100644 index 00000000000..a53414af41d --- /dev/null +++ b/third_party/upb/upb/hash/str_table.h @@ -0,0 +1,161 @@ +/* + * 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_HASH_STR_TABLE_H_ +#define UPB_HASH_STR_TABLE_H_ + +#include "upb/hash/common.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef struct { + upb_table t; +} upb_strtable; + +#ifdef __cplusplus +extern "C" { +#endif + +// Initialize a table. If memory allocation failed, false is returned and +// the table is uninitialized. +bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a); + +// Returns the number of values in the table. +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. The key is not required +// to be NULL-terminated, and the table will make an internal copy of the key. +// +// If a table resize was required but memory allocation failed, false is +// returned and the table is unchanged. */ +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_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_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); +} + +// Exposed for testing only. +bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a); + +/* Iteration over strtable: + * + * intptr_t iter = UPB_STRTABLE_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 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; + +UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) { + return &i->t->t.entries[i->index]; +} + +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); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_HASH_STR_TABLE_H_ */ diff --git a/third_party/upb/upb/hash/test.cc b/third_party/upb/upb/hash/test.cc new file mode 100644 index 00000000000..42d692fbe21 --- /dev/null +++ b/third_party/upb/upb/hash/test.cc @@ -0,0 +1,258 @@ +// Copyright (c) 2009-2021, Google LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of Google LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Tests for upb_table. + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "gtest/gtest.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/upb.hpp" + +// Must be last. +#include "upb/port/def.inc" + +using std::vector; + +TEST(Table, StringTable) { + vector keys; + keys.push_back("google.protobuf.FileDescriptorSet"); + keys.push_back("google.protobuf.FileDescriptorProto"); + keys.push_back("google.protobuf.DescriptorProto"); + keys.push_back("google.protobuf.DescriptorProto.ExtensionRange"); + keys.push_back("google.protobuf.FieldDescriptorProto"); + keys.push_back("google.protobuf.EnumDescriptorProto"); + keys.push_back("google.protobuf.EnumValueDescriptorProto"); + keys.push_back("google.protobuf.ServiceDescriptorProto"); + keys.push_back("google.protobuf.MethodDescriptorProto"); + keys.push_back("google.protobuf.FileOptions"); + keys.push_back("google.protobuf.MessageOptions"); + keys.push_back("google.protobuf.FieldOptions"); + keys.push_back("google.protobuf.EnumOptions"); + keys.push_back("google.protobuf.EnumValueOptions"); + keys.push_back("google.protobuf.ServiceOptions"); + keys.push_back("google.protobuf.MethodOptions"); + keys.push_back("google.protobuf.UninterpretedOption"); + keys.push_back("google.protobuf.UninterpretedOption.NamePart"); + + /* Initialize structures. */ + upb::Arena arena; + upb_strtable t; + upb_strtable_init(&t, keys.size(), arena.ptr()); + std::map m; + std::set all; + for (const auto& key : keys) { + all.insert(key); + upb_value val = {uint64_t(key[0])}; + upb_strtable_insert(&t, key.data(), key.size(), val, arena.ptr()); + m[key] = key[0]; + } + + /* Test correctness. */ + for (const auto& key : keys) { + upb_value val; + bool ok = upb_strtable_lookup2(&t, key.data(), key.size(), &val); + EXPECT_TRUE(ok); + EXPECT_EQ(val.val, uint64_t(key[0])); + EXPECT_EQ(m[key], key[0]); + } + + intptr_t iter = UPB_STRTABLE_BEGIN; + upb_StringView key; + upb_value val; + while (upb_strtable_next2(&t, &key, &val, &iter)) { + std::set::iterator i = all.find(key.data); + EXPECT_NE(i, all.end()); + all.erase(i); + } + EXPECT_TRUE(all.empty()); + + // Test iteration with resizes. + + for (int i = 0; i < 10; i++) { + intptr_t iter = UPB_STRTABLE_BEGIN; + while (upb_strtable_next2(&t, &key, &val, &iter)) { + // Even if we invalidate the iterator it should only return real elements. + EXPECT_EQ(val.val, m[key.data]); + + // Force a resize even though the size isn't changing. + // Also forces the table size to grow so some new buckets end up empty. + bool ok = upb_strtable_resize(&t, 5 + i, arena.ptr()); + EXPECT_TRUE(ok); + } + } +} + +class IntTableTest : public testing::TestWithParam { + void SetUp() override { + if (GetParam() > 0) { + for (int i = 0; i < GetParam(); i++) { + keys_.push_back(i + 1); + } + } else { + for (int32_t i = 0; i < 64; i++) { + if (i < 32) + keys_.push_back(i + 1); + else + keys_.push_back(10101 + i); + } + } + } + + protected: + std::vector keys_; +}; + +TEST_P(IntTableTest, TestIntTable) { + /* Initialize structures. */ + upb::Arena arena; + upb_inttable t; + upb_inttable_init(&t, arena.ptr()); + uint32_t largest_key = 0; + std::map m; + std::unordered_map hm; + for (const auto& key : keys_) { + largest_key = UPB_MAX((int32_t)largest_key, key); + upb_value val = upb_value_uint32(key * 2); + bool ok = upb_inttable_insert(&t, key, val, arena.ptr()); + EXPECT_TRUE(ok); + m[key] = key * 2; + hm[key] = key * 2; + } + EXPECT_EQ(upb_inttable_count(&t), keys_.size()); + + /* Test correctness. */ + int count = 0; + for (uint32_t i = 0; i <= largest_key; i++) { + upb_value val; + bool ok = upb_inttable_lookup(&t, i, &val); + if (ok) { /* Assume map implementation is correct. */ + EXPECT_EQ(val.val, i * 2); + EXPECT_EQ(m[i], i * 2); + EXPECT_EQ(hm[i], i * 2); + count++; + } + } + EXPECT_EQ(count, keys_.size()); + EXPECT_EQ(count, upb_inttable_count(&t)); + + // Test replace. + count = 0; + for (uint32_t i = 0; i <= largest_key; i++) { + upb_value val = upb_value_uint32(i * 3); + bool ok = upb_inttable_replace(&t, i, val); + if (ok) { /* Assume map implementation is correct. */ + m[i] = i * 3; + hm[i] = i * 3; + count++; + } + } + EXPECT_EQ(count, keys_.size()); + EXPECT_EQ(count, upb_inttable_count(&t)); + + // Compact and test correctness again. + upb_inttable_compact(&t, arena.ptr()); + count = 0; + for (uint32_t i = 0; i <= largest_key; i++) { + upb_value val; + bool ok = upb_inttable_lookup(&t, i, &val); + if (ok) { /* Assume map implementation is correct. */ + EXPECT_EQ(val.val, i * 3); + EXPECT_EQ(m[i], i * 3); + EXPECT_EQ(hm[i], i * 3); + count++; + } + } + EXPECT_EQ(count, keys_.size()); + EXPECT_EQ(count, upb_inttable_count(&t)); + + for (const auto& key : keys_) { + upb_value val; + bool ok = upb_inttable_remove(&t, key, &val); + EXPECT_TRUE(ok); + EXPECT_EQ(val.val, (uint32_t)key * 3); + count--; + EXPECT_EQ(count, upb_inttable_count(&t)); + } + EXPECT_EQ(0, upb_inttable_count(&t)); +} + +INSTANTIATE_TEST_SUITE_P(IntTableParams, IntTableTest, + testing::Values(8, 64, 512, -32)); + +/* + * This test can't pass right now because the table can't store a value of + * (uint64_t)-1. + */ +TEST(Table, MaxValue) { + /* + typedef upb::TypedIntTable Table; + Table table; + uintptr_t uint64_max = (uint64_t)-1; + table.Insert(1, uint64_max); + std::pair found = table.Lookup(1); + ASSERT(found.first); + ASSERT(found.second == uint64_max); + */ +} + +TEST(Table, Delete) { + upb::Arena arena; + upb_inttable t; + upb_inttable_init(&t, arena.ptr()); + upb_inttable_insert(&t, 0, upb_value_bool(true), arena.ptr()); + upb_inttable_insert(&t, 2, upb_value_bool(true), arena.ptr()); + upb_inttable_insert(&t, 4, upb_value_bool(true), arena.ptr()); + upb_inttable_compact(&t, arena.ptr()); + upb_inttable_remove(&t, 0, NULL); + upb_inttable_remove(&t, 2, NULL); + upb_inttable_remove(&t, 4, NULL); + + intptr_t iter = UPB_INTTABLE_BEGIN; + uintptr_t key; + upb_value val; + while (upb_inttable_next(&t, &key, &val, &iter)) { + ASSERT_TRUE(false); + } +} + +TEST(Table, Init) { + for (int i = 0; i < 2048; i++) { + /* Tests that the size calculations in init() (lg2 size for target load) + * work for all expected sizes. */ + upb::Arena arena; + upb_strtable t; + upb_strtable_init(&t, i, arena.ptr()); + } +} diff --git a/third_party/upb/upb/internal/table.h b/third_party/upb/upb/internal/table.h deleted file mode 100644 index bc647be83f1..00000000000 --- a/third_party/upb/upb/internal/table.h +++ /dev/null @@ -1,385 +0,0 @@ -/* - * 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/io/BUILD b/third_party/upb/upb/io/BUILD new file mode 100644 index 00000000000..d7ecc5578c9 --- /dev/null +++ b/third_party/upb/upb/io/BUILD @@ -0,0 +1,98 @@ +cc_library( + name = "string", + hdrs = ["string.h"], + deps = [ + "//:mem", + "//:port", + ], +) + +cc_library( + name = "tokenizer", + srcs = ["tokenizer.c"], + hdrs = ["tokenizer.h"], + deps = [ + ":string", + ":zero_copy_stream", + "//:base", + "//:lex", + "//:mem", + "//:port", + ], +) + +cc_library( + name = "zero_copy_stream", + hdrs = [ + "zero_copy_input_stream.h", + "zero_copy_output_stream.h", + ], + deps = [ + "//:base", + "//:mem", + "//:port", + ], +) + +# ==================================================================== + +cc_library( + name = "chunked_stream", + testonly = 1, + srcs = [ + "chunked_input_stream.c", + "chunked_output_stream.c", + ], + hdrs = [ + "chunked_input_stream.h", + "chunked_output_stream.h", + ], + deps = [ + ":zero_copy_stream", + "//:upb", + "//:port", + ], +) + +cc_test( + name = "string_test", + size = "small", + srcs = ["string_test.cc"], + deps = [ + ":string", + "//:upb", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "tokenizer_test", + size = "small", + srcs = ["tokenizer_test.cc"], + deps = [ + ":chunked_stream", + ":string", + ":tokenizer", + ":zero_copy_stream", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:str_format", + "//:upb", + "//:lex", + "//:port", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "zero_copy_stream_test", + size = "small", + srcs = [ + "zero_copy_stream_test.cc", + ], + deps = [ + ":chunked_stream", + ":zero_copy_stream", + "//:upb", + "@com_google_googletest//:gtest_main", + ], +) diff --git a/third_party/upb/upb/io/README.md b/third_party/upb/upb/io/README.md new file mode 100644 index 00000000000..e0a70113bcf --- /dev/null +++ b/third_party/upb/upb/io/README.md @@ -0,0 +1,4 @@ +This subdir originated as a best-effort C approximation of the C++ code in +in third_party/protobuf/io/ but over time the two will invariably diverge. +Comments have generally been copied verbatim and may therefore refer to C++ +symbol names instead of C symbol names. diff --git a/third_party/upb/upb/io/chunked_input_stream.c b/third_party/upb/upb/io/chunked_input_stream.c new file mode 100644 index 00000000000..0b456de50fe --- /dev/null +++ b/third_party/upb/upb/io/chunked_input_stream.c @@ -0,0 +1,110 @@ +/* + * 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/io/chunked_input_stream.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef struct { + upb_ZeroCopyInputStream base; + + const char* data; + size_t size; + size_t limit; + size_t position; + size_t last_returned_size; +} upb_ChunkedInputStream; + +static const void* upb_ChunkedInputStream_Next(upb_ZeroCopyInputStream* z, + size_t* count, + upb_Status* status) { + upb_ChunkedInputStream* c = (upb_ChunkedInputStream*)z; + UPB_ASSERT(c->position <= c->size); + + const char* out = c->data + c->position; + + const size_t chunk = UPB_MIN(c->limit, c->size - c->position); + c->position += chunk; + c->last_returned_size = chunk; + *count = chunk; + + return chunk ? out : NULL; +} + +static void upb_ChunkedInputStream_BackUp(upb_ZeroCopyInputStream* z, + size_t count) { + upb_ChunkedInputStream* c = (upb_ChunkedInputStream*)z; + + UPB_ASSERT(c->last_returned_size >= count); + c->position -= count; + c->last_returned_size -= count; +} + +static bool upb_ChunkedInputStream_Skip(upb_ZeroCopyInputStream* z, + size_t count) { + upb_ChunkedInputStream* c = (upb_ChunkedInputStream*)z; + + c->last_returned_size = 0; // Don't let caller back up. + if (count > c->size - c->position) { + c->position = c->size; + return false; + } + + c->position += count; + return true; +} + +static size_t upb_ChunkedInputStream_ByteCount( + const upb_ZeroCopyInputStream* z) { + const upb_ChunkedInputStream* c = (const upb_ChunkedInputStream*)z; + + return c->position; +} + +static const _upb_ZeroCopyInputStream_VTable upb_ChunkedInputStream_vtable = { + upb_ChunkedInputStream_Next, + upb_ChunkedInputStream_BackUp, + upb_ChunkedInputStream_Skip, + upb_ChunkedInputStream_ByteCount, +}; + +upb_ZeroCopyInputStream* upb_ChunkedInputStream_New(const void* data, + size_t size, size_t limit, + upb_Arena* arena) { + upb_ChunkedInputStream* c = upb_Arena_Malloc(arena, sizeof(*c)); + if (!c || !limit) return NULL; + + c->base.vtable = &upb_ChunkedInputStream_vtable; + c->data = data; + c->size = size; + c->limit = limit; + c->position = 0; + c->last_returned_size = 0; + + return (upb_ZeroCopyInputStream*)c; +} diff --git a/third_party/upb/upb/internal/mini_table_accessors.h b/third_party/upb/upb/io/chunked_input_stream.h similarity index 71% rename from third_party/upb/upb/internal/mini_table_accessors.h rename to third_party/upb/upb/io/chunked_input_stream.h index 23f694baee3..909ae3f945e 100644 --- a/third_party/upb/upb/internal/mini_table_accessors.h +++ b/third_party/upb/upb/io/chunked_input_stream.h @@ -25,35 +25,29 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_INTERNAL_MINI_TABLE_ACCESSORS_H_ -#define UPB_INTERNAL_MINI_TABLE_ACCESSORS_H_ +#ifndef UPB_IO_CHUNKED_INPUT_STREAM_H_ +#define UPB_IO_CHUNKED_INPUT_STREAM_H_ -#include "upb/msg_internal.h" +#include "upb/io/zero_copy_input_stream.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/port_def.inc" +#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; - } -} +// A ZeroCopyInputStream which wraps a flat buffer and limits the number of +// bytes that can be returned by a single call to Next(). +upb_ZeroCopyInputStream* upb_ChunkedInputStream_New(const void* data, + size_t size, size_t limit, + upb_Arena* arena); #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" -#endif // UPB_INTERNAL_MINI_TABLE_ACCESSORS_H_ +#endif /* UPB_IO_CHUNKED_INPUT_STREAM_H_ */ diff --git a/third_party/upb/upb/io/chunked_output_stream.c b/third_party/upb/upb/io/chunked_output_stream.c new file mode 100644 index 00000000000..9dc2375f5ae --- /dev/null +++ b/third_party/upb/upb/io/chunked_output_stream.c @@ -0,0 +1,94 @@ +/* + * 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/io/chunked_output_stream.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef struct { + upb_ZeroCopyOutputStream base; + + char* data; + size_t size; + size_t limit; + size_t position; + size_t last_returned_size; +} upb_ChunkedOutputStream; + +static void* upb_ChunkedOutputStream_Next(upb_ZeroCopyOutputStream* z, + size_t* count, upb_Status* status) { + upb_ChunkedOutputStream* c = (upb_ChunkedOutputStream*)z; + UPB_ASSERT(c->position <= c->size); + + char* out = c->data + c->position; + + const size_t chunk = UPB_MIN(c->limit, c->size - c->position); + c->position += chunk; + c->last_returned_size = chunk; + *count = chunk; + + return chunk ? out : NULL; +} + +static void upb_ChunkedOutputStream_BackUp(upb_ZeroCopyOutputStream* z, + size_t count) { + upb_ChunkedOutputStream* c = (upb_ChunkedOutputStream*)z; + + UPB_ASSERT(c->last_returned_size >= count); + c->position -= count; + c->last_returned_size -= count; +} + +static size_t upb_ChunkedOutputStream_ByteCount( + const upb_ZeroCopyOutputStream* z) { + const upb_ChunkedOutputStream* c = (const upb_ChunkedOutputStream*)z; + + return c->position; +} + +static const _upb_ZeroCopyOutputStream_VTable upb_ChunkedOutputStream_vtable = { + upb_ChunkedOutputStream_Next, + upb_ChunkedOutputStream_BackUp, + upb_ChunkedOutputStream_ByteCount, +}; + +upb_ZeroCopyOutputStream* upb_ChunkedOutputStream_New(void* data, size_t size, + size_t limit, + upb_Arena* arena) { + upb_ChunkedOutputStream* c = upb_Arena_Malloc(arena, sizeof(*c)); + if (!c || !limit) return NULL; + + c->base.vtable = &upb_ChunkedOutputStream_vtable; + c->data = data; + c->size = size; + c->limit = limit; + c->position = 0; + c->last_returned_size = 0; + + return (upb_ZeroCopyOutputStream*)c; +} diff --git a/third_party/upb/upb/mini_descriptor.h b/third_party/upb/upb/io/chunked_output_stream.h similarity index 71% rename from third_party/upb/upb/mini_descriptor.h rename to third_party/upb/upb/io/chunked_output_stream.h index 829d008048f..e5487199c0f 100644 --- a/third_party/upb/upb/mini_descriptor.h +++ b/third_party/upb/upb/io/chunked_output_stream.h @@ -25,34 +25,29 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_MINI_DESCRIPTOR_H_ -#define UPB_MINI_DESCRIPTOR_H_ +#ifndef UPB_IO_CHUNKED_OUTPUT_STREAM_H_ +#define UPB_IO_CHUNKED_OUTPUT_STREAM_H_ -#include "upb/def.h" -#include "upb/upb.h" +#include "upb/io/zero_copy_output_stream.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/port_def.inc" +#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); +// A ZeroCopyOutputStream which wraps a flat buffer and limits the number of +// bytes that can be returned by a single call to Next(). +upb_ZeroCopyOutputStream* upb_ChunkedOutputStream_New(void* data, size_t size, + size_t limit, + upb_Arena* arena); #ifdef __cplusplus } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" -#endif /* UPB_MINI_DESCRIPTOR_H_ */ +#endif /* UPB_IO_CHUNKED_OUTPUT_STREAM_H_ */ diff --git a/third_party/upb/upb/io/string.h b/third_party/upb/upb/io/string.h new file mode 100644 index 00000000000..4aee795181d --- /dev/null +++ b/third_party/upb/upb/io/string.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// An attempt to provide some of the C++ string functionality in C. +// Function names generally match those of corresponding C++ string methods. +// All buffers are copied so operations are relatively expensive. +// Internal character strings are always NULL-terminated. +// All bool functions return true on success, false on failure. + +#ifndef UPB_IO_STRING_H_ +#define UPB_IO_STRING_H_ + +#include +#include +#include + +#include "upb/mem/arena.h" +#include "upb/port/vsnprintf_compat.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Do not directly access the fields of this struct - use the accessors only. +// TODO(salo): Add a small (16 bytes, maybe?) internal buffer so we can avoid +// hitting the arena for short strings. +typedef struct { + size_t size_; + size_t capacity_; + char* data_; + upb_Arena* arena_; +} upb_String; + +// Initialize an already-allocted upb_String object. +UPB_INLINE bool upb_String_Init(upb_String* s, upb_Arena* a) { + static const int kDefaultCapacity = 16; + + s->size_ = 0; + s->capacity_ = kDefaultCapacity; + s->data_ = (char*)upb_Arena_Malloc(a, kDefaultCapacity); + s->arena_ = a; + if (!s->data_) return false; + s->data_[0] = '\0'; + return true; +} + +UPB_INLINE void upb_String_Clear(upb_String* s) { + s->size_ = 0; + s->data_[0] = '\0'; +} + +UPB_INLINE char* upb_String_Data(const upb_String* s) { return s->data_; } + +UPB_INLINE size_t upb_String_Size(const upb_String* s) { return s->size_; } + +UPB_INLINE bool upb_String_Empty(const upb_String* s) { return s->size_ == 0; } + +UPB_INLINE void upb_String_Erase(upb_String* s, size_t pos, size_t len) { + if (pos >= s->size_) return; + char* des = s->data_ + pos; + if (pos + len > s->size_) len = s->size_ - pos; + char* src = des + len; + memmove(des, src, s->size_ - (src - s->data_) + 1); + s->size_ -= len; +} + +UPB_INLINE bool upb_String_Reserve(upb_String* s, size_t size) { + if (s->capacity_ <= size) { + const size_t new_cap = size + 1; + s->data_ = + (char*)upb_Arena_Realloc(s->arena_, s->data_, s->capacity_, new_cap); + if (!s->data_) return false; + s->capacity_ = new_cap; + } + return true; +} + +UPB_INLINE bool upb_String_Append(upb_String* s, const char* data, + size_t size) { + if (s->capacity_ <= s->size_ + size) { + const size_t new_cap = 2 * (s->size_ + size) + 1; + if (!upb_String_Reserve(s, new_cap)) return false; + } + + memcpy(s->data_ + s->size_, data, size); + s->size_ += size; + s->data_[s->size_] = '\0'; + return true; +} + +UPB_PRINTF(2, 0) +UPB_INLINE bool upb_String_AppendFmtV(upb_String* s, const char* fmt, + va_list args) { + size_t capacity = 1000; + char* buf = (char*)malloc(capacity); + bool out = false; + for (;;) { + const int n = _upb_vsnprintf(buf, capacity, fmt, args); + if (n < 0) break; + if (n < capacity) { + out = upb_String_Append(s, buf, n); + break; + } + capacity *= 2; + buf = (char*)realloc(buf, capacity); + } + free(buf); + return out; +} + +UPB_PRINTF(2, 3) +UPB_INLINE bool upb_String_AppendFmt(upb_String* s, const char* fmt, ...) { + va_list args; + va_start(args, fmt); + const bool ok = upb_String_AppendFmtV(s, fmt, args); + va_end(args); + return ok; +} + +UPB_INLINE bool upb_String_Assign(upb_String* s, const char* data, + size_t size) { + upb_String_Clear(s); + return upb_String_Append(s, data, size); +} + +UPB_INLINE bool upb_String_Copy(upb_String* des, const upb_String* src) { + return upb_String_Assign(des, src->data_, src->size_); +} + +UPB_INLINE bool upb_String_PushBack(upb_String* s, char ch) { + return upb_String_Append(s, &ch, 1); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_IO_STRING_H_ */ diff --git a/third_party/upb/upb/io/string_test.cc b/third_party/upb/upb/io/string_test.cc new file mode 100644 index 00000000000..42b49309db5 --- /dev/null +++ b/third_party/upb/upb/io/string_test.cc @@ -0,0 +1,127 @@ +/* + * 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/io/string.h" + +#include + +#include "gtest/gtest.h" +#include "upb/upb.hpp" + +TEST(StringTest, Append) { + upb::Arena arena; + + upb_String foo; + EXPECT_TRUE(upb_String_Init(&foo, arena.ptr())); + EXPECT_EQ(upb_String_Size(&foo), 0); + + EXPECT_TRUE(upb_String_Assign(&foo, "foobar", 3)); + EXPECT_EQ(upb_String_Size(&foo), 3); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "foo"), 0); + + EXPECT_TRUE(upb_String_Append(&foo, "bar", 3)); + EXPECT_EQ(upb_String_Size(&foo), 6); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "foobar"), 0); + + EXPECT_TRUE(upb_String_Append(&foo, "baz", 3)); + EXPECT_EQ(upb_String_Size(&foo), 9); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "foobarbaz"), 0); + + EXPECT_TRUE(upb_String_Append(&foo, "bat", 3)); + EXPECT_EQ(upb_String_Size(&foo), 12); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "foobarbazbat"), 0); + + EXPECT_TRUE(upb_String_Append(&foo, "feefiefoefoo", 12)); + EXPECT_EQ(upb_String_Size(&foo), 24); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "foobarbazbatfeefiefoefoo"), 0); + + const char* password = "fiddlesnarf"; + EXPECT_TRUE(upb_String_Assign(&foo, password, strlen(password))); + EXPECT_EQ(upb_String_Size(&foo), strlen(password)); + EXPECT_EQ(strcmp(upb_String_Data(&foo), password), 0); +} + +TEST(StringTest, PushBack) { + upb::Arena arena; + + upb_String foo; + EXPECT_TRUE(upb_String_Init(&foo, arena.ptr())); + EXPECT_EQ(upb_String_Size(&foo), 0); + + const std::string big = + "asfashfxauwhfwu4fuwafxasnfwxnxwunxuwxufhwfaiwj4w9jvwxssldfjlasviorwnvwij" + "grsdjrfiasrjrasijgraisjvrvoiasjspjfsjgfasjgiasjidjsrvjsrjrasjfrijwjajsrF" + "JWJGF4WWJSAVSLJArSJGFrAISJGASrlafjgrivarijrraisrgjiawrijg3874f87f7hqfhpf" + "f8929hr32p8475902387459023475297328-22-3776-26"; + EXPECT_TRUE(upb_String_Reserve(&foo, big.size() + 1)); + EXPECT_TRUE(upb_String_Append(&foo, big.data(), big.size())); + EXPECT_EQ(upb_String_Size(&foo), big.size()); + EXPECT_EQ(strcmp(upb_String_Data(&foo), big.data()), 0); + + upb_String bar; + EXPECT_TRUE(upb_String_Init(&bar, arena.ptr())); + EXPECT_EQ(upb_String_Size(&bar), 0); + + EXPECT_TRUE(upb_String_PushBack(&bar, 'x')); + EXPECT_TRUE(upb_String_PushBack(&bar, 'y')); + EXPECT_TRUE(upb_String_PushBack(&bar, 'z')); + EXPECT_TRUE(upb_String_PushBack(&bar, 'z')); + EXPECT_TRUE(upb_String_PushBack(&bar, 'y')); + EXPECT_EQ(upb_String_Size(&bar), 5); + EXPECT_EQ(strcmp(upb_String_Data(&bar), "xyzzy"), 0); +} + +TEST(StringTest, Erase) { + upb::Arena arena; + + upb_String foo; + EXPECT_TRUE(upb_String_Init(&foo, arena.ptr())); + + const char* sent = "This is an example sentence."; + EXPECT_TRUE(upb_String_Assign(&foo, sent, strlen(sent))); + EXPECT_EQ(upb_String_Size(&foo), 28); + + upb_String_Erase(&foo, 10, 8); + EXPECT_EQ(upb_String_Size(&foo), 20); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "This is an sentence."), 0); + + upb_String_Erase(&foo, 9, 1); + EXPECT_EQ(upb_String_Size(&foo), 19); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "This is a sentence."), 0); + + upb_String_Erase(&foo, 5, 5); + EXPECT_EQ(upb_String_Size(&foo), 14); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "This sentence."), 0); + + upb_String_Erase(&foo, 4, 99); + EXPECT_EQ(upb_String_Size(&foo), 4); + EXPECT_EQ(strcmp(upb_String_Data(&foo), "This"), 0); + + upb_String_Erase(&foo, 0, 4); + EXPECT_EQ(upb_String_Size(&foo), 0); + EXPECT_EQ(strcmp(upb_String_Data(&foo), ""), 0); +} diff --git a/third_party/upb/upb/io/tokenizer.c b/third_party/upb/upb/io/tokenizer.c new file mode 100644 index 00000000000..55a6ef386ff --- /dev/null +++ b/third_party/upb/upb/io/tokenizer.c @@ -0,0 +1,1019 @@ +/* + * 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/io/tokenizer.h" + +#include "upb/io/string.h" +#include "upb/lex/strtod.h" +#include "upb/lex/unicode.h" + +// Must be included last. +#include "upb/port/def.inc" + +typedef enum { + // Started a line comment. + kUpb_CommentType_Line, + + // Started a block comment. + kUpb_CommentType_Block, + + // Consumed a slash, then realized it wasn't a comment. current_ has + // been filled in with a slash token. The caller should return it. + kUpb_CommentType_SlashNot, + + // We do not appear to be starting a comment here. + kUpb_CommentType_None, +} upb_CommentType; + +static bool upb_Tokenizer_IsUnprintable(char c) { return '\0' < c && c < ' '; } + +// Since we count columns we need to interpret tabs somehow. We'll take +// the standard 8-character definition for lack of any way to do better. +static const int kUpb_Tokenizer_TabWidth = 8; + +// Given a char, interpret it as a numeric digit and return its value. +// This supports any number base up to 36. +// Represents integer values of digits. +// Uses 36 to indicate an invalid character since we support +// bases up to 36. +static const int8_t kUpb_Tokenizer_AsciiToInt[256] = { + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // 00-0F + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // 10-1F + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // ' '-'/' + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // '0'-'9' + 36, 36, 36, 36, 36, 36, 36, // ':'-'@' + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 'A'-'P' + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 'Q'-'Z' + 36, 36, 36, 36, 36, 36, // '['-'`' + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 'a'-'p' + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 'q'-'z' + 36, 36, 36, 36, 36, // '{'-DEL + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // 80-8F + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // 90-9F + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // A0-AF + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // B0-BF + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // C0-CF + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // D0-DF + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // E0-EF + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, // F0-FF +}; + +static int DigitValue(char digit) { + return kUpb_Tokenizer_AsciiToInt[digit & 0xFF]; +} + +static bool upb_Tokenizer_IsLetter(char c) { + return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || (c == '_'); +} + +static bool upb_Tokenizer_IsDigit(char c) { return '0' <= c && c <= '9'; } + +static bool upb_Tokenizer_IsOctalDigit(char c) { return '0' <= c && c <= '7'; } + +static bool upb_Tokenizer_IsHexDigit(char c) { + return ('0' <= c && c <= '9') || ('a' <= c && c <= 'f') || + ('A' <= c && c <= 'F'); +} + +static bool upb_Tokenizer_IsAlphanumeric(char c) { + return upb_Tokenizer_IsLetter(c) || upb_Tokenizer_IsDigit(c); +} + +static bool upb_Tokenizer_IsWhitespaceNoNewline(char c) { + return c == ' ' || c == '\t' || c == '\r' || c == '\v' || c == '\f'; +} + +static bool upb_Tokenizer_IsWhitespace(char c) { + return c == '\n' || upb_Tokenizer_IsWhitespaceNoNewline(c); +} + +static bool upb_Tokenizer_IsEscape(char c) { + return c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || + c == 'v' || c == '\\' || c == '?' || c == '\'' || c == '\"'; +} + +static char TranslateEscape(char c) { + switch (c) { + case 'a': + return '\a'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'v': + return '\v'; + case '\\': + return '\\'; + case '?': + return '\?'; // Trigraphs = :( + case '\'': + return '\''; + case '"': + return '\"'; + + // We expect escape sequences to have been validated separately. + default: + return '?'; + } +} + +// =================================================================== + +struct upb_Tokenizer { + upb_TokenType token_type; // The type of the current token. + + // The exact text of the current token as it appeared in the input. + // e.g. tokens of TYPE_STRING will still be escaped and in quotes. + upb_String token_text; + + // "line" and "column" specify the position of the first character of + // the token within the input stream. They are zero-based. + int token_line; + int token_column; + int token_end_column; + + upb_ZeroCopyInputStream* input; + upb_Arena* arena; + upb_Status* status; + + char current_char; // == buffer_[buffer_pos_], updated by NextChar(). + const char* buffer; // Current buffer returned from input_. + size_t buffer_size; // Size of buffer_. + size_t buffer_pos; // Current position within the buffer. + bool read_error; // Did we previously encounter a read error? + + // Line and column number of current_char_ within the whole input stream. + int line; + + // By "column number", the proto compiler refers to a count of the number + // of bytes before a given byte, except that a tab character advances to + // the next multiple of 8 bytes. Note in particular that column numbers + // are zero-based, while many user interfaces use one-based column numbers. + int column; + + // Cached values from before the most recent call to Next() + upb_TokenType previous_type; + int previous_line; + int previous_column; + int previous_end_column; + + // String to which text should be appended as we advance through it. + // Call RecordTo(&str) to start recording and StopRecording() to stop. + // E.g. StartToken() calls RecordTo(¤t_.text). record_start_ is the + // position within the current buffer where recording started. + upb_String* record_target; + int record_start; + int options; + jmp_buf err; +}; + +// Convenience methods to return an error at the current line and column. + +UPB_NORETURN static void ReportError(upb_Tokenizer* t, const char* msg) { + upb_Status_SetErrorFormat(t->status, "%d:%d: %s", t->line, t->column, msg); + UPB_LONGJMP(t->err, 1); +} + +UPB_NORETURN UPB_PRINTF(2, 3) static void ReportErrorFormat(upb_Tokenizer* t, + const char* fmt, + ...) { + va_list args; + va_start(args, fmt); + char msg[128]; + vsnprintf(msg, sizeof(msg), fmt, args); + ReportError(t, msg); +} + +// Read a new buffer from the input. +static void Refresh(upb_Tokenizer* t) { + if (t->read_error) { + t->current_char = '\0'; + return; + } + + // If we're in a token, append the rest of the buffer to it. + if (t->record_target != NULL && t->record_start < t->buffer_size) { + upb_String_Append(t->record_target, t->buffer + t->record_start, + t->buffer_size - t->record_start); + t->record_start = 0; + } + + t->buffer = NULL; + t->buffer_pos = 0; + + upb_Status status; + const void* data = + upb_ZeroCopyInputStream_Next(t->input, &t->buffer_size, &status); + + if (t->buffer_size > 0) { + t->buffer = data; + t->current_char = t->buffer[0]; + } else { + // end of stream (or read error) + t->buffer_size = 0; + t->read_error = true; + t->current_char = '\0'; + } +} + +// Consume this character and advance to the next one. +static void NextChar(upb_Tokenizer* t) { + // Update our line and column counters based on the character being + // consumed. + if (t->current_char == '\n') { + t->line++; + t->column = 0; + } else if (t->current_char == '\t') { + t->column += kUpb_Tokenizer_TabWidth - t->column % kUpb_Tokenizer_TabWidth; + } else { + t->column++; + } + + // Advance to the next character. + t->buffer_pos++; + if (t->buffer_pos < t->buffer_size) { + t->current_char = t->buffer[t->buffer_pos]; + } else { + Refresh(t); + } +} + +static void RecordTo(upb_Tokenizer* t, upb_String* target) { + t->record_target = target; + t->record_start = t->buffer_pos; +} + +static void StopRecording(upb_Tokenizer* t) { + if (t->buffer_pos > t->record_start) { + upb_String_Append(t->record_target, t->buffer + t->record_start, + t->buffer_pos - t->record_start); + } + t->record_target = NULL; + t->record_start = -1; +} + +// Called when the current character is the first character of a new +// token (not including whitespace or comments). +static void StartToken(upb_Tokenizer* t) { + t->token_type = kUpb_TokenType_Start; + upb_String_Clear(&t->token_text); + t->token_line = t->line; + t->token_column = t->column; + RecordTo(t, &t->token_text); +} + +// Called when the current character is the first character after the +// end of the last token. After this returns, current_.text will +// contain all text consumed since StartToken() was called. +static void EndToken(upb_Tokenizer* t) { + StopRecording(t); + t->token_end_column = t->column; +} + +// ----------------------------------------------------------------- +// These helper methods make the parsing code more readable. +// The "character classes" referred to are defined at the top of the file. +// The method returns true if c is a member of this "class", like "Letter" +// or "Digit". + +// Returns true if the current character is of the given character +// class, but does not consume anything. +static bool LookingAt(const upb_Tokenizer* t, bool (*f)(char)) { + return f(t->current_char); +} + +// If the current character is in the given class, consume it and return true. +// Otherwise return false. +static bool TryConsumeOne(upb_Tokenizer* t, bool (*f)(char)) { + if (f(t->current_char)) { + NextChar(t); + return true; + } else { + return false; + } +} + +// Like above, but try to consume the specific character indicated. +static bool TryConsume(upb_Tokenizer* t, char c) { + if (t->current_char == c) { + NextChar(t); + return true; + } else { + return false; + } +} + +// Consume zero or more of the given character class. +static void ConsumeZeroOrMore(upb_Tokenizer* t, bool (*f)(char)) { + while (f(t->current_char)) { + NextChar(t); + } +} + +// Consume one or more of the given character class or log the given +// error message. +static void ConsumeOneOrMore(upb_Tokenizer* t, bool (*f)(char), + const char* err_msg) { + if (!f(t->current_char)) { + ReportError(t, err_msg); + } + + do { + NextChar(t); + } while (f(t->current_char)); +} + +// ----------------------------------------------------------------- +// The following four methods are used to consume tokens of specific +// types. They are actually used to consume all characters *after* +// the first, since the calling function consumes the first character +// in order to decide what kind of token is being read. + +// Read and consume a string, ending when the given delimiter is consumed. +static void ConsumeString(upb_Tokenizer* t, char delimiter) { + while (true) { + switch (t->current_char) { + case '\0': + ReportError(t, "Unexpected end of string."); + + case '\n': + ReportError(t, "String literals cannot cross line boundaries."); + + case '\\': { + // An escape sequence. + NextChar(t); + if (TryConsumeOne(t, upb_Tokenizer_IsEscape)) { + // Valid escape sequence. + } else if (TryConsumeOne(t, upb_Tokenizer_IsOctalDigit)) { + // Possibly followed by two more octal digits, but these will + // just be consumed by the main loop anyway so we don't need + // to do so explicitly here. + } else if (TryConsume(t, 'x')) { + if (!TryConsumeOne(t, upb_Tokenizer_IsHexDigit)) { + ReportError(t, "Expected hex digits for escape sequence."); + } + // Possibly followed by another hex digit, but again we don't care. + } else if (TryConsume(t, 'u')) { + if (!TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit)) { + ReportError(t, "Expected four hex digits for \\u escape sequence."); + } + } else if (TryConsume(t, 'U')) { + // We expect 8 hex digits; but only the range up to 0x10ffff is + // legal. + if (!TryConsume(t, '0') || !TryConsume(t, '0') || + !(TryConsume(t, '0') || TryConsume(t, '1')) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit) || + !TryConsumeOne(t, upb_Tokenizer_IsHexDigit)) { + ReportError(t, + "Expected eight hex digits up to 10ffff for \\U escape " + "sequence"); + } + } else { + ReportError(t, "Invalid escape sequence in string literal."); + } + break; + } + + default: { + if (t->current_char == delimiter) { + NextChar(t); + return; + } + NextChar(t); + break; + } + } + } +} + +// Read and consume a number, returning TYPE_FLOAT or TYPE_INTEGER depending +// on what was read. This needs to know if the first characer was a zero in +// order to correctly recognize hex and octal numbers. It also needs to know +// whether the first character was a '.' to parse floating point correctly. +static upb_TokenType ConsumeNumber(upb_Tokenizer* t, bool started_with_zero, + bool started_with_dot) { + bool is_float = false; + + if (started_with_zero && (TryConsume(t, 'x') || TryConsume(t, 'X'))) { + // A hex number (started with "0x"). + ConsumeOneOrMore(t, upb_Tokenizer_IsHexDigit, + "\"0x\" must be followed by hex digits."); + + } else if (started_with_zero && LookingAt(t, upb_Tokenizer_IsDigit)) { + // An octal number (had a leading zero). + ConsumeZeroOrMore(t, upb_Tokenizer_IsOctalDigit); + if (LookingAt(t, upb_Tokenizer_IsDigit)) { + ReportError(t, "Numbers starting with leading zero must be in octal."); + } + + } else { + // A decimal number. + if (started_with_dot) { + is_float = true; + ConsumeZeroOrMore(t, upb_Tokenizer_IsDigit); + } else { + ConsumeZeroOrMore(t, upb_Tokenizer_IsDigit); + + if (TryConsume(t, '.')) { + is_float = true; + ConsumeZeroOrMore(t, upb_Tokenizer_IsDigit); + } + } + + if (TryConsume(t, 'e') || TryConsume(t, 'E')) { + is_float = true; + if (!TryConsume(t, '-')) TryConsume(t, '+'); + ConsumeOneOrMore(t, upb_Tokenizer_IsDigit, + "\"e\" must be followed by exponent."); + } + + if (t->options & kUpb_TokenizerOption_AllowFAfterFloat) { + if (TryConsume(t, 'f') || TryConsume(t, 'F')) is_float = true; + } + } + + if (LookingAt(t, upb_Tokenizer_IsLetter)) { + ReportError(t, "Need space between number and identifier."); + } + + if (t->current_char == '.') { + if (is_float) { + ReportError( + t, "Already saw decimal point or exponent; can't have another one."); + } else { + ReportError(t, "Hex and octal numbers must be integers."); + } + } + + return is_float ? kUpb_TokenType_Float : kUpb_TokenType_Integer; +} + +// Consume the rest of a line. +static void ConsumeLineComment(upb_Tokenizer* t, upb_String* content) { + if (content != NULL) RecordTo(t, content); + + while (t->current_char != '\0' && t->current_char != '\n') { + NextChar(t); + } + TryConsume(t, '\n'); + + if (content != NULL) StopRecording(t); +} + +static void ConsumeBlockComment(upb_Tokenizer* t, upb_String* content) { + const int start_line = t->line; + const int start_column = t->column - 2; + + if (content != NULL) RecordTo(t, content); + + while (true) { + while (t->current_char != '\0' && t->current_char != '*' && + t->current_char != '/' && t->current_char != '\n') { + NextChar(t); + } + + if (TryConsume(t, '\n')) { + if (content != NULL) StopRecording(t); + + // Consume leading whitespace and asterisk; + ConsumeZeroOrMore(t, upb_Tokenizer_IsWhitespaceNoNewline); + if (TryConsume(t, '*')) { + if (TryConsume(t, '/')) { + // End of comment. + break; + } + } + + if (content != NULL) RecordTo(t, content); + } else if (TryConsume(t, '*') && TryConsume(t, '/')) { + // End of comment. + if (content != NULL) { + StopRecording(t); + // Strip trailing "*/". + upb_String_Erase(content, upb_String_Size(content) - 2, 2); + } + break; + } else if (TryConsume(t, '/') && t->current_char == '*') { + // Note: We didn't consume the '*' because if there is a '/' after it + // we want to interpret that as the end of the comment. + ReportError( + t, "\"/*\" inside block comment. Block comments cannot be nested."); + } else if (t->current_char == '\0') { + ReportErrorFormat( + t, "End-of-file inside block comment.\n%d:%d: Comment started here.", + start_line, start_column); + } + } +} + +// If we're at the start of a new comment, consume it and return what kind +// of comment it is. +static upb_CommentType TryConsumeCommentStart(upb_Tokenizer* t) { + const bool style_sh = t->options & kUpb_TokenizerOption_CommentStyleShell; + const bool style_cpp = !style_sh; + + if (style_cpp && TryConsume(t, '/')) { + if (TryConsume(t, '/')) { + return kUpb_CommentType_Line; + } else if (TryConsume(t, '*')) { + return kUpb_CommentType_Block; + } else { + // Oops, it was just a slash. Return it. + t->token_type = kUpb_TokenType_Symbol; + upb_String_Assign(&t->token_text, "/", 1); + t->token_line = t->line; + t->token_column = t->column - 1; + t->token_end_column = t->column; + return kUpb_CommentType_SlashNot; + } + } else if (style_sh && TryConsume(t, '#')) { + return kUpb_CommentType_Line; + } else { + return kUpb_CommentType_None; + } +} + +// If we're looking at a TYPE_WHITESPACE token and `report_whitespace` is true, +// consume it and return true. +static bool TryConsumeWhitespace(upb_Tokenizer* t) { + if (t->options & kUpb_TokenizerOption_ReportNewlines) { + if (TryConsumeOne(t, upb_Tokenizer_IsWhitespaceNoNewline)) { + ConsumeZeroOrMore(t, upb_Tokenizer_IsWhitespaceNoNewline); + t->token_type = kUpb_TokenType_Whitespace; + return true; + } + return false; + } + if (TryConsumeOne(t, upb_Tokenizer_IsWhitespace)) { + ConsumeZeroOrMore(t, upb_Tokenizer_IsWhitespace); + t->token_type = kUpb_TokenType_Whitespace; + return (t->options & kUpb_TokenizerOption_ReportWhitespace) != 0; + } + return false; +} + +// If we're looking at a TYPE_NEWLINE token and `report_newlines` is true, +// consume it and return true. +static bool TryConsumeNewline(upb_Tokenizer* t) { + if (t->options & kUpb_TokenizerOption_ReportNewlines) { + if (TryConsume(t, '\n')) { + t->token_type = kUpb_TokenType_Newline; + return true; + } + } + return false; +} + +// ------------------------------------------------------------------- + +int upb_Tokenizer_Column(const upb_Tokenizer* t) { return t->token_column; } + +int upb_Tokenizer_EndColumn(const upb_Tokenizer* t) { + return t->token_end_column; +} + +int upb_Tokenizer_Line(const upb_Tokenizer* t) { return t->token_line; } + +int upb_Tokenizer_TextSize(const upb_Tokenizer* t) { + return t->token_text.size_; +} + +const char* upb_Tokenizer_TextData(const upb_Tokenizer* t) { + return t->token_text.data_; +} + +upb_TokenType upb_Tokenizer_Type(const upb_Tokenizer* t) { + return t->token_type; +} + +bool upb_Tokenizer_Next(upb_Tokenizer* t, upb_Status* status) { + t->status = status; + t->previous_type = t->token_type; + t->previous_line = t->token_line; + t->previous_column = t->token_column; + t->previous_end_column = t->token_end_column; + + if (UPB_SETJMP(t->err)) return false; + + while (!t->read_error) { + StartToken(t); + bool report_token = TryConsumeWhitespace(t) || TryConsumeNewline(t); + EndToken(t); + if (report_token) return true; + + switch (TryConsumeCommentStart(t)) { + case kUpb_CommentType_Line: + ConsumeLineComment(t, NULL); + continue; + case kUpb_CommentType_Block: + ConsumeBlockComment(t, NULL); + continue; + case kUpb_CommentType_SlashNot: + return true; + case kUpb_CommentType_None: + break; + } + + // Check for EOF before continuing. + if (t->read_error) break; + + if (LookingAt(t, upb_Tokenizer_IsUnprintable) || t->current_char == '\0') { + ReportError(t, "Invalid control characters encountered in text."); + } + + // Reading some sort of token. + StartToken(t); + + if (TryConsumeOne(t, upb_Tokenizer_IsLetter)) { + ConsumeZeroOrMore(t, upb_Tokenizer_IsAlphanumeric); + t->token_type = kUpb_TokenType_Identifier; + } else if (TryConsume(t, '0')) { + t->token_type = ConsumeNumber(t, true, false); + } else if (TryConsume(t, '.')) { + // This could be the beginning of a floating-point number, or it could + // just be a '.' symbol. + + if (TryConsumeOne(t, upb_Tokenizer_IsDigit)) { + // It's a floating-point number. + if (t->previous_type == kUpb_TokenType_Identifier && + t->token_line == t->previous_line && + t->token_column == t->previous_end_column) { + // We don't accept syntax like "blah.123". + t->column -= 2; + ReportError(t, "Need space between identifier and decimal point."); + } + t->token_type = ConsumeNumber(t, false, true); + } else { + t->token_type = kUpb_TokenType_Symbol; + } + } else if (TryConsumeOne(t, upb_Tokenizer_IsDigit)) { + t->token_type = ConsumeNumber(t, false, false); + } else if (TryConsume(t, '\"')) { + ConsumeString(t, '\"'); + t->token_type = kUpb_TokenType_String; + } else if (TryConsume(t, '\'')) { + ConsumeString(t, '\''); + t->token_type = kUpb_TokenType_String; + } else { + // Check if the high order bit is set. + if (t->current_char & 0x80) { + ReportErrorFormat(t, "Interpreting non ascii codepoint %d.", + (uint8_t)t->current_char); + } + NextChar(t); + t->token_type = kUpb_TokenType_Symbol; + } + + EndToken(t); + return true; + } + + // EOF + t->token_type = kUpb_TokenType_End; + upb_String_Clear(&t->token_text); + t->token_line = t->line; + t->token_column = t->column; + t->token_end_column = t->column; + upb_Status_Clear(status); + return false; +} + +// ------------------------------------------------------------------- +// Token-parsing helpers. Remember that these don't need to report +// errors since any errors should already have been reported while +// tokenizing. Also, these can assume that whatever text they +// are given is text that the tokenizer actually parsed as a token +// of the given type. + +bool upb_Parse_Integer(const char* text, uint64_t max_value, uint64_t* output) { + // We can't just use strtoull() because (a) it accepts negative numbers, + // (b) We want additional range checks, (c) it reports overflows via errno. + + const char* ptr = text; + int base = 10; + uint64_t overflow_if_mul_base = (UINT64_MAX / 10) + 1; + if (ptr[0] == '0') { + if (ptr[1] == 'x' || ptr[1] == 'X') { + // This is hex. + base = 16; + overflow_if_mul_base = (UINT64_MAX / 16) + 1; + ptr += 2; + } else { + // This is octal. + base = 8; + overflow_if_mul_base = (UINT64_MAX / 8) + 1; + } + } + + uint64_t result = 0; + // For all the leading '0's, and also the first non-zero character, we + // don't need to multiply. + while (*ptr != '\0') { + int digit = DigitValue(*ptr++); + if (digit >= base) { + // The token provided by Tokenizer is invalid. i.e., 099 is an invalid + // token, but Tokenizer still think it's integer. + return false; + } + if (digit != 0) { + result = digit; + break; + } + } + for (; *ptr != '\0'; ptr++) { + int digit = DigitValue(*ptr); + if (digit < 0 || digit >= base) { + // The token provided by Tokenizer is invalid. i.e., 099 is an invalid + // token, but Tokenizer still think it's integer. + return false; + } + if (result >= overflow_if_mul_base) { + // We know the multiply we're about to do will overflow, so exit now. + return false; + } + // We know that result * base won't overflow, but adding digit might... + result = result * base + digit; + // C++ guarantees defined "wrap" semantics when unsigned integer + // operations overflow, making this a fast way to check if adding + // digit made result overflow, and thus, wrap around. + if (result < (uint64_t)base) return false; + } + if (result > max_value) return false; + + *output = result; + return true; +} + +double upb_Parse_Float(const char* text) { + char* end; + double result = _upb_NoLocaleStrtod(text, &end); + + // "1e" is not a valid float, but if the tokenizer reads it, it will + // report an error but still return it as a valid token. We need to + // accept anything the tokenizer could possibly return, error or not. + if (*end == 'e' || *end == 'E') { + ++end; + if (*end == '-' || *end == '+') ++end; + } + + // If the Tokenizer had allow_f_after_float_ enabled, the float may be + // suffixed with the letter 'f'. + if (*end == 'f' || *end == 'F') { + ++end; + } + + if ((end - text) != strlen(text) || *text == '-') { + fprintf(stderr, + "upb_Parse_Float() passed text that could not have" + " been tokenized as a float: %s\n", + text); + UPB_ASSERT(0); + } + return result; +} + +// Append a Unicode code point to a string as UTF8. +static void AppendUTF8(uint32_t code_point, upb_String* output) { + char temp[24]; + int len = upb_Unicode_ToUTF8(code_point, temp); + if (len == 0) { + // ConsumeString permits hex values up to 0x1FFFFF, + // and FetchUnicodePoint doesn't perform a range check. + // Unicode code points end at 0x10FFFF, so this is out-of-range. + len = snprintf(temp, sizeof temp, "\\U%08x", code_point); + } + upb_String_Append(output, temp, len); +} + +// Try to read hex digits from ptr, and stuff the numeric result into +// *result. Returns true if that many digits were successfully consumed. +static bool ReadHexDigits(const char* ptr, int len, uint32_t* result) { + *result = 0; + if (len == 0) return false; + for (const char* end = ptr + len; ptr < end; ++ptr) { + if (*ptr == '\0') return false; + *result = (*result << 4) + DigitValue(*ptr); + } + return true; +} + +// Convert the escape sequence parameter to a number of expected hex digits. +static int UnicodeLength(char key) { + if (key == 'u') return 4; + if (key == 'U') return 8; + return 0; +} + +// Given a pointer to the 'u' or 'U' starting a Unicode escape sequence, attempt +// to parse that sequence. On success, returns a pointer to the first char +// beyond that sequence, and fills in *code_point. On failure, returns ptr +// itself. +static const char* FetchUnicodePoint(const char* ptr, uint32_t* code_point) { + const char* p = ptr; + // Fetch the code point. + const int len = UnicodeLength(*p++); + if (!ReadHexDigits(p, len, code_point)) return ptr; + p += len; + + // Check if the code point we read is a "head surrogate." If so, then we + // expect it to be immediately followed by another code point which is a valid + // "trail surrogate," and together they form a UTF-16 pair which decodes into + // a single Unicode point. Trail surrogates may only use \u, not \U. + if (upb_Unicode_IsHigh(*code_point) && *p == '\\' && *(p + 1) == 'u') { + uint32_t trail_surrogate; + if (ReadHexDigits(p + 2, 4, &trail_surrogate) && + upb_Unicode_IsLow(trail_surrogate)) { + *code_point = upb_Unicode_FromPair(*code_point, trail_surrogate); + p += 6; + } + // If this failed, then we just emit the head surrogate as a code point. + // It's bogus, but so is the string. + } + + return p; +} + +// The text string must begin and end with single or double quote characters. +upb_StringView upb_Parse_String(const char* text, upb_Arena* arena) { + const size_t size = strlen(text); + + upb_String output; + upb_String_Init(&output, arena); + + // Reminder: text[0] is always a quote character. + // (If text is empty, it's invalid, so we'll just return). + if (size == 0) { + fprintf(stderr, + "Tokenizer::ParseStringAppend() passed text that could not" + " have been tokenized as a string: %s", + text); + UPB_ASSERT(0); + } + + // Reserve room for new string. + const size_t new_len = size + upb_String_Size(&output); + upb_String_Reserve(&output, new_len); + + // Loop through the string copying characters to "output" and + // interpreting escape sequences. Note that any invalid escape + // sequences or other errors were already reported while tokenizing. + // In this case we do not need to produce valid results. + for (const char* ptr = text + 1; *ptr != '\0'; ptr++) { + if (*ptr == '\\' && ptr[1] != '\0') { + // An escape sequence. + ++ptr; + + if (upb_Tokenizer_IsOctalDigit(*ptr)) { + // An octal escape. May one, two, or three digits. + int code = DigitValue(*ptr); + if (upb_Tokenizer_IsOctalDigit(ptr[1])) { + ++ptr; + code = code * 8 + DigitValue(*ptr); + } + if (upb_Tokenizer_IsOctalDigit(ptr[1])) { + ++ptr; + code = code * 8 + DigitValue(*ptr); + } + upb_String_PushBack(&output, (char)code); + + } else if (*ptr == 'x') { + // A hex escape. May zero, one, or two digits. (The zero case + // will have been caught as an error earlier.) + int code = 0; + if (upb_Tokenizer_IsHexDigit(ptr[1])) { + ++ptr; + code = DigitValue(*ptr); + } + if (upb_Tokenizer_IsHexDigit(ptr[1])) { + ++ptr; + code = code * 16 + DigitValue(*ptr); + } + upb_String_PushBack(&output, (char)code); + + } else if (*ptr == 'u' || *ptr == 'U') { + uint32_t unicode; + const char* end = FetchUnicodePoint(ptr, &unicode); + if (end == ptr) { + // Failure: Just dump out what we saw, don't try to parse it. + upb_String_PushBack(&output, *ptr); + } else { + AppendUTF8(unicode, &output); + ptr = end - 1; // Because we're about to ++ptr. + } + } else { + // Some other escape code. + upb_String_PushBack(&output, TranslateEscape(*ptr)); + } + + } else if (*ptr == text[0] && ptr[1] == '\0') { + // Ignore final quote matching the starting quote. + } else { + upb_String_PushBack(&output, *ptr); + } + } + + return upb_StringView_FromDataAndSize(upb_String_Data(&output), + upb_String_Size(&output)); +} + +static bool AllInClass(bool (*f)(char), const char* text, int size) { + for (int i = 0; i < size; i++) { + if (!f(text[i])) return false; + } + return true; +} + +bool upb_Tokenizer_IsIdentifier(const char* data, int size) { + // Mirrors IDENTIFIER definition in Tokenizer::Next() above. + if (size == 0) return false; + if (!upb_Tokenizer_IsLetter(data[0])) return false; + if (!AllInClass(upb_Tokenizer_IsAlphanumeric, data + 1, size - 1)) + return false; + return true; +} + +upb_Tokenizer* upb_Tokenizer_New(const void* data, size_t size, + upb_ZeroCopyInputStream* input, int options, + upb_Arena* arena) { + upb_Tokenizer* t = upb_Arena_Malloc(arena, sizeof(upb_Tokenizer)); + if (!t) return NULL; + + t->input = input; + t->arena = arena; + t->buffer = data; + t->buffer_size = size; + t->buffer_pos = 0; + t->read_error = false; + t->line = 0; + t->column = 0; + t->record_target = NULL; + t->record_start = -1; + + // ReportNewlines implies ReportWhitespace. + if (options & kUpb_TokenizerOption_ReportNewlines) { + options |= kUpb_TokenizerOption_ReportWhitespace; + } + t->options = options; + + upb_String_Init(&t->token_text, arena); + t->token_type = kUpb_TokenType_Start; + t->token_line = 0; + t->token_column = 0; + t->token_end_column = 0; + + t->previous_type = kUpb_TokenType_Start; + t->previous_line = 0; + t->previous_column = 0; + t->previous_end_column = 0; + + if (size) { + t->current_char = t->buffer[0]; + } else { + Refresh(t); + } + return t; +} + +void upb_Tokenizer_Fini(upb_Tokenizer* t) { + // If we had any buffer left unread, return it to the underlying stream + // so that someone else can read it. + if (t->buffer_size > t->buffer_pos) { + upb_ZeroCopyInputStream_BackUp(t->input, t->buffer_size - t->buffer_pos); + } +} diff --git a/third_party/upb/upb/io/tokenizer.h b/third_party/upb/upb/io/tokenizer.h new file mode 100644 index 00000000000..d8a6c5c2d02 --- /dev/null +++ b/third_party/upb/upb/io/tokenizer.h @@ -0,0 +1,153 @@ +/* + * 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. + */ + +// Class for parsing tokenized text from a ZeroCopyInputStream. + +#ifndef UPB_IO_TOKENIZER_H_ +#define UPB_IO_TOKENIZER_H_ + +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/io/zero_copy_input_stream.h" +#include "upb/mem/arena.h" + +// Must be included last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + kUpb_TokenType_Start, // Next() has not yet been called. + kUpb_TokenType_End, // End of input reached. "text" is empty. + + // A sequence of letters, digits, and underscores, not starting with a digit. + // It is an error for a number to be followed by an identifier with no space + // in between. + kUpb_TokenType_Identifier, + + // A sequence of digits representing an integer. Normally the digits are + // decimal, but a prefix of "0x" indicates a hex number and a leading zero + // indicates octal, just like with C numeric literals. A leading negative + // sign is NOT included in the token; it's up to the parser to interpret the + // unary minus operator on its own. + kUpb_TokenType_Integer, + + // A floating point literal, with a fractional part and/or an exponent. + // Always in decimal. Again, never negative. + kUpb_TokenType_Float, + + // A quoted sequence of escaped characters. + // Either single or double quotes can be used, but they must match. + // A string literal cannot cross a line break. + kUpb_TokenType_String, + + // Any other printable character, like '!' or '+'. + // Symbols are always a single character, so "!+$%" is four tokens. + kUpb_TokenType_Symbol, + + // A sequence of whitespace. + // This token type is only produced if report_whitespace() is true. + // It is not reported for whitespace within comments or strings. + kUpb_TokenType_Whitespace, + + // A newline ('\n'). This token type is only produced if report_whitespace() + // is true and report_newlines() is also true. + // It is not reported for newlines in comments or strings. + kUpb_TokenType_Newline, +} upb_TokenType; + +typedef enum { + // Set to allow floats to be suffixed with the letter 'f'. Tokens which would + // otherwise be integers but which have the 'f' suffix will be forced to be + // interpreted as floats. For all other purposes, the 'f' is ignored. + kUpb_TokenizerOption_AllowFAfterFloat = 1 << 0, + + // If set, whitespace tokens are reported by Next(). + kUpb_TokenizerOption_ReportWhitespace = 1 << 1, + + // If set, newline tokens are reported by Next(). + // This is a superset of ReportWhitespace. + kUpb_TokenizerOption_ReportNewlines = 1 << 2, + + // By default the tokenizer expects C-style (/* */) comments. + // If set, it expects shell-style (#) comments instead. + kUpb_TokenizerOption_CommentStyleShell = 1 << 3, +} upb_Tokenizer_Option; + +typedef struct upb_Tokenizer upb_Tokenizer; + +// Can be passed a flat array and/or a ZCIS as input. +// The array will be read first (if non-NULL), then the stream (if non-NULL). +upb_Tokenizer* upb_Tokenizer_New(const void* data, size_t size, + upb_ZeroCopyInputStream* input, int options, + upb_Arena* arena); + +void upb_Tokenizer_Fini(upb_Tokenizer* t); + +// Advance the tokenizer to the next input token. Returns True on success. +// Returns False and (clears *status on EOF, sets *status on error). +bool upb_Tokenizer_Next(upb_Tokenizer* t, upb_Status* status); + +// Accessors for inspecting current/previous parse tokens, +// which are opaque to the tokenizer (to reduce copying). + +upb_TokenType upb_Tokenizer_Type(const upb_Tokenizer* t); +int upb_Tokenizer_Column(const upb_Tokenizer* t); +int upb_Tokenizer_EndColumn(const upb_Tokenizer* t); +int upb_Tokenizer_Line(const upb_Tokenizer* t); +int upb_Tokenizer_TextSize(const upb_Tokenizer* t); +const char* upb_Tokenizer_TextData(const upb_Tokenizer* t); + +// External helper: validate an identifier. +bool upb_Tokenizer_IsIdentifier(const char* data, int size); + +// Parses a TYPE_INTEGER token. Returns false if the result would be +// greater than max_value. Otherwise, returns true and sets *output to the +// result. If the text is not from a Token of type TYPE_INTEGER originally +// parsed by a Tokenizer, the result is undefined (possibly an assert +// failure). +bool upb_Parse_Integer(const char* text, uint64_t max_value, uint64_t* output); + +// Parses a TYPE_FLOAT token. This never fails, so long as the text actually +// comes from a TYPE_FLOAT token parsed by Tokenizer. If it doesn't, the +// result is undefined (possibly an assert failure). +double upb_Parse_Float(const char* text); + +// Parses a TYPE_STRING token. This never fails, so long as the text actually +// comes from a TYPE_STRING token parsed by Tokenizer. If it doesn't, the +// result is undefined (possibly an assert failure). +upb_StringView upb_Parse_String(const char* text, upb_Arena* arena); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif // UPB_IO_TOKENIZER_H_ diff --git a/third_party/upb/upb/io/tokenizer_test.cc b/third_party/upb/upb/io/tokenizer_test.cc new file mode 100644 index 00000000000..35542419b49 --- /dev/null +++ b/third_party/upb/upb/io/tokenizer_test.cc @@ -0,0 +1,1253 @@ +/* + * 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/io/tokenizer.h" + +#include "gtest/gtest.h" +#include "absl/strings/escaping.h" +#include "absl/strings/str_format.h" +#include "upb/io/chunked_input_stream.h" +#include "upb/io/string.h" +#include "upb/lex/unicode.h" +#include "upb/upb.hpp" + +// Must be last. +#include "upb/port/def.inc" + +namespace proto2 { +namespace io { +namespace { + +#ifndef arraysize +#define arraysize(a) (sizeof(a) / sizeof(a[0])) +#endif + +static bool StringEquals(const char* a, const char* b) { + return strcmp(a, b) == 0; +} + +// =================================================================== +// Data-Driven Test Infrastructure + +// TODO(kenton): This is copied from coded_stream_unittest. This is +// temporary until these features are integrated into gUnit itself. + +// TEST_1D and TEST_2D are macros I'd eventually like to see added to +// gUnit. These macros can be used to declare tests which should be +// run multiple times, once for each item in some input array. TEST_1D +// tests all cases in a single input array. TEST_2D tests all +// combinations of cases from two arrays. The arrays must be statically +// defined such that the arraysize() macro works on them. Example: +// +// int kCases[] = {1, 2, 3, 4} +// TEST_1D(MyFixture, MyTest, kCases) { +// EXPECT_GT(kCases_case, 0); +// } +// +// This test iterates through the numbers 1, 2, 3, and 4 and tests that +// they are all grater than zero. In case of failure, the exact case +// which failed will be printed. The case type must be printable using +// ostream::operator<<. + +#define TEST_1D(FIXTURE, NAME, CASES) \ + class FIXTURE##_##NAME##_DD : public FIXTURE { \ + protected: \ + template \ + void DoSingleCase(const CaseType& CASES##_case); \ + }; \ + \ + TEST_F(FIXTURE##_##NAME##_DD, NAME) { \ + for (size_t i = 0; i < arraysize(CASES); i++) { \ + SCOPED_TRACE(testing::Message() \ + << #CASES " case #" << i << ": " << CASES[i]); \ + DoSingleCase(CASES[i]); \ + } \ + } \ + \ + template \ + void FIXTURE##_##NAME##_DD::DoSingleCase(const CaseType& CASES##_case) + +#define TEST_2D(FIXTURE, NAME, CASES1, CASES2) \ + class FIXTURE##_##NAME##_DD : public FIXTURE { \ + protected: \ + template \ + void DoSingleCase(const CaseType1& CASES1##_case, \ + const CaseType2& CASES2##_case); \ + }; \ + \ + TEST_F(FIXTURE##_##NAME##_DD, NAME) { \ + for (size_t i = 0; i < arraysize(CASES1); i++) { \ + for (size_t j = 0; j < arraysize(CASES2); j++) { \ + SCOPED_TRACE(testing::Message() \ + << #CASES1 " case #" << i << ": " << CASES1[i] << ", " \ + << #CASES2 " case #" << j << ": " << CASES2[j]); \ + DoSingleCase(CASES1[i], CASES2[j]); \ + } \ + } \ + } \ + \ + template \ + void FIXTURE##_##NAME##_DD::DoSingleCase(const CaseType1& CASES1##_case, \ + const CaseType2& CASES2##_case) + +// ------------------------------------------------------------------- + +// In C, a size of zero from ZCIS_Next() means EOF so we can't play the same +// trick here that happens in the C++ version. Use ChunkedInputStream instead. +upb_ZeroCopyInputStream* TestInputStream(const void* data, size_t size, + size_t block_size, upb_Arena* arena) { + return upb_ChunkedInputStream_New(data, size, block_size, arena); +} + +// ------------------------------------------------------------------- + +// We test each operation over a variety of block sizes to insure that +// we test cases where reads cross buffer boundaries as well as cases +// where they don't. This is sort of a brute-force approach to this, +// but it's easy to write and easy to understand. +const int kBlockSizes[] = {1, 2, 3, 5, 7, 13, 32, 1024}; + +class TokenizerTest : public testing::Test { + protected: + // For easy testing. + uint64_t ParseInteger(const std::string& text) { + uint64_t result; + EXPECT_TRUE(upb_Parse_Integer(text.data(), UINT64_MAX, &result)) + << "'" << text << "'"; + return result; + } +}; + +// =================================================================== + +// These tests causes gcc 3.3.5 (and earlier?) to give the cryptic error: +// "sorry, unimplemented: `method_call_expr' not supported by dump_expr" +#if !defined(__GNUC__) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) + +// In each test case, the entire input text should parse as a single token +// of the given type. +struct SimpleTokenCase { + std::string input; + upb_TokenType type; +}; + +inline std::ostream& operator<<(std::ostream& out, + const SimpleTokenCase& test_case) { + return out << absl::CEscape(test_case.input); +} + +SimpleTokenCase kSimpleTokenCases[] = { + // Test identifiers. + {"hello", kUpb_TokenType_Identifier}, + + // Test integers. + {"123", kUpb_TokenType_Integer}, + {"0xab6", kUpb_TokenType_Integer}, + {"0XAB6", kUpb_TokenType_Integer}, + {"0X1234567", kUpb_TokenType_Integer}, + {"0x89abcdef", kUpb_TokenType_Integer}, + {"0x89ABCDEF", kUpb_TokenType_Integer}, + {"01234567", kUpb_TokenType_Integer}, + + // Test floats. + {"123.45", kUpb_TokenType_Float}, + {"1.", kUpb_TokenType_Float}, + {"1e3", kUpb_TokenType_Float}, + {"1E3", kUpb_TokenType_Float}, + {"1e-3", kUpb_TokenType_Float}, + {"1e+3", kUpb_TokenType_Float}, + {"1.e3", kUpb_TokenType_Float}, + {"1.2e3", kUpb_TokenType_Float}, + {".1", kUpb_TokenType_Float}, + {".1e3", kUpb_TokenType_Float}, + {".1e-3", kUpb_TokenType_Float}, + {".1e+3", kUpb_TokenType_Float}, + + // Test strings. + {"'hello'", kUpb_TokenType_String}, + {"\"foo\"", kUpb_TokenType_String}, + {"'a\"b'", kUpb_TokenType_String}, + {"\"a'b\"", kUpb_TokenType_String}, + {"'a\\'b'", kUpb_TokenType_String}, + {"\"a\\\"b\"", kUpb_TokenType_String}, + {"'\\xf'", kUpb_TokenType_String}, + {"'\\0'", kUpb_TokenType_String}, + + // Test symbols. + {"+", kUpb_TokenType_Symbol}, + {".", kUpb_TokenType_Symbol}, +}; + +TEST_2D(TokenizerTest, SimpleTokens, kSimpleTokenCases, kBlockSizes) { + upb::Arena arena; + + // Set up the tokenizer. + auto input = TestInputStream(kSimpleTokenCases_case.input.data(), + kSimpleTokenCases_case.input.size(), + kBlockSizes_case, arena.ptr()); + auto t = upb_Tokenizer_New(NULL, 0, input, 0, arena.ptr()); + + // Before Next() is called, the initial token should always be TYPE_START. + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Start); + EXPECT_EQ(upb_Tokenizer_Line(t), 0); + EXPECT_EQ(upb_Tokenizer_Column(t), 0); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), 0); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "")); + + // Parse the token. + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + // Check that it has the right type. + EXPECT_EQ(upb_Tokenizer_Type(t), kSimpleTokenCases_case.type); + // Check that it contains the complete input text. + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), + kSimpleTokenCases_case.input.data())); + + // Check that it is located at the beginning of the input + EXPECT_EQ(upb_Tokenizer_Line(t), 0); + EXPECT_EQ(upb_Tokenizer_Column(t), 0); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), kSimpleTokenCases_case.input.size()); + + upb_Status status; + upb_Status_Clear(&status); + + // There should be no more input and no errors.. + EXPECT_FALSE(upb_Tokenizer_Next(t, &status)); + EXPECT_TRUE(upb_Status_IsOk(&status)); + + // After Next() returns false, the token should have type TYPE_END. + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_End); + EXPECT_EQ(upb_Tokenizer_Line(t), 0); + EXPECT_EQ(upb_Tokenizer_Column(t), kSimpleTokenCases_case.input.size()); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), kSimpleTokenCases_case.input.size()); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "")); +} + +TEST_1D(TokenizerTest, FloatSuffix, kBlockSizes) { + // Test the "allow_f_after_float" option. + + // Set up the tokenizer. + upb::Arena arena; + const char* text = "1f 2.5f 6e3f 7F"; + auto input = + TestInputStream(text, strlen(text), kBlockSizes_case, arena.ptr()); + const int options = kUpb_TokenizerOption_AllowFAfterFloat; + auto t = upb_Tokenizer_New(NULL, 0, input, options, arena.ptr()); + + // Advance through tokens and check that they are parsed as expected. + + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Float); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "1f")); + + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Float); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "2.5f")); + + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Float); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "6e3f")); + + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Float); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "7F")); + + upb_Status status; + upb_Status_Clear(&status); + + // There should be no more input and no errors.. + EXPECT_FALSE(upb_Tokenizer_Next(t, &status)); + EXPECT_TRUE(upb_Status_IsOk(&status)); +} + +SimpleTokenCase kWhitespaceTokenCases[] = { + {" ", kUpb_TokenType_Whitespace}, + {" ", kUpb_TokenType_Whitespace}, + {"\t", kUpb_TokenType_Whitespace}, + {"\v", kUpb_TokenType_Whitespace}, + {"\t ", kUpb_TokenType_Whitespace}, + {"\v\t", kUpb_TokenType_Whitespace}, + {" \t\r", kUpb_TokenType_Whitespace}, + // Newlines: + {"\n", kUpb_TokenType_Newline}, +}; + +TEST_2D(TokenizerTest, Whitespace, kWhitespaceTokenCases, kBlockSizes) { + upb::Arena arena; + { + auto input = TestInputStream(kWhitespaceTokenCases_case.input.data(), + kWhitespaceTokenCases_case.input.size(), + kBlockSizes_case, arena.ptr()); + auto t = upb_Tokenizer_New(NULL, 0, input, 0, arena.ptr()); + + EXPECT_FALSE(upb_Tokenizer_Next(t, NULL)); + } + { + auto input = TestInputStream(kWhitespaceTokenCases_case.input.data(), + kWhitespaceTokenCases_case.input.size(), + kBlockSizes_case, arena.ptr()); + const int options = kUpb_TokenizerOption_ReportNewlines; + auto t = upb_Tokenizer_New(NULL, 0, input, options, arena.ptr()); + + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + + EXPECT_EQ(upb_Tokenizer_Type(t), kWhitespaceTokenCases_case.type); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), + kWhitespaceTokenCases_case.input.data())); + EXPECT_FALSE(upb_Tokenizer_Next(t, NULL)); + } +} + +#endif + +// ------------------------------------------------------------------- + +struct TokenFields { + upb_TokenType type; + std::string text; + size_t line; + size_t column; + size_t end_column; +}; + +// In each case, the input is parsed to produce a list of tokens. The +// last token in "output" must have type TYPE_END. +struct MultiTokenCase { + std::string input; + std::vector output; +}; + +inline std::ostream& operator<<(std::ostream& out, + const MultiTokenCase& test_case) { + return out << absl::CEscape(test_case.input); +} + +MultiTokenCase kMultiTokenCases[] = { + // Test empty input. + {"", + { + {kUpb_TokenType_End, "", 0, 0, 0}, + }}, + // Test all token types at the same time. + {"foo 1 1.2 + 'bar'", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Integer, "1", 0, 4, 5}, + {kUpb_TokenType_Float, "1.2", 0, 6, 9}, + {kUpb_TokenType_Symbol, "+", 0, 10, 11}, + {kUpb_TokenType_String, "'bar'", 0, 12, 17}, + {kUpb_TokenType_End, "", 0, 17, 17}, + }}, + + // Test that consecutive symbols are parsed as separate tokens. + {"!@+%", + { + {kUpb_TokenType_Symbol, "!", 0, 0, 1}, + {kUpb_TokenType_Symbol, "@", 0, 1, 2}, + {kUpb_TokenType_Symbol, "+", 0, 2, 3}, + {kUpb_TokenType_Symbol, "%", 0, 3, 4}, + {kUpb_TokenType_End, "", 0, 4, 4}, + }}, + + // Test that newlines affect line numbers correctly. + {"foo bar\nrab oof", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Identifier, "bar", 0, 4, 7}, + {kUpb_TokenType_Identifier, "rab", 1, 0, 3}, + {kUpb_TokenType_Identifier, "oof", 1, 4, 7}, + {kUpb_TokenType_End, "", 1, 7, 7}, + }}, + + // Test that tabs affect column numbers correctly. + {"foo\tbar \tbaz", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Identifier, "bar", 0, 8, 11}, + {kUpb_TokenType_Identifier, "baz", 0, 16, 19}, + {kUpb_TokenType_End, "", 0, 19, 19}, + }}, + + // Test that tabs in string literals affect column numbers correctly. + {"\"foo\tbar\" baz", + { + {kUpb_TokenType_String, "\"foo\tbar\"", 0, 0, 12}, + {kUpb_TokenType_Identifier, "baz", 0, 13, 16}, + {kUpb_TokenType_End, "", 0, 16, 16}, + }}, + + // Test that line comments are ignored. + {"foo // This is a comment\n" + "bar // This is another comment", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Identifier, "bar", 1, 0, 3}, + {kUpb_TokenType_End, "", 1, 30, 30}, + }}, + + // Test that block comments are ignored. + {"foo /* This is a block comment */ bar", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Identifier, "bar", 0, 34, 37}, + {kUpb_TokenType_End, "", 0, 37, 37}, + }}, + + // Test that sh-style comments are not ignored by default. + {"foo # bar\n" + "baz", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Symbol, "#", 0, 4, 5}, + {kUpb_TokenType_Identifier, "bar", 0, 6, 9}, + {kUpb_TokenType_Identifier, "baz", 1, 0, 3}, + {kUpb_TokenType_End, "", 1, 3, 3}, + }}, + + // Test all whitespace chars + {"foo\n\t\r\v\fbar", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Identifier, "bar", 1, 11, 14}, + {kUpb_TokenType_End, "", 1, 14, 14}, + }}, +}; + +TEST_2D(TokenizerTest, MultipleTokens, kMultiTokenCases, kBlockSizes) { + // Set up the tokenizer. + upb::Arena arena; + auto input = TestInputStream(kMultiTokenCases_case.input.data(), + kMultiTokenCases_case.input.size(), + kBlockSizes_case, arena.ptr()); + auto t = upb_Tokenizer_New(NULL, 0, input, 0, arena.ptr()); + + // Before Next() is called, the initial token should always be TYPE_START. + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Start); + EXPECT_EQ(upb_Tokenizer_Line(t), 0); + EXPECT_EQ(upb_Tokenizer_Column(t), 0); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), 0); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "")); + + // Loop through all expected tokens. + TokenFields token_fields; + upb_Status status; + upb_Status_Clear(&status); + int i = 0; + do { + token_fields = kMultiTokenCases_case.output[i++]; + + SCOPED_TRACE(testing::Message() + << "Token #" << i << ": " << absl::CEscape(token_fields.text)); + + // Next() should only return false when it hits the end token. + if (token_fields.type == kUpb_TokenType_End) { + EXPECT_FALSE(upb_Tokenizer_Next(t, &status)); + EXPECT_TRUE(upb_Status_IsOk(&status)); + } else { + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + } + + // Check that the token matches the expected one. + EXPECT_EQ(upb_Tokenizer_Type(t), token_fields.type); + EXPECT_EQ(upb_Tokenizer_Line(t), token_fields.line); + EXPECT_EQ(upb_Tokenizer_Column(t), token_fields.column); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), token_fields.end_column); + EXPECT_EQ(upb_Tokenizer_TextSize(t), token_fields.text.size()); + EXPECT_TRUE( + StringEquals(upb_Tokenizer_TextData(t), token_fields.text.data())); + } while (token_fields.type != kUpb_TokenType_End); +} + +MultiTokenCase kMultiWhitespaceTokenCases[] = { + // Test all token types at the same time. + {"foo 1 \t1.2 \n +\v'bar'", + { + {kUpb_TokenType_Identifier, "foo", 0, 0, 3}, + {kUpb_TokenType_Whitespace, " ", 0, 3, 4}, + {kUpb_TokenType_Integer, "1", 0, 4, 5}, + {kUpb_TokenType_Whitespace, " \t", 0, 5, 8}, + {kUpb_TokenType_Float, "1.2", 0, 8, 11}, + {kUpb_TokenType_Whitespace, " ", 0, 11, 13}, + {kUpb_TokenType_Newline, "\n", 0, 13, 0}, + {kUpb_TokenType_Whitespace, " ", 1, 0, 3}, + {kUpb_TokenType_Symbol, "+", 1, 3, 4}, + {kUpb_TokenType_Whitespace, "\v", 1, 4, 5}, + {kUpb_TokenType_String, "'bar'", 1, 5, 10}, + {kUpb_TokenType_End, "", 1, 10, 10}, + }}, + +}; + +TEST_2D(TokenizerTest, MultipleWhitespaceTokens, kMultiWhitespaceTokenCases, + kBlockSizes) { + // Set up the tokenizer. + upb::Arena arena; + auto input = TestInputStream(kMultiWhitespaceTokenCases_case.input.data(), + kMultiWhitespaceTokenCases_case.input.size(), + kBlockSizes_case, arena.ptr()); + const int options = kUpb_TokenizerOption_ReportNewlines; + auto t = upb_Tokenizer_New(NULL, 0, input, options, arena.ptr()); + + // Before Next() is called, the initial token should always be TYPE_START. + EXPECT_EQ(upb_Tokenizer_Type(t), kUpb_TokenType_Start); + EXPECT_EQ(upb_Tokenizer_Line(t), 0); + EXPECT_EQ(upb_Tokenizer_Column(t), 0); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), 0); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), "")); + + // Loop through all expected tokens. + TokenFields token_fields; + upb_Status status; + upb_Status_Clear(&status); + int i = 0; + do { + token_fields = kMultiWhitespaceTokenCases_case.output[i++]; + + SCOPED_TRACE(testing::Message() + << "Token #" << i << ": " << token_fields.text); + + // Next() should only return false when it hits the end token. + if (token_fields.type == kUpb_TokenType_End) { + EXPECT_FALSE(upb_Tokenizer_Next(t, &status)); + EXPECT_TRUE(upb_Status_IsOk(&status)); + } else { + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + } + + // Check that the token matches the expected one. + EXPECT_EQ(upb_Tokenizer_Type(t), token_fields.type); + EXPECT_EQ(upb_Tokenizer_Line(t), token_fields.line); + EXPECT_EQ(upb_Tokenizer_Column(t), token_fields.column); + EXPECT_EQ(upb_Tokenizer_EndColumn(t), token_fields.end_column); + EXPECT_TRUE( + StringEquals(upb_Tokenizer_TextData(t), token_fields.text.data())); + } while (token_fields.type != kUpb_TokenType_End); +} + +// This test causes gcc 3.3.5 (and earlier?) to give the cryptic error: +// "sorry, unimplemented: `method_call_expr' not supported by dump_expr" +#if !defined(__GNUC__) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) + +TEST_1D(TokenizerTest, ShCommentStyle, kBlockSizes) { + // Test the "comment_style" option. + + const char* text = + "foo # bar\n" + "baz // qux\n" + "corge /* grault */\n" + "garply"; + const char* const kTokens[] = {"foo", // "# bar" is ignored + "baz", "/", "/", "qux", "corge", "/", + "*", "grault", "*", "/", "garply"}; + + // Set up the tokenizer. + upb::Arena arena; + auto input = + TestInputStream(text, strlen(text), kBlockSizes_case, arena.ptr()); + const int options = kUpb_TokenizerOption_CommentStyleShell; + auto t = upb_Tokenizer_New(NULL, 0, input, options, arena.ptr()); + + // Advance through tokens and check that they are parsed as expected. + for (size_t i = 0; i < arraysize(kTokens); i++) { + EXPECT_TRUE(upb_Tokenizer_Next(t, NULL)); + EXPECT_TRUE(StringEquals(upb_Tokenizer_TextData(t), kTokens[i])); + } + + // There should be no more input and no errors. + upb_Status status; + upb_Status_Clear(&status); + EXPECT_FALSE(upb_Tokenizer_Next(t, &status)); + EXPECT_TRUE(upb_Status_IsOk(&status)); +} + +#endif + +// ------------------------------------------------------------------- + +#if 0 // TODO(salo): Extended comments are currently unimplemented. + +// In each case, the input is expected to have two tokens named "prev" and +// "next" with comments in between. +struct DocCommentCase { + std::string input; + + const char* prev_trailing_comments; + const char* detached_comments[10]; + const char* next_leading_comments; +}; + +inline std::ostream& operator<<(std::ostream& out, + const DocCommentCase& test_case) { + return out << absl::CEscape(test_case.input); +} + +DocCommentCase kDocCommentCases[] = { + {"prev next", + + "", + {}, + ""}, + + {"prev /* ignored */ next", + + "", + {}, + ""}, + + {"prev // trailing comment\n" + "next", + + " trailing comment\n", + {}, + ""}, + + {"prev\n" + "// leading comment\n" + "// line 2\n" + "next", + + "", + {}, + " leading comment\n" + " line 2\n"}, + + {"prev\n" + "// trailing comment\n" + "// line 2\n" + "\n" + "next", + + " trailing comment\n" + " line 2\n", + {}, + ""}, + + {"prev // trailing comment\n" + "// leading comment\n" + "// line 2\n" + "next", + + " trailing comment\n", + {}, + " leading comment\n" + " line 2\n"}, + + {"prev /* trailing block comment */\n" + "/* leading block comment\n" + " * line 2\n" + " * line 3 */" + "next", + + " trailing block comment ", + {}, + " leading block comment\n" + " line 2\n" + " line 3 "}, + + {"prev\n" + "/* trailing block comment\n" + " * line 2\n" + " * line 3\n" + " */\n" + "/* leading block comment\n" + " * line 2\n" + " * line 3 */" + "next", + + " trailing block comment\n" + " line 2\n" + " line 3\n", + {}, + " leading block comment\n" + " line 2\n" + " line 3 "}, + + {"prev\n" + "// trailing comment\n" + "\n" + "// detached comment\n" + "// line 2\n" + "\n" + "// second detached comment\n" + "/* third detached comment\n" + " * line 2 */\n" + "// leading comment\n" + "next", + + " trailing comment\n", + {" detached comment\n" + " line 2\n", + " second detached comment\n", + " third detached comment\n" + " line 2 "}, + " leading comment\n"}, + + {"prev /**/\n" + "\n" + "// detached comment\n" + "\n" + "// leading comment\n" + "next", + + "", + {" detached comment\n"}, + " leading comment\n"}, + + {"prev /**/\n" + "// leading comment\n" + "next", + + "", + {}, + " leading comment\n"}, +}; + +TEST_2D(TokenizerTest, DocComments, kDocCommentCases, kBlockSizes) { + // Set up the tokenizer. + TestInputStream input(kDocCommentCases_case.input.data(), + kDocCommentCases_case.input.size(), kBlockSizes_case); + TestErrorCollector error_collector; + Tokenizer tokenizer(&input, &error_collector); + + // Set up a second tokenizer where we'll pass all NULLs to NextWithComments(). + TestInputStream input2(kDocCommentCases_case.input.data(), + kDocCommentCases_case.input.size(), kBlockSizes_case); + Tokenizer tokenizer2(&input2, &error_collector); + + tokenizer.Next(); + tokenizer2.Next(); + + EXPECT_EQ("prev", tokenizer.current().text); + EXPECT_EQ("prev", tokenizer2.current().text); + + std::string prev_trailing_comments; + std::vector detached_comments; + std::string next_leading_comments; + tokenizer.NextWithComments(&prev_trailing_comments, &detached_comments, + &next_leading_comments); + tokenizer2.NextWithComments(NULL, NULL, NULL); + EXPECT_EQ("next", tokenizer.current().text); + EXPECT_EQ("next", tokenizer2.current().text); + + EXPECT_EQ(kDocCommentCases_case.prev_trailing_comments, + prev_trailing_comments); + + for (int i = 0; i < detached_comments.size(); i++) { + EXPECT_LT(i, arraysize(kDocCommentCases)); + EXPECT_TRUE(kDocCommentCases_case.detached_comments[i] != NULL); + EXPECT_EQ(kDocCommentCases_case.detached_comments[i], detached_comments[i]); + } + + // Verify that we matched all the detached comments. + EXPECT_EQ(NULL, + kDocCommentCases_case.detached_comments[detached_comments.size()]); + + EXPECT_EQ(kDocCommentCases_case.next_leading_comments, next_leading_comments); +} + +#endif // 0 + +// ------------------------------------------------------------------- + +// Test parse helpers. +// TODO(b/225783758): Add a fuzz test for this. +TEST_F(TokenizerTest, ParseInteger) { + EXPECT_EQ(0, ParseInteger("0")); + EXPECT_EQ(123, ParseInteger("123")); + EXPECT_EQ(0xabcdef12u, ParseInteger("0xabcdef12")); + EXPECT_EQ(0xabcdef12u, ParseInteger("0xABCDEF12")); + EXPECT_EQ(UINT64_MAX, ParseInteger("0xFFFFFFFFFFFFFFFF")); + EXPECT_EQ(01234567, ParseInteger("01234567")); + EXPECT_EQ(0X123, ParseInteger("0X123")); + + // Test invalid integers that may still be tokenized as integers. + EXPECT_EQ(0, ParseInteger("0x")); + + uint64_t i; + + // Test invalid integers that will never be tokenized as integers. + EXPECT_FALSE(upb_Parse_Integer("zxy", UINT64_MAX, &i)); + EXPECT_FALSE(upb_Parse_Integer("1.2", UINT64_MAX, &i)); + EXPECT_FALSE(upb_Parse_Integer("08", UINT64_MAX, &i)); + EXPECT_FALSE(upb_Parse_Integer("0xg", UINT64_MAX, &i)); + EXPECT_FALSE(upb_Parse_Integer("-1", UINT64_MAX, &i)); + + // Test overflows. + EXPECT_TRUE(upb_Parse_Integer("0", 0, &i)); + EXPECT_FALSE(upb_Parse_Integer("1", 0, &i)); + EXPECT_TRUE(upb_Parse_Integer("1", 1, &i)); + EXPECT_TRUE(upb_Parse_Integer("12345", 12345, &i)); + EXPECT_FALSE(upb_Parse_Integer("12346", 12345, &i)); + EXPECT_TRUE(upb_Parse_Integer("0xFFFFFFFFFFFFFFFF", UINT64_MAX, &i)); + EXPECT_FALSE(upb_Parse_Integer("0x10000000000000000", UINT64_MAX, &i)); + + // Test near the limits of signed parsing (values in INT64_MAX +/- 1600) + for (int64_t offset = -1600; offset <= 1600; ++offset) { + // We make sure to perform an unsigned addition so that we avoid signed + // overflow, which would be undefined behavior. + uint64_t i = 0x7FFFFFFFFFFFFFFFu + static_cast(offset); + char decimal[32]; + snprintf(decimal, 32, "%llu", static_cast(i)); + if (offset > 0) { + uint64_t parsed = -1; + EXPECT_FALSE(upb_Parse_Integer(decimal, INT64_MAX, &parsed)) + << decimal << "=>" << parsed; + } else { + uint64_t parsed = -1; + EXPECT_TRUE(upb_Parse_Integer(decimal, INT64_MAX, &parsed)) + << decimal << "=>" << parsed; + EXPECT_EQ(parsed, i); + } + char octal[32]; + snprintf(octal, 32, "0%llo", static_cast(i)); + if (offset > 0) { + uint64_t parsed = -1; + EXPECT_FALSE(upb_Parse_Integer(octal, INT64_MAX, &parsed)) + << octal << "=>" << parsed; + } else { + uint64_t parsed = -1; + EXPECT_TRUE(upb_Parse_Integer(octal, INT64_MAX, &parsed)) + << octal << "=>" << parsed; + EXPECT_EQ(parsed, i); + } + char hex[32]; + snprintf(hex, 32, "0x%llx", static_cast(i)); + if (offset > 0) { + uint64_t parsed = -1; + EXPECT_FALSE(upb_Parse_Integer(hex, INT64_MAX, &parsed)) + << hex << "=>" << parsed; + } else { + uint64_t parsed = -1; + EXPECT_TRUE(upb_Parse_Integer(hex, INT64_MAX, &parsed)) << hex; + EXPECT_EQ(parsed, i); + } + // EXPECT_NE(offset, -237); + } + + // Test near the limits of unsigned parsing (values in UINT64_MAX +/- 1600) + // By definition, values greater than UINT64_MAX cannot be held in a uint64_t + // variable, so printing them is a little tricky; fortunately all but the + // last four digits are known, so we can hard-code them in the printf string, + // and we only need to format the last 4. + for (int64_t offset = -1600; offset <= 1600; ++offset) { + { + uint64_t i = 18446744073709551615u + offset; + char decimal[32]; + snprintf(decimal, 32, "1844674407370955%04llu", + static_cast(1615 + offset)); + if (offset > 0) { + uint64_t parsed = -1; + EXPECT_FALSE(upb_Parse_Integer(decimal, UINT64_MAX, &parsed)) + << decimal << "=>" << parsed; + } else { + uint64_t parsed = -1; + EXPECT_TRUE(upb_Parse_Integer(decimal, UINT64_MAX, &parsed)) << decimal; + EXPECT_EQ(parsed, i); + } + } + { + uint64_t i = 01777777777777777777777u + offset; + if (offset > 0) { + char octal[32]; + snprintf(octal, 32, "0200000000000000000%04llo", + static_cast(offset - 1)); + uint64_t parsed = -1; + EXPECT_FALSE(upb_Parse_Integer(octal, UINT64_MAX, &parsed)) + << octal << "=>" << parsed; + } else { + char octal[32]; + snprintf(octal, 32, "0%llo", static_cast(i)); + uint64_t parsed = -1; + EXPECT_TRUE(upb_Parse_Integer(octal, UINT64_MAX, &parsed)) << octal; + EXPECT_EQ(parsed, i); + } + } + { + uint64_t ui = 0xffffffffffffffffu + offset; + char hex[32]; + if (offset > 0) { + snprintf(hex, 32, "0x1000000000000%04llx", + static_cast(offset - 1)); + uint64_t parsed = -1; + EXPECT_FALSE(upb_Parse_Integer(hex, UINT64_MAX, &parsed)) + << hex << "=>" << parsed; + } else { + snprintf(hex, 32, "0x%llx", static_cast(ui)); + uint64_t parsed = -1; + EXPECT_TRUE(upb_Parse_Integer(hex, UINT64_MAX, &parsed)) << hex; + EXPECT_EQ(parsed, ui); + } + } + } +} + +TEST_F(TokenizerTest, ParseFloat) { + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1.")); + EXPECT_DOUBLE_EQ(1e3, upb_Parse_Float("1e3")); + EXPECT_DOUBLE_EQ(1e3, upb_Parse_Float("1E3")); + EXPECT_DOUBLE_EQ(1.5e3, upb_Parse_Float("1.5e3")); + EXPECT_DOUBLE_EQ(.1, upb_Parse_Float(".1")); + EXPECT_DOUBLE_EQ(.25, upb_Parse_Float(".25")); + EXPECT_DOUBLE_EQ(.1e3, upb_Parse_Float(".1e3")); + EXPECT_DOUBLE_EQ(.25e3, upb_Parse_Float(".25e3")); + EXPECT_DOUBLE_EQ(.1e+3, upb_Parse_Float(".1e+3")); + EXPECT_DOUBLE_EQ(.1e-3, upb_Parse_Float(".1e-3")); + EXPECT_DOUBLE_EQ(5, upb_Parse_Float("5")); + EXPECT_DOUBLE_EQ(6e-12, upb_Parse_Float("6e-12")); + EXPECT_DOUBLE_EQ(1.2, upb_Parse_Float("1.2")); + EXPECT_DOUBLE_EQ(1.e2, upb_Parse_Float("1.e2")); + + // Test invalid integers that may still be tokenized as integers. + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1e")); + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1e-")); + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1.e")); + + // Test 'f' suffix. + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1f")); + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1.0f")); + EXPECT_DOUBLE_EQ(1, upb_Parse_Float("1F")); + + // These should parse successfully even though they are out of range. + // Overflows become infinity and underflows become zero. + EXPECT_EQ(0.0, upb_Parse_Float("1e-9999999999999999999999999999")); + EXPECT_EQ(HUGE_VAL, upb_Parse_Float("1e+9999999999999999999999999999")); + +#if GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet + // Test invalid integers that will never be tokenized as integers. + EXPECT_DEBUG_DEATH( + upb_Parse_Float("zxy"), + "passed text that could not have been tokenized as a float"); + EXPECT_DEBUG_DEATH( + upb_Parse_Float("1-e0"), + "passed text that could not have been tokenized as a float"); + EXPECT_DEBUG_DEATH( + upb_Parse_Float("-1.0"), + "passed text that could not have been tokenized as a float"); +#endif // GTEST_HAS_DEATH_TEST +} + +TEST_F(TokenizerTest, ParseString) { + const std::string inputs[] = { + "'hello'", + "\"blah\\nblah2\"", + "'\\1x\\1\\123\\739\\52\\334n\\3'", + "'\\x20\\x4'", + + // Test invalid strings that may still be tokenized as strings. + "\"\\a\\l\\v\\t", // \l is invalid + "'", + "'\\", + + // Experiment with Unicode escapes. + // Here are one-, two- and three-byte Unicode characters. + "'\\u0024\\u00a2\\u20ac\\U00024b62XX'", + "'\\u0024\\u00a2\\u20ac\\ud852\\udf62XX'", // Same, encoded using UTF16. + + // Here's some broken UTF16: a head surrogate with no tail surrogate. + // We just output this as if it were UTF8; it's not a defined code point, + // but it has a defined encoding. + "'\\ud852XX'", + + // Malformed escape: Demons may fly out of the nose. + "'\\u0'", + + // Beyond the range of valid UTF-32 code units. + "'\\U00110000\\U00200000\\UFFFFFFFF'", + }; + + const std::string outputs[] = { + "hello", + "blah\nblah2", + "\1x\1\123\739\52\334n\3", + "\x20\x4", + + "\a?\v\t", + "", + "\\", + + "$¢€𤭢XX", + "$¢€𤭢XX", + + "\xed\xa1\x92XX", + + "u0", + + "\\U00110000\\U00200000\\Uffffffff", + }; + + upb::Arena arena; + + for (size_t i = 0; i < sizeof(inputs) / sizeof(inputs[0]); i++) { + auto sv = upb_Parse_String(inputs[i].data(), arena.ptr()); + EXPECT_TRUE(StringEquals(sv.data, outputs[i].data())); + } + + // Test invalid strings that will never be tokenized as strings. +#if GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet + EXPECT_DEBUG_DEATH( + upb_Parse_String("", arena.ptr()), + "passed text that could not have been tokenized as a string"); +#endif // GTEST_HAS_DEATH_TEST +} + +TEST_F(TokenizerTest, ParseStringAppend) { + upb::Arena arena; + upb_String output; + upb_String_Init(&output, arena.ptr()); + + upb_String_Assign(&output, "stuff+", 6); + auto sv = upb_Parse_String("'hello'", arena.ptr()); + EXPECT_TRUE(StringEquals(sv.data, "hello")); + upb_String_Append(&output, sv.data, sv.size); + EXPECT_TRUE(StringEquals(upb_String_Data(&output), "stuff+hello")); +} + +// ------------------------------------------------------------------- + +// Each case parses some input text, ignoring the tokens produced, and +// checks that the error output matches what is expected. +struct ErrorCase { + std::string input; + const char* errors; +}; + +inline std::ostream& operator<<(std::ostream& out, const ErrorCase& test_case) { + return out << absl::CEscape(test_case.input); +} + +ErrorCase kErrorCases[] = { + // String errors. + {"'\\l'", "0:2: Invalid escape sequence in string literal."}, + {"'\\X'", "0:2: Invalid escape sequence in string literal."}, + {"'\\x'", "0:3: Expected hex digits for escape sequence."}, + {"'foo", "0:4: Unexpected end of string."}, + {"'bar\nfoo", "0:4: String literals cannot cross line boundaries."}, + {"'\\u01'", "0:5: Expected four hex digits for \\u escape sequence."}, + {"'\\uXYZ'", "0:3: Expected four hex digits for \\u escape sequence."}, + + // Integer errors. + {"123foo", "0:3: Need space between number and identifier."}, + + // Hex/octal errors. + {"0x foo", "0:2: \"0x\" must be followed by hex digits."}, + {"0541823", "0:4: Numbers starting with leading zero must be in octal."}, + {"0x123z", "0:5: Need space between number and identifier."}, + {"0x123.4", "0:5: Hex and octal numbers must be integers."}, + {"0123.4", "0:4: Hex and octal numbers must be integers."}, + + // Float errors. + {"1e foo", "0:2: \"e\" must be followed by exponent."}, + {"1e- foo", "0:3: \"e\" must be followed by exponent."}, + {"1.2.3", + "0:3: Already saw decimal point or exponent; can't have another one."}, + {"1e2.3", + "0:3: Already saw decimal point or exponent; can't have another one."}, + {"a.1", "0:1: Need space between identifier and decimal point."}, + // allow_f_after_float not enabled, so this should be an error. + {"1.0f", "0:3: Need space between number and identifier."}, + + // Block comment errors. + {"/*", + "0:2: End-of-file inside block comment.\n0:0: Comment started here."}, + {"/*/*/ foo", + "0:3: \"/*\" inside block comment. Block comments cannot be nested."}, + + // Control characters. Multiple consecutive control characters should only + // produce one error. + {"\b foo", "0:0: Invalid control characters encountered in text."}, + {"\b\b foo", "0:0: Invalid control characters encountered in text."}, + + // Check that control characters at end of input don't result in an + // infinite loop. + {"\b", "0:0: Invalid control characters encountered in text."}, + + // Check recovery from '\0'. We have to explicitly specify the length of + // these strings because otherwise the string constructor will just call + // strlen() which will see the first '\0' and think that is the end of the + // string. + {std::string("\0foo", 4), + "0:0: Invalid control characters encountered in text."}, + {std::string("\0\0foo", 5), + "0:0: Invalid control characters encountered in text."}, + + // Check error from high order bits set + {"\300", "0:0: Interpreting non ascii codepoint 192."}, +}; + +TEST_2D(TokenizerTest, Errors, kErrorCases, kBlockSizes) { + // Set up the tokenizer. + upb::Arena arena; + auto input = TestInputStream(kErrorCases_case.input.data(), + kErrorCases_case.input.size(), kBlockSizes_case, + arena.ptr()); + auto t = upb_Tokenizer_New(NULL, 0, input, 0, arena.ptr()); + + upb_Status status; + upb_Status_Clear(&status); + + while (upb_Tokenizer_Next(t, &status)) + ; // just keep looping + EXPECT_TRUE( + StringEquals(upb_Status_ErrorMessage(&status), kErrorCases_case.errors)); +} + +// ------------------------------------------------------------------- + +TEST_1D(TokenizerTest, BackUpOnDestruction, kBlockSizes) { + const std::string text = "foo bar"; + upb::Arena arena; + auto input = + TestInputStream(text.data(), text.size(), kBlockSizes_case, arena.ptr()); + + // Create a tokenizer, read one token, then destroy it. + auto t = upb_Tokenizer_New(NULL, 0, input, 0, arena.ptr()); + upb_Tokenizer_Next(t, NULL); + upb_Tokenizer_Fini(t); + + // Only "foo" should have been read. + EXPECT_EQ(strlen("foo"), upb_ZeroCopyInputStream_ByteCount(input)); +} + +static const char* kParseBenchmark[] = { + "\"partner-google-mobile-modes-print\"", + "\"partner-google-mobile-modes-products\"", + "\"partner-google-mobile-modes-realtime\"", + "\"partner-google-mobile-modes-video\"", + "\"partner-google-modes-news\"", + "\"partner-google-modes-places\"", + "\"partner-google-news\"", + "\"partner-google-print\"", + "\"partner-google-products\"", + "\"partner-google-realtime\"", + "\"partner-google-video\"", + "\"true\"", + "\"BigImagesHover__js_list\"", + "\"XFEExternJsVersionParameters\"", + "\"Available versions of the big images hover javascript\"", + "\"Version: {\n\"", + "\" script_name: \"extern_js/dummy_file_compiled_post20070813.js\"\n\"", + "\" version_number: 0\n\"", + "\"}\"", + "\"BigImagesHover__js_selection\"", + "\"XFEExternJsVersionParameters\"", + "\"Versioning info for the big images hover javascript.\"", + "\"current_version: 0\"", + "\"BigImagesHover__js_suppressed\"", + "\"Indicates if the client-side javascript associated with big images.\"", + "\"true\"", + "\"BrowserAnyOf\"", + "\"IsChrome5OrAbove\"", + "\"IsFirefox3OrAbove\"", + "IsIE8OrAboveBinary", + "\"Abe \"Sausage King\" Froman\"", + "\"Frank \"Meatball\" Febbraro\"", +}; + +TEST(Benchmark, ParseStringAppendAccumulate) { + upb::Arena arena; + size_t outsize = 0; + int benchmark_len = arraysize(kParseBenchmark); + for (int i = 0; i < benchmark_len; i++) { + auto sv = upb_Parse_String(kParseBenchmark[i], arena.ptr()); + outsize += sv.size; + } + EXPECT_NE(0, outsize); +} + +TEST(Benchmark, ParseStringAppend) { + upb::Arena arena; + upb_String output; + upb_String_Init(&output, arena.ptr()); + int benchmark_len = arraysize(kParseBenchmark); + for (int i = 0; i < benchmark_len; i++) { + auto sv = upb_Parse_String(kParseBenchmark[i], arena.ptr()); + upb_String_Append(&output, sv.data, sv.size); + } + EXPECT_NE(0, upb_String_Size(&output)); +} + +// These tests validate the Tokenizer's handling of Unicode escapes. + +// Encode a single code point as UTF8. +static std::string StandardUTF8(uint32_t code_point) { + char buffer[4]; + int count = upb_Unicode_ToUTF8(code_point, &buffer[0]); + + EXPECT_NE(count, 0) << "Failed to encode point " << std::hex << code_point; + return std::string(reinterpret_cast(buffer), count); +} + +static std::string DisplayHex(const std::string& data) { + std::string output; + for (size_t i = 0; i < data.size(); ++i) { + absl::StrAppendFormat(&output, "%02x ", data[i]); + } + return output; +} + +static void ExpectFormat(const std::string& expectation, + const std::string& formatted) { + upb::Arena arena; + auto sv = upb_Parse_String(formatted.data(), arena.ptr()); + EXPECT_EQ(strcmp(sv.data, expectation.data()), 0) + << ": Incorrectly parsed " << formatted << ":\nGot " + << DisplayHex(sv.data) << "\nExpected " << DisplayHex(expectation); +} + +TEST(TokenizerHandlesUnicode, BMPCodes) { + for (uint32_t code_point = 0; code_point < 0x10000; ++code_point) { + // The UTF8 encoding of surrogates as single entities is not defined. + if (upb_Unicode_IsHigh(code_point)) continue; + if (upb_Unicode_IsLow(code_point)) continue; + + const std::string expectation = StandardUTF8(code_point); + + // Points in the BMP pages can be encoded using either \u with four hex + // digits, or \U with eight hex digits. + ExpectFormat(expectation, absl::StrFormat("'\\u%04x'", code_point)); + ExpectFormat(expectation, absl::StrFormat("'\\u%04X'", code_point)); + ExpectFormat(expectation, absl::StrFormat("'\\U%08x'", code_point)); + ExpectFormat(expectation, absl::StrFormat("'\\U%08X'", code_point)); + } +} + +TEST(TokenizerHandlesUnicode, NonBMPCodes) { + for (uint32_t code_point = 0x10000; code_point < 0x110000; ++code_point) { + const std::string expectation = StandardUTF8(code_point); + + // Points in the non-BMP pages can be encoded using either \U with eight hex + // digits, or using UTF-16 surrogate pairs. + ExpectFormat(expectation, absl::StrFormat("'\\U%08x'", code_point)); + ExpectFormat(expectation, absl::StrFormat("'\\U%08X'", code_point)); + ExpectFormat(expectation, absl::StrFormat("'\\u%04x\\u%04x'", + upb_Unicode_ToHigh(code_point), + upb_Unicode_ToLow(code_point))); + } +} + +} // namespace +} // namespace io +} // namespace proto2 diff --git a/third_party/upb/upb/io/zero_copy_input_stream.h b/third_party/upb/upb/io/zero_copy_input_stream.h new file mode 100644 index 00000000000..62520fc2b65 --- /dev/null +++ b/third_party/upb/upb/io/zero_copy_input_stream.h @@ -0,0 +1,129 @@ +/* + * 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_IO_ZERO_COPY_INPUT_STREAM_H_ +#define UPB_IO_ZERO_COPY_INPUT_STREAM_H_ + +#include "upb/base/status.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct upb_ZeroCopyInputStream upb_ZeroCopyInputStream; + +typedef struct { + // Obtains a chunk of data from the stream. + // + // Preconditions: + // "count" and "status" are not NULL. + // + // Postconditions: + // All errors are permanent. If an error occurs then: + // - NULL will be returned to the caller. + // - *count will be set to zero. + // - *status will be set to the error. + // EOF is permanent. If EOF is reached then: + // - NULL will be returned to the caller. + // - *count will be set to zero. + // - *status will not be touched. + // Otherwise: + // - The returned value will point to a buffer containing the bytes read. + // - *count will be set to the number of bytes read. + // - *status will not be touched. + // + // Ownership of this buffer remains with the stream, and the buffer + // remains valid only until some other method of the stream is called + // or the stream is destroyed. + const void* (*Next)(struct upb_ZeroCopyInputStream* z, size_t* count, + upb_Status* status); + + // Backs up a number of bytes, so that the next call to Next() returns + // data again that was already returned by the last call to Next(). This + // is useful when writing procedures that are only supposed to read up + // to a certain point in the input, then return. If Next() returns a + // buffer that goes beyond what you wanted to read, you can use BackUp() + // to return to the point where you intended to finish. + // + // Preconditions: + // * The last method called must have been Next(). + // * count must be less than or equal to the size of the last buffer + // returned by Next(). + // + // Postconditions: + // * The last "count" bytes of the last buffer returned by Next() will be + // pushed back into the stream. Subsequent calls to Next() will return + // the same data again before producing new data. + void (*BackUp)(struct upb_ZeroCopyInputStream* z, size_t count); + + // Skips a number of bytes. Returns false if the end of the stream is + // reached or some input error occurred. In the end-of-stream case, the + // stream is advanced to the end of the stream (so ByteCount() will return + // the total size of the stream). + bool (*Skip)(struct upb_ZeroCopyInputStream* z, size_t count); + + // Returns the total number of bytes read since this object was created. + size_t (*ByteCount)(const struct upb_ZeroCopyInputStream* z); +} _upb_ZeroCopyInputStream_VTable; + +struct upb_ZeroCopyInputStream { + const _upb_ZeroCopyInputStream_VTable* vtable; +}; + +UPB_INLINE const void* upb_ZeroCopyInputStream_Next(upb_ZeroCopyInputStream* z, + size_t* count, + upb_Status* status) { + const void* out = z->vtable->Next(z, count, status); + UPB_ASSERT((out == NULL) == (*count == 0)); + return out; +} + +UPB_INLINE void upb_ZeroCopyInputStream_BackUp(upb_ZeroCopyInputStream* z, + size_t count) { + return z->vtable->BackUp(z, count); +} + +UPB_INLINE bool upb_ZeroCopyInputStream_Skip(upb_ZeroCopyInputStream* z, + size_t count) { + return z->vtable->Skip(z, count); +} + +UPB_INLINE size_t +upb_ZeroCopyInputStream_ByteCount(const upb_ZeroCopyInputStream* z) { + return z->vtable->ByteCount(z); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_IO_ZERO_COPY_INPUT_STREAM_H_ */ diff --git a/third_party/upb/upb/io/zero_copy_output_stream.h b/third_party/upb/upb/io/zero_copy_output_stream.h new file mode 100644 index 00000000000..9fd75babb05 --- /dev/null +++ b/third_party/upb/upb/io/zero_copy_output_stream.h @@ -0,0 +1,130 @@ +/* + * 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_IO_ZERO_COPY_OUTPUT_STREAM_H_ +#define UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ + +#include "upb/base/status.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct upb_ZeroCopyOutputStream upb_ZeroCopyOutputStream; + +typedef struct { + // Obtains a buffer into which data can be written. Any data written + // into this buffer will eventually (maybe instantly, maybe later on) + // be written to the output. + // + // Preconditions: + // "count" and "status" are not NULL. + // + // Postconditions: + // All errors are permanent. If an error occurs then: + // - NULL will be returned to the caller. + // - *count will be set to zero. + // - *status will be set to the error. + // EOF is permanent. If EOF is reached then: + // - NULL will be returned to the caller. + // - *count will be set to zero. + // - *status will not be touched. + // Otherwise: + // - The returned value will point to a buffer containing the bytes read. + // - *count will be set to the number of bytes read. + // - *status will not be touched. + // + // Ownership of this buffer remains with the stream, and the buffer + // remains valid only until some other method of the stream is called + // or the stream is destroyed. + // + // Any data which the caller stores in this buffer will eventually be + // written to the output (unless BackUp() is called). + void* (*Next)(struct upb_ZeroCopyOutputStream* z, size_t* count, + upb_Status* status); + + // Backs up a number of bytes, so that the end of the last buffer returned + // by Next() is not actually written. This is needed when you finish + // writing all the data you want to write, but the last buffer was bigger + // than you needed. You don't want to write a bunch of garbage after the + // end of your data, so you use BackUp() to back up. + // + // Preconditions: + // * The last method called must have been Next(). + // * count must be less than or equal to the size of the last buffer + // returned by Next(). + // * The caller must not have written anything to the last "count" bytes + // of that buffer. + // + // Postconditions: + // * The last "count" bytes of the last buffer returned by Next() will be + // ignored. + // + // This method can be called with `count = 0` to finalize (flush) any + // previously returned buffer. For example, a file output stream can + // flush buffers returned from a previous call to Next() upon such + // BackUp(0) invocations. ZeroCopyOutputStream callers should always + // invoke BackUp() after a final Next() call, even if there is no + // excess buffer data to be backed up to indicate a flush point. + void (*BackUp)(struct upb_ZeroCopyOutputStream* z, size_t count); + + // Returns the total number of bytes written since this object was created. + size_t (*ByteCount)(const struct upb_ZeroCopyOutputStream* z); +} _upb_ZeroCopyOutputStream_VTable; + +struct upb_ZeroCopyOutputStream { + const _upb_ZeroCopyOutputStream_VTable* vtable; +}; + +UPB_INLINE void* upb_ZeroCopyOutputStream_Next(upb_ZeroCopyOutputStream* z, + size_t* count, + upb_Status* status) { + void* out = z->vtable->Next(z, count, status); + UPB_ASSERT((out == NULL) == (*count == 0)); + return out; +} + +UPB_INLINE void upb_ZeroCopyOutputStream_BackUp(upb_ZeroCopyOutputStream* z, + size_t count) { + return z->vtable->BackUp(z, count); +} + +UPB_INLINE size_t +upb_ZeroCopyOutputStream_ByteCount(const upb_ZeroCopyOutputStream* z) { + return z->vtable->ByteCount(z); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ */ diff --git a/third_party/upb/upb/io/zero_copy_stream_test.cc b/third_party/upb/upb/io/zero_copy_stream_test.cc new file mode 100644 index 00000000000..6cdb4f2eae6 --- /dev/null +++ b/third_party/upb/upb/io/zero_copy_stream_test.cc @@ -0,0 +1,290 @@ +/* + * 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. + */ + +// Testing strategy: For each type of I/O (array, string, file, etc.) we +// create an output stream and write some data to it, then create a +// corresponding input stream to read the same data back and expect it to +// match. When the data is written, it is written in several small chunks +// of varying sizes, with a BackUp() after each chunk. It is read back +// similarly, but with chunks separated at different points. The whole +// process is run with a variety of block sizes for both the input and +// the output. + +#include "gtest/gtest.h" +#include "upb/io/chunked_input_stream.h" +#include "upb/io/chunked_output_stream.h" +#include "upb/upb.hpp" + +namespace upb { +namespace { + +class IoTest : public testing::Test { + protected: + // Test helpers. + + // Helper to write an array of data to an output stream. + bool WriteToOutput(upb_ZeroCopyOutputStream* output, const void* data, + int size); + // Helper to read a fixed-length array of data from an input stream. + int ReadFromInput(upb_ZeroCopyInputStream* input, void* data, int size); + // Write a string to the output stream. + void WriteString(upb_ZeroCopyOutputStream* output, const std::string& str); + // Read a number of bytes equal to the size of the given string and checks + // that it matches the string. + void ReadString(upb_ZeroCopyInputStream* input, const std::string& str); + // Writes some text to the output stream in a particular order. Returns + // the number of bytes written, in case the caller needs that to set up an + // input stream. + int WriteStuff(upb_ZeroCopyOutputStream* output); + // Reads text from an input stream and expects it to match what + // WriteStuff() writes. + void ReadStuff(upb_ZeroCopyInputStream* input, bool read_eof = true); + + // Similar to WriteStuff, but performs more sophisticated testing. + int WriteStuffLarge(upb_ZeroCopyOutputStream* output); + // Reads and tests a stream that should have been written to + // via WriteStuffLarge(). + void ReadStuffLarge(upb_ZeroCopyInputStream* input); + + static const int kBlockSizes[]; + static const int kBlockSizeCount; +}; + +const int IoTest::kBlockSizes[] = {1, 2, 5, 7, 10, 23, 64}; +const int IoTest::kBlockSizeCount = sizeof(IoTest::kBlockSizes) / sizeof(int); + +bool IoTest::WriteToOutput(upb_ZeroCopyOutputStream* output, const void* data, + int size) { + const uint8_t* in = reinterpret_cast(data); + size_t in_size = size; + size_t out_size; + + while (true) { + upb::Status status; + void* out = upb_ZeroCopyOutputStream_Next(output, &out_size, status.ptr()); + if (out_size == 0) return false; + + if (in_size <= out_size) { + memcpy(out, in, in_size); + upb_ZeroCopyOutputStream_BackUp(output, out_size - in_size); + return true; + } + + memcpy(out, in, out_size); + in += out_size; + in_size -= out_size; + } +} + +int IoTest::ReadFromInput(upb_ZeroCopyInputStream* input, void* data, + int size) { + uint8_t* out = reinterpret_cast(data); + size_t out_size = size; + + const void* in; + size_t in_size = 0; + + while (true) { + upb::Status status; + in = upb_ZeroCopyInputStream_Next(input, &in_size, status.ptr()); + + if (in_size == 0) { + return size - out_size; + } + + if (out_size <= in_size) { + memcpy(out, in, out_size); + if (in_size > out_size) { + upb_ZeroCopyInputStream_BackUp(input, in_size - out_size); + } + return size; // Copied all of it. + } + + memcpy(out, in, in_size); + out += in_size; + out_size -= in_size; + } +} + +void IoTest::WriteString(upb_ZeroCopyOutputStream* output, + const std::string& str) { + EXPECT_TRUE(WriteToOutput(output, str.c_str(), str.size())); +} + +void IoTest::ReadString(upb_ZeroCopyInputStream* input, + const std::string& str) { + std::unique_ptr buffer(new char[str.size() + 1]); + buffer[str.size()] = '\0'; + EXPECT_EQ(ReadFromInput(input, buffer.get(), str.size()), str.size()); + EXPECT_STREQ(str.c_str(), buffer.get()); +} + +int IoTest::WriteStuff(upb_ZeroCopyOutputStream* output) { + WriteString(output, "Hello world!\n"); + WriteString(output, "Some te"); + WriteString(output, "xt. Blah blah."); + WriteString(output, "abcdefg"); + WriteString(output, "01234567890123456789"); + WriteString(output, "foobar"); + + const int result = upb_ZeroCopyOutputStream_ByteCount(output); + EXPECT_EQ(result, 68); + return result; +} + +// Reads text from an input stream and expects it to match what WriteStuff() +// writes. +void IoTest::ReadStuff(upb_ZeroCopyInputStream* input, bool read_eof) { + ReadString(input, "Hello world!\n"); + ReadString(input, "Some text. "); + ReadString(input, "Blah "); + ReadString(input, "blah."); + ReadString(input, "abcdefg"); + EXPECT_TRUE(upb_ZeroCopyInputStream_Skip(input, 20)); + ReadString(input, "foo"); + ReadString(input, "bar"); + + EXPECT_EQ(upb_ZeroCopyInputStream_ByteCount(input), 68); + + if (read_eof) { + uint8_t byte; + EXPECT_EQ(ReadFromInput(input, &byte, 1), 0); + } +} + +int IoTest::WriteStuffLarge(upb_ZeroCopyOutputStream* output) { + WriteString(output, "Hello world!\n"); + WriteString(output, "Some te"); + WriteString(output, "xt. Blah blah."); + WriteString(output, std::string(100000, 'x')); // A very long string + WriteString(output, std::string(100000, 'y')); // A very long string + WriteString(output, "01234567890123456789"); + + const int result = upb_ZeroCopyOutputStream_ByteCount(output); + EXPECT_EQ(result, 200055); + return result; +} + +// Reads text from an input stream and expects it to match what WriteStuff() +// writes. +void IoTest::ReadStuffLarge(upb_ZeroCopyInputStream* input) { + ReadString(input, "Hello world!\nSome text. "); + EXPECT_TRUE(upb_ZeroCopyInputStream_Skip(input, 5)); + ReadString(input, "blah."); + EXPECT_TRUE(upb_ZeroCopyInputStream_Skip(input, 100000 - 10)); + ReadString(input, std::string(10, 'x') + std::string(100000 - 20000, 'y')); + EXPECT_TRUE(upb_ZeroCopyInputStream_Skip(input, 20000 - 10)); + ReadString(input, "yyyyyyyyyy01234567890123456789"); + EXPECT_EQ(upb_ZeroCopyInputStream_ByteCount(input), 200055); + + uint8_t byte; + EXPECT_EQ(ReadFromInput(input, &byte, 1), 0); +} + +// =================================================================== + +TEST_F(IoTest, ArrayIo) { + const int kBufferSize = 256; + uint8_t buffer[kBufferSize]; + + upb::Arena arena; + for (int i = 0; i < kBlockSizeCount; i++) { + for (int j = 0; j < kBlockSizeCount; j++) { + auto output = upb_ChunkedOutputStream_New(buffer, kBufferSize, + kBlockSizes[j], arena.ptr()); + int size = WriteStuff(output); + auto input = + upb_ChunkedInputStream_New(buffer, size, kBlockSizes[j], arena.ptr()); + ReadStuff(input); + } + } +} + +TEST(ChunkedStream, SingleInput) { + const int kBufferSize = 256; + uint8_t buffer[kBufferSize]; + upb::Arena arena; + auto input = + upb_ChunkedInputStream_New(buffer, kBufferSize, kBufferSize, arena.ptr()); + const void* data; + size_t size; + + upb::Status status; + data = upb_ZeroCopyInputStream_Next(input, &size, status.ptr()); + EXPECT_EQ(size, kBufferSize); + + data = upb_ZeroCopyInputStream_Next(input, &size, status.ptr()); + EXPECT_EQ(data, nullptr); + EXPECT_EQ(size, 0); + EXPECT_TRUE(upb_Status_IsOk(status.ptr())); +} + +TEST(ChunkedStream, SingleOutput) { + const int kBufferSize = 256; + uint8_t buffer[kBufferSize]; + upb::Arena arena; + auto output = upb_ChunkedOutputStream_New(buffer, kBufferSize, kBufferSize, + arena.ptr()); + size_t size; + upb::Status status; + void* data = upb_ZeroCopyOutputStream_Next(output, &size, status.ptr()); + EXPECT_EQ(size, kBufferSize); + + data = upb_ZeroCopyOutputStream_Next(output, &size, status.ptr()); + EXPECT_EQ(data, nullptr); + EXPECT_EQ(size, 0); + EXPECT_TRUE(upb_Status_IsOk(status.ptr())); +} + +// Check that a zero-size input array doesn't confuse the code. +TEST(ChunkedStream, InputEOF) { + upb::Arena arena; + char buf; + auto input = upb_ChunkedInputStream_New(&buf, 0, 1, arena.ptr()); + size_t size; + upb::Status status; + const void* data = upb_ZeroCopyInputStream_Next(input, &size, status.ptr()); + EXPECT_EQ(data, nullptr); + EXPECT_EQ(size, 0); + EXPECT_TRUE(upb_Status_IsOk(status.ptr())); +} + +// Check that a zero-size output array doesn't confuse the code. +TEST(ChunkedStream, OutputEOF) { + upb::Arena arena; + char buf; + auto output = upb_ChunkedOutputStream_New(&buf, 0, 1, arena.ptr()); + size_t size; + upb::Status status; + void* data = upb_ZeroCopyOutputStream_Next(output, &size, status.ptr()); + EXPECT_EQ(data, nullptr); + EXPECT_EQ(size, 0); + EXPECT_TRUE(upb_Status_IsOk(status.ptr())); +} + +} // namespace +} // namespace upb diff --git a/third_party/upb/upb/json_decode.c b/third_party/upb/upb/json/decode.c similarity index 93% rename from third_party/upb/upb/json_decode.c rename to third_party/upb/upb/json/decode.c index 4f79294ef88..51a0937b5e9 100644 --- a/third_party/upb/upb/json_decode.c +++ b/third_party/upb/upb/json/decode.c @@ -25,22 +25,24 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/json_decode.h" +#include "upb/json/decode.h" #include #include #include #include #include -#include #include #include -#include "upb/encode.h" -#include "upb/reflection.h" +#include "upb/collections/map.h" +#include "upb/lex/atoi.h" +#include "upb/lex/unicode.h" +#include "upb/reflection/message.h" +#include "upb/wire/encode.h" -/* Special header, must be included last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" typedef struct { const char *ptr, *end; @@ -377,44 +379,20 @@ static uint32_t jsondec_codepoint(jsondec* d) { /* Parses a \uXXXX unicode escape (possibly a surrogate pair). */ static size_t jsondec_unicode(jsondec* d, char* out) { uint32_t cp = jsondec_codepoint(d); - if (cp >= 0xd800 && cp <= 0xdbff) { + if (upb_Unicode_IsHigh(cp)) { /* Surrogate pair: two 16-bit codepoints become a 32-bit codepoint. */ - uint32_t high = cp; - uint32_t low; jsondec_parselit(d, "\\u"); - low = jsondec_codepoint(d); - if (low < 0xdc00 || low > 0xdfff) { - jsondec_err(d, "Invalid low surrogate"); - } - cp = (high & 0x3ff) << 10; - cp |= (low & 0x3ff); - cp += 0x10000; - } else if (cp >= 0xdc00 && cp <= 0xdfff) { + uint32_t low = jsondec_codepoint(d); + if (!upb_Unicode_IsLow(low)) jsondec_err(d, "Invalid low surrogate"); + cp = upb_Unicode_FromPair(cp, low); + } else if (upb_Unicode_IsLow(cp)) { jsondec_err(d, "Unpaired low surrogate"); } /* Write to UTF-8 */ - if (cp <= 0x7f) { - out[0] = cp; - return 1; - } else if (cp <= 0x07FF) { - out[0] = ((cp >> 6) & 0x1F) | 0xC0; - out[1] = ((cp >> 0) & 0x3F) | 0x80; - return 2; - } else if (cp <= 0xFFFF) { - out[0] = ((cp >> 12) & 0x0F) | 0xE0; - out[1] = ((cp >> 6) & 0x3F) | 0x80; - out[2] = ((cp >> 0) & 0x3F) | 0x80; - return 3; - } else if (cp < 0x10FFFF) { - out[0] = ((cp >> 18) & 0x07) | 0xF0; - out[1] = ((cp >> 12) & 0x3f) | 0x80; - out[2] = ((cp >> 6) & 0x3f) | 0x80; - out[3] = ((cp >> 0) & 0x3f) | 0x80; - return 4; - } else { - jsondec_err(d, "Invalid codepoint"); - } + int bytes = upb_Unicode_ToUTF8(cp, out); + if (bytes == 0) jsondec_err(d, "Invalid codepoint"); + return bytes; } static void jsondec_resize(jsondec* d, char** buf, char** end, char** buf_end) { @@ -460,7 +438,7 @@ static upb_StringView jsondec_string(jsondec* d) { if (*d->ptr == 'u') { d->ptr++; if (buf_end - end < 4) { - /* Allow space for maximum-sized code point (4 bytes). */ + /* Allow space for maximum-sized codepoint (4 bytes). */ jsondec_resize(d, &buf, &end, &buf_end); } end += jsondec_unicode(d, end); @@ -633,44 +611,19 @@ static size_t jsondec_base64(jsondec* d, upb_StringView str) { /* Low-level integer parsing **************************************************/ -/* We use these hand-written routines instead of strto[u]l() because the "long - * long" variants aren't in c89. Also our version allows setting a ptr limit. */ - static const char* jsondec_buftouint64(jsondec* d, const char* ptr, const char* end, uint64_t* val) { - uint64_t u64 = 0; - while (ptr < end) { - unsigned ch = *ptr - '0'; - if (ch >= 10) break; - if (u64 > UINT64_MAX / 10 || u64 * 10 > UINT64_MAX - ch) { - jsondec_err(d, "Integer overflow"); - } - u64 *= 10; - u64 += ch; - ptr++; - } - - *val = u64; - return ptr; + const char* out = upb_BufToUint64(ptr, end, val); + if (!out) jsondec_err(d, "Integer overflow"); + return out; } static const char* jsondec_buftoint64(jsondec* d, const char* ptr, - const char* end, int64_t* val) { - bool neg = false; - uint64_t u64; - - if (ptr != end && *ptr == '-') { - ptr++; - neg = true; - } - - ptr = jsondec_buftouint64(d, ptr, end, &u64); - if (u64 > (uint64_t)INT64_MAX + neg) { - jsondec_err(d, "Integer overflow"); - } - - *val = neg ? -u64 : u64; - return ptr; + const char* end, int64_t* val, + bool* is_neg) { + const char* out = upb_BufToInt64(ptr, end, val, is_neg); + if (!out) jsondec_err(d, "Integer overflow"); + return out; } static uint64_t jsondec_strtouint64(jsondec* d, upb_StringView str) { @@ -685,7 +638,7 @@ static uint64_t jsondec_strtouint64(jsondec* d, upb_StringView str) { static int64_t jsondec_strtoint64(jsondec* d, upb_StringView str) { const char* end = str.data + str.size; int64_t ret; - if (jsondec_buftoint64(d, str.data, end, &ret) != end) { + if (jsondec_buftoint64(d, str.data, end, &ret, NULL) != end) { jsondec_err(d, "Non-number characters in quoted integer"); } return ret; @@ -792,11 +745,11 @@ static upb_MessageValue jsondec_double(jsondec* d, const upb_FieldDef* f) { } if (upb_FieldDef_CType(f) == kUpb_CType_Float) { - if (val.double_val != INFINITY && val.double_val != -INFINITY && - (val.double_val > FLT_MAX || val.double_val < -FLT_MAX)) { - jsondec_err(d, "Float out of range"); + float f = val.double_val; + if (val.double_val != INFINITY && val.double_val != -INFINITY) { + if (f == INFINITY || f == -INFINITY) jsondec_err(d, "Float out of range"); } - val.float_val = val.double_val; + val.float_val = f; } return val; @@ -919,7 +872,8 @@ static void jsondec_tomsg(jsondec* d, upb_Message* msg, static upb_MessageValue jsondec_msg(jsondec* d, const upb_FieldDef* f) { const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f); - upb_Message* msg = upb_Message_New(m, d->arena); + const upb_MiniTable* layout = upb_MessageDef_MiniTable(m); + upb_Message* msg = upb_Message_New(layout, d->arena); upb_MessageValue val; jsondec_tomsg(d, msg, m); @@ -984,7 +938,7 @@ static void jsondec_field(jsondec* d, upb_Message* msg, jsondec_tomsg(d, submsg, subm); } else { upb_MessageValue val = jsondec_value(d, f); - upb_Message_Set(msg, f, val, d->arena); + upb_Message_SetFieldByDef(msg, f, val, d->arena); } d->debug_field = preserved; @@ -1137,9 +1091,10 @@ static void jsondec_timestamp(jsondec* d, upb_Message* msg, jsondec_err(d, "Timestamp out of range"); } - upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 1), seconds, - d->arena); - upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 2), nanos, d->arena); + upb_Message_SetFieldByDef(msg, upb_MessageDef_FindFieldByNumber(m, 1), + seconds, d->arena); + upb_Message_SetFieldByDef(msg, upb_MessageDef_FindFieldByNumber(m, 2), nanos, + d->arena); return; malformed: @@ -1154,9 +1109,10 @@ static void jsondec_duration(jsondec* d, upb_Message* msg, const char* ptr = str.data; const char* end = ptr + str.size; const int64_t max = (uint64_t)3652500 * 86400; + bool neg = false; /* "3.000000001s", "3s", etc. */ - ptr = jsondec_buftoint64(d, ptr, end, &seconds.int64_val); + ptr = jsondec_buftoint64(d, ptr, end, &seconds.int64_val, &neg); nanos.int32_val = jsondec_nanos(d, &ptr, end); if (end - ptr != 1 || *ptr != 's') { @@ -1167,24 +1123,26 @@ static void jsondec_duration(jsondec* d, upb_Message* msg, jsondec_err(d, "Duration out of range"); } - if (seconds.int64_val < 0) { + if (neg) { nanos.int32_val = -nanos.int32_val; } - upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 1), seconds, - d->arena); - upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 2), nanos, d->arena); + upb_Message_SetFieldByDef(msg, upb_MessageDef_FindFieldByNumber(m, 1), + seconds, d->arena); + upb_Message_SetFieldByDef(msg, upb_MessageDef_FindFieldByNumber(m, 2), nanos, + d->arena); } static void jsondec_listvalue(jsondec* d, upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* values_f = upb_MessageDef_FindFieldByNumber(m, 1); const upb_MessageDef* value_m = upb_FieldDef_MessageSubDef(values_f); + const upb_MiniTable* value_layout = upb_MessageDef_MiniTable(value_m); upb_Array* values = upb_Message_Mutable(msg, values_f, d->arena).array; jsondec_arrstart(d); while (jsondec_arrnext(d)) { - upb_Message* value_msg = upb_Message_New(value_m, d->arena); + upb_Message* value_msg = upb_Message_New(value_layout, d->arena); upb_MessageValue value; value.msg_val = value_msg; upb_Array_Append(values, value, d->arena); @@ -1199,12 +1157,13 @@ static void jsondec_struct(jsondec* d, upb_Message* msg, const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(fields_f); const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(entry_m, 2); const upb_MessageDef* value_m = upb_FieldDef_MessageSubDef(value_f); + const upb_MiniTable* value_layout = upb_MessageDef_MiniTable(value_m); upb_Map* fields = upb_Message_Mutable(msg, fields_f, d->arena).map; jsondec_objstart(d); while (jsondec_objnext(d)) { upb_MessageValue key, value; - upb_Message* value_msg = upb_Message_New(value_m, d->arena); + upb_Message* value_msg = upb_Message_New(value_layout, d->arena); key.str_val = jsondec_string(d); value.msg_val = value_msg; upb_Map_Set(fields, key, value, d->arena); @@ -1266,7 +1225,7 @@ static void jsondec_wellknownvalue(jsondec* d, upb_Message* msg, UPB_UNREACHABLE(); } - upb_Message_Set(msg, f, val, d->arena); + upb_Message_SetFieldByDef(msg, f, val, d->arena); } static upb_StringView jsondec_mask(jsondec* d, const char* buf, @@ -1353,7 +1312,7 @@ static const upb_MessageDef* jsondec_typeurl(jsondec* d, upb_Message* msg, upb_MessageValue val; val.str_val = type_url; - upb_Message_Set(msg, type_url_f, val, d->arena); + upb_Message_SetFieldByDef(msg, type_url_f, val, d->arena); /* Find message name after the last '/' */ while (ptr > type_url.data && *--ptr != '/') { @@ -1406,7 +1365,8 @@ static void jsondec_any(jsondec* d, upb_Message* msg, const upb_MessageDef* m) { jsondec_err(d, "Any object didn't contain a '@type' field"); } - any_msg = upb_Message_New(any_m, d->arena); + const upb_MiniTable* any_layout = upb_MessageDef_MiniTable(any_m); + any_msg = upb_Message_New(any_layout, d->arena); if (pre_type_data) { size_t len = pre_type_end - pre_type_data + 1; @@ -1436,14 +1396,14 @@ static void jsondec_any(jsondec* d, upb_Message* msg, const upb_MessageDef* m) { (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); + upb_Message_SetFieldByDef(msg, value_f, encoded, d->arena); } static void jsondec_wrapper(jsondec* d, upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(m, 1); upb_MessageValue val = jsondec_value(d, value_f); - upb_Message_Set(msg, value_f, val, d->arena); + upb_Message_SetFieldByDef(msg, value_f, val, d->arena); } static void jsondec_wellknown(jsondec* d, upb_Message* msg, @@ -1486,6 +1446,14 @@ static void jsondec_wellknown(jsondec* d, upb_Message* msg, } } +static bool upb_JsonDecoder_Decode(jsondec* const d, upb_Message* const msg, + const upb_MessageDef* const m) { + if (UPB_SETJMP(d->err)) return false; + + jsondec_tomsg(d, msg, m); + return true; +} + bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg, const upb_MessageDef* m, const upb_DefPool* symtab, int options, upb_Arena* arena, upb_Status* status) { @@ -1505,8 +1473,5 @@ bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg, d.debug_field = NULL; d.is_first = false; - if (UPB_SETJMP(d.err)) return false; - - jsondec_tomsg(&d, msg, m); - return true; + return upb_JsonDecoder_Decode(&d, msg, m); } diff --git a/third_party/upb/upb/json/decode.h b/third_party/upb/upb/json/decode.h new file mode 100644 index 00000000000..7f8b8554d3e --- /dev/null +++ b/third_party/upb/upb/json/decode.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_JSON_DECODE_H_ +#define UPB_JSON_DECODE_H_ + +#include "upb/reflection/def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { upb_JsonDecode_IgnoreUnknown = 1 }; + +bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg, + const upb_MessageDef* m, const upb_DefPool* symtab, + int options, upb_Arena* arena, upb_Status* status); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_JSONDECODE_H_ */ diff --git a/third_party/upb/upb/json/decode_test.cc b/third_party/upb/upb/json/decode_test.cc new file mode 100644 index 00000000000..deb40f4ad1c --- /dev/null +++ b/third_party/upb/upb/json/decode_test.cc @@ -0,0 +1,91 @@ +/* + * 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/json/decode.h" + +#include "google/protobuf/struct.upb.h" +#include "gtest/gtest.h" +#include "upb/json/test.upb.h" +#include "upb/json/test.upbdefs.h" +#include "upb/reflection/def.hpp" +#include "upb/upb.hpp" + +static upb_test_Box* JsonDecode(const char* json, upb_Arena* a) { + upb::Status status; + upb::DefPool defpool; + upb::MessageDefPtr m(upb_test_Box_getmsgdef(defpool.ptr())); + EXPECT_TRUE(m.ptr() != nullptr); + + upb_test_Box* box = upb_test_Box_new(a); + int options = 0; + bool ok = upb_JsonDecode(json, strlen(json), box, m.ptr(), defpool.ptr(), + options, a, status.ptr()); + return ok ? box : nullptr; +} + +struct FloatTest { + const std::string json; + float f; +}; + +static const std::vector FloatTestsPass = { + {R"({"f": 0})", 0}, + {R"({"f": 1})", 1}, + {R"({"f": 1.000000})", 1}, + {R"({"f": 1.5e1})", 15}, + {R"({"f": 15e-1})", 1.5}, + {R"({"f": -3.5})", -3.5}, + {R"({"f": 3.402823e38})", 3.402823e38}, + {R"({"f": -3.402823e38})", -3.402823e38}, + {R"({"f": 340282346638528859811704183484516925440.0})", + 340282346638528859811704183484516925440.0}, + {R"({"f": -340282346638528859811704183484516925440.0})", + -340282346638528859811704183484516925440.0}, +}; + +static const std::vector FloatTestsFail = { + {R"({"f": 1z})", 0}, + {R"({"f": 3.4028236e+38})", 0}, + {R"({"f": -3.4028236e+38})", 0}, +}; + +// Decode some floats. +TEST(JsonTest, DecodeFloats) { + upb::Arena a; + + for (const auto& test : FloatTestsPass) { + upb_test_Box* box = JsonDecode(test.json.c_str(), a.ptr()); + EXPECT_NE(box, nullptr); + float f = upb_test_Box_f(box); + EXPECT_EQ(f, test.f); + } + + for (const auto& test : FloatTestsFail) { + upb_test_Box* box = JsonDecode(test.json.c_str(), a.ptr()); + EXPECT_EQ(box, nullptr); + } +} diff --git a/third_party/upb/upb/json_encode.c b/third_party/upb/upb/json/encode.c similarity index 88% rename from third_party/upb/upb/json_encode.c rename to third_party/upb/upb/json/encode.c index e13c0f771d6..325131c1f62 100644 --- a/third_party/upb/upb/json_encode.c +++ b/third_party/upb/upb/json/encode.c @@ -25,24 +25,23 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/json_encode.h" +#include "upb/json/encode.h" #include #include #include #include -#include #include -#include #include -#include "upb/decode.h" -#include "upb/internal/upb.h" -#include "upb/internal/vsnprintf_compat.h" -#include "upb/reflection.h" +#include "upb/collections/map.h" +#include "upb/lex/round_trip.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/message.h" +#include "upb/wire/decode.h" -/* Must be last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" typedef struct { char *buf, *ptr, *end; @@ -144,8 +143,8 @@ static void jsonenc_timestamp(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* seconds_f = upb_MessageDef_FindFieldByNumber(m, 1); const upb_FieldDef* nanos_f = upb_MessageDef_FindFieldByNumber(m, 2); - int64_t seconds = upb_Message_Get(msg, seconds_f).int64_val; - int32_t nanos = upb_Message_Get(msg, nanos_f).int32_val; + int64_t seconds = upb_Message_GetFieldByDef(msg, seconds_f).int64_val; + int32_t nanos = upb_Message_GetFieldByDef(msg, nanos_f).int32_val; int L, N, I, J, K, hour, min, sec; if (seconds < -62135596800) { @@ -187,19 +186,29 @@ static void jsonenc_duration(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* seconds_f = upb_MessageDef_FindFieldByNumber(m, 1); const upb_FieldDef* nanos_f = upb_MessageDef_FindFieldByNumber(m, 2); - int64_t seconds = upb_Message_Get(msg, seconds_f).int64_val; - int32_t nanos = upb_Message_Get(msg, nanos_f).int32_val; + int64_t seconds = upb_Message_GetFieldByDef(msg, seconds_f).int64_val; + int32_t nanos = upb_Message_GetFieldByDef(msg, nanos_f).int32_val; + bool negative = false; if (seconds > 315576000000 || seconds < -315576000000 || - (seconds < 0) != (nanos < 0)) { + (seconds != 0 && nanos != 0 && (seconds < 0) != (nanos < 0))) { jsonenc_err(e, "bad duration"); } + if (seconds < 0) { + negative = true; + seconds = -seconds; + } if (nanos < 0) { + negative = true; nanos = -nanos; } - jsonenc_printf(e, "\"%" PRId64, seconds); + jsonenc_putstr(e, "\""); + if (negative) { + jsonenc_putstr(e, "-"); + } + jsonenc_printf(e, "%" PRId64, seconds); jsonenc_nanos(e, nanos); jsonenc_putstr(e, "s\""); } @@ -339,7 +348,7 @@ static void upb_JsonEncode_Float(jsonenc* e, float val) { static void jsonenc_wrapper(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(m, 1); - upb_MessageValue val = upb_Message_Get(msg, val_f); + upb_MessageValue val = upb_Message_GetFieldByDef(msg, val_f); jsonenc_scalar(e, val, val_f); } @@ -384,12 +393,12 @@ static void jsonenc_any(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* type_url_f = upb_MessageDef_FindFieldByNumber(m, 1); const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(m, 2); - upb_StringView type_url = upb_Message_Get(msg, type_url_f).str_val; - upb_StringView value = upb_Message_Get(msg, value_f).str_val; + upb_StringView type_url = upb_Message_GetFieldByDef(msg, type_url_f).str_val; + upb_StringView value = upb_Message_GetFieldByDef(msg, value_f).str_val; const upb_MessageDef* any_m = jsonenc_getanymsg(e, type_url); const upb_MiniTable* any_layout = upb_MessageDef_MiniTable(any_m); upb_Arena* arena = jsonenc_arena(e); - upb_Message* any = upb_Message_New(any_m, arena); + upb_Message* any = upb_Message_New(any_layout, arena); if (upb_Decode(value.data, value.size, any, any_layout, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { @@ -443,7 +452,7 @@ static void jsonenc_fieldpath(jsonenc* e, upb_StringView path) { static void jsonenc_fieldmask(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* paths_f = upb_MessageDef_FindFieldByNumber(m, 1); - const upb_Array* paths = upb_Message_Get(msg, paths_f).array_val; + const upb_Array* paths = upb_Message_GetFieldByDef(msg, paths_f).array_val; bool first = true; size_t i, n = 0; @@ -461,20 +470,20 @@ static void jsonenc_fieldmask(jsonenc* e, const upb_Message* msg, static void jsonenc_struct(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { - const upb_FieldDef* fields_f = upb_MessageDef_FindFieldByNumber(m, 1); - const upb_Map* fields = upb_Message_Get(msg, fields_f).map_val; - const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(fields_f); - const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(entry_m, 2); - size_t iter = kUpb_Map_Begin; - bool first = true; - jsonenc_putstr(e, "{"); - if (fields) { - while (upb_MapIterator_Next(fields, &iter)) { - upb_MessageValue key = upb_MapIterator_Key(fields, iter); - upb_MessageValue val = upb_MapIterator_Value(fields, iter); + const upb_FieldDef* fields_f = upb_MessageDef_FindFieldByNumber(m, 1); + const upb_Map* fields = upb_Message_GetFieldByDef(msg, fields_f).map_val; + if (fields) { + const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(fields_f); + const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(entry_m, 2); + + size_t iter = kUpb_Map_Begin; + bool first = true; + + upb_MessageValue key, val; + while (upb_Map_Next(fields, &key, &val, &iter)) { jsonenc_putsep(e, ",", &first); jsonenc_string(e, key.str_val); jsonenc_putstr(e, ":"); @@ -489,7 +498,7 @@ static void jsonenc_listvalue(jsonenc* e, const upb_Message* msg, const upb_MessageDef* m) { const upb_FieldDef* values_f = upb_MessageDef_FindFieldByNumber(m, 1); const upb_MessageDef* values_m = upb_FieldDef_MessageSubDef(values_f); - const upb_Array* values = upb_Message_Get(msg, values_f).array_val; + const upb_Array* values = upb_Message_GetFieldByDef(msg, values_f).array_val; size_t i; bool first = true; @@ -524,6 +533,12 @@ static void jsonenc_value(jsonenc* e, const upb_Message* msg, jsonenc_putstr(e, "null"); break; case 2: + if (upb_JsonEncode_HandleSpecialDoubles(e, val.double_val)) { + jsonenc_err( + e, + "google.protobuf.Value cannot encode double values for " + "infinity or nan, because they would be parsed as a string"); + } upb_JsonEncode_Double(e, val.double_val); break; case 3: @@ -668,19 +683,21 @@ static void jsonenc_array(jsonenc* e, const upb_Array* arr, } static void jsonenc_map(jsonenc* e, const upb_Map* map, const upb_FieldDef* f) { + jsonenc_putstr(e, "{"); + const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f); const upb_FieldDef* key_f = upb_MessageDef_FindFieldByNumber(entry, 1); const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(entry, 2); - size_t iter = kUpb_Map_Begin; - bool first = true; - - jsonenc_putstr(e, "{"); if (map) { - while (upb_MapIterator_Next(map, &iter)) { + size_t iter = kUpb_Map_Begin; + bool first = true; + + upb_MessageValue key, val; + while (upb_Map_Next(map, &key, &val, &iter)) { jsonenc_putsep(e, ",", &first); - jsonenc_mapkey(e, upb_MapIterator_Key(map, iter), key_f); - jsonenc_scalar(e, upb_MapIterator_Value(map, iter), val_f); + jsonenc_mapkey(e, key, key_f); + jsonenc_scalar(e, val, val_f); } } @@ -727,8 +744,8 @@ static void jsonenc_msgfields(jsonenc* e, const upb_Message* msg, int n = upb_MessageDef_FieldCount(m); for (i = 0; i < n; i++) { f = upb_MessageDef_Field(m, i); - if (!upb_FieldDef_HasPresence(f) || upb_Message_Has(msg, f)) { - jsonenc_fieldval(e, f, upb_Message_Get(msg, f), &first); + if (!upb_FieldDef_HasPresence(f) || upb_Message_HasFieldByDef(msg, f)) { + jsonenc_fieldval(e, f, upb_Message_GetFieldByDef(msg, f), &first); } } } else { @@ -758,6 +775,17 @@ static size_t jsonenc_nullz(jsonenc* e, size_t size) { return ret; } +static size_t upb_JsonEncoder_Encode(jsonenc* const e, + const upb_Message* const msg, + const upb_MessageDef* const m, + const size_t size) { + if (UPB_SETJMP(e->err) != 0) return -1; + + jsonenc_msgfield(e, msg, m); + if (e->arena) upb_Arena_Free(e->arena); + return jsonenc_nullz(e, size); +} + size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, const upb_DefPool* ext_pool, int options, char* buf, size_t size, upb_Status* status) { @@ -772,9 +800,5 @@ size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, e.status = status; e.arena = NULL; - if (setjmp(e.err)) return -1; - - jsonenc_msgfield(&e, msg, m); - if (e.arena) upb_Arena_Free(e.arena); - return jsonenc_nullz(&e, size); + return upb_JsonEncoder_Encode(&e, msg, m, size); } diff --git a/third_party/upb/upb/json/encode.h b/third_party/upb/upb/json/encode.h new file mode 100644 index 00000000000..ad9444a3e23 --- /dev/null +++ b/third_party/upb/upb/json/encode.h @@ -0,0 +1,70 @@ +/* + * 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_JSON_ENCODE_H_ +#define UPB_JSON_ENCODE_H_ + +#include "upb/reflection/def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + /* When set, emits 0/default values. TODO(haberman): proto3 only? */ + upb_JsonEncode_EmitDefaults = 1 << 0, + + /* When set, use normal (snake_case) field names instead of JSON (camelCase) + names. */ + 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 + * |m|. The symtab in |symtab| is used to find extensions (if NULL, extensions + * will not be printed). + * + * Output is placed in the given buffer, and always NULL-terminated. The output + * size (excluding NULL) is returned. This means that a return value >= |size| + * implies that the output was truncated. (These are the same semantics as + * snprintf()). */ +size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, + const upb_DefPool* ext_pool, int options, char* buf, + size_t size, upb_Status* status); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_JSONENCODE_H_ */ diff --git a/third_party/upb/upb/json_test.cc b/third_party/upb/upb/json/encode_test.cc similarity index 96% rename from third_party/upb/upb/json_test.cc rename to third_party/upb/upb/json/encode_test.cc index 7abd23a93b1..4c0d1a77457 100644 --- a/third_party/upb/upb/json_test.cc +++ b/third_party/upb/upb/json/encode_test.cc @@ -25,12 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "upb/json/encode.h" + #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/json/test.upb.h" +#include "upb/json/test.upbdefs.h" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" static std::string JsonEncode(const upb_test_Box* msg, int options) { diff --git a/third_party/upb/upb/json_test.proto b/third_party/upb/upb/json/test.proto similarity index 86% rename from third_party/upb/upb/json_test.proto rename to third_party/upb/upb/json/test.proto index d14b2f105a7..0765333f5ee 100644 --- a/third_party/upb/upb/json_test.proto +++ b/third_party/upb/upb/json/test.proto @@ -17,4 +17,6 @@ message Box { optional Tag last_tag = 5; optional string name = 4; optional google.protobuf.Value val = 6; + optional float f = 7; + optional double d = 8; } diff --git a/third_party/upb/upb/json_decode.h b/third_party/upb/upb/json_decode.h index 848f4df33c8..816bf013dbc 100644 --- a/third_party/upb/upb/json_decode.h +++ b/third_party/upb/upb/json_decode.h @@ -25,23 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/json/decode.h instead +// IWYU pragma: private, include "upb/json/decode.h" + #ifndef UPB_JSONDECODE_H_ #define UPB_JSONDECODE_H_ -#include "upb/def.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { upb_JsonDecode_IgnoreUnknown = 1 }; - -bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg, - const upb_MessageDef* m, const upb_DefPool* symtab, - int options, upb_Arena* arena, upb_Status* status); - -#ifdef __cplusplus -} /* extern "C" */ -#endif +#include "upb/json/decode.h" #endif /* UPB_JSONDECODE_H_ */ diff --git a/third_party/upb/upb/json_encode.h b/third_party/upb/upb/json_encode.h index 6e0cac3fc17..8189956fd05 100644 --- a/third_party/upb/upb/json_encode.h +++ b/third_party/upb/upb/json_encode.h @@ -25,41 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/json/encode.h instead +// IWYU pragma: private, include "upb/json/encode.h" + #ifndef UPB_JSONENCODE_H_ #define UPB_JSONENCODE_H_ -#include "upb/def.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - /* When set, emits 0/default values. TODO(haberman): proto3 only? */ - upb_JsonEncode_EmitDefaults = 1 << 0, - - /* When set, use normal (snake_case) field names instead of JSON (camelCase) - names. */ - 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 - * |m|. The symtab in |symtab| is used to find extensions (if NULL, extensions - * will not be printed). - * - * Output is placed in the given buffer, and always NULL-terminated. The output - * size (excluding NULL) is returned. This means that a return value >= |size| - * implies that the output was truncated. (These are the same semantics as - * snprintf()). */ -size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, - const upb_DefPool* ext_pool, int options, char* buf, - size_t size, upb_Status* status); - -#ifdef __cplusplus -} /* extern "C" */ -#endif +#include "upb/json/encode.h" #endif /* UPB_JSONENCODE_H_ */ diff --git a/third_party/upb/upb/lex/atoi.c b/third_party/upb/upb/lex/atoi.c new file mode 100644 index 00000000000..35bebfce9ff --- /dev/null +++ b/third_party/upb/upb/lex/atoi.c @@ -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. + */ + +#include "upb/lex/atoi.h" + +// Must be last. +#include "upb/port/def.inc" + +const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val) { + uint64_t u64 = 0; + while (ptr < end) { + unsigned ch = *ptr - '0'; + if (ch >= 10) break; + if (u64 > UINT64_MAX / 10 || u64 * 10 > UINT64_MAX - ch) { + return NULL; // integer overflow + } + u64 *= 10; + u64 += ch; + ptr++; + } + + *val = u64; + return ptr; +} + +const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val, + bool* is_neg) { + bool neg = false; + uint64_t u64; + + if (ptr != end && *ptr == '-') { + ptr++; + neg = true; + } + + ptr = upb_BufToUint64(ptr, end, &u64); + if (!ptr || u64 > (uint64_t)INT64_MAX + neg) { + return NULL; // integer overflow + } + + *val = neg ? -u64 : u64; + if (is_neg) *is_neg = neg; + return ptr; +} diff --git a/third_party/upb/upb/lex/atoi.h b/third_party/upb/upb/lex/atoi.h new file mode 100644 index 00000000000..e8f37119a21 --- /dev/null +++ b/third_party/upb/upb/lex/atoi.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_LEX_ATOI_H_ +#define UPB_LEX_ATOI_H_ + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// We use these hand-written routines instead of strto[u]l() because the "long +// long" variants aren't in c89. Also our version allows setting a ptr limit. +// Return the new position of the pointer after parsing the int, or NULL on +// integer overflow. + +const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val); +const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val, + bool* is_neg); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_LEX_ATOI_H_ */ diff --git a/third_party/upb/upb/lex/atoi_test.cc b/third_party/upb/upb/lex/atoi_test.cc new file mode 100644 index 00000000000..40fc9731638 --- /dev/null +++ b/third_party/upb/upb/lex/atoi_test.cc @@ -0,0 +1,109 @@ +/* + * 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/lex/atoi.h" + +#include "gtest/gtest.h" +#include "absl/strings/str_cat.h" + +TEST(AtoiTest, Uint64) { + uint64_t val; + + const char* s = "1234z"; + EXPECT_EQ(s + 1, upb_BufToUint64(s, s + 1, &val)); + EXPECT_EQ(val, 1); + EXPECT_EQ(s + 4, upb_BufToUint64(s, s + 4, &val)); + EXPECT_EQ(val, 1234); + EXPECT_EQ(s + 4, upb_BufToUint64(s, s + 5, &val)); + EXPECT_EQ(val, 1234); + + const char* t = "42.6"; + EXPECT_EQ(t + 1, upb_BufToUint64(t, t + 1, &val)); + EXPECT_EQ(val, 4); + EXPECT_EQ(t + 2, upb_BufToUint64(t, t + 2, &val)); + EXPECT_EQ(val, 42); + EXPECT_EQ(t + 2, upb_BufToUint64(t, t + 3, &val)); + EXPECT_EQ(val, 42); + + // Integer overflow + const char* u = "1000000000000000000000000000000"; + EXPECT_EQ(NULL, upb_BufToUint64(u, u + strlen(u), &val)); + + // Not an integer + const char* v = "foobar"; + EXPECT_EQ(v, upb_BufToUint64(v, v + strlen(v), &val)); + + const uint64_t values[] = { + std::numeric_limits::max(), + std::numeric_limits::min(), + }; + for (size_t i = 0; i < ABSL_ARRAYSIZE(values); i++) { + std::string v = absl::StrCat(values[i]); + const char* ptr = v.c_str(); + const char* end = ptr + strlen(ptr); + EXPECT_EQ(end, upb_BufToUint64(ptr, end, &val)); + EXPECT_EQ(val, values[i]); + } +} + +TEST(AtoiTest, Int64) { + int64_t val; + bool neg; + + const char* s = "1234z"; + EXPECT_EQ(s + 1, upb_BufToInt64(s, s + 1, &val, &neg)); + EXPECT_EQ(val, 1); + EXPECT_EQ(neg, false); + EXPECT_EQ(s + 4, upb_BufToInt64(s, s + 4, &val, NULL)); + EXPECT_EQ(val, 1234); + EXPECT_EQ(s + 4, upb_BufToInt64(s, s + 5, &val, NULL)); + EXPECT_EQ(val, 1234); + + const char* t = "-42.6"; + EXPECT_EQ(t + 2, upb_BufToInt64(t, t + 2, &val, &neg)); + EXPECT_EQ(val, -4); + EXPECT_EQ(neg, true); + EXPECT_EQ(t + 3, upb_BufToInt64(t, t + 3, &val, NULL)); + EXPECT_EQ(val, -42); + EXPECT_EQ(neg, true); + EXPECT_EQ(t + 3, upb_BufToInt64(t, t + 5, &val, NULL)); + EXPECT_EQ(val, -42); + + const int64_t values[] = { + std::numeric_limits::max(), + std::numeric_limits::min(), + std::numeric_limits::max(), + std::numeric_limits::min(), + }; + for (size_t i = 0; i < ABSL_ARRAYSIZE(values); i++) { + std::string v = absl::StrCat(values[i]); + const char* ptr = v.c_str(); + const char* end = ptr + strlen(ptr); + EXPECT_EQ(end, upb_BufToInt64(ptr, end, &val, NULL)); + EXPECT_EQ(val, values[i]); + } +} diff --git a/third_party/upb/upb/upb.c b/third_party/upb/upb/lex/round_trip.c similarity index 92% rename from third_party/upb/upb/upb.c rename to third_party/upb/upb/lex/round_trip.c index 08ae9647773..f4d95453a1b 100644 --- a/third_party/upb/upb/upb.c +++ b/third_party/upb/upb/lex/round_trip.c @@ -25,22 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/internal/upb.h" +#include "upb/lex/round_trip.h" -#include #include -#include -#include -#include -#include #include -#include - -#include "upb/arena.h" -#include "upb/status.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" /* Miscellaneous utilities ****************************************************/ diff --git a/third_party/upb/upb/lex/round_trip.h b/third_party/upb/upb/lex/round_trip.h new file mode 100644 index 00000000000..307910b477c --- /dev/null +++ b/third_party/upb/upb/lex/round_trip.h @@ -0,0 +1,55 @@ +/* + * 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_LEX_ROUND_TRIP_H_ +#define UPB_LEX_ROUND_TRIP_H_ + +// Must be last. +#include "upb/port/def.inc" + +// 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 }; + +#ifdef __cplusplus +extern "C" { +#endif + +void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size); +void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_LEX_ROUND_TRIP_H_ */ diff --git a/third_party/upb/upb/lex/strtod.c b/third_party/upb/upb/lex/strtod.c new file mode 100644 index 00000000000..2b3c61e3657 --- /dev/null +++ b/third_party/upb/upb/lex/strtod.c @@ -0,0 +1,97 @@ +/* + * 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/lex/strtod.h" + +#include +#include + +// Must be last. +#include "upb/port/def.inc" + +// Determine the locale-specific radix character by calling sprintf() to print +// the number 1.5, then stripping off the digits. As far as I can tell, this +// is the only portable, thread-safe way to get the C library to divulge the +// locale's radix character. No, localeconv() is NOT thread-safe. + +static int GetLocaleRadix(char *data, size_t capacity) { + char temp[16]; + const int size = snprintf(temp, sizeof(temp), "%.1f", 1.5); + UPB_ASSERT(temp[0] == '1'); + UPB_ASSERT(temp[size - 1] == '5'); + UPB_ASSERT(size < capacity); + temp[size - 1] = '\0'; + strcpy(data, temp + 1); + return size - 2; +} + +// Populates a string identical to *input except that the character pointed to +// by pos (which should be '.') is replaced with the locale-specific radix. + +static void LocalizeRadix(const char *input, const char *pos, char *output) { + const int len1 = pos - input; + + char radix[8]; + const int len2 = GetLocaleRadix(radix, sizeof(radix)); + + memcpy(output, input, len1); + memcpy(output + len1, radix, len2); + strcpy(output + len1 + len2, input + len1 + 1); +} + +double _upb_NoLocaleStrtod(const char *str, char **endptr) { + // We cannot simply set the locale to "C" temporarily with setlocale() + // as this is not thread-safe. Instead, we try to parse in the current + // locale first. If parsing stops at a '.' character, then this is a + // pretty good hint that we're actually in some other locale in which + // '.' is not the radix character. + + char *temp_endptr; + double result = strtod(str, &temp_endptr); + if (endptr != NULL) *endptr = temp_endptr; + if (*temp_endptr != '.') return result; + + // Parsing halted on a '.'. Perhaps we're in a different locale? Let's + // try to replace the '.' with a locale-specific radix character and + // try again. + + char localized[80]; + LocalizeRadix(str, temp_endptr, localized); + char *localized_endptr; + result = strtod(localized, &localized_endptr); + if ((localized_endptr - &localized[0]) > (temp_endptr - str)) { + // This attempt got further, so replacing the decimal must have helped. + // Update endptr to point at the right location. + if (endptr != NULL) { + // size_diff is non-zero if the localized radix has multiple bytes. + int size_diff = strlen(localized) - strlen(str); + *endptr = (char *)str + (localized_endptr - &localized[0] - size_diff); + } + } + + return result; +} diff --git a/third_party/upb/upb/mini_table_accessors_internal.h b/third_party/upb/upb/lex/strtod.h similarity index 83% rename from third_party/upb/upb/mini_table_accessors_internal.h rename to third_party/upb/upb/lex/strtod.h index 8368b65bd43..bda9242513a 100644 --- a/third_party/upb/upb/mini_table_accessors_internal.h +++ b/third_party/upb/upb/lex/strtod.h @@ -25,12 +25,22 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_MINI_TABLE_ACCESSORS_INTERNAL_H_ -#define UPB_MINI_TABLE_ACCESSORS_INTERNAL_H_ +#ifndef UPB_LEX_STRTOD_H_ +#define UPB_LEX_STRTOD_H_ -// TODO(b/232091617): Delete this entire header which currently exists only for -// temporary backwards compatibility. +// Must be last. +#include "upb/port/def.inc" -#include "upb/internal/mini_table_accessors.h" +#ifdef __cplusplus +extern "C" { +#endif -#endif // UPB_MINI_TABLE_ACCESSORS_INTERNAL_H_ +double _upb_NoLocaleStrtod(const char *str, char **endptr); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_LEX_STRTOD_H_ */ diff --git a/third_party/upb/upb/lex/unicode.c b/third_party/upb/upb/lex/unicode.c new file mode 100644 index 00000000000..ec08c34a323 --- /dev/null +++ b/third_party/upb/upb/lex/unicode.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/lex/unicode.h" + +// Must be last. +#include "upb/port/def.inc" + +int upb_Unicode_ToUTF8(uint32_t cp, char* out) { + if (cp <= 0x7f) { + out[0] = cp; + return 1; + } + if (cp <= 0x07ff) { + out[0] = (cp >> 6) | 0xc0; + out[1] = (cp & 0x3f) | 0x80; + return 2; + } + if (cp <= 0xffff) { + out[0] = (cp >> 12) | 0xe0; + out[1] = ((cp >> 6) & 0x3f) | 0x80; + out[2] = (cp & 0x3f) | 0x80; + return 3; + } + if (cp <= 0x10ffff) { + out[0] = (cp >> 18) | 0xf0; + out[1] = ((cp >> 12) & 0x3f) | 0x80; + out[2] = ((cp >> 6) & 0x3f) | 0x80; + out[3] = (cp & 0x3f) | 0x80; + return 4; + } + return 0; +} diff --git a/third_party/upb/upb/lex/unicode.h b/third_party/upb/upb/lex/unicode.h new file mode 100644 index 00000000000..c7407ff606b --- /dev/null +++ b/third_party/upb/upb/lex/unicode.h @@ -0,0 +1,77 @@ +/* + * 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_LEX_UNICODE_H_ +#define UPB_LEX_UNICODE_H_ + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns true iff a codepoint is the value for a high surrogate. +UPB_INLINE bool upb_Unicode_IsHigh(uint32_t cp) { + return (cp >= 0xd800 && cp <= 0xdbff); +} + +// Returns true iff a codepoint is the value for a low surrogate. +UPB_INLINE bool upb_Unicode_IsLow(uint32_t cp) { + return (cp >= 0xdc00 && cp <= 0xdfff); +} + +// Returns the high 16-bit surrogate value for a supplementary codepoint. +// Does not sanity-check the input. +UPB_INLINE uint16_t upb_Unicode_ToHigh(uint32_t cp) { + return (cp >> 10) + 0xd7c0; +} + +// Returns the low 16-bit surrogate value for a supplementary codepoint. +// Does not sanity-check the input. +UPB_INLINE uint16_t upb_Unicode_ToLow(uint32_t cp) { + return (cp & 0x3ff) | 0xdc00; +} + +// Returns the 32-bit value corresponding to a pair of 16-bit surrogates. +// Does not sanity-check the input. +UPB_INLINE uint32_t upb_Unicode_FromPair(uint32_t high, uint32_t low) { + return ((high & 0x3ff) << 10) + (low & 0x3ff) + 0x10000; +} + +// Outputs a codepoint as UTF8. +// Returns the number of bytes written (1-4 on success, 0 on error). +// Does not sanity-check the input. Specifically does not check for surrogates. +int upb_Unicode_ToUTF8(uint32_t cp, char* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_LEX_UNICODE_H_ */ diff --git a/third_party/upb/upb/map.h b/third_party/upb/upb/map.h index 8ee0ddd05e4..9ce69f69fc6 100644 --- a/third_party/upb/upb/map.h +++ b/third_party/upb/upb/map.h @@ -25,93 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/collections/map.h instead +// IWYU pragma: private, include "upb/collections/map.h" + #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" +#include "upb/collections/map.h" #endif /* UPB_MAP_H_ */ diff --git a/third_party/upb/upb/mem/alloc.c b/third_party/upb/upb/mem/alloc.c new file mode 100644 index 00000000000..23650655ced --- /dev/null +++ b/third_party/upb/upb/mem/alloc.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/mem/alloc.h" + +#include + +// Must be last. +#include "upb/port/def.inc" + +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); + } +} + +upb_alloc upb_alloc_global = {&upb_global_allocfunc}; diff --git a/third_party/upb/upb/mem/alloc.h b/third_party/upb/upb/mem/alloc.h new file mode 100644 index 00000000000..df7a65ecca1 --- /dev/null +++ b/third_party/upb/upb/mem/alloc.h @@ -0,0 +1,98 @@ +/* + * 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_MEM_ALLOC_H_ +#define UPB_MEM_ALLOC_H_ + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct upb_alloc upb_alloc; + +/* A combined `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); + +/* 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 { + 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) { + UPB_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); } + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MEM_ALLOC_H_ */ diff --git a/third_party/upb/upb/arena.c b/third_party/upb/upb/mem/arena.c similarity index 85% rename from third_party/upb/upb/arena.c rename to third_party/upb/upb/mem/arena.c index 3c872698cd6..23124a64255 100644 --- a/third_party/upb/upb/arena.c +++ b/third_party/upb/upb/mem/arena.c @@ -25,28 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/arena.h" - -#include - -#include "upb/internal/upb.h" +#include "upb/mem/arena_internal.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); - } -} +#include "upb/port/def.inc" static uint32_t* upb_cleanup_pointer(uintptr_t cleanup_metadata) { return (uint32_t*)(cleanup_metadata & ~0x1); @@ -61,15 +43,11 @@ static uintptr_t upb_cleanup_metadata(uint32_t* cleanup, return (uintptr_t)cleanup | has_initial_block; } -upb_alloc upb_alloc_global = {&upb_global_allocfunc}; - -/* upb_Arena ******************************************************************/ - -struct mem_block { - struct mem_block* next; +struct _upb_MemBlock { + struct _upb_MemBlock* next; uint32_t size; uint32_t cleanups; - /* Data follows. */ + // Data follows. }; typedef struct cleanup_ent { @@ -78,7 +56,7 @@ typedef struct cleanup_ent { } cleanup_ent; static const size_t memblock_reserve = - UPB_ALIGN_UP(sizeof(mem_block), UPB_MALLOC_ALIGN); + UPB_ALIGN_UP(sizeof(_upb_MemBlock), UPB_MALLOC_ALIGN); static upb_Arena* arena_findroot(upb_Arena* a) { /* Path splitting keeps time complexity down, see: @@ -91,9 +69,27 @@ static upb_Arena* arena_findroot(upb_Arena* a) { return a; } +size_t upb_Arena_SpaceAllocated(upb_Arena* arena) { + arena = arena_findroot(arena); + size_t memsize = 0; + + _upb_MemBlock* block = arena->freelist; + + while (block) { + memsize += sizeof(_upb_MemBlock) + block->size; + block = block->next; + } + + return memsize; +} + +uint32_t upb_Arena_DebugRefCount(upb_Arena* arena) { + return arena_findroot(arena)->refcount; +} + static void upb_Arena_addblock(upb_Arena* a, upb_Arena* root, void* ptr, size_t size) { - mem_block* block = ptr; + _upb_MemBlock* block = ptr; /* The block is for arena |a|, but should appear in the freelist of |root|. */ block->next = root->freelist; @@ -114,7 +110,7 @@ static void upb_Arena_addblock(upb_Arena* a, upb_Arena* root, void* 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); + _upb_MemBlock* block = upb_malloc(root->block_alloc, block_size); if (!block) return false; upb_Arena_addblock(a, root, block, block_size); @@ -127,15 +123,9 @@ void* _upb_Arena_SlowMalloc(upb_Arena* a, size_t 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) { +static 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; @@ -148,7 +138,6 @@ upb_Arena* arena_initslow(void* mem, size_t n, upb_alloc* alloc) { 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; @@ -182,7 +171,6 @@ upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* 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; @@ -190,19 +178,20 @@ upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc) { a->head.ptr = mem; a->head.end = UPB_PTR_AT(mem, n - sizeof(*a), char); a->freelist = NULL; + a->freelist_tail = NULL; a->cleanup_metadata = upb_cleanup_metadata(NULL, true); return a; } static void arena_dofree(upb_Arena* a) { - mem_block* block = a->freelist; + _upb_MemBlock* 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; + _upb_MemBlock* next = block->next; if (block->cleanups > 0) { cleanup_ent* end = UPB_PTR_AT(block, block->size, void); diff --git a/third_party/upb/upb/mem/arena.h b/third_party/upb/upb/mem/arena.h new file mode 100644 index 00000000000..3e1ddf1401e --- /dev/null +++ b/third_party/upb/upb/mem/arena.h @@ -0,0 +1,160 @@ +/* + * 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_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. */ + +#ifndef UPB_MEM_ARENA_H_ +#define UPB_MEM_ARENA_H_ + +#include + +#include "upb/mem/alloc.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef struct upb_Arena upb_Arena; + +typedef void upb_CleanupFunc(void* context); + +typedef struct { + char *ptr, *end; +} _upb_ArenaHead; + +#ifdef __cplusplus +extern "C" { +#endif + +// 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_API upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc); + +UPB_API void upb_Arena_Free(upb_Arena* a); +UPB_API bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, + upb_CleanupFunc* func); +UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b); + +void* _upb_Arena_SlowMalloc(upb_Arena* a, size_t size); +size_t upb_Arena_SpaceAllocated(upb_Arena* arena); +uint32_t upb_Arena_DebugRefCount(upb_Arena* arena); + +UPB_INLINE size_t _upb_ArenaHas(upb_Arena* a) { + _upb_ArenaHead* h = (_upb_ArenaHead*)a; + return (size_t)(h->end - h->ptr); +} + +UPB_API_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); + } + + // We have enough space to do a fast malloc. + _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; +} + +// 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_API_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_API_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_API_INLINE upb_Arena* upb_Arena_New(void) { + return upb_Arena_Init(NULL, 0, &upb_alloc_global); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MEM_ARENA_H_ */ diff --git a/third_party/upb/upb/internal/upb.h b/third_party/upb/upb/mem/arena_internal.h similarity index 76% rename from third_party/upb/upb/internal/upb.h rename to third_party/upb/upb/mem/arena_internal.h index cdc8bfc228b..42b6f60b95f 100644 --- a/third_party/upb/upb/internal/upb.h +++ b/third_party/upb/upb/mem/arena_internal.h @@ -25,13 +25,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_INTERNAL_UPB_H_ -#define UPB_INTERNAL_UPB_H_ +#ifndef UPB_MEM_ARENA_INTERNAL_H_ +#define UPB_MEM_ARENA_INTERNAL_H_ -#include "upb/upb.h" +#include "upb/mem/arena.h" -struct mem_block; -typedef struct mem_block mem_block; +// Must be last. +#include "upb/port/def.inc" + +typedef struct _upb_MemBlock _upb_MemBlock; struct upb_Arena { _upb_ArenaHead head; @@ -52,17 +54,17 @@ struct upb_Arena { struct upb_Arena* parent; /* Linked list of blocks to free/cleanup. */ - mem_block *freelist, *freelist_tail; + _upb_MemBlock *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); +#ifdef __cplusplus +extern "C" { +#endif -#endif /* UPB_INTERNAL_UPB_H_ */ +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MEM_ARENA_INTERNAL_H_ */ diff --git a/third_party/upb/upb/message/accessors.c b/third_party/upb/upb/message/accessors.c new file mode 100644 index 00000000000..2ed872a774b --- /dev/null +++ b/third_party/upb/upb/message/accessors.c @@ -0,0 +1,337 @@ +/* + * 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/message/accessors.h" + +#include "upb/collections/array.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map.h" +#include "upb/message/message.h" +#include "upb/mini_table/field_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" + +// Must be last. +#include "upb/port/def.inc" + +// Parses unknown data by merging into existing base_message or creating a +// new message usingg mini_table. +static upb_UnknownToMessageRet upb_MiniTable_ParseUnknownMessage( + const char* unknown_data, size_t unknown_size, + const upb_MiniTable* mini_table, upb_Message* base_message, + int decode_options, upb_Arena* arena) { + upb_UnknownToMessageRet ret; + ret.message = + base_message ? base_message : _upb_Message_New(mini_table, arena); + if (!ret.message) { + ret.status = kUpb_UnknownToMessage_OutOfMemory; + return ret; + } + // Decode sub message using unknown field contents. + const char* data = unknown_data; + uint32_t tag; + uint64_t message_len = 0; + data = upb_WireReader_ReadTag(data, &tag); + data = upb_WireReader_ReadVarint(data, &message_len); + upb_DecodeStatus status = upb_Decode(data, message_len, ret.message, + mini_table, NULL, decode_options, arena); + if (status == kUpb_DecodeStatus_OutOfMemory) { + ret.status = kUpb_UnknownToMessage_OutOfMemory; + } else if (status == kUpb_DecodeStatus_Ok) { + ret.status = kUpb_UnknownToMessage_Ok; + } else { + ret.status = kUpb_UnknownToMessage_ParseError; + } + return ret; +} + +upb_GetExtension_Status upb_MiniTable_GetOrPromoteExtension( + upb_Message* msg, const upb_MiniTableExtension* 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; + upb_FindUnknownRet result = upb_MiniTable_FindUnknown(msg, field_number); + if (result.status != kUpb_FindUnknown_Ok) { + return kUpb_GetExtension_NotPresent; + } + size_t len; + size_t ofs = result.ptr - upb_Message_GetUnknown(msg, &len); + // Decode and promote from unknown. + const upb_MiniTable* extension_table = ext_table->sub.submsg; + upb_UnknownToMessageRet parse_result = upb_MiniTable_ParseUnknownMessage( + result.ptr, result.len, extension_table, + /* base_message= */ NULL, decode_options, arena); + switch (parse_result.status) { + case kUpb_UnknownToMessage_OutOfMemory: + return kUpb_GetExtension_OutOfMemory; + case kUpb_UnknownToMessage_ParseError: + return kUpb_GetExtension_ParseError; + case kUpb_UnknownToMessage_NotFound: + return kUpb_GetExtension_NotPresent; + case kUpb_UnknownToMessage_Ok: + break; + } + upb_Message* extension_msg = parse_result.message; + // 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; + const char* delete_ptr = upb_Message_GetUnknown(msg, &len) + ofs; + upb_Message_DeleteUnknown(msg, delete_ptr, result.len); + return kUpb_GetExtension_Ok; +} + +upb_GetExtensionAsBytes_Status upb_MiniTable_GetExtensionAsBytes( + const upb_Message* msg, const upb_MiniTableExtension* 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; + upb_FindUnknownRet result = upb_MiniTable_FindUnknown(msg, field_number); + if (result.status != kUpb_FindUnknown_Ok) { + return kUpb_GetExtensionAsBytes_NotPresent; + } + const char* data = result.ptr; + uint32_t tag; + uint64_t message_len = 0; + data = upb_WireReader_ReadTag(data, &tag); + data = upb_WireReader_ReadVarint(data, &message_len); + *extension_data = data; + *len = message_len; + return kUpb_GetExtensionAsBytes_Ok; +} + +static upb_FindUnknownRet upb_FindUnknownRet_ParseError(void) { + return (upb_FindUnknownRet){.status = kUpb_FindUnknown_ParseError}; +} + +upb_FindUnknownRet upb_MiniTable_FindUnknown(const upb_Message* msg, + uint32_t field_number) { + const int depth_limit = 100; // TODO: this should be a parameter + size_t size; + upb_FindUnknownRet ret; + + const char* ptr = upb_Message_GetUnknown(msg, &size); + upb_EpsCopyInputStream stream; + upb_EpsCopyInputStream_Init(&stream, &ptr, size, true); + + while (!upb_EpsCopyInputStream_IsDone(&stream, &ptr)) { + uint32_t tag; + const char* unknown_begin = ptr; + ptr = upb_WireReader_ReadTag(ptr, &tag); + if (!ptr) return upb_FindUnknownRet_ParseError(); + if (field_number == upb_WireReader_GetFieldNumber(tag)) { + ret.status = kUpb_FindUnknown_Ok; + ret.ptr = upb_EpsCopyInputStream_GetAliasedPtr(&stream, unknown_begin); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); + // Because we know that the input is a flat buffer, it is safe to perform + // pointer arithmetic on aliased pointers. + ret.len = upb_EpsCopyInputStream_GetAliasedPtr(&stream, ptr) - ret.ptr; + return ret; + } + + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); + if (!ptr) return upb_FindUnknownRet_ParseError(); + } + ret.status = kUpb_FindUnknown_NotPresent; + ret.ptr = NULL; + ret.len = 0; + return ret; +} + +// Warning: See TODO(b/267655898) +upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( + upb_Message* msg, const upb_MiniTable* mini_table, + const upb_MiniTableField* field, const upb_MiniTable* sub_mini_table, + int decode_options, upb_Arena* arena) { + upb_FindUnknownRet unknown; + // We need to loop and merge unknowns that have matching tag field->number. + upb_Message* message = NULL; + // Callers should check that message is not set first before calling + // PromotoUnknownToMessage. + UPB_ASSERT(mini_table->subs[field->submsg_index].submsg == sub_mini_table); + bool is_oneof = _upb_MiniTableField_InOneOf(field); + if (!is_oneof || _upb_getoneofcase_field(msg, field) == field->number) { + UPB_ASSERT(upb_Message_GetMessage(msg, field, NULL) == NULL); + } + upb_UnknownToMessageRet ret; + ret.status = kUpb_UnknownToMessage_Ok; + do { + unknown = upb_MiniTable_FindUnknown(msg, field->number); + switch (unknown.status) { + case kUpb_FindUnknown_Ok: { + const char* unknown_data = unknown.ptr; + size_t unknown_size = unknown.len; + ret = upb_MiniTable_ParseUnknownMessage(unknown_data, unknown_size, + sub_mini_table, message, + decode_options, arena); + if (ret.status == kUpb_UnknownToMessage_Ok) { + message = ret.message; + upb_Message_DeleteUnknown(msg, unknown_data, unknown_size); + } + } break; + case kUpb_FindUnknown_ParseError: + ret.status = kUpb_UnknownToMessage_ParseError; + break; + case kUpb_FindUnknown_NotPresent: + // If we parsed at least one unknown, we are done. + ret.status = + message ? kUpb_UnknownToMessage_Ok : kUpb_UnknownToMessage_NotFound; + break; + } + } while (unknown.status == kUpb_FindUnknown_Ok); + if (message) { + if (is_oneof) { + *_upb_oneofcase_field(msg, field) = field->number; + } + upb_Message_SetMessage(msg, mini_table, field, message); + ret.message = message; + } + return ret; +} + +// Moves repeated messages in unknowns to a upb_Array. +// +// Since the repeated field is not a scalar type we don't check for +// kUpb_LabelFlags_IsPacked. +// TODO(b/251007554): Optimize. Instead of converting messages one at a time, +// scan all unknown data once and compact. +upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMessageArray( + upb_Message* msg, const upb_MiniTableField* field, + const upb_MiniTable* mini_table, int decode_options, upb_Arena* arena) { + upb_Array* repeated_messages = upb_Message_GetMutableArray(msg, field); + // Find all unknowns with given field number and parse. + upb_FindUnknownRet unknown; + do { + unknown = upb_MiniTable_FindUnknown(msg, field->number); + if (unknown.status == kUpb_FindUnknown_Ok) { + upb_UnknownToMessageRet ret = upb_MiniTable_ParseUnknownMessage( + unknown.ptr, unknown.len, mini_table, + /* base_message= */ NULL, decode_options, arena); + if (ret.status == kUpb_UnknownToMessage_Ok) { + upb_MessageValue value; + value.msg_val = ret.message; + // Allocate array on demand before append. + if (!repeated_messages) { + upb_Message_ResizeArray(msg, field, 0, arena); + repeated_messages = upb_Message_GetMutableArray(msg, field); + } + if (!upb_Array_Append(repeated_messages, value, arena)) { + return kUpb_UnknownToMessage_OutOfMemory; + } + upb_Message_DeleteUnknown(msg, unknown.ptr, unknown.len); + } else { + return ret.status; + } + } + } while (unknown.status == kUpb_FindUnknown_Ok); + return kUpb_UnknownToMessage_Ok; +} + +upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map, + const upb_MiniTable* mini_table, + const upb_MiniTableField* field, + upb_Message* map_entry_message, + upb_Arena* arena) { + const upb_MiniTable* map_entry_mini_table = + mini_table->subs[field->submsg_index].submsg; + UPB_ASSERT(map_entry_mini_table); + UPB_ASSERT(map_entry_mini_table->field_count == 2); + const upb_MiniTableField* map_entry_key_field = + &map_entry_mini_table->fields[0]; + const upb_MiniTableField* map_entry_value_field = + &map_entry_mini_table->fields[1]; + // Map key/value cannot have explicit defaults, + // hence assuming a zero default is valid. + upb_MessageValue default_val; + memset(&default_val, 0, sizeof(upb_MessageValue)); + upb_MessageValue map_entry_key; + upb_MessageValue map_entry_value; + _upb_Message_GetField(map_entry_message, map_entry_key_field, &default_val, + &map_entry_key); + _upb_Message_GetField(map_entry_message, map_entry_value_field, &default_val, + &map_entry_value); + return upb_Map_Insert(map, map_entry_key, map_entry_value, arena); +} + +// Moves repeated messages in unknowns to a upb_Map. +upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMap( + upb_Message* msg, const upb_MiniTable* mini_table, + const upb_MiniTableField* field, int decode_options, upb_Arena* arena) { + const upb_MiniTable* map_entry_mini_table = + mini_table->subs[field->submsg_index].submsg; + UPB_ASSERT(map_entry_mini_table); + UPB_ASSERT(map_entry_mini_table); + UPB_ASSERT(map_entry_mini_table->field_count == 2); + UPB_ASSERT(upb_FieldMode_Get(field) == kUpb_FieldMode_Map); + // Find all unknowns with given field number and parse. + upb_FindUnknownRet unknown; + while (1) { + unknown = upb_MiniTable_FindUnknown(msg, field->number); + if (unknown.status != kUpb_FindUnknown_Ok) break; + upb_UnknownToMessageRet ret = upb_MiniTable_ParseUnknownMessage( + unknown.ptr, unknown.len, map_entry_mini_table, + /* base_message= */ NULL, decode_options, arena); + if (ret.status != kUpb_UnknownToMessage_Ok) return ret.status; + // Allocate map on demand before append. + upb_Map* map = upb_Message_GetOrCreateMutableMap(msg, map_entry_mini_table, + field, arena); + upb_Message* map_entry_message = ret.message; + upb_MapInsertStatus insert_status = upb_Message_InsertMapEntry( + map, mini_table, field, map_entry_message, arena); + if (insert_status == kUpb_MapInsertStatus_OutOfMemory) { + return kUpb_UnknownToMessage_OutOfMemory; + } + UPB_ASSUME(insert_status == kUpb_MapInsertStatus_Inserted || + insert_status == kUpb_MapInsertStatus_Replaced); + upb_Message_DeleteUnknown(msg, unknown.ptr, unknown.len); + } + return kUpb_UnknownToMessage_Ok; +} diff --git a/third_party/upb/upb/message/accessors.h b/third_party/upb/upb/message/accessors.h new file mode 100644 index 00000000000..36b5835998d --- /dev/null +++ b/third_party/upb/upb/message/accessors.h @@ -0,0 +1,761 @@ +/* + * 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_MESSAGE_ACCESSORS_H_ +#define UPB_MESSAGE_ACCESSORS_H_ + +#include "upb/base/descriptor_constants.h" +#include "upb/collections/array.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map.h" +#include "upb/collections/map_internal.h" +#include "upb/message/extension_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/common.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/mini_table/field_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +#if defined(__GNUC__) && !defined(__clang__) +// GCC raises incorrect warnings in these functions. It thinks that we are +// overrunning buffers, but we carefully write the functions in this file to +// guarantee that this is impossible. GCC gets this wrong due it its failure +// to perform constant propagation as we expect: +// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108217 +// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108226 +// +// Unfortunately this also indicates that GCC is not optimizing away the +// switch() in cases where it should be, compromising the performance. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#if __GNUC__ >= 11 +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE bool _upb_MiniTableField_InOneOf(const upb_MiniTableField* field) { + return field->presence < 0; +} + +UPB_INLINE void* _upb_MiniTableField_GetPtr(upb_Message* msg, + const upb_MiniTableField* field) { + return (char*)msg + field->offset; +} + +UPB_INLINE const void* _upb_MiniTableField_GetConstPtr( + const upb_Message* msg, const upb_MiniTableField* field) { + return (char*)msg + field->offset; +} + +UPB_INLINE void _upb_Message_SetPresence(upb_Message* msg, + const upb_MiniTableField* field) { + if (field->presence > 0) { + _upb_sethas_field(msg, field); + } else if (_upb_MiniTableField_InOneOf(field)) { + *_upb_oneofcase_field(msg, field) = field->number; + } +} + +UPB_INLINE bool _upb_MiniTable_ValueIsNonZero(const void* default_val, + const upb_MiniTableField* field) { + char zero[16] = {0}; + switch (_upb_MiniTableField_GetRep(field)) { + case kUpb_FieldRep_1Byte: + return memcmp(&zero, default_val, 1) != 0; + case kUpb_FieldRep_4Byte: + return memcmp(&zero, default_val, 4) != 0; + case kUpb_FieldRep_8Byte: + return memcmp(&zero, default_val, 8) != 0; + case kUpb_FieldRep_StringView: { + const upb_StringView* sv = (const upb_StringView*)default_val; + return sv->size != 0; + } + } + UPB_UNREACHABLE(); +} + +UPB_INLINE void _upb_MiniTable_CopyFieldData(void* to, const void* from, + const upb_MiniTableField* field) { + switch (_upb_MiniTableField_GetRep(field)) { + case kUpb_FieldRep_1Byte: + memcpy(to, from, 1); + return; + case kUpb_FieldRep_4Byte: + memcpy(to, from, 4); + return; + case kUpb_FieldRep_8Byte: + memcpy(to, from, 8); + return; + case kUpb_FieldRep_StringView: { + memcpy(to, from, sizeof(upb_StringView)); + return; + } + } + UPB_UNREACHABLE(); +} + +UPB_INLINE size_t +_upb_MiniTable_ElementSizeLg2(const upb_MiniTableField* field) { + const unsigned char table[] = { + 0, + 3, // kUpb_FieldType_Double = 1, + 2, // kUpb_FieldType_Float = 2, + 3, // kUpb_FieldType_Int64 = 3, + 3, // kUpb_FieldType_UInt64 = 4, + 2, // kUpb_FieldType_Int32 = 5, + 3, // kUpb_FieldType_Fixed64 = 6, + 2, // kUpb_FieldType_Fixed32 = 7, + 0, // kUpb_FieldType_Bool = 8, + UPB_SIZE(3, 4), // kUpb_FieldType_String = 9, + UPB_SIZE(2, 3), // kUpb_FieldType_Group = 10, + UPB_SIZE(2, 3), // kUpb_FieldType_Message = 11, + UPB_SIZE(3, 4), // kUpb_FieldType_Bytes = 12, + 2, // kUpb_FieldType_UInt32 = 13, + 2, // kUpb_FieldType_Enum = 14, + 2, // kUpb_FieldType_SFixed32 = 15, + 3, // kUpb_FieldType_SFixed64 = 16, + 2, // kUpb_FieldType_SInt32 = 17, + 3, // kUpb_FieldType_SInt64 = 18, + }; + return table[field->descriptortype]; +} + +// Here we define universal getter/setter functions for message fields. +// These look very branchy and inefficient, but as long as the MiniTableField +// values are known at compile time, all the branches are optimized away and +// we are left with ideal code. This can happen either through through +// literals or UPB_ASSUME(): +// +// // Via struct literals. +// bool FooMessage_set_bool_field(const upb_Message* msg, bool val) { +// const upb_MiniTableField field = {1, 0, 0, /* etc... */}; +// // All value in "field" are compile-time known. +// _upb_Message_SetNonExtensionField(msg, &field, &value); +// } +// +// // Via UPB_ASSUME(). +// UPB_INLINE bool upb_Message_SetBool(upb_Message* msg, +// const upb_MiniTableField* field, +// bool value, upb_Arena* a) { +// UPB_ASSUME(field->descriptortype == kUpb_FieldType_Bool); +// UPB_ASSUME(!upb_IsRepeatedOrMap(field)); +// UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte); +// _upb_Message_SetField(msg, field, &value, a); +// } +// +// As a result, we can use these universal getters/setters for *all* message +// accessors: generated code, MiniTable accessors, and reflection. The only +// exception is the binary encoder/decoder, which need to be a bit more clever +// about how they read/write the message data, for efficiency. +// +// These functions work on both extensions and non-extensions. If the field +// of a setter is known to be a non-extension, the arena may be NULL and the +// returned bool value may be ignored since it will always succeed. + +UPB_INLINE bool _upb_Message_HasExtensionField( + const upb_Message* msg, const upb_MiniTableExtension* ext) { + UPB_ASSERT(upb_MiniTableField_HasPresence(&ext->field)); + return _upb_Message_Getext(msg, ext) != NULL; +} + +UPB_INLINE bool _upb_Message_HasNonExtensionField( + const upb_Message* msg, const upb_MiniTableField* field) { + UPB_ASSERT(upb_MiniTableField_HasPresence(field)); + UPB_ASSUME(!upb_MiniTableField_IsExtension(field)); + if (_upb_MiniTableField_InOneOf(field)) { + return _upb_getoneofcase_field(msg, field) == field->number; + } else { + return _upb_hasbit_field(msg, field); + } +} + +static UPB_FORCEINLINE void _upb_Message_GetNonExtensionField( + const upb_Message* msg, const upb_MiniTableField* field, + const void* default_val, void* val) { + UPB_ASSUME(!upb_MiniTableField_IsExtension(field)); + if ((_upb_MiniTableField_InOneOf(field) || + _upb_MiniTable_ValueIsNonZero(default_val, field)) && + !_upb_Message_HasNonExtensionField(msg, field)) { + _upb_MiniTable_CopyFieldData(val, default_val, field); + return; + } + _upb_MiniTable_CopyFieldData(val, _upb_MiniTableField_GetConstPtr(msg, field), + field); +} + +UPB_INLINE void _upb_Message_GetExtensionField( + const upb_Message* msg, const upb_MiniTableExtension* mt_ext, + const void* default_val, void* val) { + UPB_ASSUME(upb_MiniTableField_IsExtension(&mt_ext->field)); + const upb_Message_Extension* ext = _upb_Message_Getext(msg, mt_ext); + if (ext) { + _upb_MiniTable_CopyFieldData(val, &ext->data, &mt_ext->field); + } else { + _upb_MiniTable_CopyFieldData(val, default_val, &mt_ext->field); + } +} + +UPB_INLINE void _upb_Message_GetField(const upb_Message* msg, + const upb_MiniTableField* field, + const void* default_val, void* val) { + if (upb_MiniTableField_IsExtension(field)) { + _upb_Message_GetExtensionField(msg, (upb_MiniTableExtension*)field, + default_val, val); + } else { + _upb_Message_GetNonExtensionField(msg, field, default_val, val); + } +} + +UPB_INLINE void _upb_Message_SetNonExtensionField( + upb_Message* msg, const upb_MiniTableField* field, const void* val) { + UPB_ASSUME(!upb_MiniTableField_IsExtension(field)); + _upb_Message_SetPresence(msg, field); + _upb_MiniTable_CopyFieldData(_upb_MiniTableField_GetPtr(msg, field), val, + field); +} + +UPB_INLINE bool _upb_Message_SetExtensionField( + upb_Message* msg, const upb_MiniTableExtension* mt_ext, const void* val, + upb_Arena* a) { + UPB_ASSERT(a); + upb_Message_Extension* ext = + _upb_Message_GetOrCreateExtension(msg, mt_ext, a); + if (!ext) return false; + _upb_MiniTable_CopyFieldData(&ext->data, val, &mt_ext->field); + return true; +} + +UPB_INLINE bool _upb_Message_SetField(upb_Message* msg, + const upb_MiniTableField* field, + const void* val, upb_Arena* a) { + if (upb_MiniTableField_IsExtension(field)) { + const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)field; + return _upb_Message_SetExtensionField(msg, ext, val, a); + } else { + _upb_Message_SetNonExtensionField(msg, field, val); + return true; + } +} + +UPB_INLINE void _upb_Message_ClearExtensionField( + upb_Message* msg, const upb_MiniTableExtension* ext_l) { + upb_Message_Internal* in = upb_Message_Getinternal(msg); + if (!in->internal) return; + const upb_Message_Extension* base = + UPB_PTR_AT(in->internal, in->internal->ext_begin, upb_Message_Extension); + upb_Message_Extension* ext = + (upb_Message_Extension*)_upb_Message_Getext(msg, ext_l); + if (ext) { + *ext = *base; + in->internal->ext_begin += sizeof(upb_Message_Extension); + } +} + +UPB_INLINE void _upb_Message_ClearNonExtensionField( + upb_Message* msg, const upb_MiniTableField* field) { + if (field->presence > 0) { + _upb_clearhas(msg, _upb_Message_Hasidx(field)); + } else if (_upb_MiniTableField_InOneOf(field)) { + uint32_t* oneof_case = _upb_oneofcase_field(msg, field); + if (*oneof_case != field->number) return; + *oneof_case = 0; + } + const char zeros[16] = {0}; + _upb_MiniTable_CopyFieldData(_upb_MiniTableField_GetPtr(msg, field), zeros, + field); +} + +UPB_INLINE upb_Map* _upb_Message_GetOrCreateMutableMap( + upb_Message* msg, const upb_MiniTableField* field, size_t key_size, + size_t val_size, upb_Arena* arena) { + _upb_MiniTableField_CheckIsMap(field); + upb_Map* map = NULL; + upb_Map* default_map_value = NULL; + _upb_Message_GetNonExtensionField(msg, field, &default_map_value, &map); + if (!map) { + map = _upb_Map_New(arena, key_size, val_size); + // Check again due to: https://godbolt.org/z/7WfaoKG1r + _upb_MiniTableField_CheckIsMap(field); + _upb_Message_SetNonExtensionField(msg, field, &map); + } + return map; +} + +// EVERYTHING ABOVE THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// + +UPB_API_INLINE void upb_Message_ClearField(upb_Message* msg, + const upb_MiniTableField* field) { + if (upb_MiniTableField_IsExtension(field)) { + const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)field; + _upb_Message_ClearExtensionField(msg, ext); + } else { + _upb_Message_ClearNonExtensionField(msg, field); + } +} + +UPB_API_INLINE bool upb_Message_HasField(const upb_Message* msg, + const upb_MiniTableField* field) { + if (upb_MiniTableField_IsExtension(field)) { + const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)field; + return _upb_Message_HasExtensionField(msg, ext); + } else { + return _upb_Message_HasNonExtensionField(msg, field); + } +} + +UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber( + const upb_Message* message, const upb_MiniTableField* oneof_field) { + UPB_ASSUME(_upb_MiniTableField_InOneOf(oneof_field)); + return _upb_getoneofcase_field(message, oneof_field); +} + +UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg, + const upb_MiniTableField* field, + bool default_val) { + UPB_ASSUME(field->descriptortype == kUpb_FieldType_Bool); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte); + bool ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg, + const upb_MiniTableField* field, + bool value, upb_Arena* a) { + UPB_ASSUME(field->descriptortype == kUpb_FieldType_Bool); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg, + const upb_MiniTableField* field, + int32_t default_val) { + UPB_ASSUME(field->descriptortype == kUpb_FieldType_Int32 || + field->descriptortype == kUpb_FieldType_SInt32 || + field->descriptortype == kUpb_FieldType_SFixed32 || + field->descriptortype == kUpb_FieldType_Enum); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + int32_t ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg, + const upb_MiniTableField* field, + int32_t value, upb_Arena* a) { + UPB_ASSUME(field->descriptortype == kUpb_FieldType_Int32 || + field->descriptortype == kUpb_FieldType_SInt32 || + field->descriptortype == kUpb_FieldType_SFixed32); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg, + const upb_MiniTableField* field, + uint32_t default_val) { + UPB_ASSUME(field->descriptortype == kUpb_FieldType_UInt32 || + field->descriptortype == kUpb_FieldType_Fixed32); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + uint32_t ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg, + const upb_MiniTableField* field, + uint32_t value, upb_Arena* a) { + UPB_ASSUME(field->descriptortype == kUpb_FieldType_UInt32 || + field->descriptortype == kUpb_FieldType_Fixed32); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE void upb_Message_SetEnumProto2( + upb_Message* msg, const upb_MiniTable* msg_mini_table, + const upb_MiniTableField* field, int32_t value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Enum); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + UPB_ASSERT(upb_MiniTableEnum_CheckValue( + upb_MiniTable_GetSubEnumTable(msg_mini_table, field), value)); + _upb_Message_SetNonExtensionField(msg, field, &value); +} + +UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg, + const upb_MiniTableField* field, + uint64_t default_val) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Int64 || + field->descriptortype == kUpb_FieldType_SInt64 || + field->descriptortype == kUpb_FieldType_SFixed64); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); + int64_t ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg, + const upb_MiniTableField* field, + int64_t value, upb_Arena* a) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Int64 || + field->descriptortype == kUpb_FieldType_SInt64 || + field->descriptortype == kUpb_FieldType_SFixed64); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg, + const upb_MiniTableField* field, + uint64_t default_val) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_UInt64 || + field->descriptortype == kUpb_FieldType_Fixed64); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); + uint64_t ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg, + const upb_MiniTableField* field, + uint64_t value, upb_Arena* a) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_UInt64 || + field->descriptortype == kUpb_FieldType_Fixed64); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg, + const upb_MiniTableField* field, + float default_val) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Float); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + float ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg, + const upb_MiniTableField* field, + float value, upb_Arena* a) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Float); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg, + const upb_MiniTableField* field, + double default_val) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Double); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); + double ret; + _upb_Message_GetField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg, + const upb_MiniTableField* field, + double value, upb_Arena* a) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Double); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE upb_StringView +upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field, + upb_StringView def_val) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Bytes || + field->descriptortype == kUpb_FieldType_String); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView); + upb_StringView ret; + _upb_Message_GetField(msg, field, &def_val, &ret); + return ret; +} + +UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg, + const upb_MiniTableField* field, + upb_StringView value, upb_Arena* a) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Bytes || + field->descriptortype == kUpb_FieldType_String); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView); + return _upb_Message_SetField(msg, field, &value, a); +} + +UPB_API_INLINE const upb_Message* upb_Message_GetMessage( + const upb_Message* msg, const upb_MiniTableField* field, + upb_Message* default_val) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == + UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte)); + upb_Message* ret; + _upb_Message_GetNonExtensionField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg, + const upb_MiniTable* mini_table, + const upb_MiniTableField* field, + upb_Message* sub_message) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); + UPB_ASSUME(!upb_IsRepeatedOrMap(field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == + UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte)); + UPB_ASSERT(mini_table->subs[field->submsg_index].submsg); + _upb_Message_SetNonExtensionField(msg, field, &sub_message); +} + +UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage( + upb_Message* msg, const upb_MiniTable* mini_table, + const upb_MiniTableField* 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) { + const upb_MiniTable* sub_mini_table = + mini_table->subs[field->submsg_index].submsg; + UPB_ASSERT(sub_mini_table); + sub_message = _upb_Message_New(sub_mini_table, arena); + *UPB_PTR_AT(msg, field->offset, upb_Message*) = sub_message; + _upb_Message_SetPresence(msg, field); + } + return sub_message; +} + +UPB_API_INLINE const upb_Array* upb_Message_GetArray( + const upb_Message* msg, const upb_MiniTableField* field) { + _upb_MiniTableField_CheckIsArray(field); + const upb_Array* ret; + const upb_Array* default_val = NULL; + _upb_Message_GetNonExtensionField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE upb_Array* upb_Message_GetMutableArray( + upb_Message* msg, const upb_MiniTableField* field) { + _upb_MiniTableField_CheckIsArray(field); + return (upb_Array*)upb_Message_GetArray(msg, field); +} + +UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray( + upb_Message* msg, const upb_MiniTableField* field, upb_Arena* arena) { + _upb_MiniTableField_CheckIsArray(field); + upb_Array* array = upb_Message_GetMutableArray(msg, field); + if (!array) { + array = _upb_Array_New(arena, 4, _upb_MiniTable_ElementSizeLg2(field)); + // Check again due to: https://godbolt.org/z/7WfaoKG1r + _upb_MiniTableField_CheckIsArray(field); + _upb_Message_SetField(msg, field, &array, arena); + } + return array; +} + +UPB_INLINE upb_Array* upb_Message_ResizeArrayUninitialized( + upb_Message* msg, const upb_MiniTableField* field, size_t size, + upb_Arena* arena) { + _upb_MiniTableField_CheckIsArray(field); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, size, arena)) return NULL; + return arr; +} + +// TODO: remove, migrate users to upb_Message_ResizeArrayUninitialized(), which +// has the same semantics but a clearer name. Alternatively, if users want an +// initialized variant, we can also offer that. +UPB_API_INLINE void* upb_Message_ResizeArray(upb_Message* msg, + const upb_MiniTableField* field, + size_t size, upb_Arena* arena) { + _upb_MiniTableField_CheckIsArray(field); + upb_Array* arr = + upb_Message_ResizeArrayUninitialized(msg, field, size, arena); + return _upb_array_ptr(arr); +} + +UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum( + const upb_MiniTableField* field) { + return field->descriptortype == kUpb_FieldType_Enum; +} + +UPB_API_INLINE const upb_Map* upb_Message_GetMap( + const upb_Message* msg, const upb_MiniTableField* field) { + _upb_MiniTableField_CheckIsMap(field); + const upb_Map* ret; + const upb_Map* default_val = NULL; + _upb_Message_GetNonExtensionField(msg, field, &default_val, &ret); + return ret; +} + +UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap( + upb_Message* msg, const upb_MiniTable* map_entry_mini_table, + const upb_MiniTableField* field, upb_Arena* arena) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); + const upb_MiniTableField* map_entry_key_field = + &map_entry_mini_table->fields[0]; + const upb_MiniTableField* map_entry_value_field = + &map_entry_mini_table->fields[1]; + return _upb_Message_GetOrCreateMutableMap( + msg, field, + _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)), + _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_value_field)), + arena); +} + +// Updates a map entry given an entry message. +upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map, + const upb_MiniTable* mini_table, + const upb_MiniTableField* field, + upb_Message* map_entry_message, + 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_MiniTableExtension* 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_MiniTableExtension* ext_table, + int encode_options, upb_Arena* arena, const char** extension_data, + size_t* len); + +typedef enum { + kUpb_FindUnknown_Ok, + kUpb_FindUnknown_NotPresent, + kUpb_FindUnknown_ParseError, +} upb_FindUnknown_Status; + +typedef struct { + upb_FindUnknown_Status status; + // Start of unknown field data in message arena. + const char* ptr; + // Size of unknown field data. + size_t len; +} upb_FindUnknownRet; + +// Finds first occurrence of unknown data by tag id in message. +upb_FindUnknownRet upb_MiniTable_FindUnknown(const upb_Message* msg, + uint32_t field_number); + +typedef enum { + kUpb_UnknownToMessage_Ok, + kUpb_UnknownToMessage_ParseError, + kUpb_UnknownToMessage_OutOfMemory, + kUpb_UnknownToMessage_NotFound, +} upb_UnknownToMessage_Status; + +typedef struct { + upb_UnknownToMessage_Status status; + upb_Message* message; +} upb_UnknownToMessageRet; + +// Promotes unknown data inside message to a upb_Message parsing the unknown. +// +// The unknown data is removed from message after field value is set +// using upb_Message_SetMessage. +// +// WARNING!: See b/267655898 +upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( + upb_Message* msg, const upb_MiniTable* mini_table, + const upb_MiniTableField* field, const upb_MiniTable* sub_mini_table, + int decode_options, upb_Arena* arena); + +// Promotes all unknown data that matches field tag id to repeated messages +// in upb_Array. +// +// The unknown data is removed from message after upb_Array is populated. +// Since repeated messages can't be packed we remove each unknown that +// contains the target tag id. +upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMessageArray( + upb_Message* msg, const upb_MiniTableField* field, + const upb_MiniTable* mini_table, int decode_options, upb_Arena* arena); + +// Promotes all unknown data that matches field tag id to upb_Map. +// +// The unknown data is removed from message after upb_Map is populated. +// Since repeated messages can't be packed we remove each unknown that +// contains the target tag id. +upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMap( + upb_Message* msg, const upb_MiniTable* mini_table, + const upb_MiniTableField* field, int decode_options, upb_Arena* arena); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#include "upb/port/undef.inc" + +#endif // UPB_MESSAGE_ACCESSORS_H_ diff --git a/third_party/upb/upb/message/accessors_test.cc b/third_party/upb/upb/message/accessors_test.cc new file mode 100644 index 00000000000..d299acdf7a7 --- /dev/null +++ b/third_party/upb/upb/message/accessors_test.cc @@ -0,0 +1,803 @@ +/* + * 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/message/accessors.h" + +#include "gtest/gtest.h" +#include "google/protobuf/test_messages_proto2.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/mini_table/common.h" +#include "upb/mini_table/decode.h" +#include "upb/mini_table/encode_internal.hpp" +#include "upb/mini_table/field_internal.h" +#include "upb/test/test.upb.h" +#include "upb/upb.h" +#include "upb/wire/decode.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_MiniTableField* find_proto3_field(int field_number) { + return upb_MiniTable_FindFieldByNumber( + &protobuf_test_messages_proto3_TestAllTypesProto3_msg_init, field_number); +} + +const upb_MiniTableField* find_proto2_field(int field_number) { + return upb_MiniTable_FindFieldByNumber( + &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init, 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_MiniTableField* optional_bool_field = + find_proto2_field(kFieldOptionalBool); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_bool_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_bool(msg, true); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_bool_field)); + upb_Message_ClearField(msg, optional_bool_field); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_bool_field)); + EXPECT_EQ( + false, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_bool(msg)); + + // String. + const upb_MiniTableField* optional_string_field = + find_proto2_field(kFieldOptionalString); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_string_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_string( + msg, upb_StringView_FromString(kTestStr1)); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_string_field)); + EXPECT_EQ( + strlen(kTestStr1), + protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg) + .size); + upb_Message_ClearField(msg, optional_string_field); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_string_field)); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg) + .size); + + // Message. + const upb_MiniTableField* optional_message_field = + find_proto2_field(kFieldOptionalNestedMessage); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_message_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_mutable_optional_nested_message( + msg, arena); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_message_field)); + upb_Message_ClearField(msg, optional_message_field); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_message_field)); + EXPECT_EQ( + true, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message( + msg) == nullptr); + + // One of. + const upb_MiniTableField* optional_oneof_uint32_field = + find_proto2_field(kFieldOptionalOneOfUInt32); + const upb_MiniTableField* optional_oneof_string_field = + find_proto2_field(kFieldOptionalOneOfString); + + EXPECT_EQ(false, upb_Message_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_oneof_string_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_oneof_uint32(msg, 123); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_oneof_string_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_oneof_string( + msg, upb_StringView_FromString(kTestStr1)); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_oneof_string_field)); + upb_Message_ClearField(msg, optional_oneof_uint32_field); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_oneof_string_field)); + upb_Message_ClearField(msg, optional_oneof_string_field); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(false, upb_Message_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_MiniTableField* optional_int32_field = + find_proto2_field(kFieldOptionalInt32); + + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg)); + + EXPECT_EQ(0, upb_Message_GetInt32(msg, optional_int32_field, 0)); + upb_Message_SetInt32(msg, optional_int32_field, kTestInt32, NULL); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_int32_field)); + EXPECT_EQ(kTestInt32, upb_Message_GetInt32(msg, optional_int32_field, 0)); + EXPECT_EQ( + kTestInt32, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg)); + + const upb_MiniTableField* optional_uint32_field = + find_proto2_field(kFieldOptionalUInt32); + + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg)); + EXPECT_EQ(0, upb_Message_GetUInt32(msg, optional_uint32_field, 0)); + upb_Message_SetUInt32(msg, optional_uint32_field, kTestUInt32, NULL); + EXPECT_EQ(kTestUInt32, upb_Message_GetUInt32(msg, optional_uint32_field, 0)); + 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_MiniTableField* optional_int64_field = + find_proto3_field(kFieldProto3OptionalInt64); + const upb_MiniTableField* optional_uint64_field = + find_proto3_field(kFieldProto3OptionalUInt64); + + EXPECT_EQ( + 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg)); + upb_Message_SetInt64(msg, optional_int64_field, -1, NULL); + EXPECT_EQ( + -1, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg)); + EXPECT_EQ(-1, upb_Message_GetInt64(msg, optional_int64_field, 0)); + + EXPECT_EQ( + 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg)); + upb_Message_SetUInt64(msg, optional_uint64_field, kTestUInt64, NULL); + EXPECT_EQ( + kTestUInt64, + protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg)); + EXPECT_EQ(kTestUInt64, upb_Message_GetUInt64(msg, optional_uint64_field, 0)); + + 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_MiniTableField* optional_string_field = + find_proto2_field(kFieldOptionalString); + + // Test default. + EXPECT_EQ(false, upb_Message_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_Message_HasField(msg, optional_string_field)); + upb_StringView value = upb_Message_GetString(msg, optional_string_field, + upb_StringView{NULL, 0}); + std::string read_value = std::string(value.data, value.size); + EXPECT_EQ(kTestStr1, read_value); + // Clear. + upb_Message_ClearField(msg, optional_string_field); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_string_field)); + EXPECT_EQ( + false, + protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string( + msg)); + upb_Message_SetString(msg, optional_string_field, + upb_StringView_FromString(kTestStr2), NULL); + EXPECT_EQ(true, upb_Message_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_MiniTableField* optional_message_field = + find_proto2_field(kFieldOptionalNestedMessage); + + const upb_Message* test_message = + upb_Message_GetMessage(msg, optional_message_field, NULL); + EXPECT_EQ(NULL, test_message); + + EXPECT_EQ(false, upb_Message_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_Message_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_Message_GetMessage(msg, optional_message_field, NULL); + EXPECT_EQ(true, sub_message != NULL); + + const upb_MiniTableField* nested_message_a_field = + upb_MiniTable_FindFieldByNumber( + &protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_msg_init, + kFieldOptionalNestedMessageA); + EXPECT_EQ(5, upb_Message_GetInt32(sub_message, nested_message_a_field, 0)); + + upb_Message_ClearField(msg, optional_message_field); + EXPECT_EQ( + NULL, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message( + msg)); + EXPECT_EQ(false, upb_Message_HasField(msg, optional_message_field)); + + upb_Message* new_nested_message = + protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_new(arena); + upb_Message_SetInt32(new_nested_message, nested_message_a_field, 123, NULL); + upb_Message_SetMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init, + optional_message_field, new_nested_message); + + upb_Message* mutable_message = upb_Message_GetOrCreateMutableMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init, + optional_message_field, arena); + EXPECT_EQ( + true, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message( + msg) != NULL); + EXPECT_EQ(true, upb_Message_HasField(msg, optional_message_field)); + EXPECT_EQ(123, + upb_Message_GetInt32(mutable_message, nested_message_a_field, 0)); + + 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_MiniTableField* 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_Message_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_Message_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_Message_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_MiniTableField* optional_message_field = + find_proto2_field(kFieldOptionalNestedMessage); + upb_Message* msg1 = upb_Message_GetOrCreateMutableMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init, + optional_message_field, arena); + upb_Message* msg2 = upb_Message_GetOrCreateMutableMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init, + optional_message_field, arena); + // Verify that newly constructed sub message is stored in msg. + EXPECT_EQ(msg1, msg2); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, FindUnknown) { + 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_ModelExtension1_set_model_ext(msg, extension1, arena); + + size_t serialized_size; + char* serialized = + upb_test_ModelWithExtensions_serialize(msg, arena, &serialized_size); + + upb_test_EmptyMessageWithExtensions* base_msg = + upb_test_EmptyMessageWithExtensions_parse(serialized, serialized_size, + arena); + + upb_FindUnknownRet result = upb_MiniTable_FindUnknown( + base_msg, upb_test_ModelExtension1_model_ext_ext.field.number); + EXPECT_EQ(kUpb_FindUnknown_Ok, result.status); + + result = upb_MiniTable_FindUnknown( + base_msg, upb_test_ModelExtension2_model_ext_ext.field.number); + EXPECT_EQ(kUpb_FindUnknown_NotPresent, result.status); + + 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_ModelExtension2* extension3 = upb_test_ModelExtension2_new(arena); + upb_test_ModelExtension2_set_i(extension3, 6); + + upb_test_ModelExtension2* extension4 = upb_test_ModelExtension2_new(arena); + upb_test_ModelExtension2_set_i(extension4, 7); + + upb_test_ModelExtension2* extension5 = upb_test_ModelExtension2_new(arena); + upb_test_ModelExtension2_set_i(extension5, 8); + + upb_test_ModelExtension2* extension6 = upb_test_ModelExtension2_new(arena); + upb_test_ModelExtension2_set_i(extension6, 9); + + // Set many extensions, to exercise code paths that involve reallocating the + // extensions and unknown fields array. + upb_test_ModelExtension1_set_model_ext(msg, extension1, arena); + upb_test_ModelExtension2_set_model_ext(msg, extension2, arena); + upb_test_ModelExtension2_set_model_ext_2(msg, extension3, arena); + upb_test_ModelExtension2_set_model_ext_3(msg, extension4, arena); + upb_test_ModelExtension2_set_model_ext_4(msg, extension5, arena); + upb_test_ModelExtension2_set_model_ext_5(msg, extension6, arena); + + size_t serialized_size; + char* serialized = + upb_test_ModelWithExtensions_serialize(msg, arena, &serialized_size); + + const upb_Message_Extension* upb_ext2; + upb_test_ModelExtension1* ext1; + upb_test_ModelExtension2* ext2; + upb_GetExtension_Status promote_status; + + // Test known GetExtension 1 + promote_status = upb_MiniTable_GetOrPromoteExtension( + msg, &upb_test_ModelExtension1_model_ext_ext, 0, arena, &upb_ext2); + ext1 = (upb_test_ModelExtension1*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_TRUE(upb_StringView_IsEqual(upb_StringView_FromString("World"), + upb_test_ModelExtension1_str(ext1))); + + // Test known GetExtension 2 + promote_status = upb_MiniTable_GetOrPromoteExtension( + 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)); + + // Test known GetExtension 3 + promote_status = upb_MiniTable_GetOrPromoteExtension( + msg, &upb_test_ModelExtension2_model_ext_2_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(6, upb_test_ModelExtension2_i(ext2)); + + // Test known GetExtension 4 + promote_status = upb_MiniTable_GetOrPromoteExtension( + msg, &upb_test_ModelExtension2_model_ext_3_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(7, upb_test_ModelExtension2_i(ext2)); + + // Test known GetExtension 5 + promote_status = upb_MiniTable_GetOrPromoteExtension( + msg, &upb_test_ModelExtension2_model_ext_4_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(8, upb_test_ModelExtension2_i(ext2)); + + // Test known GetExtension 6 + promote_status = upb_MiniTable_GetOrPromoteExtension( + msg, &upb_test_ModelExtension2_model_ext_5_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(9, 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 = 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_ModelExtension1_model_ext_ext, 0, arena, &upb_ext2); + ext1 = (upb_test_ModelExtension1*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_TRUE(upb_StringView_IsEqual(upb_StringView_FromString("World"), + upb_test_ModelExtension1_str(ext1))); + + // 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)); + + // Test unknown GetExtension. + promote_status = upb_MiniTable_GetOrPromoteExtension( + base_msg, &upb_test_ModelExtension2_model_ext_2_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(6, upb_test_ModelExtension2_i(ext2)); + + // Test unknown GetExtension. + promote_status = upb_MiniTable_GetOrPromoteExtension( + base_msg, &upb_test_ModelExtension2_model_ext_3_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(7, upb_test_ModelExtension2_i(ext2)); + + // Test unknown GetExtension. + promote_status = upb_MiniTable_GetOrPromoteExtension( + base_msg, &upb_test_ModelExtension2_model_ext_4_ext, 0, arena, &upb_ext2); + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(8, upb_test_ModelExtension2_i(ext2)); + + upb_Arena_Free(arena); +} + +// Create a minitable to mimic ModelWithSubMessages with unlinked subs +// to lazily promote unknowns after parsing. +upb_MiniTable* CreateMiniTableWithEmptySubTables(upb_Arena* arena) { + upb::MtDataEncoder e; + e.StartMessage(0); + e.PutField(kUpb_FieldType_Int32, 4, 0); + e.PutField(kUpb_FieldType_Message, 5, 0); + e.PutField(kUpb_FieldType_Message, 6, kUpb_FieldModifier_IsRepeated); + + upb_Status status; + upb_Status_Clear(&status); + upb_MiniTable* table = + upb_MiniTable_Build(e.data().data(), e.data().size(), arena, &status); + EXPECT_EQ(status.ok, true); + // Initialize sub table to null. Not using upb_MiniTable_SetSubMessage + // since it checks ->ext on parameter. + upb_MiniTableSub* sub = const_cast( + &table->subs[table->fields[1].submsg_index]); + sub->submsg = nullptr; + sub = const_cast( + &table->subs[table->fields[2].submsg_index]); + sub->submsg = nullptr; + return table; +} + +// Create a minitable to mimic ModelWithMaps with unlinked subs +// to lazily promote unknowns after parsing. +upb_MiniTable* CreateMiniTableWithEmptySubTablesForMaps(upb_Arena* arena) { + upb::MtDataEncoder e; + e.StartMessage(0); + e.PutField(kUpb_FieldType_Int32, 1, 0); + e.PutField(kUpb_FieldType_Message, 3, kUpb_FieldModifier_IsRepeated); + e.PutField(kUpb_FieldType_Message, 4, kUpb_FieldModifier_IsRepeated); + + upb_Status status; + upb_Status_Clear(&status); + upb_MiniTable* table = + upb_MiniTable_Build(e.data().data(), e.data().size(), arena, &status); + EXPECT_EQ(status.ok, true); + // Initialize sub table to null. Not using upb_MiniTable_SetSubMessage + // since it checks ->ext on parameter. + upb_MiniTableSub* sub = const_cast( + &table->subs[table->fields[1].submsg_index]); + sub->submsg = nullptr; + sub = const_cast( + &table->subs[table->fields[2].submsg_index]); + sub->submsg = nullptr; + return table; +} + +upb_MiniTable* CreateMapEntryMiniTable(upb_Arena* arena) { + upb::MtDataEncoder e; + e.EncodeMap(kUpb_FieldType_String, kUpb_FieldType_String, 0, 0); + upb_Status status; + upb_Status_Clear(&status); + upb_MiniTable* table = + upb_MiniTable_Build(e.data().data(), e.data().size(), arena, &status); + EXPECT_EQ(status.ok, true); + return table; +} + +TEST(GeneratedCode, PromoteUnknownMessage) { + upb_Arena* arena = upb_Arena_New(); + upb_test_ModelWithSubMessages* input_msg = + upb_test_ModelWithSubMessages_new(arena); + upb_test_ModelWithExtensions* sub_message = + upb_test_ModelWithExtensions_new(arena); + upb_test_ModelWithSubMessages_set_id(input_msg, 11); + upb_test_ModelWithExtensions_set_random_int32(sub_message, 12); + upb_test_ModelWithSubMessages_set_optional_child(input_msg, sub_message); + size_t serialized_size; + char* serialized = upb_test_ModelWithSubMessages_serialize(input_msg, arena, + &serialized_size); + + upb_MiniTable* mini_table = CreateMiniTableWithEmptySubTables(arena); + upb_Message* msg = _upb_Message_New(mini_table, arena); + upb_DecodeStatus decode_status = upb_Decode(serialized, serialized_size, msg, + mini_table, nullptr, 0, arena); + EXPECT_EQ(decode_status, kUpb_DecodeStatus_Ok); + int32_t val = upb_Message_GetInt32( + msg, upb_MiniTable_FindFieldByNumber(mini_table, 4), 0); + EXPECT_EQ(val, 11); + upb_FindUnknownRet unknown = upb_MiniTable_FindUnknown(msg, 5); + EXPECT_EQ(unknown.status, kUpb_FindUnknown_Ok); + // Update mini table and promote unknown to a message. + EXPECT_TRUE(upb_MiniTable_SetSubMessage( + mini_table, (upb_MiniTableField*)&mini_table->fields[1], + &upb_test_ModelWithExtensions_msg_init)); + const int decode_options = + UPB_DECODE_MAXDEPTH(100); // UPB_DECODE_ALIAS disabled. + upb_UnknownToMessageRet promote_result = + upb_MiniTable_PromoteUnknownToMessage( + msg, mini_table, &mini_table->fields[1], + &upb_test_ModelWithExtensions_msg_init, decode_options, arena); + EXPECT_EQ(promote_result.status, kUpb_UnknownToMessage_Ok); + const upb_Message* promoted_message = + upb_Message_GetMessage(msg, &mini_table->fields[1], NULL); + EXPECT_EQ(upb_test_ModelWithExtensions_random_int32( + (upb_test_ModelWithExtensions*)promoted_message), + 12); + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, PromoteUnknownRepeatedMessage) { + upb_Arena* arena = upb_Arena_New(); + upb_test_ModelWithSubMessages* input_msg = + upb_test_ModelWithSubMessages_new(arena); + upb_test_ModelWithSubMessages_set_id(input_msg, 123); + + // Add 2 repeated messages to input_msg. + upb_test_ModelWithExtensions* item = + upb_test_ModelWithSubMessages_add_items(input_msg, arena); + upb_test_ModelWithExtensions_set_random_int32(item, 5); + item = upb_test_ModelWithSubMessages_add_items(input_msg, arena); + upb_test_ModelWithExtensions_set_random_int32(item, 6); + + size_t serialized_size; + char* serialized = upb_test_ModelWithSubMessages_serialize(input_msg, arena, + &serialized_size); + + upb_MiniTable* mini_table = CreateMiniTableWithEmptySubTables(arena); + upb_Message* msg = _upb_Message_New(mini_table, arena); + upb_DecodeStatus decode_status = upb_Decode(serialized, serialized_size, msg, + mini_table, nullptr, 0, arena); + EXPECT_EQ(decode_status, kUpb_DecodeStatus_Ok); + int32_t val = upb_Message_GetInt32( + msg, upb_MiniTable_FindFieldByNumber(mini_table, 4), 0); + EXPECT_EQ(val, 123); + + // Check that we have repeated field data in an unknown. + upb_FindUnknownRet unknown = upb_MiniTable_FindUnknown(msg, 6); + EXPECT_EQ(unknown.status, kUpb_FindUnknown_Ok); + + // Update mini table and promote unknown to a message. + EXPECT_TRUE(upb_MiniTable_SetSubMessage( + mini_table, (upb_MiniTableField*)&mini_table->fields[2], + &upb_test_ModelWithExtensions_msg_init)); + const int decode_options = + UPB_DECODE_MAXDEPTH(100); // UPB_DECODE_ALIAS disabled. + upb_UnknownToMessage_Status promote_result = + upb_MiniTable_PromoteUnknownToMessageArray( + msg, &mini_table->fields[2], &upb_test_ModelWithExtensions_msg_init, + decode_options, arena); + EXPECT_EQ(promote_result, kUpb_UnknownToMessage_Ok); + + upb_Array* array = upb_Message_GetMutableArray(msg, &mini_table->fields[2]); + const upb_Message* promoted_message = upb_Array_Get(array, 0).msg_val; + EXPECT_EQ(upb_test_ModelWithExtensions_random_int32( + (upb_test_ModelWithExtensions*)promoted_message), + 5); + promoted_message = upb_Array_Get(array, 1).msg_val; + EXPECT_EQ(upb_test_ModelWithExtensions_random_int32( + (upb_test_ModelWithExtensions*)promoted_message), + 6); + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, PromoteUnknownToMap) { + upb_Arena* arena = upb_Arena_New(); + upb_test_ModelWithMaps* input_msg = upb_test_ModelWithMaps_new(arena); + upb_test_ModelWithMaps_set_id(input_msg, 123); + + // Add 2 map entries. + upb_test_ModelWithMaps_map_ss_set(input_msg, + upb_StringView_FromString("key1"), + upb_StringView_FromString("value1"), arena); + upb_test_ModelWithMaps_map_ss_set(input_msg, + upb_StringView_FromString("key2"), + upb_StringView_FromString("value2"), arena); + + size_t serialized_size; + char* serialized = + upb_test_ModelWithMaps_serialize(input_msg, arena, &serialized_size); + + upb_MiniTable* mini_table = CreateMiniTableWithEmptySubTablesForMaps(arena); + upb_MiniTable* map_entry_mini_table = CreateMapEntryMiniTable(arena); + upb_Message* msg = _upb_Message_New(mini_table, arena); + upb_DecodeStatus decode_status = upb_Decode(serialized, serialized_size, msg, + mini_table, nullptr, 0, arena); + EXPECT_EQ(decode_status, kUpb_DecodeStatus_Ok); + int32_t val = upb_Message_GetInt32( + msg, upb_MiniTable_FindFieldByNumber(mini_table, 1), 0); + EXPECT_EQ(val, 123); + + // Check that we have map data in an unknown. + upb_FindUnknownRet unknown = upb_MiniTable_FindUnknown(msg, 3); + EXPECT_EQ(unknown.status, kUpb_FindUnknown_Ok); + + // Update mini table and promote unknown to a message. + EXPECT_TRUE(upb_MiniTable_SetSubMessage( + mini_table, (upb_MiniTableField*)&mini_table->fields[1], + map_entry_mini_table)); + const int decode_options = + UPB_DECODE_MAXDEPTH(100); // UPB_DECODE_ALIAS disabled. + upb_UnknownToMessage_Status promote_result = + upb_MiniTable_PromoteUnknownToMap(msg, mini_table, &mini_table->fields[1], + decode_options, arena); + EXPECT_EQ(promote_result, kUpb_UnknownToMessage_Ok); + + upb_Map* map = upb_Message_GetOrCreateMutableMap( + msg, map_entry_mini_table, &mini_table->fields[1], arena); + EXPECT_NE(map, nullptr); + // Lookup in map. + upb_MessageValue key; + key.str_val = upb_StringView_FromString("key2"); + upb_MessageValue value; + EXPECT_TRUE(upb_Map_Get(map, key, &value)); + EXPECT_EQ(0, strncmp(value.str_val.data, "value2", 5)); + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, EnumClosedCheck) { + upb_Arena* arena = upb_Arena_New(); + + upb::MtDataEncoder e; + e.StartMessage(0); + e.PutField(kUpb_FieldType_Int32, 4, 0); + e.PutField(kUpb_FieldType_Enum, 5, 0); + + upb_Status status; + upb_Status_Clear(&status); + upb_MiniTable* table = + upb_MiniTable_Build(e.data().data(), e.data().size(), arena, &status); + + const upb_MiniTableField* enumField = &table->fields[1]; + EXPECT_EQ(upb_MiniTableField_Type(enumField), kUpb_FieldType_Enum); + EXPECT_FALSE(upb_MiniTableField_IsClosedEnum(enumField)); + + upb::MtDataEncoder e2; + e2.StartMessage(0); + e2.PutField(kUpb_FieldType_Int32, 4, 0); + e2.PutField(kUpb_FieldType_Enum, 6, kUpb_FieldModifier_IsClosedEnum); + + upb_Status_Clear(&status); + table = + upb_MiniTable_Build(e2.data().data(), e2.data().size(), arena, &status); + + const upb_MiniTableField* closedEnumField = &table->fields[1]; + EXPECT_EQ(upb_MiniTableField_Type(closedEnumField), kUpb_FieldType_Enum); + EXPECT_TRUE(upb_MiniTableField_IsClosedEnum(closedEnumField)); + upb_Arena_Free(arena); +} + +} // namespace diff --git a/third_party/upb/upb/message/extension_internal.h b/third_party/upb/upb/message/extension_internal.h new file mode 100644 index 00000000000..ac54d87c113 --- /dev/null +++ b/third_party/upb/upb/message/extension_internal.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_MESSAGE_EXTENSION_INTERNAL_H_ +#define UPB_MESSAGE_EXTENSION_INTERNAL_H_ + +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/message/message.h" +#include "upb/mini_table/extension_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +// The internal representation of an extension is self-describing: it contains +// enough information that we can serialize it to binary format without needing +// to look it up in a upb_ExtensionRegistry. +// +// This representation allocates 16 bytes to data on 64-bit platforms. +// This is rather wasteful for scalars (in the extreme case of bool, +// it wastes 15 bytes). We accept this because we expect messages to be +// the most common extension type. +typedef struct { + const upb_MiniTableExtension* ext; + union { + upb_StringView str; + void* ptr; + char scalar_data[8]; + } data; +} upb_Message_Extension; + +#ifdef __cplusplus +extern "C" { +#endif + +// 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_GetOrCreateExtension( + upb_Message* msg, const upb_MiniTableExtension* ext, upb_Arena* arena); + +// Returns an array of extensions for this message. +// Note: the array is ordered in reverse relative to the order of creation. +const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg, + size_t* count); + +// Returns an extension for the given field number, or NULL if no extension +// exists for this field number. +const upb_Message_Extension* _upb_Message_Getext( + const upb_Message* msg, const upb_MiniTableExtension* ext); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MESSAGE_EXTENSION_INTERNAL_H_ */ diff --git a/third_party/upb/upb/message/internal.h b/third_party/upb/upb/message/internal.h new file mode 100644 index 00000000000..8dbe673a6c1 --- /dev/null +++ b/third_party/upb/upb/message/internal.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +** Our memory representation for parsing tables and messages themselves. +** Functions in this file are used by generated code and possibly reflection. +** +** The definitions in this file are internal to upb. +**/ + +#ifndef UPB_MESSAGE_INTERNAL_H_ +#define UPB_MESSAGE_INTERNAL_H_ + +#include +#include + +#include "upb/hash/common.h" +#include "upb/message/extension_internal.h" +#include "upb/message/message.h" +#include "upb/mini_table/extension_internal.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/file_internal.h" +#include "upb/mini_table/message_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +extern const float kUpb_FltInfinity; +extern const double kUpb_Infinity; +extern const double kUpb_NaN; + +/* Internal members of a upb_Message that track unknown fields and/or + * extensions. We can change this without breaking binary compatibility. We put + * these before the user's data. The user's upb_Message* points after the + * upb_Message_Internal. */ + +typedef struct { + /* Total size of this structure, including the data that follows. + * Must be aligned to 8, which is alignof(upb_Message_Extension) */ + uint32_t size; + + /* Offsets relative to the beginning of this structure. + * + * Unknown data grows forward from the beginning to unknown_end. + * Extension data grows backward from size to ext_begin. + * When the two meet, we're out of data and have to realloc. + * + * If we imagine that the final member of this struct is: + * char data[size - overhead]; // overhead = + * sizeof(upb_Message_InternalData) + * + * Then we have: + * unknown data: data[0 .. (unknown_end - overhead)] + * extensions data: data[(ext_begin - overhead) .. (size - overhead)] */ + uint32_t unknown_end; + uint32_t ext_begin; + /* Data follows, as if there were an array: + * char data[size - sizeof(upb_Message_InternalData)]; */ +} upb_Message_InternalData; + +typedef struct { + upb_Message_InternalData* internal; + /* Message data follows. */ +} upb_Message_Internal; + +/* Maps upb_CType -> memory size. */ +extern char _upb_CTypeo_size[12]; + +UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable* t) { + return t->size + sizeof(upb_Message_Internal); +} + +// Inline version upb_Message_New(), for internal use. +UPB_INLINE upb_Message* _upb_Message_New(const upb_MiniTable* mini_table, + upb_Arena* arena) { + size_t size = upb_msg_sizeof(mini_table); + void* mem = upb_Arena_Malloc(arena, size + sizeof(upb_Message_Internal)); + if (UPB_UNLIKELY(!mem)) return NULL; + upb_Message* msg = UPB_PTR_AT(mem, sizeof(upb_Message_Internal), upb_Message); + memset(mem, 0, size); + return msg; +} + +UPB_INLINE upb_Message_Internal* upb_Message_Getinternal( + const upb_Message* msg) { + ptrdiff_t size = sizeof(upb_Message_Internal); + return (upb_Message_Internal*)((char*)msg - size); +} + +// Clears the given message. +void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l); + +// Discards the unknown fields for this message only. +void _upb_Message_DiscardUnknown_shallow(upb_Message* msg); + +// Adds unknown data (serialized protobuf data) to the given message. +// The data is copied into the message instance. +bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, + upb_Arena* arena); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MESSAGE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/message/message.c b/third_party/upb/upb/message/message.c new file mode 100644 index 00000000000..50d7bd6b058 --- /dev/null +++ b/third_party/upb/upb/message/message.c @@ -0,0 +1,180 @@ +/* + * 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/message/message.h" + +#include + +#include "upb/base/log2.h" +#include "upb/message/internal.h" + +// Must be last. +#include "upb/port/def.inc" + +const float kUpb_FltInfinity = INFINITY; +const double kUpb_Infinity = INFINITY; +const double kUpb_NaN = NAN; + +static const size_t overhead = sizeof(upb_Message_InternalData); + +upb_Message* upb_Message_New(const upb_MiniTable* mini_table, + upb_Arena* arena) { + return _upb_Message_New(mini_table, arena); +} + +void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l) { + // Note: Can't use UPB_PTR_AT() here because we are doing pointer subtraction. + char* mem = (char*)msg - sizeof(upb_Message_Internal); + memset(mem, 0, upb_msg_sizeof(l)); +} + +static bool realloc_internal(upb_Message* msg, size_t need, upb_Arena* arena) { + upb_Message_Internal* in = upb_Message_Getinternal(msg); + if (!in->internal) { + /* No internal data, allocate from scratch. */ + size_t size = UPB_MAX(128, upb_Log2CeilingSize(need + overhead)); + upb_Message_InternalData* internal = upb_Arena_Malloc(arena, size); + if (!internal) return false; + internal->size = size; + internal->unknown_end = overhead; + internal->ext_begin = size; + in->internal = internal; + } else if (in->internal->ext_begin - in->internal->unknown_end < need) { + /* Internal data is too small, reallocate. */ + size_t new_size = upb_Log2CeilingSize(in->internal->size + need); + size_t ext_bytes = in->internal->size - in->internal->ext_begin; + size_t new_ext_begin = new_size - ext_bytes; + upb_Message_InternalData* internal = + upb_Arena_Realloc(arena, in->internal, in->internal->size, new_size); + if (!internal) return false; + if (ext_bytes) { + /* Need to move extension data to the end. */ + char* ptr = (char*)internal; + memmove(ptr + new_ext_begin, ptr + internal->ext_begin, ext_bytes); + } + internal->ext_begin = new_ext_begin; + internal->size = new_size; + in->internal = internal; + } + UPB_ASSERT(in->internal->ext_begin - in->internal->unknown_end >= need); + return true; +} + +bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, + upb_Arena* arena) { + if (!realloc_internal(msg, len, arena)) return false; + upb_Message_Internal* in = upb_Message_Getinternal(msg); + memcpy(UPB_PTR_AT(in->internal, in->internal->unknown_end, char), data, len); + in->internal->unknown_end += len; + return true; +} + +void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) { + upb_Message_Internal* in = upb_Message_Getinternal(msg); + if (in->internal) { + in->internal->unknown_end = overhead; + } +} + +const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) { + const upb_Message_Internal* in = upb_Message_Getinternal(msg); + if (in->internal) { + *len = in->internal->unknown_end - overhead; + return (char*)(in->internal + 1); + } else { + *len = 0; + return NULL; + } +} + +void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len) { + upb_Message_Internal* in = upb_Message_Getinternal(msg); + const char* internal_unknown_end = + UPB_PTR_AT(in->internal, in->internal->unknown_end, char); +#ifndef NDEBUG + size_t full_unknown_size; + const char* full_unknown = upb_Message_GetUnknown(msg, &full_unknown_size); + UPB_ASSERT((uintptr_t)data >= (uintptr_t)full_unknown); + UPB_ASSERT((uintptr_t)data < (uintptr_t)(full_unknown + full_unknown_size)); + UPB_ASSERT((uintptr_t)(data + len) > (uintptr_t)data); + UPB_ASSERT((uintptr_t)(data + len) <= (uintptr_t)internal_unknown_end); +#endif + if ((data + len) != internal_unknown_end) { + memmove((char*)data, data + len, internal_unknown_end - data - len); + } + in->internal->unknown_end -= len; +} + +const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg, + size_t* count) { + const upb_Message_Internal* in = upb_Message_Getinternal(msg); + if (in->internal) { + *count = (in->internal->size - in->internal->ext_begin) / + sizeof(upb_Message_Extension); + return UPB_PTR_AT(in->internal, in->internal->ext_begin, void); + } else { + *count = 0; + return NULL; + } +} + +const upb_Message_Extension* _upb_Message_Getext( + const upb_Message* msg, const upb_MiniTableExtension* e) { + size_t n; + const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &n); + + /* For now we use linear search exclusively to find extensions. If this + * becomes an issue due to messages with lots of extensions, we can introduce + * a table of some sort. */ + for (size_t i = 0; i < n; i++) { + if (ext[i].ext == e) { + return &ext[i]; + } + } + + return NULL; +} + +upb_Message_Extension* _upb_Message_GetOrCreateExtension( + upb_Message* msg, const upb_MiniTableExtension* e, upb_Arena* arena) { + upb_Message_Extension* ext = + (upb_Message_Extension*)_upb_Message_Getext(msg, e); + if (ext) return ext; + if (!realloc_internal(msg, sizeof(upb_Message_Extension), arena)) return NULL; + upb_Message_Internal* in = upb_Message_Getinternal(msg); + in->internal->ext_begin -= sizeof(upb_Message_Extension); + ext = UPB_PTR_AT(in->internal, in->internal->ext_begin, void); + memset(ext, 0, sizeof(upb_Message_Extension)); + ext->ext = e; + return ext; +} + +size_t upb_Message_ExtensionCount(const upb_Message* msg) { + size_t count; + _upb_Message_Getexts(msg, &count); + return count; +} diff --git a/third_party/upb/upb/message/message.h b/third_party/upb/upb/message/message.h new file mode 100644 index 00000000000..1cf7249c2d9 --- /dev/null +++ b/third_party/upb/upb/message/message.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// Public APIs for message operations that do not require descriptors. +// These functions can be used even in build that does not want to depend on +// reflection or descriptors. +// +// Descriptor-based reflection functionality lives in reflection.h. + +#ifndef UPB_MESSAGE_MESSAGE_H_ +#define UPB_MESSAGE_MESSAGE_H_ + +#include "upb/mem/arena.h" +#include "upb/mini_table/types.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Creates a new message with the given mini_table on the given arena. +UPB_API upb_Message* upb_Message_New(const upb_MiniTable* mini_table, + upb_Arena* arena); + +// Adds unknown data (serialized protobuf data) to the given message. +// The data is copied into the message instance. +void upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, + upb_Arena* arena); + +// Returns a reference to the message's unknown data. +const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len); + +// Removes partial unknown data from message. +void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len); + +// Returns the number of extensions present in this message. +size_t upb_Message_ExtensionCount(const upb_Message* msg); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MESSAGE_MESSAGE_H_ */ diff --git a/third_party/upb/upb/msg_test.cc b/third_party/upb/upb/message/test.cc similarity index 69% rename from third_party/upb/upb/msg_test.cc rename to third_party/upb/upb/message/test.cc index d46e29fd96b..f0e392d42a6 100644 --- a/third_party/upb/upb/msg_test.cc +++ b/third_party/upb/upb/message/test.cc @@ -25,16 +25,24 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/def.hpp" -#include "upb/json_decode.h" -#include "upb/json_encode.h" -#include "upb/msg_test.upb.h" -#include "upb/msg_test.upbdefs.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/message/test.upb.h" +#include "upb/message/test.upbdefs.h" +#include "upb/reflection/def.hpp" +#include "upb/test/fuzz_util.h" #include "upb/upb.hpp" +// begin:google_only +// #include "testing/fuzzing/fuzztest.h" +// end:google_only + void VerifyMessage(const upb_test_TestExtensions* ext_msg) { EXPECT_TRUE(upb_test_TestExtensions_has_optional_int32_ext(ext_msg)); // EXPECT_FALSE(upb_test_TestExtensions_Nested_has_optional_int32_ext(ext_msg)); @@ -88,8 +96,8 @@ TEST(MessageTest, Extensions) { VerifyMessage(ext_msg2); // Test round-trip through JSON format. - size_t json_size = - upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, NULL, 0, status.ptr()); + size_t json_size = upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, nullptr, + 0, status.ptr()); char* json_buf = static_cast(upb_Arena_Malloc(arena.ptr(), json_size + 1)); upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, json_buf, json_size + 1, @@ -148,8 +156,8 @@ TEST(MessageTest, MessageSet) { VerifyMessageSet(ext_msg2); // Test round-trip through JSON format. - size_t json_size = - upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, NULL, 0, status.ptr()); + size_t json_size = upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, nullptr, + 0, status.ptr()); char* json_buf = static_cast(upb_Arena_Malloc(arena.ptr(), json_size + 1)); upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, json_buf, json_size + 1, @@ -266,6 +274,7 @@ TEST(MessageTest, Proto2Enum) { pb = upb_test_Proto2EnumMessage_serialize(enum_msg, arena.ptr(), &size); upb_test_Proto2FakeEnumMessage* fake_msg2 = upb_test_Proto2FakeEnumMessage_parse(pb, size, arena.ptr()); + ASSERT_TRUE(fake_msg2 != nullptr); EXPECT_EQ(true, upb_test_Proto2FakeEnumMessage_has_optional_enum(fake_msg2)); EXPECT_EQ(999, upb_test_Proto2FakeEnumMessage_optional_enum(fake_msg2)); @@ -303,13 +312,14 @@ TEST(MessageTest, DecodeRequiredFieldsTopLevelMessage) { upb_test_EmptyMessage* empty_msg; // Succeeds, because we did not request required field checks. - test_msg = upb_test_TestRequiredFields_parse(NULL, 0, arena.ptr()); + test_msg = upb_test_TestRequiredFields_parse(nullptr, 0, arena.ptr()); EXPECT_NE(nullptr, test_msg); // Fails, because required fields are missing. - EXPECT_EQ(kUpb_DecodeStatus_MissingRequired, - upb_Decode(NULL, 0, test_msg, &upb_test_TestRequiredFields_msginit, - NULL, kUpb_DecodeOption_CheckRequired, arena.ptr())); + EXPECT_EQ( + kUpb_DecodeStatus_MissingRequired, + upb_Decode(nullptr, 0, test_msg, &upb_test_TestRequiredFields_msg_init, + nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr())); upb_test_TestRequiredFields_set_required_int32(test_msg, 1); size_t size; @@ -322,7 +332,7 @@ TEST(MessageTest, DecodeRequiredFieldsTopLevelMessage) { // payload is not empty. EXPECT_EQ(kUpb_DecodeStatus_MissingRequired, upb_Decode(serialized, size, test_msg, - &upb_test_TestRequiredFields_msginit, NULL, + &upb_test_TestRequiredFields_msg_init, nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr())); empty_msg = upb_test_EmptyMessage_new(arena.ptr()); @@ -331,9 +341,10 @@ TEST(MessageTest, DecodeRequiredFieldsTopLevelMessage) { upb_test_TestRequiredFields_set_required_message(test_msg, empty_msg); // Succeeds, because required fields are present (though not in the input). - EXPECT_EQ(kUpb_DecodeStatus_Ok, - upb_Decode(NULL, 0, test_msg, &upb_test_TestRequiredFields_msginit, - NULL, kUpb_DecodeOption_CheckRequired, arena.ptr())); + EXPECT_EQ( + kUpb_DecodeStatus_Ok, + upb_Decode(nullptr, 0, test_msg, &upb_test_TestRequiredFields_msg_init, + nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr())); // Serialize a complete payload. serialized = @@ -342,7 +353,7 @@ TEST(MessageTest, DecodeRequiredFieldsTopLevelMessage) { EXPECT_NE(0, size); upb_test_TestRequiredFields* test_msg2 = upb_test_TestRequiredFields_parse_ex( - serialized, size, NULL, kUpb_DecodeOption_CheckRequired, arena.ptr()); + serialized, size, nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr()); EXPECT_NE(nullptr, test_msg2); // When we add an incomplete sub-message, this is not flagged by the parser. @@ -351,7 +362,7 @@ TEST(MessageTest, DecodeRequiredFieldsTopLevelMessage) { test_msg2, upb_test_TestRequiredFields_new(arena.ptr())); EXPECT_EQ(kUpb_DecodeStatus_Ok, upb_Decode(serialized, size, test_msg2, - &upb_test_TestRequiredFields_msginit, NULL, + &upb_test_TestRequiredFields_msg_init, nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr())); } @@ -375,7 +386,7 @@ TEST(MessageTest, DecodeRequiredFieldsSubMessage) { // Parse error when verifying required fields, due to incomplete sub-message. EXPECT_EQ(nullptr, upb_test_SubMessageHasRequired_parse_ex( - serialized, size, NULL, + serialized, size, nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr())); upb_test_TestRequiredFields_set_required_int32(test_msg, 1); @@ -388,7 +399,7 @@ TEST(MessageTest, DecodeRequiredFieldsSubMessage) { // No parse error; sub-message now is complete. EXPECT_NE(nullptr, upb_test_SubMessageHasRequired_parse_ex( - serialized, size, NULL, + serialized, size, nullptr, kUpb_DecodeOption_CheckRequired, arena.ptr())); } @@ -444,7 +455,7 @@ TEST(MessageTest, MaxRequiredFields) { for (int i = 1; i <= 61; i++) { upb::FieldDefPtr f = m.FindFieldByNumber(i); ASSERT_TRUE(f); - upb_Message_Set(test_msg, f.ptr(), val, arena.ptr()); + upb_Message_SetFieldByDef(test_msg, f.ptr(), val, arena.ptr()); } // Fails, field 63 still isn't set. @@ -455,7 +466,7 @@ TEST(MessageTest, MaxRequiredFields) { // Succeeds, all required fields are set. upb::FieldDefPtr f = m.FindFieldByNumber(62); ASSERT_TRUE(f); - upb_Message_Set(test_msg, f.ptr(), val, arena.ptr()); + upb_Message_SetFieldByDef(test_msg, f.ptr(), val, arena.ptr()); serialized = upb_test_TestMaxRequiredFields_serialize_ex( test_msg, kUpb_EncodeOption_CheckRequired, arena.ptr(), &size); ASSERT_TRUE(serialized != nullptr); @@ -489,3 +500,163 @@ TEST(MessageTest, MapField) { ASSERT_TRUE( upb_test_TestMapFieldExtra_map_field_get(test_msg_extra2, 0, nullptr)); } + +// begin:google_only +// +// static void DecodeEncodeArbitrarySchemaAndPayload( +// const upb::fuzz::MiniTableFuzzInput& input, std::string_view proto_payload, +// int decode_options, int encode_options) { +// upb::Arena arena; +// upb_ExtensionRegistry* exts; +// const upb_MiniTable* mini_table = +// upb::fuzz::BuildMiniTable(input, &exts, arena.ptr()); +// if (!mini_table) return; +// upb::Status status; +// upb_Message* msg = upb_Message_New(mini_table, arena.ptr()); +// upb_Decode(proto_payload.data(), proto_payload.size(), msg, mini_table, exts, +// decode_options, arena.ptr()); +// char* ptr; +// size_t size; +// upb_Encode(msg, mini_table, encode_options, arena.ptr(), &ptr, &size); +// } +// FUZZ_TEST(FuzzTest, DecodeEncodeArbitrarySchemaAndPayload); +// +// TEST(FuzzTest, DecodeUnknownProto2EnumExtension) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\256\354Rt\216\3271\234", "\243\243\267\207\336gV\366w"}, +// {"z"}, +// "}\212\304d\371\363\341\2329\325B\264\377?\215\223\201\201\226y\201%" +// "\321\363\255;", +// {}}, +// "\010", -724543908, -591643538); +// } +// +// TEST(FuzzTest, DecodeExtensionEnsurePresenceInitialized) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\031", "S", "\364", "", "", "j", "\303", "", "\224", "\277"}, +// {}, +// "_C-\236$*)C0C>", +// {4041515984, 2147483647, 1929379871, 0, 3715937258, 4294967295}}, +// "\010\002", 342248070, -806315555); +// } +// +// TEST(FuzzTest, DecodeExtendMessageSetWithNonMessage) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\n"}, {""}, ".\244", {}}, "\013\032\005\212a#\365\336\020\001\226", +// 14803219, 670718349); +// } +// +// TEST(FuzzTest, DecodeExtendMessageSetWithNonMessage2) { +// DecodeEncodeArbitrarySchemaAndPayload({{"\n", "G", "\n", "\274", ""}, +// {"", "\030"}, +// "_@", +// {4294967295, 2147483647}}, +// std::string("\013\032\000\220", 4), +// 279975758, 1647495141); +// } +// +// TEST(FuzzTest, DecodeExtendMessageSetWithNonMessage3) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\n"}, {"B", ""}, "\212:b", {11141121}}, +// "\013\032\004\357;7\363\020\001\346\240\200\201\271", 399842149, +// -452966025); +// } +// +// TEST(FuzzTest, DecodeExtendMessageSetWithNonMessage4) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\n", "3\340", "\354"}, {}, "B}G", {4294967295, 4082331310}}, +// "\013\032\004\244B\331\255\020\001\220\224\243\350\t", -561523015, +// 1683327312); +// } +// +// TEST(FuzzTest, DecodeExtendMessageSetWithNonMessage5) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\n"}, {""}, "kB", {0}}, +// "x\203\251\006\013\032\002S\376\010\273\'\020\014\365\207\244\234", +// -696925610, -654590577); +// } +// +// TEST(FuzzTest, ExtendMessageSetWithEmptyExtension) { +// DecodeEncodeArbitrarySchemaAndPayload({{"\n"}, {}, "_", {}}, std::string(), 0, +// 0); +// } +// +// TEST(FuzzTest, DecodeEncodeArbitrarySchemaAndPayloadRegression) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"\320", "\320", "\320", "\320", "\320", "%2%%%%%"}, +// {"", "", "", "", "", "", "", "", "", "", "", "", +// "", "", "", "", "", "", "", "", "", "", ""}, +// "\226\226\226\226\226\226\350\351\350\350\350\350\350\350\350\314", +// {4026531839}}, +// std::string("\n\n\n\n\272\n======@@%%%%%%%%%%%%%%%@@@((" +// "qqqqqqqq5555555555qqqqqffq((((((((((((\335@@>" +// "\ru\360ncppppxxxxxxxxx\025\025\025xxxxxppppppp<=" +// "\2165\275\275\315\217\361\010\t\000\016\013in\n\n\n\256\263", +// 130), +// 901979906, 65537); +// } +// +// // This test encodes a map field with extra cruft. +// TEST(FuzzTest, DecodeEncodeArbitrarySchemaAndPayloadRegressionInvalidMap) { +// DecodeEncodeArbitrarySchemaAndPayload({{"%%%%///////"}, {}, "", {}}, +// std::string("\035|", 2), 65536, 3); +// } +// +// // This test found a case where presence was unset for a mini table field. +// TEST(FuzzTest, DecodeEncodeArbitrarySchemaAndPayloadRegressionMsan) { +// DecodeEncodeArbitrarySchemaAndPayload({{"%-#^#"}, {}, "", {}}, std::string(), +// -1960166338, 16809991); +// } +// +// // This test encodes a map containing a msg wrapping another, empty msg. +// TEST(FuzzTest, DecodeEncodeArbitrarySchemaAndPayloadRegressionMapMap) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"%#G"}, {}, "", {}}, std::string("\022\002\022\000", 4), 0, 0); +// } +// +// TEST(FuzzTest, GroupMap) { +// // Groups should not be allowed as maps, but we previously failed to prevent +// // this. +// DecodeEncodeArbitrarySchemaAndPayload( +// {.mini_descriptors = {"$$FF$", "%-C"}, +// .enum_mini_descriptors = {}, +// .extensions = "", +// .links = {1}}, +// std::string( +// "\023\020\030\233\000\204\330\372#\000`" +// "a\000\000\001\000\000\000ccccccc\030s\273sssssssss\030\030\030\030" +// "\030\030\030\030\215\215\215\215\215\215\215\215\030\030\232\253\253" +// "\232*\334\227\273\231\207\373\t\0051\305\265\335\224\226"), +// 0, 0); +// } +// +// TEST(FuzzTest, MapUnknownFieldSpanBuffers) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"$ 3", "%# "}, {}, "", {1}}, +// std::string( +// "\"\002\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000", +// 17), +// 0, 0); +// } +// +// // Another test for mismatched submsg types. +// TEST(FuzzTest, DecodeEncodeArbitrarySchemaAndPayloadRegression22) { +// DecodeEncodeArbitrarySchemaAndPayload( +// {{"$2222222222222222222222", "%,&"}, {}, "", {1}}, +// std::string("\035\170\170\170\051\263\001\030\000\035\357\357\340\021\035" +// "\025\331\035\035\035\035\035\035\035\035", +// 25), +// 0, 0); +// } +// +// TEST(FuzzTest, ExtensionWithoutExt) { +// DecodeEncodeArbitrarySchemaAndPayload({{"$ 3", "", "%#F"}, {}, "", {2, 1}}, +// std::string("\022\002\010\000", 4), 0, +// 0); +// } +// +// TEST(FuzzTest, MapFieldVerify) { +// DecodeEncodeArbitrarySchemaAndPayload({{"% ^!"}, {}, "", {}}, "", 0, 0); +// } +// +// end:google_only diff --git a/third_party/upb/upb/msg_test.proto b/third_party/upb/upb/message/test.proto similarity index 98% rename from third_party/upb/upb/msg_test.proto rename to third_party/upb/upb/message/test.proto index 237f1323811..3b45d13109e 100644 --- a/third_party/upb/upb/msg_test.proto +++ b/third_party/upb/upb/message/test.proto @@ -193,3 +193,8 @@ message TestMapFieldExtra { } map map_field = 1; } + +message TestNameConflict { + map map_field = 1; + optional bool clear_map_field = 2; +} diff --git a/third_party/upb/upb/mini_descriptor.c b/third_party/upb/upb/mini_descriptor.c deleted file mode 100644 index 21383704d25..00000000000 --- a/third_party/upb/upb/mini_descriptor.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - * 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_table.h b/third_party/upb/upb/mini_table.h index 6c41f810ebe..ca8a324f607 100644 --- a/third_party/upb/upb/mini_table.h +++ b/third_party/upb/upb/mini_table.h @@ -25,165 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use the header(s) below instead. +// IWYU pragma: private, include "upb/mini_table/decode.h" + #ifndef UPB_MINI_TABLE_H_ #define UPB_MINI_TABLE_H_ -#include "upb/msg_internal.h" - -// Must be last. -#include "upb/port_def.inc" - -#ifdef __cplusplus -extern "C" { -#endif - -const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber( - const upb_MiniTable* table, uint32_t number); - -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, - kUpb_MessageModifier_IsExtendable = 1 << 2, -} kUpb_MessageModifier; - -typedef enum { - kUpb_FieldModifier_IsRepeated = 1 << 0, - kUpb_FieldModifier_IsPacked = 1 << 1, - kUpb_FieldModifier_IsClosedEnum = 1 << 2, - kUpb_FieldModifier_IsProto3Singular = 1 << 3, - kUpb_FieldModifier_IsRequired = 1 << 4, -} kUpb_FieldModifier; - -typedef struct { - char* end; // Limit of the buffer passed as a parameter. - // Aliased to internal-only members in .cc. - char internal[32]; -} upb_MtDataEncoder; - -// If the input buffer has at least this many bytes available, the encoder call -// is guaranteed to succeed (as long as field number order is maintained). -#define kUpb_MtDataEncoder_MinSize 16 - -// Encodes field/oneof information for a given message. The sequence of calls -// should look like: -// -// upb_MtDataEncoder e; -// char buf[256]; -// char* ptr = buf; -// e.end = ptr + sizeof(buf); -// ptr = upb_MtDataEncoder_StartMessage(&e, ptr); -// // Fields *must* be in field number order. -// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...); -// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...); -// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...); -// -// // If oneofs are present. Oneofs must be encoded after regular fields. -// ptr = upb_MiniTable_StartOneof(&e, ptr) -// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); -// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); -// -// ptr = upb_MiniTable_StartOneof(&e, ptr); -// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); -// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); -// -// Oneofs must be encoded after all regular fields. -char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr, - uint64_t msg_mod); -char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, - upb_FieldType type, uint32_t field_num, - uint64_t field_mod); -char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr); -char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr, - uint32_t field_num); - -// Encodes the set of values for a given enum. The values must be given in -// order (after casting to uint32_t), and repeats are not allowed. -void upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e); -char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr, - uint32_t val); -char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr); - -/** upb_MiniTable *************************************************************/ - -typedef enum { - kUpb_MiniTablePlatform_32Bit, - kUpb_MiniTablePlatform_64Bit, - kUpb_MiniTablePlatform_Native = - UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit), -} upb_MiniTablePlatform; - -// Builds a mini table from the data encoded in the buffer [data, len]. If any -// errors occur, returns NULL and sets a status message. In the success case, -// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum -// fields to link the table to the appropriate sub-tables. -upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len, - upb_MiniTablePlatform platform, - upb_Arena* arena, upb_Status* status); -void upb_MiniTable_SetSubMessage(upb_MiniTable* table, - upb_MiniTable_Field* field, - const upb_MiniTable* sub); -void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field, - const upb_MiniTable_Enum* sub); - -bool upb_MiniTable_BuildExtension(const char* data, size_t len, - upb_MiniTable_Extension* ext, - upb_MiniTable_Sub sub, upb_Status* status); - -// Special-case functions for MessageSet layout and map entries. -upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform, - upb_Arena* arena); -upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type, - upb_FieldType value_type, - bool value_is_proto3_enum, - upb_MiniTablePlatform platform, - upb_Arena* arena); - -upb_MiniTable_Enum* upb_MiniTable_BuildEnum(const char* data, size_t len, - upb_Arena* arena, - upb_Status* status); - -// Like upb_MiniTable_Build(), but the user provides a buffer of layout data so -// it can be reused from call to call, avoiding repeated realloc()/free(). -// -// The caller owns `*buf` both before and after the call, and must free() it -// when it is no longer in use. The function will realloc() `*buf` as -// necessary, updating `*size` accordingly. -upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, - upb_MiniTablePlatform platform, - upb_Arena* arena, void** buf, - size_t* buf_size, upb_Status* status); - -// For testing only. -char upb_ToBase92(int8_t ch); -char upb_FromBase92(uint8_t ch); -bool upb_IsTypePackable(upb_FieldType type); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#include "upb/port_undef.inc" +#include "upb/mini_table/decode.h" #endif /* UPB_MINI_TABLE_H_ */ diff --git a/third_party/upb/upb/mini_table/common.c b/third_party/upb/upb/mini_table/common.c new file mode 100644 index 00000000000..2c4c9119639 --- /dev/null +++ b/third_party/upb/upb/mini_table/common.c @@ -0,0 +1,128 @@ +/* + * 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/common.h" + +#include + +#include "upb/mem/arena.h" +#include "upb/mini_table/common_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +const char _kUpb_ToBase92[] = { + ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', + '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', + 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', + 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '{', '|', '}', '~', +}; + +const int8_t _kUpb_FromBase92[] = { + 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, +}; + +const upb_MiniTableField* upb_MiniTable_FindFieldByNumber( + const upb_MiniTable* t, uint32_t number) { + const size_t i = ((size_t)number) - 1; // 0 wraps to SIZE_MAX + + // Ideal case: index into dense fields + if (i < t->dense_below) { + UPB_ASSERT(t->fields[i].number == number); + return &t->fields[i]; + } + + // Slow case: binary search + int lo = t->dense_below; + int hi = t->field_count - 1; + while (lo <= hi) { + int mid = (lo + hi) / 2; + int num = t->fields[mid].number; + if (num < number) { + lo = mid + 1; + continue; + } + if (num > number) { + hi = mid - 1; + continue; + } + return &t->fields[mid]; + } + return NULL; +} + +upb_FieldType upb_MiniTableField_Type(const upb_MiniTableField* field) { + if (field->mode & kUpb_LabelFlags_IsAlternate) { + if (field->descriptortype == kUpb_FieldType_Int32) { + return kUpb_FieldType_Enum; + } else if (field->descriptortype == kUpb_FieldType_Bytes) { + return kUpb_FieldType_String; + } else { + UPB_ASSERT(false); + } + } + return field->descriptortype; +} + +static bool upb_MiniTable_Is_Oneof(const upb_MiniTableField* f) { + return f->presence < 0; +} + +const upb_MiniTableField* upb_MiniTable_GetOneof(const upb_MiniTable* m, + const upb_MiniTableField* f) { + if (UPB_UNLIKELY(!upb_MiniTable_Is_Oneof(f))) { + return NULL; + } + const upb_MiniTableField* ptr = &m->fields[0]; + const upb_MiniTableField* end = &m->fields[m->field_count]; + while (++ptr < end) { + if (ptr->presence == (*f).presence) { + return ptr; + } + } + return NULL; +} + +bool upb_MiniTable_NextOneofField(const upb_MiniTable* m, + const upb_MiniTableField** f) { + const upb_MiniTableField* ptr = *f; + const upb_MiniTableField* end = &m->fields[m->field_count]; + while (++ptr < end) { + if (ptr->presence == (*f)->presence) { + *f = ptr; + return true; + } + } + return false; +} diff --git a/third_party/upb/upb/mini_table/common.h b/third_party/upb/upb/mini_table/common.h new file mode 100644 index 00000000000..82590a6ad59 --- /dev/null +++ b/third_party/upb/upb/mini_table/common.h @@ -0,0 +1,146 @@ +/* + * 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_COMMON_H_ +#define UPB_MINI_TABLE_COMMON_H_ + +#include "upb/mini_table/field_internal.h" +#include "upb/mini_table/message_internal.h" +#include "upb/mini_table/sub_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef enum { + kUpb_FieldModifier_IsRepeated = 1 << 0, + kUpb_FieldModifier_IsPacked = 1 << 1, + kUpb_FieldModifier_IsClosedEnum = 1 << 2, + kUpb_FieldModifier_IsProto3Singular = 1 << 3, + kUpb_FieldModifier_IsRequired = 1 << 4, +} kUpb_FieldModifier; + +typedef enum { + kUpb_MessageModifier_ValidateUtf8 = 1 << 0, + kUpb_MessageModifier_DefaultIsPacked = 1 << 1, + kUpb_MessageModifier_IsExtendable = 1 << 2, +} kUpb_MessageModifier; + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_API const upb_MiniTableField* upb_MiniTable_FindFieldByNumber( + const upb_MiniTable* table, uint32_t number); + +UPB_API upb_FieldType upb_MiniTableField_Type(const upb_MiniTableField* field); + +UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f) { + switch (f->descriptortype) { + case kUpb_FieldType_Double: + return kUpb_CType_Double; + case kUpb_FieldType_Float: + return kUpb_CType_Float; + case kUpb_FieldType_Int64: + case kUpb_FieldType_SInt64: + case kUpb_FieldType_SFixed64: + return kUpb_CType_Int64; + case kUpb_FieldType_Int32: + case kUpb_FieldType_SFixed32: + case kUpb_FieldType_SInt32: + return kUpb_CType_Int32; + case kUpb_FieldType_UInt64: + case kUpb_FieldType_Fixed64: + return kUpb_CType_UInt64; + case kUpb_FieldType_UInt32: + case kUpb_FieldType_Fixed32: + return kUpb_CType_UInt32; + case kUpb_FieldType_Enum: + return kUpb_CType_Enum; + case kUpb_FieldType_Bool: + return kUpb_CType_Bool; + case kUpb_FieldType_String: + return kUpb_CType_String; + case kUpb_FieldType_Bytes: + return kUpb_CType_Bytes; + case kUpb_FieldType_Group: + case kUpb_FieldType_Message: + return kUpb_CType_Message; + } + UPB_UNREACHABLE(); +} + +UPB_API_INLINE bool upb_MiniTableField_IsExtension( + const upb_MiniTableField* field) { + return field->mode & kUpb_LabelFlags_IsExtension; +} + +UPB_API_INLINE bool upb_MiniTableField_HasPresence( + const upb_MiniTableField* field) { + if (upb_MiniTableField_IsExtension(field)) { + return !upb_IsRepeatedOrMap(field); + } else { + return field->presence != 0; + } +} + +UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable( + const upb_MiniTable* mini_table, const upb_MiniTableField* field) { + return mini_table->subs[field->submsg_index].submsg; +} + +UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable( + const upb_MiniTable* mini_table, const upb_MiniTableField* field) { + return mini_table->subs[field->submsg_index].subenum; +} + +// If this field is in a oneof, returns the first field in the oneof. +// +// Otherwise returns NULL. +// +// Usage: +// const upb_MiniTableField* field = upb_MiniTable_GetOneof(m, f); +// do { +// .. +// } while (upb_MiniTable_NextOneofField(m, &field); +// +const upb_MiniTableField* upb_MiniTable_GetOneof(const upb_MiniTable* m, + const upb_MiniTableField* f); + +// Returns the next field in the oneof. If this is the last field in the +// oneof, returns NULL. The ordering of fields in the oneof is not +// guaranteed. +// REQUIRES: |iter| is and iterator. +bool upb_MiniTable_NextOneofField(const upb_MiniTable* m, + const upb_MiniTableField** f); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_COMMON_H_ */ diff --git a/third_party/upb/upb/mini_table/common_internal.h b/third_party/upb/upb/mini_table/common_internal.h new file mode 100644 index 00000000000..d7a5134adc9 --- /dev/null +++ b/third_party/upb/upb/mini_table/common_internal.h @@ -0,0 +1,122 @@ +/* + * 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_COMMON_INTERNAL_H_ +#define UPB_MINI_TABLE_COMMON_INTERNAL_H_ + +#include "upb/base/descriptor_constants.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef enum { + kUpb_EncodedType_Double = 0, + kUpb_EncodedType_Float = 1, + kUpb_EncodedType_Fixed32 = 2, + kUpb_EncodedType_Fixed64 = 3, + kUpb_EncodedType_SFixed32 = 4, + kUpb_EncodedType_SFixed64 = 5, + kUpb_EncodedType_Int32 = 6, + kUpb_EncodedType_UInt32 = 7, + kUpb_EncodedType_SInt32 = 8, + kUpb_EncodedType_Int64 = 9, + kUpb_EncodedType_UInt64 = 10, + kUpb_EncodedType_SInt64 = 11, + kUpb_EncodedType_OpenEnum = 12, + kUpb_EncodedType_Bool = 13, + kUpb_EncodedType_Bytes = 14, + kUpb_EncodedType_String = 15, + kUpb_EncodedType_Group = 16, + kUpb_EncodedType_Message = 17, + kUpb_EncodedType_ClosedEnum = 18, + + kUpb_EncodedType_RepeatedBase = 20, +} upb_EncodedType; + +typedef enum { + kUpb_EncodedFieldModifier_FlipPacked = 1 << 0, + kUpb_EncodedFieldModifier_IsRequired = 1 << 1, + kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2, +} upb_EncodedFieldModifier; + +enum { + kUpb_EncodedValue_MinField = ' ', + kUpb_EncodedValue_MaxField = 'I', + kUpb_EncodedValue_MinModifier = 'L', + kUpb_EncodedValue_MaxModifier = '[', + kUpb_EncodedValue_End = '^', + kUpb_EncodedValue_MinSkip = '_', + kUpb_EncodedValue_MaxSkip = '~', + kUpb_EncodedValue_OneofSeparator = '~', + kUpb_EncodedValue_FieldSeparator = '|', + kUpb_EncodedValue_MinOneofField = ' ', + kUpb_EncodedValue_MaxOneofField = 'b', + kUpb_EncodedValue_MaxEnumMask = 'A', +}; + +enum { + kUpb_EncodedVersion_EnumV1 = '!', + kUpb_EncodedVersion_ExtensionV1 = '#', + kUpb_EncodedVersion_MapV1 = '%', + kUpb_EncodedVersion_MessageV1 = '$', + kUpb_EncodedVersion_MessageSetV1 = '&', +}; + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE char _upb_ToBase92(int8_t ch) { + extern const char _kUpb_ToBase92[]; + UPB_ASSERT(0 <= ch && ch < 92); + return _kUpb_ToBase92[ch]; +} + +UPB_INLINE char _upb_FromBase92(uint8_t ch) { + extern const int8_t _kUpb_FromBase92[]; + if (' ' > ch || ch > '~') return -1; + return _kUpb_FromBase92[ch - ' ']; +} + +UPB_INLINE bool _upb_FieldType_IsPackable(upb_FieldType type) { + // clang-format off + const unsigned kUnpackableTypes = + (1 << kUpb_FieldType_String) | + (1 << kUpb_FieldType_Bytes) | + (1 << kUpb_FieldType_Message) | + (1 << kUpb_FieldType_Group); + // clang-format on + return (1 << type) & ~kUnpackableTypes; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_COMMON_INTERNAL_H_ */ diff --git a/third_party/upb/upb/mini_table.c b/third_party/upb/upb/mini_table/decode.c similarity index 52% rename from third_party/upb/upb/mini_table.c rename to third_party/upb/upb/mini_table/decode.c index cd53059738f..4c4c5bec2d2 100644 --- a/third_party/upb/upb/mini_table.c +++ b/third_party/upb/upb/mini_table/decode.c @@ -25,333 +25,21 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/mini_table.h" +#include "upb/mini_table/decode.h" #include -#include +#include -#include "upb/msg_internal.h" -#include "upb/upb.h" +#include "upb/base/log2.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/common.h" +#include "upb/mini_table/common_internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/mini_table/extension_internal.h" // Must be last. -#include "upb/port_def.inc" - -typedef enum { - kUpb_EncodedType_Double = 0, - kUpb_EncodedType_Float = 1, - kUpb_EncodedType_Fixed32 = 2, - kUpb_EncodedType_Fixed64 = 3, - kUpb_EncodedType_SFixed32 = 4, - kUpb_EncodedType_SFixed64 = 5, - kUpb_EncodedType_Int32 = 6, - kUpb_EncodedType_UInt32 = 7, - kUpb_EncodedType_SInt32 = 8, - kUpb_EncodedType_Int64 = 9, - kUpb_EncodedType_UInt64 = 10, - kUpb_EncodedType_SInt64 = 11, - kUpb_EncodedType_Enum = 12, - kUpb_EncodedType_Bool = 13, - kUpb_EncodedType_Bytes = 14, - kUpb_EncodedType_String = 15, - kUpb_EncodedType_Group = 16, - kUpb_EncodedType_Message = 17, - - kUpb_EncodedType_RepeatedBase = 20, -} upb_EncodedType; - -typedef enum { - kUpb_EncodedFieldModifier_FlipPacked = 1 << 0, - kUpb_EncodedFieldModifier_IsClosedEnum = 1 << 1, - // upb only. - kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2, - kUpb_EncodedFieldModifier_IsRequired = 1 << 3, -} upb_EncodedFieldModifier; - -enum { - kUpb_EncodedValue_MinField = ' ', - kUpb_EncodedValue_MaxField = 'K', - kUpb_EncodedValue_MinModifier = 'L', - kUpb_EncodedValue_MaxModifier = '[', - kUpb_EncodedValue_End = '^', - kUpb_EncodedValue_MinSkip = '_', - kUpb_EncodedValue_MaxSkip = '~', - kUpb_EncodedValue_OneofSeparator = '~', - kUpb_EncodedValue_FieldSeparator = '|', - kUpb_EncodedValue_MinOneofField = ' ', - kUpb_EncodedValue_MaxOneofField = 'b', - kUpb_EncodedValue_MaxEnumMask = 'A', -}; - -char upb_ToBase92(int8_t ch) { - static const char kUpb_ToBase92[] = { - ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', - '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', - 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', '{', '|', '}', '~', - }; - - UPB_ASSERT(0 <= ch && ch < 92); - return kUpb_ToBase92[ch]; -} - -char upb_FromBase92(uint8_t ch) { - static const int8_t kUpb_FromBase92[] = { - 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - }; - - if (' ' > ch || ch > '~') return -1; - return kUpb_FromBase92[ch - ' ']; -} - -bool upb_IsTypePackable(upb_FieldType type) { - // clang-format off - static const unsigned kUnpackableTypes = - (1 << kUpb_FieldType_String) | - (1 << kUpb_FieldType_Bytes) | - (1 << kUpb_FieldType_Message) | - (1 << kUpb_FieldType_Group); - // clang-format on - return (1 << type) & ~kUnpackableTypes; -} - -/** upb_MtDataEncoder *********************************************************/ - -typedef struct { - 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; -} - -static char* upb_MtDataEncoder_Put(upb_MtDataEncoder* e, char* ptr, char ch) { - upb_MtDataEncoderInternal* in = (upb_MtDataEncoderInternal*)e->internal; - UPB_ASSERT(ptr - in->buf_start < kUpb_MtDataEncoder_MinSize); - if (ptr == e->end) return NULL; - *ptr++ = upb_ToBase92(ch); - return ptr; -} - -static char* upb_MtDataEncoder_PutBase92Varint(upb_MtDataEncoder* e, char* ptr, - uint32_t val, int min, int max) { - int shift = _upb_Log2Ceiling(upb_FromBase92(max) - upb_FromBase92(min) + 1); - UPB_ASSERT(shift <= 6); - uint32_t mask = (1 << shift) - 1; - do { - uint32_t bits = val & mask; - ptr = upb_MtDataEncoder_Put(e, ptr, bits + upb_FromBase92(min)); - if (!ptr) return NULL; - val >>= shift; - } while (val); - return ptr; -} - -char* upb_MtDataEncoder_PutModifier(upb_MtDataEncoder* e, char* ptr, - uint64_t mod) { - if (mod) { - ptr = upb_MtDataEncoder_PutBase92Varint(e, ptr, mod, - kUpb_EncodedValue_MinModifier, - kUpb_EncodedValue_MaxModifier); - } - return ptr; -} - -char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr, - uint64_t msg_mod) { - upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); - in->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); -} - -char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, - upb_FieldType type, uint32_t field_num, - uint64_t field_mod) { - static const char kUpb_TypeToEncoded[] = { - [kUpb_FieldType_Double] = kUpb_EncodedType_Double, - [kUpb_FieldType_Float] = kUpb_EncodedType_Float, - [kUpb_FieldType_Int64] = kUpb_EncodedType_Int64, - [kUpb_FieldType_UInt64] = kUpb_EncodedType_UInt64, - [kUpb_FieldType_Int32] = kUpb_EncodedType_Int32, - [kUpb_FieldType_Fixed64] = kUpb_EncodedType_Fixed64, - [kUpb_FieldType_Fixed32] = kUpb_EncodedType_Fixed32, - [kUpb_FieldType_Bool] = kUpb_EncodedType_Bool, - [kUpb_FieldType_String] = kUpb_EncodedType_String, - [kUpb_FieldType_Group] = kUpb_EncodedType_Group, - [kUpb_FieldType_Message] = kUpb_EncodedType_Message, - [kUpb_FieldType_Bytes] = kUpb_EncodedType_Bytes, - [kUpb_FieldType_UInt32] = kUpb_EncodedType_UInt32, - [kUpb_FieldType_Enum] = kUpb_EncodedType_Enum, - [kUpb_FieldType_SFixed32] = kUpb_EncodedType_SFixed32, - [kUpb_FieldType_SFixed64] = kUpb_EncodedType_SFixed64, - [kUpb_FieldType_SInt32] = kUpb_EncodedType_SInt32, - [kUpb_FieldType_SInt64] = kUpb_EncodedType_SInt64, - }; - - upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); - if (field_num <= in->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->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->state.msg_state.last_field_num = field_num; - - uint32_t encoded_modifiers = 0; - - // Put field type. - if (type == kUpb_FieldType_Enum && - !(field_mod & kUpb_FieldModifier_IsClosedEnum)) { - type = kUpb_FieldType_Int32; - } - - int encoded_type = kUpb_TypeToEncoded[type]; - if (field_mod & kUpb_FieldModifier_IsRepeated) { - // Repeated fields shift the type number up (unlike other modifiers which - // are bit flags). - encoded_type += kUpb_EncodedType_RepeatedBase; - - if (upb_IsTypePackable(type)) { - bool field_is_packed = field_mod & kUpb_FieldModifier_IsPacked; - bool default_is_packed = in->state.msg_state.msg_modifiers & - kUpb_MessageModifier_DefaultIsPacked; - if (field_is_packed != default_is_packed) { - encoded_modifiers |= kUpb_EncodedFieldModifier_FlipPacked; - } - } - } - ptr = upb_MtDataEncoder_Put(e, ptr, encoded_type); - if (!ptr) return NULL; - - if (field_mod & kUpb_FieldModifier_IsProto3Singular) { - encoded_modifiers |= kUpb_EncodedFieldModifier_IsProto3Singular; - } - if (field_mod & kUpb_FieldModifier_IsRequired) { - encoded_modifiers |= kUpb_EncodedFieldModifier_IsRequired; - } - return upb_MtDataEncoder_PutModifier(e, ptr, encoded_modifiers); -} - -char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr) { - upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); - if (in->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->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->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->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; - for (int i = 0; i < n; i++) { - if (table->fields[i].number == number) { - return &table->fields[i]; - } - } - return NULL; -} - -/** Data decoder **************************************************************/ +#include "upb/port/def.inc" // Note: we sort by this number when calculating layout order. typedef enum { @@ -382,22 +70,31 @@ typedef struct { typedef struct { const char* end; upb_MiniTable* table; - upb_MiniTable_Field* fields; + upb_MiniTableField* fields; upb_MiniTablePlatform platform; upb_LayoutItemVector vec; upb_Arena* arena; upb_Status* status; + + // When building enums. + upb_MiniTableEnum* enum_table; + uint32_t enum_value_count; + uint32_t enum_data_count; + uint32_t enum_data_capacity; + jmp_buf err; } upb_MtDecoder; UPB_PRINTF(2, 3) UPB_NORETURN static void upb_MtDecoder_ErrorFormat(upb_MtDecoder* d, const char* fmt, ...) { - va_list argp; - upb_Status_SetErrorMessage(d->status, "Error building mini table: "); - va_start(argp, fmt); - upb_Status_VAppendErrorFormat(d->status, fmt, argp); - va_end(argp); + if (d->status) { + va_list argp; + upb_Status_SetErrorMessage(d->status, "Error building mini table: "); + va_start(argp, fmt); + upb_Status_VAppendErrorFormat(d->status, fmt, argp); + va_end(argp); + } UPB_LONGJMP(d->err, 1); } @@ -424,11 +121,10 @@ static const char* upb_MiniTable_DecodeBase92Varint(upb_MtDecoder* d, uint32_t val = 0; uint32_t shift = 0; const int bits_per_char = - _upb_Log2Ceiling(upb_FromBase92(max) - upb_FromBase92(min)); + upb_Log2Ceiling(_upb_FromBase92(max) - _upb_FromBase92(min)); char ch = first_ch; while (1) { - uint32_t bits = upb_FromBase92(ch) - upb_FromBase92(min); - UPB_ASSERT(shift < 32); + uint32_t bits = _upb_FromBase92(ch) - _upb_FromBase92(min); val |= bits << shift; if (ptr == d->end || *ptr < min || max < *ptr) { *out_val = val; @@ -436,10 +132,11 @@ static const char* upb_MiniTable_DecodeBase92Varint(upb_MtDecoder* d, } ch = *ptr++; shift += bits_per_char; + if (shift >= 32) upb_MtDecoder_ErrorFormat(d, "Overlong varint"); } } -static bool upb_MiniTable_HasSub(upb_MiniTable_Field* field, +static bool upb_MiniTable_HasSub(upb_MiniTableField* field, uint64_t msg_modifiers) { switch (field->descriptortype) { case kUpb_FieldType_Message: @@ -449,6 +146,7 @@ static bool upb_MiniTable_HasSub(upb_MiniTable_Field* field, case kUpb_FieldType_String: if (!(msg_modifiers & kUpb_MessageModifier_ValidateUtf8)) { field->descriptortype = kUpb_FieldType_Bytes; + field->mode |= kUpb_LabelFlags_IsAlternate; } return false; default: @@ -456,15 +154,23 @@ static bool upb_MiniTable_HasSub(upb_MiniTable_Field* field, } } -static bool upb_MtDecoder_FieldIsPackable(upb_MiniTable_Field* field) { +static bool upb_MtDecoder_FieldIsPackable(upb_MiniTableField* field) { return (field->mode & kUpb_FieldMode_Array) && - upb_IsTypePackable(field->descriptortype); + _upb_FieldType_IsPackable(field->descriptortype); } -static void upb_MiniTable_SetTypeAndSub(upb_MiniTable_Field* field, +static void upb_MiniTable_SetTypeAndSub(upb_MiniTableField* field, upb_FieldType type, uint32_t* sub_count, - uint64_t msg_modifiers) { + uint64_t msg_modifiers, + bool is_proto3_enum) { field->descriptortype = type; + + if (is_proto3_enum) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Enum); + field->descriptortype = kUpb_FieldType_Int32; + field->mode |= kUpb_LabelFlags_IsAlternate; + } + if (upb_MiniTable_HasSub(field, msg_modifiers)) { field->submsg_index = sub_count ? (*sub_count)++ : 0; } else { @@ -477,8 +183,30 @@ static void upb_MiniTable_SetTypeAndSub(upb_MiniTable_Field* field, } } +static const char kUpb_EncodedToType[] = { + [kUpb_EncodedType_Double] = kUpb_FieldType_Double, + [kUpb_EncodedType_Float] = kUpb_FieldType_Float, + [kUpb_EncodedType_Int64] = kUpb_FieldType_Int64, + [kUpb_EncodedType_UInt64] = kUpb_FieldType_UInt64, + [kUpb_EncodedType_Int32] = kUpb_FieldType_Int32, + [kUpb_EncodedType_Fixed64] = kUpb_FieldType_Fixed64, + [kUpb_EncodedType_Fixed32] = kUpb_FieldType_Fixed32, + [kUpb_EncodedType_Bool] = kUpb_FieldType_Bool, + [kUpb_EncodedType_String] = kUpb_FieldType_String, + [kUpb_EncodedType_Group] = kUpb_FieldType_Group, + [kUpb_EncodedType_Message] = kUpb_FieldType_Message, + [kUpb_EncodedType_Bytes] = kUpb_FieldType_Bytes, + [kUpb_EncodedType_UInt32] = kUpb_FieldType_UInt32, + [kUpb_EncodedType_OpenEnum] = kUpb_FieldType_Enum, + [kUpb_EncodedType_SFixed32] = kUpb_FieldType_SFixed32, + [kUpb_EncodedType_SFixed64] = kUpb_FieldType_SFixed64, + [kUpb_EncodedType_SInt32] = kUpb_FieldType_SInt32, + [kUpb_EncodedType_SInt64] = kUpb_FieldType_SInt64, + [kUpb_EncodedType_ClosedEnum] = kUpb_FieldType_Enum, +}; + static void upb_MiniTable_SetField(upb_MtDecoder* d, uint8_t ch, - upb_MiniTable_Field* field, + upb_MiniTableField* field, uint64_t msg_modifiers, uint32_t* sub_count) { static const char kUpb_EncodedToFieldRep[] = { @@ -491,61 +219,50 @@ static void upb_MiniTable_SetField(upb_MtDecoder* d, uint8_t ch, [kUpb_EncodedType_Fixed32] = kUpb_FieldRep_4Byte, [kUpb_EncodedType_Bool] = kUpb_FieldRep_1Byte, [kUpb_EncodedType_String] = kUpb_FieldRep_StringView, - [kUpb_EncodedType_Group] = kUpb_FieldRep_Pointer, - [kUpb_EncodedType_Message] = kUpb_FieldRep_Pointer, [kUpb_EncodedType_Bytes] = kUpb_FieldRep_StringView, [kUpb_EncodedType_UInt32] = kUpb_FieldRep_4Byte, - [kUpb_EncodedType_Enum] = kUpb_FieldRep_4Byte, + [kUpb_EncodedType_OpenEnum] = kUpb_FieldRep_4Byte, [kUpb_EncodedType_SFixed32] = kUpb_FieldRep_4Byte, [kUpb_EncodedType_SFixed64] = kUpb_FieldRep_8Byte, [kUpb_EncodedType_SInt32] = kUpb_FieldRep_4Byte, [kUpb_EncodedType_SInt64] = kUpb_FieldRep_8Byte, + [kUpb_EncodedType_ClosedEnum] = kUpb_FieldRep_4Byte, }; - static const char kUpb_EncodedToType[] = { - [kUpb_EncodedType_Double] = kUpb_FieldType_Double, - [kUpb_EncodedType_Float] = kUpb_FieldType_Float, - [kUpb_EncodedType_Int64] = kUpb_FieldType_Int64, - [kUpb_EncodedType_UInt64] = kUpb_FieldType_UInt64, - [kUpb_EncodedType_Int32] = kUpb_FieldType_Int32, - [kUpb_EncodedType_Fixed64] = kUpb_FieldType_Fixed64, - [kUpb_EncodedType_Fixed32] = kUpb_FieldType_Fixed32, - [kUpb_EncodedType_Bool] = kUpb_FieldType_Bool, - [kUpb_EncodedType_String] = kUpb_FieldType_String, - [kUpb_EncodedType_Group] = kUpb_FieldType_Group, - [kUpb_EncodedType_Message] = kUpb_FieldType_Message, - [kUpb_EncodedType_Bytes] = kUpb_FieldType_Bytes, - [kUpb_EncodedType_UInt32] = kUpb_FieldType_UInt32, - [kUpb_EncodedType_Enum] = kUpb_FieldType_Enum, - [kUpb_EncodedType_SFixed32] = kUpb_FieldType_SFixed32, - [kUpb_EncodedType_SFixed64] = kUpb_FieldType_SFixed64, - [kUpb_EncodedType_SInt32] = kUpb_FieldType_SInt32, - [kUpb_EncodedType_SInt64] = kUpb_FieldType_SInt64, - }; + char pointer_rep = d->platform == kUpb_MiniTablePlatform_32Bit + ? kUpb_FieldRep_4Byte + : kUpb_FieldRep_8Byte; - int8_t type = upb_FromBase92(ch); - if (ch >= upb_ToBase92(kUpb_EncodedType_RepeatedBase)) { + int8_t type = _upb_FromBase92(ch); + if (ch >= _upb_ToBase92(kUpb_EncodedType_RepeatedBase)) { type -= kUpb_EncodedType_RepeatedBase; field->mode = kUpb_FieldMode_Array; - field->mode |= kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift; + field->mode |= pointer_rep << kUpb_FieldRep_Shift; field->offset = kNoPresence; } else { field->mode = kUpb_FieldMode_Scalar; - field->mode |= kUpb_EncodedToFieldRep[type] << kUpb_FieldRep_Shift; field->offset = kHasbitPresence; + if (type == kUpb_EncodedType_Group || type == kUpb_EncodedType_Message) { + field->mode |= pointer_rep << kUpb_FieldRep_Shift; + } else if (type >= sizeof(kUpb_EncodedToFieldRep)) { + upb_MtDecoder_ErrorFormat(d, "Invalid field type: %d", (int)type); + UPB_UNREACHABLE(); + } else { + field->mode |= kUpb_EncodedToFieldRep[type] << kUpb_FieldRep_Shift; + } } - if (type >= 18) { + if (type >= sizeof(kUpb_EncodedToType)) { upb_MtDecoder_ErrorFormat(d, "Invalid field type: %d", (int)type); UPB_UNREACHABLE(); } upb_MiniTable_SetTypeAndSub(field, kUpb_EncodedToType[type], sub_count, - msg_modifiers); + msg_modifiers, type == kUpb_EncodedType_OpenEnum); } static void upb_MtDecoder_ModifyField(upb_MtDecoder* d, uint32_t message_modifiers, uint32_t field_modifiers, - upb_MiniTable_Field* field) { + upb_MiniTableField* field) { if (field_modifiers & kUpb_EncodedFieldModifier_FlipPacked) { if (!upb_MtDecoder_FieldIsPackable(field)) { upb_MtDecoder_ErrorFormat( @@ -607,13 +324,15 @@ static void upb_MtDecoder_PushOneof(upb_MtDecoder* d, upb_LayoutItem item) { size_t upb_MtDecoder_SizeOfRep(upb_FieldRep rep, upb_MiniTablePlatform platform) { static const uint8_t kRepToSize32[] = { - [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4, - [kUpb_FieldRep_Pointer] = 4, [kUpb_FieldRep_StringView] = 8, + [kUpb_FieldRep_1Byte] = 1, + [kUpb_FieldRep_4Byte] = 4, + [kUpb_FieldRep_StringView] = 8, [kUpb_FieldRep_8Byte] = 8, }; static const uint8_t kRepToSize64[] = { - [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4, - [kUpb_FieldRep_Pointer] = 8, [kUpb_FieldRep_StringView] = 16, + [kUpb_FieldRep_1Byte] = 1, + [kUpb_FieldRep_4Byte] = 4, + [kUpb_FieldRep_StringView] = 16, [kUpb_FieldRep_8Byte] = 8, }; UPB_ASSERT(sizeof(upb_StringView) == @@ -625,13 +344,15 @@ size_t upb_MtDecoder_SizeOfRep(upb_FieldRep rep, size_t upb_MtDecoder_AlignOfRep(upb_FieldRep rep, upb_MiniTablePlatform platform) { static const uint8_t kRepToAlign32[] = { - [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4, - [kUpb_FieldRep_Pointer] = 4, [kUpb_FieldRep_StringView] = 4, + [kUpb_FieldRep_1Byte] = 1, + [kUpb_FieldRep_4Byte] = 4, + [kUpb_FieldRep_StringView] = 4, [kUpb_FieldRep_8Byte] = 8, }; static const uint8_t kRepToAlign64[] = { - [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4, - [kUpb_FieldRep_Pointer] = 8, [kUpb_FieldRep_StringView] = 8, + [kUpb_FieldRep_1Byte] = 1, + [kUpb_FieldRep_4Byte] = 4, + [kUpb_FieldRep_StringView] = 8, [kUpb_FieldRep_8Byte] = 8, }; UPB_ASSERT(UPB_ALIGN_OF(upb_StringView) == @@ -648,7 +369,7 @@ static const char* upb_MtDecoder_DecodeOneofField(upb_MtDecoder* d, ptr = upb_MiniTable_DecodeBase92Varint( d, ptr, first_ch, kUpb_EncodedValue_MinOneofField, kUpb_EncodedValue_MaxOneofField, &field_num); - upb_MiniTable_Field* f = + upb_MiniTableField* f = (void*)upb_MiniTable_FindFieldByNumber(d->table, field_num); if (!f) { @@ -703,7 +424,7 @@ static const char* upb_MtDecoder_DecodeOneofs(upb_MtDecoder* d, static const char* upb_MtDecoder_ParseModifier(upb_MtDecoder* d, const char* ptr, char first_ch, - upb_MiniTable_Field* last_field, + upb_MiniTableField* last_field, uint64_t* msg_modifiers) { uint32_t mod; ptr = upb_MiniTable_DecodeBase92Varint(d, ptr, first_ch, @@ -724,16 +445,19 @@ static const char* upb_MtDecoder_ParseModifier(upb_MtDecoder* d, static void upb_MtDecoder_AllocateSubs(upb_MtDecoder* d, uint32_t sub_count) { size_t subs_bytes = sizeof(*d->table->subs) * sub_count; - d->table->subs = upb_Arena_Malloc(d->arena, subs_bytes); + void* subs = upb_Arena_Malloc(d->arena, subs_bytes); + memset(subs, 0, subs_bytes); + d->table->subs = subs; upb_MtDecoder_CheckOutOfMemory(d, d->table->subs); } -static void upb_MtDecoder_Parse(upb_MtDecoder* d, const char* ptr, size_t len, - void* fields, size_t field_size, - uint16_t* field_count, uint32_t* sub_count) { +static const char* upb_MtDecoder_Parse(upb_MtDecoder* d, const char* ptr, + size_t len, void* fields, + size_t field_size, uint16_t* field_count, + uint32_t* sub_count) { uint64_t msg_modifiers = 0; uint32_t last_field_number = 0; - upb_MiniTable_Field* last_field = NULL; + upb_MiniTableField* last_field = NULL; bool need_dense_below = d->table != NULL; d->end = UPB_PTRADD(ptr, len); @@ -741,7 +465,11 @@ static void upb_MtDecoder_Parse(upb_MtDecoder* d, const char* ptr, size_t len, while (ptr < d->end) { char ch = *ptr++; if (ch <= kUpb_EncodedValue_MaxField) { - upb_MiniTable_Field* field = fields; + if (!d->table && last_field) { + // For extensions, consume only a single field and then return. + return --ptr; + } + upb_MiniTableField* field = fields; *field_count += 1; fields = (char*)fields + field_size; field->number = ++last_field_number; @@ -771,12 +499,17 @@ static void upb_MtDecoder_Parse(upb_MtDecoder* d, const char* ptr, size_t len, kUpb_EncodedValue_MaxSkip, &skip); last_field_number += skip; last_field_number--; // Next field seen will increment. + } else { + upb_MtDecoder_ErrorFormat(d, "Invalid char: %c", ch); + UPB_UNREACHABLE(); } } if (need_dense_below) { d->table->dense_below = d->table->field_count; } + + return ptr; } static void upb_MtDecoder_ParseMessage(upb_MtDecoder* d, const char* data, @@ -807,8 +540,8 @@ int upb_MtDecoder_CompareFields(const void* _a, const void* _b) { // 2. field_index (smallest numbers first) // The main goal of this is to reduce space lost to padding. // Later we may have more subtle reasons to prefer a different ordering. - const int rep_bits = _upb_Log2Ceiling(kUpb_FieldRep_Max); - const int type_bits = _upb_Log2Ceiling(kUpb_LayoutItemType_Max); + const int rep_bits = upb_Log2Ceiling(kUpb_FieldRep_Max); + const int type_bits = upb_Log2Ceiling(kUpb_LayoutItemType_Max); const int idx_bits = (sizeof(a->field_index) * 8); UPB_ASSERT(idx_bits + rep_bits + type_bits < 32); #define UPB_COMBINE(rep, ty, idx) (((rep << type_bits) | ty) << idx_bits) | idx @@ -823,7 +556,7 @@ static bool upb_MtDecoder_SortLayoutItems(upb_MtDecoder* d) { // Add items for all non-oneof fields (oneofs were already added). int n = d->table->field_count; for (int i = 0; i < n; i++) { - upb_MiniTable_Field* f = &d->fields[i]; + upb_MiniTableField* f = &d->fields[i]; if (f->offset >= kOneofBase) continue; upb_LayoutItem item = {.field_index = i, .rep = f->mode >> kUpb_FieldRep_Shift, @@ -849,7 +582,7 @@ static void upb_MtDecoder_AssignHasbits(upb_MiniTable* ret) { // First assign required fields, which must have the lowest hasbits. for (int i = 0; i < n; i++) { - upb_MiniTable_Field* field = (upb_MiniTable_Field*)&ret->fields[i]; + upb_MiniTableField* field = (upb_MiniTableField*)&ret->fields[i]; if (field->offset == kRequiredPresence) { field->presence = ++last_hasbit; } else if (field->offset == kNoPresence) { @@ -860,7 +593,7 @@ static void upb_MtDecoder_AssignHasbits(upb_MiniTable* ret) { // Next assign non-required hasbit fields. for (int i = 0; i < n; i++) { - upb_MiniTable_Field* field = (upb_MiniTable_Field*)&ret->fields[i]; + upb_MiniTableField* field = (upb_MiniTableField*)&ret->fields[i]; if (field->offset == kHasbitPresence) { field->presence = ++last_hasbit; } @@ -873,7 +606,13 @@ size_t upb_MtDecoder_Place(upb_MtDecoder* d, upb_FieldRep rep) { size_t size = upb_MtDecoder_SizeOfRep(rep, d->platform); size_t align = upb_MtDecoder_AlignOfRep(rep, d->platform); size_t ret = UPB_ALIGN_UP(d->table->size, align); - d->table->size = ret + size; + static const size_t max = UINT16_MAX; + size_t new_size = ret + size; + if (new_size > max) { + upb_MtDecoder_ErrorFormat( + d, "Message size exceeded maximum size of %zu bytes", max); + } + d->table->size = new_size; return ret; } @@ -889,7 +628,7 @@ static void upb_MtDecoder_AssignOffsets(upb_MtDecoder* d) { // actual offsets will overwrite the links of the linked list. for (upb_LayoutItem* item = d->vec.data; item < end; item++) { if (item->type != kUpb_LayoutItemType_OneofCase) continue; - upb_MiniTable_Field* f = &d->fields[item->field_index]; + upb_MiniTableField* f = &d->fields[item->field_index]; while (true) { f->presence = ~item->offset; if (f->offset == kUpb_LayoutItem_IndexSentinel) break; @@ -900,7 +639,7 @@ static void upb_MtDecoder_AssignOffsets(upb_MtDecoder* d) { // Assign offsets. for (upb_LayoutItem* item = d->vec.data; item < end; item++) { - upb_MiniTable_Field* f = &d->fields[item->field_index]; + upb_MiniTableField* f = &d->fields[item->field_index]; switch (item->type) { case kUpb_LayoutItemType_OneofField: while (true) { @@ -926,6 +665,85 @@ static void upb_MtDecoder_AssignOffsets(upb_MtDecoder* d) { d->table->size = UPB_ALIGN_UP(d->table->size, 8); } +static void upb_MtDecoder_ValidateEntryField(upb_MtDecoder* d, + const upb_MiniTableField* f, + int expected_num) { + const char* name = expected_num == 1 ? "key" : "val"; + if (f->number != expected_num) { + upb_MtDecoder_ErrorFormat(d, + "map %s did not have expected number (%d vs %d)", + name, expected_num, (int)f->number); + } + + if (upb_IsRepeatedOrMap(f)) { + upb_MtDecoder_ErrorFormat( + d, "map %s cannot be repeated or map, or be in oneof", name); + } + + uint32_t not_ok_types; + if (expected_num == 1) { + not_ok_types = (1 << kUpb_FieldType_Float) | (1 << kUpb_FieldType_Double) | + (1 << kUpb_FieldType_Message) | (1 << kUpb_FieldType_Group) | + (1 << kUpb_FieldType_Bytes) | (1 << kUpb_FieldType_Enum); + } else { + not_ok_types = 1 << kUpb_FieldType_Group; + } + + if ((1 << upb_MiniTableField_Type(f)) & not_ok_types) { + upb_MtDecoder_ErrorFormat(d, "map %s cannot have type %d", name, + (int)f->descriptortype); + } +} + +static void upb_MtDecoder_ParseMap(upb_MtDecoder* d, const char* data, + size_t len) { + upb_MtDecoder_ParseMessage(d, data, len); + upb_MtDecoder_AssignHasbits(d->table); + + if (UPB_UNLIKELY(d->table->field_count != 2)) { + upb_MtDecoder_ErrorFormat(d, "%hu fields in map", d->table->field_count); + UPB_UNREACHABLE(); + } + + upb_LayoutItem* end = UPB_PTRADD(d->vec.data, d->vec.size); + for (upb_LayoutItem* item = d->vec.data; item < end; item++) { + if (item->type == kUpb_LayoutItemType_OneofCase) { + upb_MtDecoder_ErrorFormat(d, "Map entry cannot have oneof"); + } + } + + upb_MtDecoder_ValidateEntryField(d, &d->table->fields[0], 1); + upb_MtDecoder_ValidateEntryField(d, &d->table->fields[1], 2); + + // Map entries have a pre-determined layout, regardless of types. + // NOTE: sync with mini_table/message_internal.h. + const size_t kv_size = d->platform == kUpb_MiniTablePlatform_32Bit ? 8 : 16; + const size_t hasbit_size = 8; + d->fields[0].offset = hasbit_size; + d->fields[1].offset = hasbit_size + kv_size; + d->table->size = UPB_ALIGN_UP(hasbit_size + kv_size + kv_size, 8); + + // Map entries have a special bit set to signal it's a map entry, used in + // upb_MiniTable_SetSubMessage() below. + d->table->ext |= kUpb_ExtMode_IsMapEntry; +} + +static void upb_MtDecoder_ParseMessageSet(upb_MtDecoder* d, const char* data, + size_t len) { + if (len > 0) { + upb_MtDecoder_ErrorFormat(d, "Invalid message set encode length: %zu", len); + UPB_UNREACHABLE(); + } + + upb_MiniTable* ret = d->table; + ret->size = 0; + ret->field_count = 0; + ret->ext = kUpb_ExtMode_IsMessageSet; + ret->dense_below = 0; + ret->table_mask = -1; + ret->required_count = 0; +} + upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, upb_MiniTablePlatform platform, upb_Arena* arena, void** buf, @@ -955,166 +773,189 @@ upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, decoder.table->field_count = 0; decoder.table->ext = kUpb_ExtMode_NonExtendable; decoder.table->dense_below = 0; - decoder.table->table_mask = 0; + decoder.table->table_mask = -1; decoder.table->required_count = 0; - upb_MtDecoder_ParseMessage(&decoder, data, len); - upb_MtDecoder_AssignHasbits(decoder.table); - upb_MtDecoder_SortLayoutItems(&decoder); - upb_MtDecoder_AssignOffsets(&decoder); + // Strip off and verify the version tag. + if (!len--) goto done; + const char vers = *data++; + + switch (vers) { + case kUpb_EncodedVersion_MapV1: + upb_MtDecoder_ParseMap(&decoder, data, len); + break; + + case kUpb_EncodedVersion_MessageV1: + upb_MtDecoder_ParseMessage(&decoder, data, len); + upb_MtDecoder_AssignHasbits(decoder.table); + upb_MtDecoder_SortLayoutItems(&decoder); + upb_MtDecoder_AssignOffsets(&decoder); + break; + + case kUpb_EncodedVersion_MessageSetV1: + upb_MtDecoder_ParseMessageSet(&decoder, data, len); + break; + + default: + upb_MtDecoder_ErrorFormat(&decoder, "Invalid message version: %c", vers); + UPB_UNREACHABLE(); + } done: *buf = decoder.vec.data; - *buf_size = decoder.vec.capacity / sizeof(*decoder.vec.data); + *buf_size = decoder.vec.capacity * sizeof(*decoder.vec.data); return decoder.table; } -upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform, - upb_Arena* arena) { - upb_MiniTable* ret = upb_Arena_Malloc(arena, sizeof(*ret)); - if (!ret) return NULL; - - ret->size = 0; - ret->field_count = 0; - ret->ext = kUpb_ExtMode_IsMessageSet; - ret->dense_below = 0; - ret->table_mask = 0; - ret->required_count = 0; - return ret; +static size_t upb_MiniTableEnum_Size(size_t count) { + return sizeof(upb_MiniTableEnum) + count * sizeof(uint32_t); } -upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type, - upb_FieldType value_type, - bool value_is_proto3_enum, - upb_MiniTablePlatform platform, - upb_Arena* arena) { - upb_MiniTable* ret = upb_Arena_Malloc(arena, sizeof(*ret)); - upb_MiniTable_Field* fields = upb_Arena_Malloc(arena, sizeof(*fields) * 2); - if (!ret || !fields) return NULL; - - upb_MiniTable_Sub* subs = NULL; - if (value_is_proto3_enum) value_type = kUpb_FieldType_Int32; - if (value_type == kUpb_FieldType_Message || - value_type == kUpb_FieldType_Group || value_type == kUpb_FieldType_Enum) { - subs = upb_Arena_Malloc(arena, sizeof(*subs)); - if (!subs) return NULL; +static upb_MiniTableEnum* _upb_MiniTable_AddEnumDataMember(upb_MtDecoder* d, + uint32_t val) { + if (d->enum_data_count == d->enum_data_capacity) { + size_t old_sz = upb_MiniTableEnum_Size(d->enum_data_capacity); + d->enum_data_capacity = UPB_MAX(2, d->enum_data_capacity * 2); + size_t new_sz = upb_MiniTableEnum_Size(d->enum_data_capacity); + d->enum_table = upb_Arena_Realloc(d->arena, d->enum_table, old_sz, new_sz); + upb_MtDecoder_CheckOutOfMemory(d, d->enum_table); } - - size_t field_size = - upb_MtDecoder_SizeOfRep(kUpb_FieldRep_StringView, platform); - - fields[0].number = 1; - fields[1].number = 2; - fields[0].mode = kUpb_FieldMode_Scalar; - fields[1].mode = kUpb_FieldMode_Scalar; - fields[0].presence = 0; - fields[1].presence = 0; - fields[0].offset = 0; - fields[1].offset = field_size; - - upb_MiniTable_SetTypeAndSub(&fields[0], key_type, NULL, 0); - upb_MiniTable_SetTypeAndSub(&fields[1], value_type, NULL, 0); - - ret->size = UPB_ALIGN_UP(2 * field_size, 8); - ret->field_count = 2; - ret->ext = kUpb_ExtMode_NonExtendable | kUpb_ExtMode_IsMapEntry; - ret->dense_below = 2; - ret->table_mask = 0; - ret->required_count = 0; - ret->subs = subs; - ret->fields = fields; - return ret; + d->enum_table->data[d->enum_data_count++] = val; + return d->enum_table; } -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; +static void upb_MiniTableEnum_BuildValue(upb_MtDecoder* d, uint32_t val) { + upb_MiniTableEnum* table = d->enum_table; + d->enum_value_count++; + if (table->value_count || (val > 512 && d->enum_value_count < val / 32)) { + if (table->value_count == 0) { + assert(d->enum_data_count == table->mask_limit / 32); + } + table = _upb_MiniTable_AddEnumDataMember(d, val); + table->value_count++; + } else { + uint32_t new_mask_limit = ((val / 32) + 1) * 32; + while (table->mask_limit < new_mask_limit) { + table = _upb_MiniTable_AddEnumDataMember(d, 0); + table->mask_limit += 32; + } + table->data[val / 32] |= 1ULL << (val % 32); } - - 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 d = { +upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status) { + upb_MtDecoder decoder = { + .enum_table = upb_Arena_Malloc(arena, upb_MiniTableEnum_Size(2)), + .enum_value_count = 0, + .enum_data_count = 0, + .enum_data_capacity = 1, .status = status, .end = UPB_PTRADD(data, len), + .arena = arena, }; - if (UPB_SETJMP(d.err)) { - return NULL; + if (UPB_SETJMP(decoder.err)) return NULL; + + // If the string is non-empty then it must begin with a version tag. + if (len) { + if (*data != kUpb_EncodedVersion_EnumV1) { + upb_MtDecoder_ErrorFormat(&decoder, "Invalid enum version: %c", *data); + UPB_UNREACHABLE(); + } + data++; + len--; } - upb_MiniTable_Enum* table = upb_Arena_Malloc(arena, sizeof(*table)); - upb_MtDecoder_CheckOutOfMemory(&d, table); + upb_MtDecoder_CheckOutOfMemory(&decoder, decoder.enum_table); - table->mask = 0; - table->value_count = 0; - table->values = NULL; + // Guarantee at least 64 bits of mask without checking mask size. + decoder.enum_table->mask_limit = 64; + decoder.enum_table = _upb_MiniTable_AddEnumDataMember(&decoder, 0); + decoder.enum_table = _upb_MiniTable_AddEnumDataMember(&decoder, 0); + + decoder.enum_table->value_count = 0; const char* ptr = data; uint32_t base = 0; - while (ptr < d.end) { + while (ptr < decoder.end) { char ch = *ptr++; if (ch <= kUpb_EncodedValue_MaxEnumMask) { - uint32_t mask = upb_FromBase92(ch); + 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; - } - } + if (mask & 1) upb_MiniTableEnum_BuildValue(&decoder, base); } } else if (kUpb_EncodedValue_MinSkip <= ch && ch <= kUpb_EncodedValue_MaxSkip) { uint32_t skip; - ptr = upb_MiniTable_DecodeBase92Varint(&d, ptr, ch, + ptr = upb_MiniTable_DecodeBase92Varint(&decoder, ptr, ch, kUpb_EncodedValue_MinSkip, kUpb_EncodedValue_MaxSkip, &skip); base += skip; } else { - upb_Status_SetErrorFormat(status, "Unexpected character: %c", ch); + upb_MtDecoder_ErrorFormat(&decoder, "Unexpected character: %c", ch); return NULL; } } - return table; + return decoder.enum_table; } -bool upb_MiniTable_BuildExtension(const char* data, size_t len, - upb_MiniTable_Extension* ext, - upb_MiniTable_Sub sub, upb_Status* status) { +const char* _upb_MiniTableExtension_Build(const char* data, size_t len, + upb_MiniTableExtension* ext, + const upb_MiniTable* extendee, + upb_MiniTableSub sub, + upb_MiniTablePlatform platform, + upb_Status* status) { upb_MtDecoder decoder = { .arena = NULL, .status = status, .table = NULL, + .platform = platform, }; - if (UPB_SETJMP(decoder.err)) { - return false; + if (UPB_SETJMP(decoder.err)) return NULL; + + // If the string is non-empty then it must begin with a version tag. + if (len) { + if (*data != kUpb_EncodedVersion_ExtensionV1) { + upb_MtDecoder_ErrorFormat(&decoder, "Invalid ext version: %c", *data); + UPB_UNREACHABLE(); + } + data++; + len--; } uint16_t count = 0; - upb_MtDecoder_Parse(&decoder, data, len, ext, sizeof(*ext), &count, NULL); - ext->field.mode |= kUpb_LabelFlags_IsExtension; - ext->field.offset = 0; - return true; + const char* ret = + upb_MtDecoder_Parse(&decoder, data, len, ext, sizeof(*ext), &count, NULL); + if (!ret || count != 1) return NULL; + + upb_MiniTableField* f = &ext->field; + + f->mode |= kUpb_LabelFlags_IsExtension; + f->offset = 0; + f->presence = 0; + + if (extendee->ext & kUpb_ExtMode_IsMessageSet) { + // Extensions of MessageSet must be messages. + if (!upb_IsSubMessage(f)) return NULL; + + // Extensions of MessageSet must be non-repeating. + if ((f->mode & kUpb_FieldMode_Mask) == kUpb_FieldMode_Array) return NULL; + } + + ext->extendee = extendee; + ext->sub = sub; + + return ret; } -upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len, - upb_MiniTablePlatform platform, - upb_Arena* arena, upb_Status* status) { +upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len, + upb_MiniTablePlatform platform, + upb_Arena* arena, upb_Status* status) { void* buf = NULL; size_t size = 0; upb_MiniTable* ret = upb_MiniTable_BuildWithBuf(data, len, platform, arena, @@ -1123,25 +964,47 @@ upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len, return ret; } -void upb_MiniTable_SetSubMessage(upb_MiniTable* table, - upb_MiniTable_Field* field, +bool upb_MiniTable_SetSubMessage(upb_MiniTable* table, + upb_MiniTableField* field, const upb_MiniTable* sub) { UPB_ASSERT((uintptr_t)table->fields <= (uintptr_t)field && (uintptr_t)field < (uintptr_t)(table->fields + table->field_count)); - if (sub->ext & kUpb_ExtMode_IsMapEntry) { - field->mode = - (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift) | kUpb_FieldMode_Map; + UPB_ASSERT(sub); + + const bool sub_is_map = sub->ext & kUpb_ExtMode_IsMapEntry; + + switch (field->descriptortype) { + case kUpb_FieldType_Message: + if (sub_is_map) { + const bool table_is_map = table->ext & kUpb_ExtMode_IsMapEntry; + if (UPB_UNLIKELY(table_is_map)) return false; + + field->mode = (field->mode & ~kUpb_FieldMode_Mask) | kUpb_FieldMode_Map; + } + break; + + case kUpb_FieldType_Group: + if (UPB_UNLIKELY(sub_is_map)) return false; + break; + + default: + return false; } - upb_MiniTable_Sub* table_sub = (void*)&table->subs[field->submsg_index]; + + upb_MiniTableSub* table_sub = (void*)&table->subs[field->submsg_index]; table_sub->submsg = sub; + return true; } -void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field, - const upb_MiniTable_Enum* sub) { +bool upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTableField* field, + const upb_MiniTableEnum* sub) { UPB_ASSERT((uintptr_t)table->fields <= (uintptr_t)field && (uintptr_t)field < (uintptr_t)(table->fields + table->field_count)); - upb_MiniTable_Sub* table_sub = (void*)&table->subs[field->submsg_index]; + UPB_ASSERT(sub); + + upb_MiniTableSub* table_sub = (void*)&table->subs[field->submsg_index]; table_sub->subenum = sub; + return true; } diff --git a/third_party/upb/upb/mini_table/decode.h b/third_party/upb/upb/mini_table/decode.h new file mode 100644 index 00000000000..57d7e52cae0 --- /dev/null +++ b/third_party/upb/upb/mini_table/decode.h @@ -0,0 +1,117 @@ +/* + * 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_DECODE_H_ +#define UPB_MINI_TABLE_DECODE_H_ + +#include "upb/base/status.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/common.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef enum { + kUpb_MiniTablePlatform_32Bit, + kUpb_MiniTablePlatform_64Bit, + kUpb_MiniTablePlatform_Native = + UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit), +} upb_MiniTablePlatform; + +#ifdef __cplusplus +extern "C" { +#endif + +// Builds a mini table from the data encoded in the buffer [data, len]. If any +// errors occur, returns NULL and sets a status message. In the success case, +// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum +// fields to link the table to the appropriate sub-tables. +upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len, + upb_MiniTablePlatform platform, + upb_Arena* arena, upb_Status* status); + +UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status) { + return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena, + status); +} + +// Links a sub-message field to a MiniTable for that sub-message. If a +// sub-message field is not linked, it will be treated as an unknown field +// during parsing, and setting the field will not be allowed. It is possible +// to link the message field later, at which point it will no longer be treated +// as unknown. However there is no synchronization for this operation, which +// means parallel mutation requires external synchronization. +// Returns success/failure. +UPB_API bool upb_MiniTable_SetSubMessage(upb_MiniTable* table, + upb_MiniTableField* field, + const upb_MiniTable* sub); + +// Links an enum field to a MiniTable for that enum. +// All enum fields must be linked prior to parsing. +// Returns success/failure. +UPB_API bool upb_MiniTable_SetSubEnum(upb_MiniTable* table, + upb_MiniTableField* field, + const upb_MiniTableEnum* sub); + +const char* _upb_MiniTableExtension_Build(const char* data, size_t len, + upb_MiniTableExtension* ext, + const upb_MiniTable* extendee, + upb_MiniTableSub sub, + upb_MiniTablePlatform platform, + upb_Status* status); + +UPB_API_INLINE const char* upb_MiniTableExtension_Build( + const char* data, size_t len, upb_MiniTableExtension* ext, + const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) { + return _upb_MiniTableExtension_Build(data, len, ext, extendee, sub, + kUpb_MiniTablePlatform_Native, status); +} + +UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status); + +// Like upb_MiniTable_Build(), but the user provides a buffer of layout data so +// it can be reused from call to call, avoiding repeated realloc()/free(). +// +// The caller owns `*buf` both before and after the call, and must free() it +// when it is no longer in use. The function will realloc() `*buf` as +// necessary, updating `*size` accordingly. +upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, + upb_MiniTablePlatform platform, + upb_Arena* arena, void** buf, + size_t* buf_size, upb_Status* status); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_DECODE_H_ */ diff --git a/third_party/upb/upb/mini_table/encode.c b/third_party/upb/upb/mini_table/encode.c new file mode 100644 index 00000000000..9d38a8375a5 --- /dev/null +++ b/third_party/upb/upb/mini_table/encode.c @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include "upb/base/log2.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/common.h" +#include "upb/mini_table/common_internal.h" +#include "upb/mini_table/encode_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +typedef struct { + 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; +} + +static char* upb_MtDataEncoder_PutRaw(upb_MtDataEncoder* e, char* ptr, + char ch) { + upb_MtDataEncoderInternal* in = (upb_MtDataEncoderInternal*)e->internal; + UPB_ASSERT(ptr - in->buf_start < kUpb_MtDataEncoder_MinSize); + if (ptr == e->end) return NULL; + *ptr++ = ch; + return ptr; +} + +static char* upb_MtDataEncoder_Put(upb_MtDataEncoder* e, char* ptr, char ch) { + return upb_MtDataEncoder_PutRaw(e, ptr, _upb_ToBase92(ch)); +} + +static char* upb_MtDataEncoder_PutBase92Varint(upb_MtDataEncoder* e, char* ptr, + uint32_t val, int min, int max) { + int shift = upb_Log2Ceiling(_upb_FromBase92(max) - _upb_FromBase92(min) + 1); + UPB_ASSERT(shift <= 6); + uint32_t mask = (1 << shift) - 1; + do { + uint32_t bits = val & mask; + ptr = upb_MtDataEncoder_Put(e, ptr, bits + _upb_FromBase92(min)); + if (!ptr) return NULL; + val >>= shift; + } while (val); + return ptr; +} + +char* upb_MtDataEncoder_PutModifier(upb_MtDataEncoder* e, char* ptr, + uint64_t mod) { + if (mod) { + ptr = upb_MtDataEncoder_PutBase92Varint(e, ptr, mod, + kUpb_EncodedValue_MinModifier, + kUpb_EncodedValue_MaxModifier); + } + return ptr; +} + +char* upb_MtDataEncoder_EncodeExtension(upb_MtDataEncoder* e, char* ptr, + upb_FieldType type, uint32_t field_num, + uint64_t field_mod) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + in->state.msg_state.msg_modifiers = 0; + in->state.msg_state.last_field_num = 0; + in->state.msg_state.oneof_state = kUpb_OneofState_NotStarted; + + ptr = upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_ExtensionV1); + if (!ptr) return NULL; + + return upb_MtDataEncoder_PutField(e, ptr, type, field_num, field_mod); +} + +char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr, + upb_FieldType key_type, + upb_FieldType value_type, uint64_t key_mod, + uint64_t value_mod) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + in->state.msg_state.msg_modifiers = 0; + in->state.msg_state.last_field_num = 0; + in->state.msg_state.oneof_state = kUpb_OneofState_NotStarted; + + ptr = upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_MapV1); + if (!ptr) return NULL; + + ptr = upb_MtDataEncoder_PutField(e, ptr, key_type, 1, key_mod); + if (!ptr) return NULL; + + return upb_MtDataEncoder_PutField(e, ptr, value_type, 2, value_mod); +} + +char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr) { + (void)upb_MtDataEncoder_GetInternal(e, ptr); + return upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_MessageSetV1); +} + +char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr, + uint64_t msg_mod) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + 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; + + ptr = upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_MessageV1); + if (!ptr) return NULL; + + return upb_MtDataEncoder_PutModifier(e, ptr, msg_mod); +} + +char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, + upb_FieldType type, uint32_t field_num, + uint64_t field_mod) { + static const char kUpb_TypeToEncoded[] = { + [kUpb_FieldType_Double] = kUpb_EncodedType_Double, + [kUpb_FieldType_Float] = kUpb_EncodedType_Float, + [kUpb_FieldType_Int64] = kUpb_EncodedType_Int64, + [kUpb_FieldType_UInt64] = kUpb_EncodedType_UInt64, + [kUpb_FieldType_Int32] = kUpb_EncodedType_Int32, + [kUpb_FieldType_Fixed64] = kUpb_EncodedType_Fixed64, + [kUpb_FieldType_Fixed32] = kUpb_EncodedType_Fixed32, + [kUpb_FieldType_Bool] = kUpb_EncodedType_Bool, + [kUpb_FieldType_String] = kUpb_EncodedType_String, + [kUpb_FieldType_Group] = kUpb_EncodedType_Group, + [kUpb_FieldType_Message] = kUpb_EncodedType_Message, + [kUpb_FieldType_Bytes] = kUpb_EncodedType_Bytes, + [kUpb_FieldType_UInt32] = kUpb_EncodedType_UInt32, + [kUpb_FieldType_Enum] = kUpb_EncodedType_OpenEnum, + [kUpb_FieldType_SFixed32] = kUpb_EncodedType_SFixed32, + [kUpb_FieldType_SFixed64] = kUpb_EncodedType_SFixed64, + [kUpb_FieldType_SInt32] = kUpb_EncodedType_SInt32, + [kUpb_FieldType_SInt64] = kUpb_EncodedType_SInt64, + }; + + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + if (field_num <= in->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->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->state.msg_state.last_field_num = field_num; + + uint32_t encoded_modifiers = 0; + + // Put field type. + int encoded_type = kUpb_TypeToEncoded[type]; + if (field_mod & kUpb_FieldModifier_IsClosedEnum) { + UPB_ASSERT(type == kUpb_FieldType_Enum); + encoded_type = kUpb_EncodedType_ClosedEnum; + } + if (field_mod & kUpb_FieldModifier_IsRepeated) { + // Repeated fields shift the type number up (unlike other modifiers which + // are bit flags). + encoded_type += kUpb_EncodedType_RepeatedBase; + + if (_upb_FieldType_IsPackable(type)) { + bool field_is_packed = field_mod & kUpb_FieldModifier_IsPacked; + 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; + } + } + } + ptr = upb_MtDataEncoder_Put(e, ptr, encoded_type); + if (!ptr) return NULL; + + if (field_mod & kUpb_FieldModifier_IsProto3Singular) { + encoded_modifiers |= kUpb_EncodedFieldModifier_IsProto3Singular; + } + if (field_mod & kUpb_FieldModifier_IsRequired) { + encoded_modifiers |= kUpb_EncodedFieldModifier_IsRequired; + } + return upb_MtDataEncoder_PutModifier(e, ptr, encoded_modifiers); +} + +char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + if (in->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->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->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->state.msg_state.oneof_state = kUpb_OneofState_EmittedOneofField; + return ptr; +} + +char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + in->state.enum_state.present_values_mask = 0; + in->state.enum_state.last_written_value = 0; + + return upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_EnumV1); +} + +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); +} diff --git a/third_party/upb/upb/mini_table/encode_internal.h b/third_party/upb/upb/mini_table/encode_internal.h new file mode 100644 index 00000000000..a4b0aca66dc --- /dev/null +++ b/third_party/upb/upb/mini_table/encode_internal.h @@ -0,0 +1,110 @@ +/* + * 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_ENCODE_INTERNAL_H_ +#define UPB_MINI_TABLE_ENCODE_INTERNAL_H_ + +#include "upb/mini_table/common.h" + +// Must be last. +#include "upb/port/def.inc" + +// If the input buffer has at least this many bytes available, the encoder call +// is guaranteed to succeed (as long as field number order is maintained). +#define kUpb_MtDataEncoder_MinSize 16 + +typedef struct { + char* end; // Limit of the buffer passed as a parameter. + // Aliased to internal-only members in .cc. + char internal[32]; +} upb_MtDataEncoder; + +#ifdef __cplusplus +extern "C" { +#endif + +// Encodes field/oneof information for a given message. The sequence of calls +// should look like: +// +// upb_MtDataEncoder e; +// char buf[256]; +// char* ptr = buf; +// e.end = ptr + sizeof(buf); +// unit64_t msg_mod = ...; // bitwise & of kUpb_MessageModifiers or zero +// ptr = upb_MtDataEncoder_StartMessage(&e, ptr, msg_mod); +// // Fields *must* be in field number order. +// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...); +// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...); +// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...); +// +// // If oneofs are present. Oneofs must be encoded after regular fields. +// ptr = upb_MiniTable_StartOneof(&e, ptr) +// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); +// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); +// +// ptr = upb_MiniTable_StartOneof(&e, ptr); +// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); +// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...); +// +// Oneofs must be encoded after all regular fields. +char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr, + uint64_t msg_mod); +char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, + upb_FieldType type, uint32_t field_num, + uint64_t field_mod); +char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr); +char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr, + uint32_t field_num); + +// Encodes the set of values for a given enum. The values must be given in +// order (after casting to uint32_t), and repeats are not allowed. +char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr); +char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr, + uint32_t val); +char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr); + +// Encodes an entire mini descriptor for an extension. +char* upb_MtDataEncoder_EncodeExtension(upb_MtDataEncoder* e, char* ptr, + upb_FieldType type, uint32_t field_num, + uint64_t field_mod); + +// Encodes an entire mini descriptor for a map. +char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr, + upb_FieldType key_type, + upb_FieldType value_type, uint64_t key_mod, + uint64_t value_mod); + +// Encodes an entire mini descriptor for a message set. +char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_ENCODE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/mini_table.hpp b/third_party/upb/upb/mini_table/encode_internal.hpp similarity index 74% rename from third_party/upb/upb/mini_table.hpp rename to third_party/upb/upb/mini_table/encode_internal.hpp index 57de9e9e3e0..ae2bfc579c8 100644 --- a/third_party/upb/upb/mini_table.hpp +++ b/third_party/upb/upb/mini_table/encode_internal.hpp @@ -25,14 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_MINI_TABLE_HPP_ -#define UPB_MINI_TABLE_HPP_ - -#include +#ifndef UPB_MINI_TABLE_ENCODE_INTERNAL_HPP_ +#define UPB_MINI_TABLE_ENCODE_INTERNAL_HPP_ #include -#include "upb/mini_table.h" +#include "upb/base/log2.h" +#include "upb/mini_table/encode_internal.h" namespace upb { @@ -65,7 +64,10 @@ class MtDataEncoder { }); } - void StartEnum() { upb_MtDataEncoder_StartEnum(&encoder_); } + bool StartEnum() { + return appender_( + [=](char* buf) { return upb_MtDataEncoder_StartEnum(&encoder_, buf); }); + } bool PutEnumValue(uint32_t enum_value) { return appender_([=](char* buf) { @@ -78,6 +80,28 @@ class MtDataEncoder { [=](char* buf) { return upb_MtDataEncoder_EndEnum(&encoder_, buf); }); } + bool EncodeExtension(upb_FieldType type, uint32_t field_num, + uint64_t field_mod) { + return appender_([=](char* buf) { + return upb_MtDataEncoder_EncodeExtension(&encoder_, buf, type, field_num, + field_mod); + }); + } + + bool EncodeMap(upb_FieldType key_type, upb_FieldType val_type, + uint64_t key_mod, uint64_t val_mod) { + return appender_([=](char* buf) { + return upb_MtDataEncoder_EncodeMap(&encoder_, buf, key_type, val_type, + key_mod, val_mod); + }); + } + + bool EncodeMessageSet() { + return appender_([=](char* buf) { + return upb_MtDataEncoder_EncodeMessageSet(&encoder_, buf); + }); + } + const std::string& data() const { return appender_.data(); } private: @@ -91,7 +115,7 @@ class MtDataEncoder { if (!end) return false; // C++ does not guarantee that string has doubling growth behavior, but // we need it to avoid O(n^2). - str_.reserve(_upb_Log2CeilingSize(str_.size() + (end - buf_))); + str_.reserve(upb_Log2CeilingSize(str_.size() + (end - buf_))); str_.append(buf_, end - buf_); return true; } @@ -109,4 +133,4 @@ class MtDataEncoder { } // namespace upb -#endif /* UPB_MINI_TABLE_HPP_ */ +#endif /* UPB_MINI_TABLE_ENCODE_INTERNAL_HPP_ */ diff --git a/third_party/upb/upb/mini_table_test.cc b/third_party/upb/upb/mini_table/encode_test.cc similarity index 70% rename from third_party/upb/upb/mini_table_test.cc rename to third_party/upb/upb/mini_table/encode_test.cc index bb0d6d4ef5c..b53584fb9a5 100644 --- a/third_party/upb/upb/mini_table_test.cc +++ b/third_party/upb/upb/mini_table/encode_test.cc @@ -25,14 +25,21 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/mini_table.hpp" - -#include "absl/container/flat_hash_set.h" #include "gmock/gmock.h" -#include "google/protobuf/descriptor.h" #include "gtest/gtest.h" -#include "upb/msg_internal.h" +#include "absl/container/flat_hash_set.h" +#include "google/protobuf/descriptor.h" +#include "upb/message/internal.h" +#include "upb/mini_table/common_internal.h" +#include "upb/mini_table/decode.h" +#include "upb/mini_table/encode_internal.hpp" +#include "upb/mini_table/enum_internal.h" #include "upb/upb.hpp" +#include "upb/wire/decode.h" + +// begin:google_only +// #include "testing/fuzzing/fuzztest.h" +// end:google_only namespace protobuf = ::google::protobuf; @@ -42,7 +49,7 @@ TEST_P(MiniTableTest, Empty) { upb::Arena arena; upb::Status status; upb_MiniTable* table = - upb_MiniTable_Build(NULL, 0, GetParam(), arena.ptr(), status.ptr()); + _upb_MiniTable_Build(NULL, 0, GetParam(), arena.ptr(), status.ptr()); ASSERT_NE(nullptr, table); EXPECT_EQ(0, table->field_count); EXPECT_EQ(0, table->required_count); @@ -58,13 +65,13 @@ TEST_P(MiniTableTest, AllScalarTypes) { count++; } upb::Status status; - upb_MiniTable* table = upb_MiniTable_Build( + upb_MiniTable* table = _upb_MiniTable_Build( e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr()); ASSERT_NE(nullptr, table); EXPECT_EQ(count, table->field_count); absl::flat_hash_set offsets; for (int i = 0; i < 16; i++) { - const upb_MiniTable_Field* f = &table->fields[i]; + const upb_MiniTableField* f = &table->fields[i]; EXPECT_EQ(i + 1, f->number); EXPECT_EQ(kUpb_FieldMode_Scalar, f->mode & kUpb_FieldMode_Mask); EXPECT_TRUE(offsets.insert(f->offset).second); @@ -84,13 +91,13 @@ TEST_P(MiniTableTest, AllRepeatedTypes) { count++; } upb::Status status; - upb_MiniTable* table = upb_MiniTable_Build( + upb_MiniTable* table = _upb_MiniTable_Build( e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr()); ASSERT_NE(nullptr, table); EXPECT_EQ(count, table->field_count); absl::flat_hash_set offsets; for (int i = 0; i < 16; i++) { - const upb_MiniTable_Field* f = &table->fields[i]; + const upb_MiniTableField* f = &table->fields[i]; EXPECT_EQ(i + 1, f->number); EXPECT_EQ(kUpb_FieldMode_Array, f->mode & kUpb_FieldMode_Mask); EXPECT_TRUE(offsets.insert(f->offset).second); @@ -112,13 +119,13 @@ TEST_P(MiniTableTest, Skips) { count++; } upb::Status status; - upb_MiniTable* table = upb_MiniTable_Build( + upb_MiniTable* table = _upb_MiniTable_Build( e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr()); ASSERT_NE(nullptr, table); EXPECT_EQ(count, table->field_count); absl::flat_hash_set offsets; for (size_t i = 0; i < field_numbers.size(); i++) { - const upb_MiniTable_Field* f = &table->fields[i]; + const upb_MiniTableField* f = &table->fields[i]; EXPECT_EQ(field_numbers[i], f->number); EXPECT_EQ(kUpb_FieldType_Float, f->descriptortype); EXPECT_EQ(kUpb_FieldMode_Scalar, f->mode & kUpb_FieldMode_Mask); @@ -142,13 +149,13 @@ TEST_P(MiniTableTest, AllScalarTypesOneof) { ASSERT_TRUE(e.PutOneofField(i)); } upb::Status status; - upb_MiniTable* table = upb_MiniTable_Build( + upb_MiniTable* table = _upb_MiniTable_Build( e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr()); ASSERT_NE(nullptr, table) << status.error_message(); EXPECT_EQ(count, table->field_count); absl::flat_hash_set offsets; for (int i = 0; i < 16; i++) { - const upb_MiniTable_Field* f = &table->fields[i]; + const upb_MiniTableField* f = &table->fields[i]; EXPECT_EQ(i + 1, f->number); EXPECT_EQ(kUpb_FieldMode_Scalar, f->mode & kUpb_FieldMode_Mask); // For a oneof all fields have the same offset. @@ -163,19 +170,45 @@ TEST_P(MiniTableTest, AllScalarTypesOneof) { EXPECT_EQ(0, table->required_count); } +TEST_P(MiniTableTest, SizeOverflow) { + upb::Arena arena; + upb::MtDataEncoder e; + // upb can only handle messages up to UINT16_MAX. + size_t max_double_fields = UINT16_MAX / (sizeof(double) + 1); + + // A bit under max_double_fields is ok. + ASSERT_TRUE(e.StartMessage(0)); + for (size_t i = 1; i < max_double_fields; i++) { + ASSERT_TRUE(e.PutField(kUpb_FieldType_Double, i, 0)); + } + upb::Status status; + upb_MiniTable* table = _upb_MiniTable_Build( + e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr()); + ASSERT_NE(nullptr, table) << status.error_message(); + + // A bit over max_double_fields fails. + ASSERT_TRUE(e.StartMessage(0)); + for (size_t i = 1; i < max_double_fields + 2; i++) { + ASSERT_TRUE(e.PutField(kUpb_FieldType_Double, i, 0)); + } + upb_MiniTable* table2 = _upb_MiniTable_Build( + e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr()); + ASSERT_EQ(nullptr, table2) << status.error_message(); +} + INSTANTIATE_TEST_SUITE_P(Platforms, MiniTableTest, testing::Values(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit)); TEST(MiniTablePlatformIndependentTest, Base92Roundtrip) { for (char i = 0; i < 92; i++) { - EXPECT_EQ(i, upb_FromBase92(upb_ToBase92(i))); + EXPECT_EQ(i, _upb_FromBase92(_upb_ToBase92(i))); } } TEST(MiniTablePlatformIndependentTest, IsTypePackable) { for (int i = 1; i <= protobuf::FieldDescriptor::MAX_TYPE; i++) { - EXPECT_EQ(upb_IsTypePackable(static_cast(i)), + EXPECT_EQ(_upb_FieldType_IsPackable(static_cast(i)), protobuf::FieldDescriptor::IsTypePackable( static_cast(i))); } @@ -185,7 +218,7 @@ TEST(MiniTableEnumTest, Enum) { upb::Arena arena; upb::MtDataEncoder e; - e.StartEnum(); + ASSERT_TRUE(e.StartEnum()); absl::flat_hash_set values; for (int i = 0; i < 256; i++) { values.insert(i * 2); @@ -194,20 +227,36 @@ TEST(MiniTableEnumTest, Enum) { e.EndEnum(); upb::Status status; - upb_MiniTable_Enum* table = upb_MiniTable_BuildEnum( + upb_MiniTableEnum* table = upb_MiniTableEnum_Build( 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; + EXPECT_EQ(values.contains(i), upb_MiniTableEnum_CheckValue(table, i)) << i; } } +TEST_P(MiniTableTest, SubsInitializedToNull) { + upb::Arena arena; + upb::MtDataEncoder e; + // Create mini table with 2 message fields. + ASSERT_TRUE(e.StartMessage(0)); + ASSERT_TRUE(e.PutField(kUpb_FieldType_Message, 15, 0)); + ASSERT_TRUE(e.PutField(kUpb_FieldType_Message, 16, 0)); + 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(table->field_count, 2); + EXPECT_EQ(table->subs[0].submsg, nullptr); + EXPECT_EQ(table->subs[1].submsg, nullptr); +} + TEST(MiniTableEnumTest, PositiveAndNegative) { upb::Arena arena; upb::MtDataEncoder e; - e.StartEnum(); + ASSERT_TRUE(e.StartEnum()); absl::flat_hash_set values; for (int i = 0; i < 100; i++) { values.insert(i); @@ -220,12 +269,12 @@ TEST(MiniTableEnumTest, PositiveAndNegative) { e.EndEnum(); upb::Status status; - upb_MiniTable_Enum* table = upb_MiniTable_BuildEnum( + upb_MiniTableEnum* table = upb_MiniTableEnum_Build( 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; + EXPECT_EQ(values.contains(i), upb_MiniTableEnum_CheckValue(table, i)) << i; } } @@ -239,8 +288,26 @@ TEST_P(MiniTableTest, Extendible) { count++; } upb::Status status; - upb_MiniTable* table = upb_MiniTable_Build( + 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); } + +// begin:google_only +// +// static void BuildMiniTable(std::string_view s, bool is_32bit) { +// upb::Arena arena; +// upb::Status status; +// _upb_MiniTable_Build( +// s.data(), s.size(), +// is_32bit ? kUpb_MiniTablePlatform_32Bit : kUpb_MiniTablePlatform_64Bit, +// arena.ptr(), status.ptr()); +// } +// FUZZ_TEST(FuzzTest, BuildMiniTable); +// +// TEST(FuzzTest, BuildMiniTableRegression) { +// BuildMiniTable("g}{v~fq{\271", false); +// } +// +// end:google_only diff --git a/third_party/upb/upb/mini_table/enum_internal.h b/third_party/upb/upb/mini_table/enum_internal.h new file mode 100644 index 00000000000..f86a06bd012 --- /dev/null +++ b/third_party/upb/upb/mini_table/enum_internal.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_ENUM_INTERNAL_H_ +#define UPB_MINI_TABLE_ENUM_INTERNAL_H_ + +#include "upb/mini_table/types.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MiniTableEnum { + uint32_t mask_limit; // Limit enum value that can be tested with mask. + uint32_t value_count; // Number of values after the bitfield. + uint32_t data[]; // Bitmask + enumerated values follow. +}; + +typedef enum { + _kUpb_FastEnumCheck_ValueIsInEnum = 0, + _kUpb_FastEnumCheck_ValueIsNotInEnum = 1, + _kUpb_FastEnumCheck_CannotCheckFast = 2, +} _kUpb_FastEnumCheck_Status; + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE _kUpb_FastEnumCheck_Status +_upb_MiniTable_CheckEnumValueFast(const upb_MiniTableEnum* e, uint32_t val) { + if (UPB_UNLIKELY(val >= 64)) return _kUpb_FastEnumCheck_CannotCheckFast; + uint64_t mask = e->data[0] | ((uint64_t)e->data[1] << 32); + return (mask & (1ULL << val)) ? _kUpb_FastEnumCheck_ValueIsInEnum + : _kUpb_FastEnumCheck_ValueIsNotInEnum; +} + +UPB_INLINE bool _upb_MiniTable_CheckEnumValueSlow(const upb_MiniTableEnum* e, + uint32_t val) { + if (val < e->mask_limit) return e->data[val / 32] & (1ULL << (val % 32)); + // OPT: binary search long lists? + const uint32_t* start = &e->data[e->mask_limit / 32]; + const uint32_t* limit = &e->data[(e->mask_limit / 32) + e->value_count]; + for (const uint32_t* p = start; p < limit; p++) { + if (*p == val) return true; + } + return false; +} + +// Validates enum value against range defined by enum mini table. +UPB_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e, + uint32_t val) { + _kUpb_FastEnumCheck_Status status = _upb_MiniTable_CheckEnumValueFast(e, val); + if (UPB_UNLIKELY(status == _kUpb_FastEnumCheck_CannotCheckFast)) { + return _upb_MiniTable_CheckEnumValueSlow(e, val); + } + return status == _kUpb_FastEnumCheck_ValueIsInEnum ? true : false; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_ENUM_INTERNAL_H_ */ diff --git a/third_party/upb/upb/mini_table/extension_internal.h b/third_party/upb/upb/mini_table/extension_internal.h new file mode 100644 index 00000000000..2a29ff505e5 --- /dev/null +++ b/third_party/upb/upb/mini_table/extension_internal.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_EXTENSION_INTERNAL_H_ +#define UPB_MINI_TABLE_EXTENSION_INTERNAL_H_ + +#include "upb/mini_table/field_internal.h" +#include "upb/mini_table/sub_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MiniTableExtension { + // Do not move this field. We need to be able to alias pointers. + upb_MiniTableField field; + + const upb_MiniTable* extendee; + upb_MiniTableSub sub; // NULL unless submessage or proto2 enum +}; + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_EXTENSION_INTERNAL_H_ */ diff --git a/third_party/upb/upb/extension_registry.c b/third_party/upb/upb/mini_table/extension_registry.c similarity index 75% rename from third_party/upb/upb/extension_registry.c rename to third_party/upb/upb/mini_table/extension_registry.c index 921cf227dde..de8e05ed7a3 100644 --- a/third_party/upb/upb/extension_registry.c +++ b/third_party/upb/upb/mini_table/extension_registry.c @@ -25,22 +25,21 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/extension_registry.h" +#include "upb/mini_table/extension_registry.h" -#include "upb/internal/table.h" -#include "upb/msg.h" -#include "upb/msg_internal.h" +#include "upb/hash/str_table.h" +#include "upb/mini_table/extension_internal.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" + +#define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t)) struct upb_ExtensionRegistry { upb_Arena* arena; - upb_strtable exts; /* Key is upb_MiniTable* concatenated with fieldnum. */ + 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)); @@ -54,14 +53,19 @@ upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena) { return r; } -bool _upb_extreg_add(upb_ExtensionRegistry* r, - const upb_MiniTable_Extension** e, size_t count) { +bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r, + const upb_MiniTableExtension** e, + size_t count) { char buf[EXTREG_KEY_SIZE]; - const upb_MiniTable_Extension** start = e; - const upb_MiniTable_Extension** end = UPB_PTRADD(e, count); + const upb_MiniTableExtension** start = e; + const upb_MiniTableExtension** end = UPB_PTRADD(e, count); for (; e < end; e++) { - const upb_MiniTable_Extension* ext = *e; + const upb_MiniTableExtension* ext = *e; extreg_key(buf, ext->extendee, ext->field.number); + upb_value v; + if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) { + goto failure; + } if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE, upb_value_constptr(ext), r->arena)) { goto failure; @@ -70,21 +74,20 @@ bool _upb_extreg_add(upb_ExtensionRegistry* r, return true; failure: - /* Back out the entries previously added. */ + // Back out the entries previously added. for (end = e, e = start; e < end; e++) { - const upb_MiniTable_Extension* ext = *e; + const upb_MiniTableExtension* 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) { +const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup( + const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num) { char buf[EXTREG_KEY_SIZE]; upb_value v; - extreg_key(buf, l, num); + extreg_key(buf, t, num); if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) { return upb_value_getconstptr(v); } else { diff --git a/third_party/upb/upb/mini_table/extension_registry.h b/third_party/upb/upb/mini_table/extension_registry.h new file mode 100644 index 00000000000..fb7ba053c29 --- /dev/null +++ b/third_party/upb/upb/mini_table/extension_registry.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ +#define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ + +#include "upb/mem/arena.h" +#include "upb/mini_table/types.h" + +// Must be last. +#include "upb/port/def.inc" + +#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. + */ + +typedef struct upb_ExtensionRegistry upb_ExtensionRegistry; + +// Creates a upb_ExtensionRegistry in the given arena. +// The arena must outlive any use of the extreg. +UPB_API upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena); + +// Adds the given extension info for the array |e| of size |count| into the +// registry. If there are any errors, the entire array is backed out. +// The extensions must outlive the registry. +// Possible errors include OOM or an extension number that already exists. +// TODO: There is currently no way to determine the exact reason for failure. +bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r, + const upb_MiniTableExtension** e, + size_t count); + +// Looks up the extension (if any) defined for message type |t| and field +// number |num|. Returns the extension if found, otherwise NULL. +const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup( + const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */ diff --git a/third_party/upb/upb/mini_table/field_internal.h b/third_party/upb/upb/mini_table/field_internal.h new file mode 100644 index 00000000000..e2b8f6bcc2f --- /dev/null +++ b/third_party/upb/upb/mini_table/field_internal.h @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_FIELD_INTERNAL_H_ +#define UPB_MINI_TABLE_FIELD_INTERNAL_H_ + +#include "upb/base/descriptor_constants.h" +#include "upb/mini_table/types.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MiniTableField { + uint32_t number; + uint16_t offset; + int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index + uint16_t submsg_index; // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM + uint8_t descriptortype; + + // upb_FieldMode | upb_LabelFlags | (upb_FieldRep << kUpb_FieldRep_Shift) + uint8_t mode; +}; + +#define kUpb_NoSub ((uint16_t)-1) + +typedef enum { + kUpb_FieldMode_Map = 0, + kUpb_FieldMode_Array = 1, + kUpb_FieldMode_Scalar = 2, +} upb_FieldMode; + +// Mask to isolate the upb_FieldMode from field.mode. +#define kUpb_FieldMode_Mask 3 + +// Extra flags on the mode field. +typedef enum { + kUpb_LabelFlags_IsPacked = 4, + kUpb_LabelFlags_IsExtension = 8, + // Indicates that this descriptor type is an "alternate type": + // - for Int32, this indicates that the actual type is Enum (but was + // rewritten to Int32 because it is an open enum that requires no check). + // - for Bytes, this indicates that the actual type is String (but does + // not require any UTF-8 check). + kUpb_LabelFlags_IsAlternate = 16, +} upb_LabelFlags; + +// Note: we sort by this number when calculating layout order. +typedef enum { + kUpb_FieldRep_1Byte = 0, + kUpb_FieldRep_4Byte = 1, + kUpb_FieldRep_StringView = 2, + kUpb_FieldRep_8Byte = 3, + + kUpb_FieldRep_NativePointer = + UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte), + kUpb_FieldRep_Max = kUpb_FieldRep_8Byte, +} upb_FieldRep; + +#define kUpb_FieldRep_Shift 6 + +UPB_INLINE upb_FieldRep +_upb_MiniTableField_GetRep(const upb_MiniTableField* field) { + return (upb_FieldRep)(field->mode >> kUpb_FieldRep_Shift); +} + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE upb_FieldMode upb_FieldMode_Get(const upb_MiniTableField* field) { + return (upb_FieldMode)(field->mode & 3); +} + +UPB_INLINE void _upb_MiniTableField_CheckIsArray( + const upb_MiniTableField* field) { + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_NativePointer); + UPB_ASSUME(upb_FieldMode_Get(field) == kUpb_FieldMode_Array); + UPB_ASSUME(field->presence == 0); +} + +UPB_INLINE void _upb_MiniTableField_CheckIsMap( + const upb_MiniTableField* field) { + UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_NativePointer); + UPB_ASSUME(upb_FieldMode_Get(field) == kUpb_FieldMode_Map); + UPB_ASSUME(field->presence == 0); +} + +UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTableField* field) { + // This works because upb_FieldMode has no value 3. + return !(field->mode & kUpb_FieldMode_Scalar); +} + +UPB_INLINE bool upb_IsSubMessage(const upb_MiniTableField* field) { + return field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group; +} + +// LINT.IfChange(presence_logic) + +// Hasbit access /////////////////////////////////////////////////////////////// + +UPB_INLINE size_t _upb_hasbit_ofs(size_t idx) { return idx / 8; } + +UPB_INLINE char _upb_hasbit_mask(size_t idx) { return 1 << (idx % 8); } + +UPB_INLINE bool _upb_hasbit(const upb_Message* msg, size_t idx) { + return (*UPB_PTR_AT(msg, _upb_hasbit_ofs(idx), const char) & + _upb_hasbit_mask(idx)) != 0; +} + +UPB_INLINE void _upb_sethas(const upb_Message* msg, size_t idx) { + (*UPB_PTR_AT(msg, _upb_hasbit_ofs(idx), char)) |= _upb_hasbit_mask(idx); +} + +UPB_INLINE void _upb_clearhas(const upb_Message* msg, size_t idx) { + (*UPB_PTR_AT(msg, _upb_hasbit_ofs(idx), char)) &= ~_upb_hasbit_mask(idx); +} + +UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTableField* f) { + UPB_ASSERT(f->presence > 0); + return f->presence; +} + +UPB_INLINE bool _upb_hasbit_field(const upb_Message* msg, + const upb_MiniTableField* f) { + return _upb_hasbit(msg, _upb_Message_Hasidx(f)); +} + +UPB_INLINE void _upb_sethas_field(const upb_Message* msg, + const upb_MiniTableField* f) { + _upb_sethas(msg, _upb_Message_Hasidx(f)); +} + +// Oneof case access /////////////////////////////////////////////////////////// + +UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTableField* f) { + UPB_ASSERT(f->presence < 0); + return ~(ptrdiff_t)f->presence; +} + +UPB_INLINE uint32_t* _upb_oneofcase_field(upb_Message* msg, + const upb_MiniTableField* f) { + return UPB_PTR_AT(msg, _upb_oneofcase_ofs(f), uint32_t); +} + +UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message* msg, + const upb_MiniTableField* f) { + return *_upb_oneofcase_field((upb_Message*)msg, f); +} + +// LINT.ThenChange(GoogleInternalName2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_FIELD_INTERNAL_H_ */ diff --git a/third_party/upb/upb/mini_table/file_internal.h b/third_party/upb/upb/mini_table/file_internal.h new file mode 100644 index 00000000000..b102bdfca2e --- /dev/null +++ b/third_party/upb/upb/mini_table/file_internal.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_FILE_INTERNAL_H_ +#define UPB_MINI_TABLE_FILE_INTERNAL_H_ + +#include "upb/mini_table/types.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MiniTableFile { + const upb_MiniTable** msgs; + const upb_MiniTableEnum** enums; + const upb_MiniTableExtension** exts; + int msg_count; + int enum_count; + int ext_count; +}; + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_FILE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/mini_table/message_internal.h b/third_party/upb/upb/mini_table/message_internal.h new file mode 100644 index 00000000000..586e5fc807a --- /dev/null +++ b/third_party/upb/upb/mini_table/message_internal.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ +#define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ + +#include "upb/base/string_view.h" +#include "upb/hash/common.h" +#include "upb/mini_table/types.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_Decoder; +typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr, + upb_Message* msg, intptr_t table, + uint64_t hasbits, uint64_t data); +typedef struct { + uint64_t field_data; + _upb_FieldParser* field_parser; +} _upb_FastTable_Entry; + +typedef enum { + kUpb_ExtMode_NonExtendable = 0, // Non-extendable message. + kUpb_ExtMode_Extendable = 1, // Normal extendable message. + kUpb_ExtMode_IsMessageSet = 2, // MessageSet message. + kUpb_ExtMode_IsMessageSet_ITEM = + 3, // MessageSet item (temporary only, see decode.c) + + // During table building we steal a bit to indicate that the message is a map + // entry. *Only* used during table building! + kUpb_ExtMode_IsMapEntry = 4, +} upb_ExtMode; + +// upb_MiniTable represents the memory layout of a given upb_MessageDef. +// The members are public so generated code can initialize them, +// but users MUST NOT directly read or write any of its members. +struct upb_MiniTable { + const upb_MiniTableSub* subs; + const upb_MiniTableField* fields; + + // Must be aligned to sizeof(void*). Doesn't include internal members like + // unknown fields, extension dict, pointer to msglayout, etc. + uint16_t size; + + uint16_t field_count; + uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1 + uint8_t dense_below; + uint8_t table_mask; + uint8_t required_count; // Required fields have the lowest hasbits. + + // To statically initialize the tables of variable length, we need a flexible + // array member, and we need to compile in gnu99 mode (constant initialization + // of flexible array members is a GNU extension, not in C99 unfortunately. + _upb_FastTable_Entry fasttable[]; +}; + +// Map entries aren't actually stored for map fields, they are only used during +// parsing. For parsing, it helps a lot if all map entry messages have the same +// layout. The layout code in mini_table/decode.c will ensure that all map +// entries have this layout. +// +// Note that users can and do create map entries directly, which will also use +// this layout. +// +// NOTE: sync with mini_table/decode.c. +typedef struct { + // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here, + // and the uint64_t helps make this clear. + uint64_t hasbits; + union { + upb_StringView str; // For str/bytes. + upb_value val; // For all other types. + } k; + union { + upb_StringView str; // For str/bytes. + upb_value val; // For all other types. + } v; +} upb_MapEntryData; + +typedef struct { + void* internal_data; + upb_MapEntryData data; +} upb_MapEntry; + +#ifdef __cplusplus +extern "C" { +#endif + +// Computes a bitmask in which the |l->required_count| lowest bits are set, +// except that we skip the lowest bit (because upb never uses hasbit 0). +// +// Sample output: +// requiredmask(1) => 0b10 (0x2) +// requiredmask(5) => 0b111110 (0x3e) +UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) { + int n = l->required_count; + assert(0 < n && n <= 63); + return ((1ULL << n) - 1) << 1; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/table_internal.h b/third_party/upb/upb/mini_table/sub_internal.h similarity index 86% rename from third_party/upb/upb/table_internal.h rename to third_party/upb/upb/mini_table/sub_internal.h index 7ac8bf78f9c..981a286d22d 100644 --- a/third_party/upb/upb/table_internal.h +++ b/third_party/upb/upb/mini_table/sub_internal.h @@ -25,12 +25,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_TABLE_H_ -#define UPB_TABLE_H_ +#ifndef UPB_MINI_TABLE_SUB_INTERNAL_H_ +#define UPB_MINI_TABLE_SUB_INTERNAL_H_ -// TODO(b/232091617): Delete this entire header which currently exists only for -// temporary backwards compatibility. +#include "upb/mini_table/types.h" -#include "upb/internal/table.h" +union upb_MiniTableSub { + const upb_MiniTable* submsg; + const upb_MiniTableEnum* subenum; +}; -#endif /* UPB_TABLE_H_ */ +#endif /* UPB_MINI_TABLE_SUB_INTERNAL_H_ */ diff --git a/third_party/upb/upb/mini_table/types.h b/third_party/upb/upb/mini_table/types.h new file mode 100644 index 00000000000..8f0a9c4382b --- /dev/null +++ b/third_party/upb/upb/mini_table/types.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_MINI_TABLE_TYPES_H_ +#define UPB_MINI_TABLE_TYPES_H_ + +typedef void upb_Message; + +typedef struct upb_MiniTable upb_MiniTable; +typedef struct upb_MiniTableEnum upb_MiniTableEnum; +typedef struct upb_MiniTableExtension upb_MiniTableExtension; +typedef struct upb_MiniTableField upb_MiniTableField; +typedef struct upb_MiniTableFile upb_MiniTableFile; +typedef union upb_MiniTableSub upb_MiniTableSub; + +#endif /* UPB_MINI_TABLE_TYPES_H_ */ diff --git a/third_party/upb/upb/mini_table_accessors.c b/third_party/upb/upb/mini_table_accessors.c deleted file mode 100644 index b04a7cf116a..00000000000 --- a/third_party/upb/upb/mini_table_accessors.c +++ /dev/null @@ -1,397 +0,0 @@ -/* - * 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 deleted file mode 100644 index 750f66f2074..00000000000 --- a/third_party/upb/upb/mini_table_accessors.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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_test.cc b/third_party/upb/upb/mini_table_accessors_test.cc deleted file mode 100644 index 16274476ad9..00000000000 --- a/third_party/upb/upb/mini_table_accessors_test.cc +++ /dev/null @@ -1,444 +0,0 @@ -/* - * 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/msg.c b/third_party/upb/upb/msg.c deleted file mode 100644 index 036c62199d3..00000000000 --- a/third_party/upb/upb/msg.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (c) 2009-2021, Google LLC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Google LLC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "upb/msg.h" - -#include "upb/internal/table.h" -#include "upb/msg_internal.h" -#include "upb/port_def.inc" - -/** upb_Message ***************************************************************/ - -static const size_t overhead = sizeof(upb_Message_InternalData); - -static const upb_Message_Internal* upb_Message_Getinternal_const( - const upb_Message* msg) { - ptrdiff_t size = sizeof(upb_Message_Internal); - return (upb_Message_Internal*)((char*)msg - size); -} - -upb_Message* _upb_Message_New(const upb_MiniTable* l, upb_Arena* a) { - return _upb_Message_New_inl(l, a); -} - -void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l) { - void* mem = UPB_PTR_AT(msg, -sizeof(upb_Message_Internal), char); - memset(mem, 0, upb_msg_sizeof(l)); -} - -static bool realloc_internal(upb_Message* msg, size_t need, upb_Arena* arena) { - upb_Message_Internal* in = upb_Message_Getinternal(msg); - if (!in->internal) { - /* No internal data, allocate from scratch. */ - size_t size = UPB_MAX(128, _upb_Log2CeilingSize(need + overhead)); - upb_Message_InternalData* internal = upb_Arena_Malloc(arena, size); - if (!internal) return false; - internal->size = size; - internal->unknown_end = overhead; - internal->ext_begin = size; - in->internal = internal; - } else if (in->internal->ext_begin - in->internal->unknown_end < need) { - /* Internal data is too small, reallocate. */ - size_t new_size = _upb_Log2CeilingSize(in->internal->size + need); - size_t ext_bytes = in->internal->size - in->internal->ext_begin; - size_t new_ext_begin = new_size - ext_bytes; - upb_Message_InternalData* internal = - upb_Arena_Realloc(arena, in->internal, in->internal->size, new_size); - if (!internal) return false; - if (ext_bytes) { - /* Need to move extension data to the end. */ - char* ptr = (char*)internal; - memmove(ptr + new_ext_begin, ptr + internal->ext_begin, ext_bytes); - } - internal->ext_begin = new_ext_begin; - internal->size = new_size; - in->internal = internal; - } - UPB_ASSERT(in->internal->ext_begin - in->internal->unknown_end >= need); - return true; -} - -bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, - upb_Arena* arena) { - if (!realloc_internal(msg, len, arena)) return false; - upb_Message_Internal* in = upb_Message_Getinternal(msg); - memcpy(UPB_PTR_AT(in->internal, in->internal->unknown_end, char), data, len); - in->internal->unknown_end += len; - return true; -} - -void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) { - upb_Message_Internal* in = upb_Message_Getinternal(msg); - if (in->internal) { - in->internal->unknown_end = overhead; - } -} - -const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) { - const upb_Message_Internal* in = upb_Message_Getinternal_const(msg); - if (in->internal) { - *len = in->internal->unknown_end - overhead; - return (char*)(in->internal + 1); - } else { - *len = 0; - return NULL; - } -} - -const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg, - size_t* count) { - const upb_Message_Internal* in = upb_Message_Getinternal_const(msg); - if (in->internal) { - *count = (in->internal->size - in->internal->ext_begin) / - sizeof(upb_Message_Extension); - return UPB_PTR_AT(in->internal, in->internal->ext_begin, void); - } else { - *count = 0; - return NULL; - } -} - -const upb_Message_Extension* _upb_Message_Getext( - const upb_Message* msg, const upb_MiniTable_Extension* e) { - size_t n; - const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &n); - - /* For now we use linear search exclusively to find extensions. If this - * becomes an issue due to messages with lots of extensions, we can introduce - * a table of some sort. */ - for (size_t i = 0; i < n; i++) { - if (ext[i].ext == e) { - return &ext[i]; - } - } - - return NULL; -} - -void _upb_Message_Clearext(upb_Message* msg, - const upb_MiniTable_Extension* ext_l) { - upb_Message_Internal* in = upb_Message_Getinternal(msg); - if (!in->internal) return; - const upb_Message_Extension* base = - UPB_PTR_AT(in->internal, in->internal->ext_begin, void); - upb_Message_Extension* ext = - (upb_Message_Extension*)_upb_Message_Getext(msg, ext_l); - if (ext) { - *ext = *base; - in->internal->ext_begin += sizeof(upb_Message_Extension); - } -} - -upb_Message_Extension* _upb_Message_GetOrCreateExtension( - upb_Message* msg, const upb_MiniTable_Extension* e, upb_Arena* arena) { - upb_Message_Extension* ext = - (upb_Message_Extension*)_upb_Message_Getext(msg, e); - if (ext) return ext; - if (!realloc_internal(msg, sizeof(upb_Message_Extension), arena)) return NULL; - upb_Message_Internal* in = upb_Message_Getinternal(msg); - in->internal->ext_begin -= sizeof(upb_Message_Extension); - ext = UPB_PTR_AT(in->internal, in->internal->ext_begin, void); - memset(ext, 0, sizeof(upb_Message_Extension)); - ext->ext = e; - return ext; -} - -size_t upb_Message_ExtensionCount(const upb_Message* msg) { - size_t count; - _upb_Message_Getexts(msg, &count); - return count; -} - -/** upb_Array *****************************************************************/ - -bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena) { - size_t new_size = UPB_MAX(arr->size, 4); - int elem_size_lg2 = arr->data & 7; - size_t old_bytes = arr->size << elem_size_lg2; - size_t new_bytes; - void* ptr = _upb_array_ptr(arr); - - /* Log2 ceiling of size. */ - while (new_size < min_size) new_size *= 2; - - new_bytes = new_size << elem_size_lg2; - ptr = upb_Arena_Realloc(arena, ptr, old_bytes, new_bytes); - - if (!ptr) { - return false; - } - - arr->data = _upb_tag_arrptr(ptr, elem_size_lg2); - arr->size = new_size; - return true; -} - -static upb_Array* getorcreate_array(upb_Array** arr_ptr, int elem_size_lg2, - upb_Arena* arena) { - upb_Array* arr = *arr_ptr; - if (!arr) { - arr = _upb_Array_New(arena, 4, elem_size_lg2); - if (!arr) return NULL; - *arr_ptr = arr; - } - return arr; -} - -void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size, - int elem_size_lg2, upb_Arena* arena) { - upb_Array* arr = getorcreate_array(arr_ptr, elem_size_lg2, arena); - return arr && _upb_Array_Resize(arr, size, arena) ? _upb_array_ptr(arr) - : NULL; -} - -bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value, - int elem_size_lg2, upb_Arena* arena) { - upb_Array* arr = getorcreate_array(arr_ptr, elem_size_lg2, arena); - if (!arr) return false; - - size_t elems = arr->len; - - if (!_upb_Array_Resize(arr, elems + 1, arena)) { - return false; - } - - char* data = _upb_array_ptr(arr); - memcpy(data + (elems << elem_size_lg2), value, 1 << elem_size_lg2); - return true; -} - -/** upb_Map *******************************************************************/ - -upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size) { - upb_Map* map = upb_Arena_Malloc(a, sizeof(upb_Map)); - - if (!map) { - return NULL; - } - - upb_strtable_init(&map->table, 4, a); - map->key_size = key_size; - map->val_size = value_size; - - return map; -} - -static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key, - void* b_key, size_t size) { - const upb_tabent* const* a = _a; - const upb_tabent* const* b = _b; - upb_StringView a_tabkey = upb_tabstrview((*a)->key); - upb_StringView b_tabkey = upb_tabstrview((*b)->key); - _upb_map_fromkey(a_tabkey, a_key, size); - _upb_map_fromkey(b_tabkey, b_key, size); -} - -#define UPB_COMPARE_INTEGERS(a, b) ((a) < (b) ? -1 : ((a) == (b) ? 0 : 1)) - -static int _upb_mapsorter_cmpi64(const void* _a, const void* _b) { - int64_t a, b; - _upb_mapsorter_getkeys(_a, _b, &a, &b, 8); - return UPB_COMPARE_INTEGERS(a, b); -} - -static int _upb_mapsorter_cmpu64(const void* _a, const void* _b) { - uint64_t a, b; - _upb_mapsorter_getkeys(_a, _b, &a, &b, 8); - return UPB_COMPARE_INTEGERS(a, b); -} - -static int _upb_mapsorter_cmpi32(const void* _a, const void* _b) { - int32_t a, b; - _upb_mapsorter_getkeys(_a, _b, &a, &b, 4); - return UPB_COMPARE_INTEGERS(a, b); -} - -static int _upb_mapsorter_cmpu32(const void* _a, const void* _b) { - uint32_t a, b; - _upb_mapsorter_getkeys(_a, _b, &a, &b, 4); - return UPB_COMPARE_INTEGERS(a, b); -} - -static int _upb_mapsorter_cmpbool(const void* _a, const void* _b) { - bool a, b; - _upb_mapsorter_getkeys(_a, _b, &a, &b, 1); - return UPB_COMPARE_INTEGERS(a, b); -} - -static int _upb_mapsorter_cmpstr(const void* _a, const void* _b) { - upb_StringView a, b; - _upb_mapsorter_getkeys(_a, _b, &a, &b, UPB_MAPTYPE_STRING); - size_t common_size = UPB_MIN(a.size, b.size); - int cmp = memcmp(a.data, b.data, common_size); - if (cmp) return -cmp; - return UPB_COMPARE_INTEGERS(a.size, b.size); -} - -#undef UPB_COMPARE_INTEGERS - -bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, - const upb_Map* map, _upb_sortedmap* sorted) { - int map_size = _upb_Map_Size(map); - sorted->start = s->size; - sorted->pos = sorted->start; - sorted->end = sorted->start + map_size; - - /* Grow s->entries if necessary. */ - if (sorted->end > s->cap) { - s->cap = _upb_Log2CeilingSize(sorted->end); - s->entries = realloc(s->entries, s->cap * sizeof(*s->entries)); - if (!s->entries) return false; - } - - s->size = sorted->end; - - /* Copy non-empty entries from the table to s->entries. */ - upb_tabent const** dst = &s->entries[sorted->start]; - const upb_tabent* src = map->table.t.entries; - const upb_tabent* end = src + upb_table_size(&map->table.t); - for (; src < end; src++) { - if (!upb_tabent_isempty(src)) { - *dst = src; - dst++; - } - } - UPB_ASSERT(dst == &s->entries[sorted->end]); - - /* Sort entries according to the key type. */ - - int (*compar)(const void*, const void*); - - switch (key_type) { - case kUpb_FieldType_Int64: - case kUpb_FieldType_SFixed64: - case kUpb_FieldType_SInt64: - compar = _upb_mapsorter_cmpi64; - break; - case kUpb_FieldType_UInt64: - case kUpb_FieldType_Fixed64: - compar = _upb_mapsorter_cmpu64; - break; - case kUpb_FieldType_Int32: - case kUpb_FieldType_SInt32: - case kUpb_FieldType_SFixed32: - case kUpb_FieldType_Enum: - compar = _upb_mapsorter_cmpi32; - break; - case kUpb_FieldType_UInt32: - case kUpb_FieldType_Fixed32: - compar = _upb_mapsorter_cmpu32; - break; - case kUpb_FieldType_Bool: - compar = _upb_mapsorter_cmpbool; - break; - case kUpb_FieldType_String: - case kUpb_FieldType_Bytes: - compar = _upb_mapsorter_cmpstr; - break; - default: - UPB_UNREACHABLE(); - } - - qsort(&s->entries[sorted->start], map_size, sizeof(*s->entries), compar); - return true; -} diff --git a/third_party/upb/upb/msg.h b/third_party/upb/upb/msg.h index 5c1e8e89317..5443a79e56e 100644 --- a/third_party/upb/upb/msg.h +++ b/third_party/upb/upb/msg.h @@ -25,47 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * Public APIs for message operations that do not require descriptors. - * These functions can be used even in build that does not want to depend on - * reflection or descriptors. - * - * Descriptor-based reflection functionality lives in reflection.h. - */ +// This header is deprecated, use upb/message/message.h instead +// IWYU pragma: private, include "upb/message/message.h" #ifndef UPB_MSG_H_ #define UPB_MSG_H_ -#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 - -typedef void upb_Message; - -/* For users these are opaque. They can be obtained from - * upb_MessageDef_MiniTable() but users cannot access any of the members. */ -struct upb_MiniTable; -typedef struct upb_MiniTable upb_MiniTable; - -/* Adds unknown data (serialized protobuf data) to the given message. The data - * is copied into the message instance. */ -void upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, - upb_Arena* arena); - -/* Returns a reference to the message's unknown data. */ -const char* upb_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); - -#ifdef __cplusplus -} /* extern "C" */ -#endif +#include "upb/message/message.h" #endif /* UPB_MSG_INT_H_ */ diff --git a/third_party/upb/upb/msg_internal.h b/third_party/upb/upb/msg_internal.h index 4f5c4797c5d..2cfdae87a3d 100644 --- a/third_party/upb/upb/msg_internal.h +++ b/third_party/upb/upb/msg_internal.h @@ -25,813 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* -** Our memory representation for parsing tables and messages themselves. -** Functions in this file are used by generated code and possibly reflection. -** -** The definitions in this file are internal to upb. -**/ +// This header is deprecated, use upb/message/internal.h instead +// IWYU pragma: private, include "upb/message/internal.h" #ifndef UPB_MSG_INT_H_ #define UPB_MSG_INT_H_ -#include -#include -#include - -#include "upb/extension_registry.h" -#include "upb/internal/table.h" -#include "upb/msg.h" -#include "upb/upb.h" - -/* Must be last. */ -#include "upb/port_def.inc" - -#ifdef __cplusplus -extern "C" { -#endif - -/** upb_*Int* conversion routines ********************************************/ - -UPB_INLINE int32_t _upb_Int32_FromI(int v) { return (int32_t)v; } - -UPB_INLINE int64_t _upb_Int64_FromLL(long long v) { return (int64_t)v; } - -UPB_INLINE uint32_t _upb_UInt32_FromU(unsigned v) { return (uint32_t)v; } - -UPB_INLINE uint64_t _upb_UInt64_FromULL(unsigned long long v) { - return (uint64_t)v; -} - -/** upb_MiniTable *************************************************************/ - -/* upb_MiniTable represents the memory layout of a given upb_MessageDef. The - * members are public so generated code can initialize them, but users MUST NOT - * read or write any of its members. */ - -typedef struct { - uint32_t number; - uint16_t offset; - int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index - uint16_t submsg_index; // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM - uint8_t descriptortype; - uint8_t mode; /* upb_FieldMode | upb_LabelFlags | - (upb_FieldRep << kUpb_FieldRep_Shift) */ -} upb_MiniTable_Field; - -#define kUpb_NoSub ((uint16_t)-1) - -typedef enum { - kUpb_FieldMode_Map = 0, - kUpb_FieldMode_Array = 1, - kUpb_FieldMode_Scalar = 2, -} upb_FieldMode; - -// Mask to isolate the upb_FieldMode from field.mode. -#define kUpb_FieldMode_Mask 3 - -/* Extra flags on the mode field. */ -typedef enum { - kUpb_LabelFlags_IsPacked = 4, - kUpb_LabelFlags_IsExtension = 8, -} upb_LabelFlags; - -// Note: we sort by this number when calculating layout order. -typedef enum { - kUpb_FieldRep_1Byte = 0, - kUpb_FieldRep_4Byte = 1, - kUpb_FieldRep_StringView = 2, - kUpb_FieldRep_Pointer = 3, - kUpb_FieldRep_8Byte = 4, - - kUpb_FieldRep_Shift = 5, // Bit offset of the rep in upb_MiniTable_Field.mode - kUpb_FieldRep_Max = kUpb_FieldRep_8Byte, -} upb_FieldRep; - -UPB_INLINE upb_FieldMode upb_FieldMode_Get(const upb_MiniTable_Field* field) { - return (upb_FieldMode)(field->mode & 3); -} - -UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTable_Field* field) { - /* This works because upb_FieldMode has no value 3. */ - return !(field->mode & kUpb_FieldMode_Scalar); -} - -UPB_INLINE bool upb_IsSubMessage(const upb_MiniTable_Field* field) { - return field->descriptortype == kUpb_FieldType_Message || - field->descriptortype == kUpb_FieldType_Group; -} - -struct upb_Decoder; -struct upb_MiniTable; - -typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr, - upb_Message* msg, intptr_t table, - uint64_t hasbits, uint64_t data); - -typedef struct { - uint64_t field_data; - _upb_FieldParser* field_parser; -} _upb_FastTable_Entry; - -typedef struct { - const int32_t* values; // List of values <0 or >63 - uint64_t mask; // Bits are set for acceptable value 0 <= x < 64 - int value_count; -} upb_MiniTable_Enum; - -typedef union { - const struct upb_MiniTable* submsg; - const upb_MiniTable_Enum* subenum; -} upb_MiniTable_Sub; - -typedef enum { - kUpb_ExtMode_NonExtendable = 0, // Non-extendable message. - kUpb_ExtMode_Extendable = 1, // Normal extendable message. - kUpb_ExtMode_IsMessageSet = 2, // MessageSet message. - kUpb_ExtMode_IsMessageSet_ITEM = - 3, // MessageSet item (temporary only, see decode.c) - - // During table building we steal a bit to indicate that the message is a map - // entry. *Only* used during table building! - kUpb_ExtMode_IsMapEntry = 4, -} upb_ExtMode; - -/* MessageSet wire format is: - * message MessageSet { - * repeated group Item = 1 { - * required int32 type_id = 2; - * required bytes message = 3; - * } - * } - */ -typedef enum { - _UPB_MSGSET_ITEM = 1, - _UPB_MSGSET_TYPEID = 2, - _UPB_MSGSET_MESSAGE = 3, -} upb_msgext_fieldnum; - -struct upb_MiniTable { - const upb_MiniTable_Sub* subs; - const upb_MiniTable_Field* fields; - /* Must be aligned to sizeof(void*). Doesn't include internal members like - * unknown fields, extension dict, pointer to msglayout, etc. */ - uint16_t size; - uint16_t field_count; - uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1 - uint8_t dense_below; - uint8_t table_mask; - uint8_t required_count; // Required fields have the lowest hasbits. - /* To statically initialize the tables of variable length, we need a flexible - * array member, and we need to compile in gnu99 mode (constant initialization - * of flexible array members is a GNU extension, not in C99 unfortunately. */ - _upb_FastTable_Entry fasttable[]; -}; - -typedef struct { - upb_MiniTable_Field field; - const upb_MiniTable* extendee; - upb_MiniTable_Sub sub; /* NULL unless submessage or proto2 enum */ -} upb_MiniTable_Extension; - -typedef struct { - const upb_MiniTable** msgs; - const upb_MiniTable_Enum** enums; - const upb_MiniTable_Extension** exts; - int msg_count; - int enum_count; - int ext_count; -} upb_MiniTable_File; - -// Computes a bitmask in which the |l->required_count| lowest bits are set, -// except that we skip the lowest bit (because upb never uses hasbit 0). -// -// Sample output: -// requiredmask(1) => 0b10 (0x2) -// requiredmask(5) => 0b111110 (0x3e) -UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) { - int n = l->required_count; - assert(0 < n && n <= 63); - return ((1ULL << n) - 1) << 1; -} - -/** upb_ExtensionRegistry *****************************************************/ - -/* Adds the given extension info for message type |l| and field number |num| - * into the registry. Returns false if this message type and field number were - * already in the map, or if memory allocation fails. */ -bool _upb_extreg_add(upb_ExtensionRegistry* r, - const upb_MiniTable_Extension** e, size_t count); - -/* Looks up the extension (if any) defined for message type |l| and field - * number |num|. If an extension was found, copies the field info into |*ext| - * and returns true. Otherwise returns false. */ -const upb_MiniTable_Extension* _upb_extreg_get(const upb_ExtensionRegistry* r, - const upb_MiniTable* l, - uint32_t num); - -/** upb_Message ***************************************************************/ - -/* Internal members of a upb_Message that track unknown fields and/or - * extensions. We can change this without breaking binary compatibility. We put - * these before the user's data. The user's upb_Message* points after the - * upb_Message_Internal. */ - -typedef struct { - /* Total size of this structure, including the data that follows. - * Must be aligned to 8, which is alignof(upb_Message_Extension) */ - uint32_t size; - - /* Offsets relative to the beginning of this structure. - * - * Unknown data grows forward from the beginning to unknown_end. - * Extension data grows backward from size to ext_begin. - * When the two meet, we're out of data and have to realloc. - * - * If we imagine that the final member of this struct is: - * char data[size - overhead]; // overhead = - * sizeof(upb_Message_InternalData) - * - * Then we have: - * unknown data: data[0 .. (unknown_end - overhead)] - * extensions data: data[(ext_begin - overhead) .. (size - overhead)] */ - uint32_t unknown_end; - uint32_t ext_begin; - /* Data follows, as if there were an array: - * char data[size - sizeof(upb_Message_InternalData)]; */ -} upb_Message_InternalData; - -typedef struct { - upb_Message_InternalData* internal; - /* Message data follows. */ -} upb_Message_Internal; - -/* Maps upb_CType -> memory size. */ -extern char _upb_CTypeo_size[12]; - -UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable* l) { - return l->size + sizeof(upb_Message_Internal); -} - -UPB_INLINE upb_Message* _upb_Message_New_inl(const upb_MiniTable* l, - upb_Arena* a) { - size_t size = upb_msg_sizeof(l); - void* mem = upb_Arena_Malloc(a, size + sizeof(upb_Message_Internal)); - upb_Message* msg; - if (UPB_UNLIKELY(!mem)) return NULL; - msg = UPB_PTR_AT(mem, sizeof(upb_Message_Internal), upb_Message); - memset(mem, 0, size); - return msg; -} - -/* Creates a new messages with the given layout on the given arena. */ -upb_Message* _upb_Message_New(const upb_MiniTable* l, upb_Arena* a); - -UPB_INLINE upb_Message_Internal* upb_Message_Getinternal(upb_Message* msg) { - ptrdiff_t size = sizeof(upb_Message_Internal); - return (upb_Message_Internal*)((char*)msg - size); -} - -/* Clears the given message. */ -void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l); - -/* Discards the unknown fields for this message only. */ -void _upb_Message_DiscardUnknown_shallow(upb_Message* msg); - -/* Adds unknown data (serialized protobuf data) to the given message. The data - * is copied into the message instance. */ -bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, - upb_Arena* arena); - -/** upb_Message_Extension *****************************************************/ - -/* The internal representation of an extension is self-describing: it contains - * enough information that we can serialize it to binary format without needing - * to look it up in a upb_ExtensionRegistry. - * - * This representation allocates 16 bytes to data on 64-bit platforms. This is - * rather wasteful for scalars (in the extreme case of bool, it wastes 15 - * bytes). We accept this because we expect messages to be the most common - * extension type. */ -typedef struct { - const upb_MiniTable_Extension* ext; - union { - upb_StringView str; - void* ptr; - char scalar_data[8]; - } data; -} upb_Message_Extension; - -/* Adds the given extension data to the given message. |ext| is copied into the - * message instance. This logically replaces any previously-added extension with - * this number */ -upb_Message_Extension* _upb_Message_GetOrCreateExtension( - upb_Message* msg, const upb_MiniTable_Extension* ext, upb_Arena* arena); - -/* Returns an array of extensions for this message. Note: the array is - * ordered in reverse relative to the order of creation. */ -const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg, - size_t* count); - -/* Returns an extension for the given field number, or NULL if no extension - * exists for this field number. */ -const upb_Message_Extension* _upb_Message_Getext( - const upb_Message* msg, const upb_MiniTable_Extension* ext); - -void _upb_Message_Clearext(upb_Message* msg, - const upb_MiniTable_Extension* ext); - -void _upb_Message_Clearext(upb_Message* msg, - const upb_MiniTable_Extension* ext); - -/** Hasbit access *************************************************************/ - -UPB_INLINE bool _upb_hasbit(const upb_Message* msg, size_t idx) { - return (*UPB_PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0; -} - -UPB_INLINE void _upb_sethas(const upb_Message* msg, size_t idx) { - (*UPB_PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8)); -} - -UPB_INLINE void _upb_clearhas(const upb_Message* msg, size_t idx) { - (*UPB_PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8))); -} - -UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTable_Field* f) { - UPB_ASSERT(f->presence > 0); - return f->presence; -} - -UPB_INLINE bool _upb_hasbit_field(const upb_Message* msg, - const upb_MiniTable_Field* f) { - return _upb_hasbit(msg, _upb_Message_Hasidx(f)); -} - -UPB_INLINE void _upb_sethas_field(const upb_Message* msg, - const upb_MiniTable_Field* f) { - _upb_sethas(msg, _upb_Message_Hasidx(f)); -} - -UPB_INLINE void _upb_clearhas_field(const upb_Message* msg, - const upb_MiniTable_Field* f) { - _upb_clearhas(msg, _upb_Message_Hasidx(f)); -} - -/** Oneof case access *********************************************************/ - -UPB_INLINE uint32_t* _upb_oneofcase(upb_Message* msg, size_t case_ofs) { - return UPB_PTR_AT(msg, case_ofs, uint32_t); -} - -UPB_INLINE uint32_t _upb_getoneofcase(const void* msg, size_t case_ofs) { - return *UPB_PTR_AT(msg, case_ofs, uint32_t); -} - -UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTable_Field* f) { - UPB_ASSERT(f->presence < 0); - return ~(ptrdiff_t)f->presence; -} - -UPB_INLINE uint32_t* _upb_oneofcase_field(upb_Message* msg, - const upb_MiniTable_Field* f) { - return _upb_oneofcase(msg, _upb_oneofcase_ofs(f)); -} - -UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message* msg, - const upb_MiniTable_Field* f) { - return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f)); -} - -UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_Message* msg, size_t ofs) { - return *UPB_PTR_AT(msg, ofs, const upb_Message*) != NULL; -} - -/** upb_Array *****************************************************************/ - -/* Our internal representation for repeated fields. */ -typedef struct { - uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */ - size_t len; /* Measured in elements. */ - size_t size; /* Measured in elements. */ - uint64_t junk; -} upb_Array; - -UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) { - UPB_ASSERT((arr->data & 7) <= 4); - return (void*)(arr->data & ~(uintptr_t)7); -} - -UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) { - UPB_ASSERT(elem_size_lg2 <= 4); - return (uintptr_t)ptr | elem_size_lg2; -} - -UPB_INLINE void* _upb_array_ptr(upb_Array* arr) { - return (void*)_upb_array_constptr(arr); -} - -UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) { - UPB_ASSERT(elem_size_lg2 <= 4); - UPB_ASSERT(((uintptr_t)ptr & 7) == 0); - return (uintptr_t)ptr | (unsigned)elem_size_lg2; -} - -UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_size, - int elem_size_lg2) { - const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), 8); - const size_t bytes = sizeof(upb_Array) + (init_size << elem_size_lg2); - upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes); - if (!arr) return NULL; - arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2); - arr->len = 0; - arr->size = init_size; - return arr; -} - -/* Resizes the capacity of the array to be at least min_size. */ -bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena); - -/* Fallback functions for when the accessors require a resize. */ -void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size, - int elem_size_lg2, upb_Arena* arena); -bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value, - int elem_size_lg2, upb_Arena* arena); - -UPB_INLINE bool _upb_array_reserve(upb_Array* arr, size_t size, - upb_Arena* arena) { - if (arr->size < size) return _upb_array_realloc(arr, size, arena); - return true; -} - -UPB_INLINE bool _upb_Array_Resize(upb_Array* arr, size_t size, - upb_Arena* arena) { - if (!_upb_array_reserve(arr, size, arena)) return false; - arr->len = size; - return true; -} - -UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) { - *UPB_PTR_AT(msg, ofs, upb_Array*) = NULL; -} - -UPB_INLINE const void* _upb_array_accessor(const void* msg, size_t ofs, - size_t* size) { - const upb_Array* arr = *UPB_PTR_AT(msg, ofs, const upb_Array*); - if (arr) { - if (size) *size = arr->len; - return _upb_array_constptr(arr); - } else { - if (size) *size = 0; - return NULL; - } -} - -UPB_INLINE void* _upb_array_mutable_accessor(void* msg, size_t ofs, - size_t* size) { - upb_Array* arr = *UPB_PTR_AT(msg, ofs, upb_Array*); - if (arr) { - if (size) *size = arr->len; - return _upb_array_ptr(arr); - } else { - if (size) *size = 0; - return NULL; - } -} - -UPB_INLINE void* _upb_Array_Resize_accessor2(void* msg, size_t ofs, size_t size, - int elem_size_lg2, - upb_Arena* arena) { - upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*); - upb_Array* arr = *arr_ptr; - if (!arr || arr->size < size) { - return _upb_Array_Resize_fallback(arr_ptr, size, elem_size_lg2, arena); - } - arr->len = size; - return _upb_array_ptr(arr); -} - -UPB_INLINE bool _upb_Array_Append_accessor2(void* msg, size_t ofs, - int elem_size_lg2, - const void* value, - upb_Arena* arena) { - upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*); - size_t elem_size = 1 << elem_size_lg2; - upb_Array* arr = *arr_ptr; - void* ptr; - if (!arr || arr->len == arr->size) { - return _upb_Array_Append_fallback(arr_ptr, value, elem_size_lg2, arena); - } - ptr = _upb_array_ptr(arr); - memcpy(UPB_PTR_AT(ptr, arr->len * elem_size, char), value, elem_size); - arr->len++; - return true; -} - -/* Used by old generated code, remove once all code has been regenerated. */ -UPB_INLINE int _upb_sizelg2(upb_CType type) { - switch (type) { - case kUpb_CType_Bool: - return 0; - case kUpb_CType_Float: - case kUpb_CType_Int32: - case kUpb_CType_UInt32: - case kUpb_CType_Enum: - return 2; - case kUpb_CType_Message: - return UPB_SIZE(2, 3); - case kUpb_CType_Double: - case kUpb_CType_Int64: - case kUpb_CType_UInt64: - return 3; - case kUpb_CType_String: - case kUpb_CType_Bytes: - return UPB_SIZE(3, 4); - } - UPB_UNREACHABLE(); -} -UPB_INLINE void* _upb_Array_Resize_accessor(void* msg, size_t ofs, size_t size, - upb_CType type, upb_Arena* arena) { - return _upb_Array_Resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena); -} -UPB_INLINE bool _upb_Array_Append_accessor(void* msg, size_t ofs, - size_t elem_size, upb_CType type, - const void* value, - upb_Arena* arena) { - (void)elem_size; - return _upb_Array_Append_accessor2(msg, ofs, _upb_sizelg2(type), value, - arena); -} - -/** upb_Map *******************************************************************/ - -/* Right now we use strmaps for everything. We'll likely want to use - * integer-specific maps for integer-keyed maps.*/ -typedef struct { - /* Size of key and val, based on the map type. Strings are represented as '0' - * because they must be handled specially. */ - char key_size; - char val_size; - - upb_strtable table; -} upb_Map; - -/* Map entries aren't actually stored, they are only used during parsing. For - * parsing, it helps a lot if all map entry messages have the same layout. - * The compiler and def.c must ensure that all map entries have this layout. */ -typedef struct { - upb_Message_Internal internal; - union { - upb_StringView str; /* For str/bytes. */ - upb_value val; /* For all other types. */ - } k; - union { - upb_StringView str; /* For str/bytes. */ - upb_value val; /* For all other types. */ - } v; -} upb_MapEntry; - -/* Creates a new map on the given arena with this key/value type. */ -upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size); - -/* Converting between internal table representation and user values. - * - * _upb_map_tokey() and _upb_map_fromkey() are inverses. - * _upb_map_tovalue() and _upb_map_fromvalue() are inverses. - * - * These functions account for the fact that strings are treated differently - * from other types when stored in a map. - */ - -UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) { - if (size == UPB_MAPTYPE_STRING) { - return *(upb_StringView*)key; - } else { - return upb_StringView_FromDataAndSize((const char*)key, size); - } -} - -UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) { - if (size == UPB_MAPTYPE_STRING) { - memcpy(out, &key, sizeof(key)); - } else { - memcpy(out, key.data, size); - } -} - -UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size, - upb_value* msgval, upb_Arena* a) { - if (size == UPB_MAPTYPE_STRING) { - upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp)); - if (!strp) return false; - *strp = *(upb_StringView*)val; - *msgval = upb_value_ptr(strp); - } else { - memcpy(msgval, val, size); - } - return true; -} - -UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) { - if (size == UPB_MAPTYPE_STRING) { - const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val); - memcpy(out, strp, sizeof(upb_StringView)); - } else { - memcpy(out, &val, size); - } -} - -/* Map operations, shared by reflection and generated code. */ - -UPB_INLINE size_t _upb_Map_Size(const upb_Map* map) { - return map->table.t.count; -} - -UPB_INLINE bool _upb_Map_Get(const upb_Map* map, const void* key, - size_t key_size, void* val, size_t val_size) { - upb_value tabval; - upb_StringView k = _upb_map_tokey(key, key_size); - bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval); - if (ret && val) { - _upb_map_fromvalue(tabval, val, val_size); - } - return ret; -} - -UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) { - upb_strtable_iter it; - it.t = &map->table; - it.index = *iter; - upb_strtable_next(&it); - *iter = it.index; - if (upb_strtable_done(&it)) return NULL; - return (void*)str_tabent(&it); -} - -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 _kUpb_MapInsertStatus_OutOfMemory; - } - - /* TODO(haberman): add overwrite operation to minimize number of lookups. */ - 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, - size_t key_size) { - upb_StringView k = _upb_map_tokey(key, key_size); - return upb_strtable_remove2(&map->table, k.data, k.size, NULL); -} - -UPB_INLINE void _upb_Map_Clear(upb_Map* map) { - upb_strtable_clear(&map->table); -} - -/* Message map operations, these get the map from the message first. */ - -UPB_INLINE size_t _upb_msg_map_size(const upb_Message* msg, size_t ofs) { - upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*); - return map ? _upb_Map_Size(map) : 0; -} - -UPB_INLINE bool _upb_msg_map_get(const upb_Message* msg, size_t ofs, - const void* key, size_t key_size, void* val, - size_t val_size) { - upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*); - if (!map) return false; - return _upb_Map_Get(map, key, key_size, val, val_size); -} - -UPB_INLINE void* _upb_msg_map_next(const upb_Message* msg, size_t ofs, - size_t* iter) { - upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*); - if (!map) return NULL; - return _upb_map_next(map, iter); -} - -UPB_INLINE bool _upb_msg_map_set(upb_Message* msg, size_t ofs, const void* key, - size_t key_size, void* val, size_t val_size, - upb_Arena* arena) { - upb_Map** map = UPB_PTR_AT(msg, ofs, upb_Map*); - if (!*map) { - *map = _upb_Map_New(arena, key_size, val_size); - } - return _upb_Map_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, - const void* key, size_t key_size) { - upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*); - if (!map) return false; - return _upb_Map_Delete(map, key, key_size); -} - -UPB_INLINE void _upb_msg_map_clear(upb_Message* msg, size_t ofs) { - upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*); - if (!map) return; - _upb_Map_Clear(map); -} - -/* Accessing map key/value from a pointer, used by generated code only. */ - -UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) { - const upb_tabent* ent = (const upb_tabent*)msg; - uint32_t u32len; - upb_StringView k; - k.data = upb_tabstr(ent->key, &u32len); - k.size = u32len; - _upb_map_fromkey(k, key, size); -} - -UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) { - const upb_tabent* ent = (const upb_tabent*)msg; - upb_value v = {ent->val.val}; - _upb_map_fromvalue(v, val, size); -} - -UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, - size_t size) { - upb_tabent* ent = (upb_tabent*)msg; - /* This is like _upb_map_tovalue() except the entry already exists so we can - * reuse the allocated upb_StringView for string fields. */ - if (size == UPB_MAPTYPE_STRING) { - upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val; - memcpy(strp, val, sizeof(*strp)); - } else { - memcpy(&ent->val.val, val, size); - } -} - -/** _upb_mapsorter ************************************************************/ - -/* _upb_mapsorter sorts maps and provides ordered iteration over the entries. - * Since maps can be recursive (map values can be messages which contain other - * maps). _upb_mapsorter can contain a stack of maps. */ - -typedef struct { - upb_tabent const** entries; - int size; - int cap; -} _upb_mapsorter; - -typedef struct { - int start; - int pos; - int end; -} _upb_sortedmap; - -UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) { - s->entries = NULL; - s->size = 0; - s->cap = 0; -} - -UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) { - if (s->entries) free(s->entries); -} - -bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, - const upb_Map* map, _upb_sortedmap* sorted); - -UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s, - _upb_sortedmap* sorted) { - s->size = sorted->start; -} - -UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map, - _upb_sortedmap* sorted, upb_MapEntry* ent) { - if (sorted->pos == sorted->end) return false; - const upb_tabent* tabent = s->entries[sorted->pos++]; - upb_StringView key = upb_tabstrview(tabent->key); - _upb_map_fromkey(key, &ent->k, map->key_size); - upb_value val = {tabent->val.val}; - _upb_map_fromvalue(val, &ent->v, map->val_size); - return true; -} - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#include "upb/port_undef.inc" +#include "upb/message/internal.h" #endif /* UPB_MSG_INT_H_ */ diff --git a/third_party/upb/upb/port_def.inc b/third_party/upb/upb/port/def.inc similarity index 74% rename from third_party/upb/upb/port_def.inc rename to third_party/upb/upb/port/def.inc index 92e4bf24779..978972ee749 100644 --- a/third_party/upb/upb/port_def.inc +++ b/third_party/upb/upb/port/def.inc @@ -26,10 +26,9 @@ */ /* - * This is where we define macros used across upb. + * This is where we define internal portability macros used across upb. * - * All of these macros are undef'd in port_undef.inc to avoid leaking them to - * users. + * All of these macros are undef'd in undef.inc to avoid leaking them to users. * * The correct usage is: * @@ -37,25 +36,38 @@ * #include "upb/baz.h" * * // MUST be last included header. - * #include "upb/port_def.inc" + * #include "upb/port/def.inc" * * // Code for this file. * // <...> * * // Can be omitted for .c files, required for .h. - * #include "upb/port_undef.inc" + * #include "upb/port/undef.inc" * * This file is private and must not be included by users! */ #if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) || \ + (defined(__cplusplus) && __cplusplus >= 201402L) || \ (defined(_MSC_VER) && _MSC_VER >= 1900)) -#error upb requires C99 or C++11 or MSVC >= 2015. +#error upb requires C99 or C++14 or MSVC >= 2015. #endif -#include +// Portable check for GCC minimum version: +// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html +#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +#define UPB_GNUC_MIN(x, y) \ + (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y)) +#else +#define UPB_GNUC_MIN(x, y) 0 +#endif + +#include +#include +#include #include +#include +#include #if UINTPTR_MAX == 0xffffffff #define UPB_SIZE(size32, size64) size32 @@ -68,18 +80,16 @@ */ #define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs))) -#define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \ - *UPB_PTR_AT(msg, case_offset, int) == case_val \ - ? *UPB_PTR_AT(msg, offset, fieldtype) \ - : default - -#define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \ - *UPB_PTR_AT(msg, case_offset, int) = case_val; \ - *UPB_PTR_AT(msg, offset, fieldtype) = value; - #define UPB_MAPTYPE_STRING 0 -/* UPB_INLINE: inline if possible, emit standalone code if required. */ +// UPB_EXPORT: always generate a public symbol. +#if defined(__GNUC__) || defined(__clang__) +#define UPB_EXPORT __attribute__((visibility("default"))) __attribute__((used)) +#else +#define UPB_EXPORT +#endif + +// UPB_INLINE: inline if possible, emit standalone code if required. #ifdef __cplusplus #define UPB_INLINE inline #elif defined (__GNUC__) || defined(__clang__) @@ -88,22 +98,34 @@ #define UPB_INLINE static #endif +#ifdef UPB_BUILD_API +#define UPB_API UPB_EXPORT +#define UPB_API_INLINE UPB_EXPORT +#else +#define UPB_API +#define UPB_API_INLINE UPB_INLINE +#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, UPB_MALLOC_ALIGN) +#ifdef __clang__ +#define UPB_ALIGN_OF(type) _Alignof(type) +#else #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) +#endif -/* Hints to the compiler about likely/unlikely branches. */ +// Hints to the compiler about likely/unlikely branches. #if defined (__GNUC__) || defined(__clang__) -#define UPB_LIKELY(x) __builtin_expect((x),1) -#define UPB_UNLIKELY(x) __builtin_expect((x),0) +#define UPB_LIKELY(x) __builtin_expect((bool)(x), 1) +#define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0) #else #define UPB_LIKELY(x) (x) #define UPB_UNLIKELY(x) (x) #endif -/* Macros for function attributes on compilers that support them. */ +// Macros for function attributes on compilers that support them. #ifdef __GNUC__ #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) #define UPB_NOINLINE __attribute__((noinline)) @@ -126,8 +148,7 @@ #define UPB_UNUSED(var) (void)var -/* UPB_ASSUME(): in release mode, we tell the compiler to assume this is true. - */ +// UPB_ASSUME(): in release mode, we tell the compiler to assume this is true. #ifdef NDEBUG #ifdef __GNUC__ #define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable() @@ -150,6 +171,12 @@ #if defined(__GNUC__) || defined(__clang__) #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0) +#elif defined(_MSC_VER) +#define UPB_UNREACHABLE() \ + do { \ + assert(0); \ + __assume(0); \ + } while (0) #else #define UPB_UNREACHABLE() do { assert(0); } while(0) #endif @@ -220,16 +247,22 @@ #endif /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully - * degrade to non-fasttable if we are using UPB_TRY_ENABLE_FASTTABLE. */ -#if !UPB_FASTTABLE && defined(UPB_TRY_ENABLE_FASTTABLE) + * degrade to non-fasttable if the runtime or platform do not support it. */ +#if !UPB_FASTTABLE #define UPB_FASTTABLE_INIT(...) +#define UPB_FASTTABLE_MASK(mask) -1 #else #define UPB_FASTTABLE_INIT(...) __VA_ARGS__ +#define UPB_FASTTABLE_MASK(mask) mask #endif #undef UPB_FASTTABLE_SUPPORTED -/* ASAN poisoning (for arena) *************************************************/ +/* ASAN poisoning (for arena). + * If using UPB from an interpreted language like Ruby, a build of the + * interpreter compiled with ASAN enabled must be used in order to get sane and + * expected behavior. + */ #if defined(__SANITIZE_ADDRESS__) #define UPB_ASAN 1 @@ -260,3 +293,28 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); #else #define UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 0 #endif + +#if defined(__cplusplus) +#if defined(__clang__) || UPB_GNUC_MIN(6, 0) +// https://gcc.gnu.org/gcc-6/changes.html +#if __cplusplus >= 201402L +#define UPB_DEPRECATED [[deprecated]] +#else +#define UPB_DEPRECATED __attribute__((deprecated)) +#endif +#else +#define UPB_DEPRECATED +#endif +#else +#define UPB_DEPRECATED +#endif + +// begin:google_only +// #define UPB_IS_GOOGLE3 +// end:google_only + +#if defined(UPB_IS_GOOGLE3) && !defined(UPB_BOOTSTRAP_STAGE0) +#define UPB_DESC(sym) proto2_##sym +#else +#define UPB_DESC(sym) google_protobuf_##sym +#endif diff --git a/third_party/upb/upb/port_undef.inc b/third_party/upb/upb/port/undef.inc similarity index 89% rename from third_party/upb/upb/port_undef.inc rename to third_party/upb/upb/port/undef.inc index 1dff3d275d2..a4782838aee 100644 --- a/third_party/upb/upb/port_undef.inc +++ b/third_party/upb/upb/port/undef.inc @@ -25,14 +25,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* See port_def.inc. This should #undef all macros #defined there. */ +// This should #undef all macros #defined in def.inc #undef UPB_SIZE #undef UPB_PTR_AT -#undef UPB_READ_ONEOF -#undef UPB_WRITE_ONEOF #undef UPB_MAPTYPE_STRING +#undef UPB_EXPORT #undef UPB_INLINE +#undef UPB_API +#undef UPB_API_INLINE #undef UPB_ALIGN_UP #undef UPB_ALIGN_DOWN #undef UPB_ALIGN_MALLOC @@ -55,9 +56,15 @@ #undef UPB_PTRADD #undef UPB_MUSTTAIL #undef UPB_FASTTABLE_SUPPORTED +#undef UPB_FASTTABLE_MASK #undef UPB_FASTTABLE #undef UPB_FASTTABLE_INIT #undef UPB_POISON_MEMORY_REGION #undef UPB_UNPOISON_MEMORY_REGION #undef UPB_ASAN #undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 +#undef UPB_DEPRECATED +#undef UPB_GNUC_MIN +#undef UPB_DESCRIPTOR_UPB_H_FILENAME +#undef UPB_DESC +#undef UPB_IS_GOOGLE3 diff --git a/third_party/upb/upb/internal/vsnprintf_compat.h b/third_party/upb/upb/port/vsnprintf_compat.h similarity index 91% rename from third_party/upb/upb/internal/vsnprintf_compat.h rename to third_party/upb/upb/port/vsnprintf_compat.h index a9d84bb6feb..f895060162e 100644 --- a/third_party/upb/upb/internal/vsnprintf_compat.h +++ b/third_party/upb/upb/port/vsnprintf_compat.h @@ -25,13 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_INTERNAL_VSNPRINTF_COMPAT_H_ -#define UPB_INTERNAL_VSNPRINTF_COMPAT_H_ - -#include +#ifndef UPB_PORT_VSNPRINTF_COMPAT_H_ +#define UPB_PORT_VSNPRINTF_COMPAT_H_ // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, va_list ap) { @@ -47,6 +45,6 @@ UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, #endif } -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" -#endif // UPB_INTERNAL_VSNPRINTF_COMPAT_H_ +#endif // UPB_PORT_VSNPRINTF_COMPAT_H_ diff --git a/third_party/upb/upb/reflection.c b/third_party/upb/upb/reflection.c deleted file mode 100644 index 43f884495fe..00000000000 --- a/third_party/upb/upb/reflection.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2009-2021, Google LLC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Google LLC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "upb/reflection.h" - -#include - -#include "upb/internal/table.h" -#include "upb/msg.h" -#include "upb/port_def.inc" - -static size_t get_field_size(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]; -} - -/** upb_Message - * *******************************************************************/ - -upb_Message* upb_Message_New(const upb_MessageDef* m, upb_Arena* a) { - return _upb_Message_New(upb_MessageDef_MiniTable(m), a); -} - -static bool in_oneof(const upb_MiniTable_Field* field) { - return field->presence < 0; -} - -static upb_MessageValue _upb_Message_Getraw(const upb_Message* msg, - const upb_FieldDef* f) { - const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f); - const char* mem = UPB_PTR_AT(msg, field->offset, char); - upb_MessageValue val = {0}; - memcpy(&val, mem, get_field_size(field)); - return val; -} - -bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f) { - assert(upb_FieldDef_HasPresence(f)); - if (upb_FieldDef_IsExtension(f)) { - const upb_MiniTable_Extension* ext = _upb_FieldDef_ExtensionMiniTable(f); - return _upb_Message_Getext(msg, ext) != NULL; - } else { - const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f); - if (in_oneof(field)) { - return _upb_getoneofcase_field(msg, field) == field->number; - } else if (field->presence > 0) { - return _upb_hasbit_field(msg, field); - } else { - UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || - field->descriptortype == kUpb_FieldType_Group); - return _upb_Message_Getraw(msg, f).msg_val != NULL; - } - } -} - -const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg, - const upb_OneofDef* o) { - const upb_FieldDef* f = upb_OneofDef_Field(o, 0); - if (upb_OneofDef_IsSynthetic(o)) { - UPB_ASSERT(upb_OneofDef_FieldCount(o) == 1); - return upb_Message_Has(msg, f) ? f : NULL; - } else { - const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f); - uint32_t oneof_case = _upb_getoneofcase_field(msg, field); - f = oneof_case ? upb_OneofDef_LookupNumber(o, oneof_case) : NULL; - UPB_ASSERT((f != NULL) == (oneof_case != 0)); - return f; - } -} - -upb_MessageValue upb_Message_Get(const upb_Message* msg, - const upb_FieldDef* f) { - if (upb_FieldDef_IsExtension(f)) { - const upb_Message_Extension* ext = - _upb_Message_Getext(msg, _upb_FieldDef_ExtensionMiniTable(f)); - if (ext) { - upb_MessageValue val; - memcpy(&val, &ext->data, sizeof(val)); - return val; - } else if (upb_FieldDef_IsRepeated(f)) { - return (upb_MessageValue){.array_val = NULL}; - } - } else if (!upb_FieldDef_HasPresence(f) || upb_Message_Has(msg, f)) { - return _upb_Message_Getraw(msg, f); - } - return upb_FieldDef_Default(f); -} - -upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg, - const upb_FieldDef* f, - upb_Arena* a) { - UPB_ASSERT(upb_FieldDef_IsSubMessage(f) || upb_FieldDef_IsRepeated(f)); - if (upb_FieldDef_HasPresence(f) && !upb_Message_Has(msg, f)) { - // We need to skip the upb_Message_Get() call in this case. - goto make; - } - - upb_MessageValue val = upb_Message_Get(msg, f); - if (val.array_val) { - return (upb_MutableMessageValue){.array = (upb_Array*)val.array_val}; - } - - upb_MutableMessageValue ret; -make: - if (!a) return (upb_MutableMessageValue){.array = NULL}; - if (upb_FieldDef_IsMap(f)) { - const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f); - const upb_FieldDef* key = - upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_KeyFieldNumber); - const upb_FieldDef* value = - upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_ValueFieldNumber); - ret.map = - upb_Map_New(a, upb_FieldDef_CType(key), upb_FieldDef_CType(value)); - } else if (upb_FieldDef_IsRepeated(f)) { - ret.array = upb_Array_New(a, upb_FieldDef_CType(f)); - } else { - UPB_ASSERT(upb_FieldDef_IsSubMessage(f)); - ret.msg = upb_Message_New(upb_FieldDef_MessageSubDef(f), a); - } - - val.array_val = ret.array; - upb_Message_Set(msg, f, val, a); - - return ret; -} - -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_GetOrCreateExtension( - msg, _upb_FieldDef_ExtensionMiniTable(f), a); - if (!ext) return false; - memcpy(&ext->data, &val, sizeof(val)); - } else { - const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f); - char* mem = UPB_PTR_AT(msg, field->offset, char); - memcpy(mem, &val, get_field_size(field)); - if (field->presence > 0) { - _upb_sethas_field(msg, field); - } else if (in_oneof(field)) { - *_upb_oneofcase_field(msg, field) = field->number; - } - } - return true; -} - -void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f) { - if (upb_FieldDef_IsExtension(f)) { - _upb_Message_Clearext(msg, _upb_FieldDef_ExtensionMiniTable(f)); - } else { - const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f); - char* mem = UPB_PTR_AT(msg, field->offset, char); - - if (field->presence > 0) { - _upb_clearhas_field(msg, field); - } else if (in_oneof(field)) { - uint32_t* oneof_case = _upb_oneofcase_field(msg, field); - if (*oneof_case != field->number) return; - *oneof_case = 0; - } - - memset(mem, 0, get_field_size(field)); - } -} - -void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m) { - _upb_Message_Clear(msg, upb_MessageDef_MiniTable(m)); -} - -bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, - const upb_DefPool* ext_pool, const upb_FieldDef** out_f, - upb_MessageValue* out_val, size_t* iter) { - size_t i = *iter; - size_t n = upb_MessageDef_FieldCount(m); - const upb_MessageValue zero = {0}; - UPB_UNUSED(ext_pool); - - /* Iterate over normal fields, returning the first one that is set. */ - while (++i < n) { - const upb_FieldDef* f = upb_MessageDef_Field(m, i); - upb_MessageValue val = _upb_Message_Getraw(msg, f); - - /* Skip field if unset or empty. */ - if (upb_FieldDef_HasPresence(f)) { - if (!upb_Message_Has(msg, f)) continue; - } else { - upb_MessageValue test = val; - if (upb_FieldDef_IsString(f) && !upb_FieldDef_IsRepeated(f)) { - /* Clear string pointer, only size matters (ptr could be non-NULL). */ - test.str_val.data = NULL; - } - /* Continue if NULL or 0. */ - if (memcmp(&test, &zero, sizeof(test)) == 0) continue; - - /* Continue on empty array or map. */ - if (upb_FieldDef_IsMap(f)) { - if (upb_Map_Size(test.map_val) == 0) continue; - } else if (upb_FieldDef_IsRepeated(f)) { - if (upb_Array_Size(test.array_val) == 0) continue; - } - } - - *out_val = val; - *out_f = f; - *iter = i; - return true; - } - - if (ext_pool) { - /* Return any extensions that are set. */ - size_t count; - const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count); - if (i - n < count) { - ext += count - 1 - (i - n); - memcpy(out_val, &ext->data, sizeof(*out_val)); - *out_f = _upb_DefPool_FindExtensionByMiniTable(ext_pool, ext->ext); - *iter = i; - return true; - } - } - - *iter = i; - return false; -} - -bool _upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, - int depth) { - size_t iter = kUpb_Message_Begin; - const upb_FieldDef* f; - upb_MessageValue val; - bool ret = true; - - if (--depth == 0) return false; - - _upb_Message_DiscardUnknown_shallow(msg); - - while (upb_Message_Next(msg, m, NULL /*ext_pool*/, &f, &val, &iter)) { - const upb_MessageDef* subm = upb_FieldDef_MessageSubDef(f); - if (!subm) continue; - if (upb_FieldDef_IsMap(f)) { - const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(subm, 2); - const upb_MessageDef* val_m = upb_FieldDef_MessageSubDef(val_f); - upb_Map* map = (upb_Map*)val.map_val; - size_t iter = kUpb_Map_Begin; - - if (!val_m) continue; - - while (upb_MapIterator_Next(map, &iter)) { - upb_MessageValue map_val = upb_MapIterator_Value(map, iter); - if (!_upb_Message_DiscardUnknown((upb_Message*)map_val.msg_val, val_m, - depth)) { - ret = false; - } - } - } else if (upb_FieldDef_IsRepeated(f)) { - const upb_Array* arr = val.array_val; - size_t i, n = upb_Array_Size(arr); - for (i = 0; i < n; i++) { - upb_MessageValue elem = upb_Array_Get(arr, i); - if (!_upb_Message_DiscardUnknown((upb_Message*)elem.msg_val, subm, - depth)) { - ret = false; - } - } - } else { - if (!_upb_Message_DiscardUnknown((upb_Message*)val.msg_val, subm, - depth)) { - ret = false; - } - } - } - - return ret; -} - -bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, - int maxdepth) { - return _upb_Message_DiscardUnknown(msg, m, maxdepth); -} diff --git a/third_party/upb/upb/reflection.h b/third_party/upb/upb/reflection.h index 6071fba6f5c..12f0762cc75 100644 --- a/third_party/upb/upb/reflection.h +++ b/third_party/upb/upb/reflection.h @@ -25,86 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/reflection/message.h instead +// IWYU pragma: private, include "upb/reflection/message.h" + #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" - -#ifdef __cplusplus -extern "C" { -#endif - -upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f); - -/** upb_Message - * *******************************************************************/ - -/* Creates a new message of the given type in the given arena. */ -upb_Message* upb_Message_New(const upb_MessageDef* m, upb_Arena* a); - -/* Returns the value associated with this field. */ -upb_MessageValue upb_Message_Get(const upb_Message* msg, const upb_FieldDef* f); - -/* Returns a mutable pointer to a map, array, or submessage value. If the given - * arena is non-NULL this will construct a new object if it was not previously - * present. May not be called for primitive fields. */ -upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg, - const upb_FieldDef* f, - upb_Arena* a); - -/* May only be called for fields where upb_FieldDef_HasPresence(f) == true. */ -bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f); - -/* Returns the field that is set in the oneof, or NULL if none are set. */ -const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg, - const upb_OneofDef* o); - -/* Sets the given field to the given value. For a msg/array/map/string, the - * caller must ensure that the target data outlives |msg| (by living either in - * the same arena or a different arena that outlives it). - * - * Returns false if allocation fails. */ -bool upb_Message_Set(upb_Message* msg, const upb_FieldDef* f, - upb_MessageValue val, upb_Arena* a); - -/* Clears any field presence and sets the value back to its default. */ -void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f); - -/* Clear all data and unknown fields. */ -void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m); - -/* Iterate over present fields. - * - * size_t iter = kUpb_Message_Begin; - * const upb_FieldDef *f; - * upb_MessageValue val; - * while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) { - * process_field(f, val); - * } - * - * If ext_pool is NULL, no extensions will be returned. If the given symtab - * returns extensions that don't match what is in this message, those extensions - * will be skipped. - */ - -#define kUpb_Message_Begin -1 -bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, - const upb_DefPool* ext_pool, const upb_FieldDef** f, - upb_MessageValue* val, size_t* iter); - -/* Clears all unknown field data from this message and all submessages. */ -bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, - int maxdepth); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#include "upb/port_undef.inc" +#include "upb/reflection/message.h" #endif /* UPB_REFLECTION_H_ */ diff --git a/third_party/upb/upb/reflection.hpp b/third_party/upb/upb/reflection.hpp index b653893c0dc..a2443fb6d45 100644 --- a/third_party/upb/upb/reflection.hpp +++ b/third_party/upb/upb/reflection.hpp @@ -23,15 +23,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// This header is deprecated, use upb/reflection/message.hpp instead + #ifndef UPB_REFLECTION_HPP_ #define UPB_REFLECTION_HPP_ -#include "upb/reflection.h" - -namespace upb { - -typedef upb_MessageValue MessageValue; - -} // namespace upb +#include "upb/reflection/message.hpp" #endif // UPB_REFLECTION_HPP_ diff --git a/third_party/upb/upb/reflection/common.h b/third_party/upb/upb/reflection/common.h new file mode 100644 index 00000000000..797fbb223ef --- /dev/null +++ b/third_party/upb/upb/reflection/common.h @@ -0,0 +1,67 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +// Declarations common to all public def types. + +#ifndef UPB_REFLECTION_COMMON_H_ +#define UPB_REFLECTION_COMMON_H_ + +// begin:google_only +// #ifndef UPB_BOOTSTRAP_STAGE0 +// #include "net/proto2/proto/descriptor.upb.h" +// #else +// #include "google/protobuf/descriptor.upb.h" +// #endif +// end:google_only + +// begin:github_only +#include "google/protobuf/descriptor.upb.h" +// end:github_only + +typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax; + +// Forward declarations for circular references. +typedef struct upb_DefPool upb_DefPool; +typedef struct upb_EnumDef upb_EnumDef; +typedef struct upb_EnumReservedRange upb_EnumReservedRange; +typedef struct upb_EnumValueDef upb_EnumValueDef; +typedef struct upb_ExtensionRange upb_ExtensionRange; +typedef struct upb_FieldDef upb_FieldDef; +typedef struct upb_FileDef upb_FileDef; +typedef struct upb_MessageDef upb_MessageDef; +typedef struct upb_MessageReservedRange upb_MessageReservedRange; +typedef struct upb_MethodDef upb_MethodDef; +typedef struct upb_OneofDef upb_OneofDef; +typedef struct upb_ServiceDef upb_ServiceDef; + +// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// + +typedef struct upb_DefBuilder upb_DefBuilder; + +#endif /* UPB_REFLECTION_COMMON_H_ */ diff --git a/third_party/upb/upb/reflection/def.h b/third_party/upb/upb/reflection/def.h new file mode 100644 index 00000000000..be04a9a596b --- /dev/null +++ b/third_party/upb/upb/reflection/def.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_DEF_H_ +#define UPB_REFLECTION_DEF_H_ + +#include "upb/reflection/def_pool.h" +#include "upb/reflection/enum_def.h" +#include "upb/reflection/enum_value_def.h" +#include "upb/reflection/extension_range.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/file_def.h" +#include "upb/reflection/message_def.h" +#include "upb/reflection/method_def.h" +#include "upb/reflection/oneof_def.h" +#include "upb/reflection/service_def.h" + +#endif /* UPB_REFLECTION_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/def.hpp b/third_party/upb/upb/reflection/def.hpp new file mode 100644 index 00000000000..1da809a3f42 --- /dev/null +++ b/third_party/upb/upb/reflection/def.hpp @@ -0,0 +1,610 @@ +// Copyright (c) 2009-2021, Google LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of Google LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef UPB_REFLECTION_DEF_HPP_ +#define UPB_REFLECTION_DEF_HPP_ + +#include +#include +#include +#include + +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/message.h" +#include "upb/upb.hpp" + +// Must be last +#include "upb/port/def.inc" + +namespace upb { + +typedef upb_MessageValue MessageValue; + +class EnumDefPtr; +class FileDefPtr; +class MessageDefPtr; +class OneofDefPtr; + +// A upb::FieldDefPtr describes a single field in a message. It is most often +// found as a part of a upb_MessageDef, but can also stand alone to represent +// an extension. +class FieldDefPtr { + public: + FieldDefPtr() : ptr_(nullptr) {} + explicit FieldDefPtr(const upb_FieldDef* ptr) : ptr_(ptr) {} + + const upb_FieldDef* ptr() const { return ptr_; } + + typedef upb_FieldType Type; + typedef upb_CType CType; + typedef upb_Label Label; + + FileDefPtr file() const; + const char* full_name() const { return upb_FieldDef_FullName(ptr_); } + + const upb_MiniTableField* mini_table() const { + return upb_FieldDef_MiniTable(ptr_); + } + + const UPB_DESC(FieldOptions) * options() const { + return upb_FieldDef_Options(ptr_); + } + + Type type() const { return upb_FieldDef_Type(ptr_); } + CType ctype() const { return upb_FieldDef_CType(ptr_); } + Label label() const { return upb_FieldDef_Label(ptr_); } + const char* name() const { return upb_FieldDef_Name(ptr_); } + const char* json_name() const { return upb_FieldDef_JsonName(ptr_); } + uint32_t number() const { return upb_FieldDef_Number(ptr_); } + bool is_extension() const { return upb_FieldDef_IsExtension(ptr_); } + bool is_required() const { return upb_FieldDef_IsRequired(ptr_); } + bool has_presence() const { return upb_FieldDef_HasPresence(ptr_); } + + // For non-string, non-submessage fields, this indicates whether binary + // protobufs are encoded in packed or non-packed format. + // + // Note: this accessor reflects the fact that "packed" has different defaults + // depending on whether the proto is proto2 or proto3. + bool packed() const { return upb_FieldDef_IsPacked(ptr_); } + + // An integer that can be used as an index into an array of fields for + // whatever message this field belongs to. Guaranteed to be less than + // f->containing_type()->field_count(). May only be accessed once the def has + // been finalized. + uint32_t index() const { return upb_FieldDef_Index(ptr_); } + + // The MessageDef to which this field belongs (for extensions, the extended + // message). + MessageDefPtr containing_type() const; + + // For extensions, the message the extension is declared inside, or NULL if + // none. + MessageDefPtr extension_scope() const; + + // The OneofDef to which this field belongs, or NULL if this field is not part + // of a oneof. + OneofDefPtr containing_oneof() const; + OneofDefPtr real_containing_oneof() const; + + // Convenient field type tests. + bool IsSubMessage() const { return upb_FieldDef_IsSubMessage(ptr_); } + bool IsString() const { return upb_FieldDef_IsString(ptr_); } + bool IsSequence() const { return upb_FieldDef_IsRepeated(ptr_); } + bool IsPrimitive() const { return upb_FieldDef_IsPrimitive(ptr_); } + bool IsMap() const { return upb_FieldDef_IsMap(ptr_); } + + MessageValue default_value() const { return upb_FieldDef_Default(ptr_); } + + // Returns the enum or submessage def for this field, if any. The field's + // type must match (ie. you may only call enum_subdef() for fields where + // type() == kUpb_CType_Enum). + EnumDefPtr enum_subdef() const; + MessageDefPtr message_type() const; + + explicit operator bool() const { return ptr_ != nullptr; } + + friend bool operator==(FieldDefPtr lhs, FieldDefPtr rhs) { + return lhs.ptr_ == rhs.ptr_; + } + + friend bool operator!=(FieldDefPtr lhs, FieldDefPtr rhs) { + return !(lhs == rhs); + } + + private: + const upb_FieldDef* ptr_; +}; + +// Class that represents a oneof. +class OneofDefPtr { + public: + OneofDefPtr() : ptr_(nullptr) {} + explicit OneofDefPtr(const upb_OneofDef* ptr) : ptr_(ptr) {} + + const upb_OneofDef* ptr() const { return ptr_; } + explicit operator bool() const { return ptr_ != nullptr; } + + const UPB_DESC(OneofOptions) * options() const { + return upb_OneofDef_Options(ptr_); + } + + // Returns the MessageDef that contains this OneofDef. + MessageDefPtr containing_type() const; + + // Returns the name of this oneof. + const char* name() const { return upb_OneofDef_Name(ptr_); } + const char* full_name() const { return upb_OneofDef_FullName(ptr_); } + + // Returns the number of fields in the oneof. + int field_count() const { return upb_OneofDef_FieldCount(ptr_); } + FieldDefPtr field(int i) const { + return FieldDefPtr(upb_OneofDef_Field(ptr_, i)); + } + + // Looks up by name. + FieldDefPtr FindFieldByName(const char* name, size_t len) const { + return FieldDefPtr(upb_OneofDef_LookupNameWithSize(ptr_, name, len)); + } + FieldDefPtr FindFieldByName(const char* name) const { + return FieldDefPtr(upb_OneofDef_LookupName(ptr_, name)); + } + + template + FieldDefPtr FindFieldByName(const T& str) const { + return FindFieldByName(str.c_str(), str.size()); + } + + // Looks up by tag number. + FieldDefPtr FindFieldByNumber(uint32_t num) const { + return FieldDefPtr(upb_OneofDef_LookupNumber(ptr_, num)); + } + + private: + const upb_OneofDef* ptr_; +}; + +// Structure that describes a single .proto message type. +class MessageDefPtr { + public: + MessageDefPtr() : ptr_(nullptr) {} + explicit MessageDefPtr(const upb_MessageDef* ptr) : ptr_(ptr) {} + + const UPB_DESC(MessageOptions) * options() const { + return upb_MessageDef_Options(ptr_); + } + + std::string MiniDescriptorEncode() const { + upb::Arena arena; + upb_StringView md; + upb_MessageDef_MiniDescriptorEncode(ptr_, arena.ptr(), &md); + return std::string(md.data, md.size); + } + + const upb_MessageDef* ptr() const { return ptr_; } + + FileDefPtr file() const; + + const char* full_name() const { return upb_MessageDef_FullName(ptr_); } + const char* name() const { return upb_MessageDef_Name(ptr_); } + + const upb_MiniTable* mini_table() const { + return upb_MessageDef_MiniTable(ptr_); + } + + // The number of fields that belong to the MessageDef. + int field_count() const { return upb_MessageDef_FieldCount(ptr_); } + FieldDefPtr field(int i) const { + return FieldDefPtr(upb_MessageDef_Field(ptr_, i)); + } + + // The number of oneofs that belong to the MessageDef. + int oneof_count() const { return upb_MessageDef_OneofCount(ptr_); } + int real_oneof_count() const { return upb_MessageDef_RealOneofCount(ptr_); } + OneofDefPtr oneof(int i) const { + return OneofDefPtr(upb_MessageDef_Oneof(ptr_, i)); + } + + int enum_type_count() const { return upb_MessageDef_NestedEnumCount(ptr_); } + EnumDefPtr enum_type(int i) const; + + int nested_message_count() const { + return upb_MessageDef_NestedMessageCount(ptr_); + } + MessageDefPtr nested_message(int i) const { + return MessageDefPtr(upb_MessageDef_NestedMessage(ptr_, i)); + } + + int nested_extension_count() const { + return upb_MessageDef_NestedExtensionCount(ptr_); + } + FieldDefPtr nested_extension(int i) const { + return FieldDefPtr(upb_MessageDef_NestedExtension(ptr_, i)); + } + + int extension_range_count() const { + return upb_MessageDef_ExtensionRangeCount(ptr_); + } + + upb_Syntax syntax() const { return upb_MessageDef_Syntax(ptr_); } + + // These return null pointers if the field is not found. + FieldDefPtr FindFieldByNumber(uint32_t number) const { + return FieldDefPtr(upb_MessageDef_FindFieldByNumber(ptr_, number)); + } + FieldDefPtr FindFieldByName(const char* name, size_t len) const { + return FieldDefPtr(upb_MessageDef_FindFieldByNameWithSize(ptr_, name, len)); + } + FieldDefPtr FindFieldByName(const char* name) const { + return FieldDefPtr(upb_MessageDef_FindFieldByName(ptr_, name)); + } + + template + FieldDefPtr FindFieldByName(const T& str) const { + return FindFieldByName(str.c_str(), str.size()); + } + + OneofDefPtr FindOneofByName(const char* name, size_t len) const { + return OneofDefPtr(upb_MessageDef_FindOneofByNameWithSize(ptr_, name, len)); + } + + OneofDefPtr FindOneofByName(const char* name) const { + return OneofDefPtr(upb_MessageDef_FindOneofByName(ptr_, name)); + } + + template + OneofDefPtr FindOneofByName(const T& str) const { + return FindOneofByName(str.c_str(), str.size()); + } + + // Is this message a map entry? + bool mapentry() const { return upb_MessageDef_IsMapEntry(ptr_); } + + FieldDefPtr map_key() const { + if (!mapentry()) return FieldDefPtr(); + return FieldDefPtr(upb_MessageDef_Field(ptr_, 0)); + } + + FieldDefPtr map_value() const { + if (!mapentry()) return FieldDefPtr(); + return FieldDefPtr(upb_MessageDef_Field(ptr_, 1)); + } + + // Return the type of well known type message. kUpb_WellKnown_Unspecified for + // non-well-known message. + upb_WellKnown wellknowntype() const { + return upb_MessageDef_WellKnownType(ptr_); + } + + explicit operator bool() const { return ptr_ != nullptr; } + + friend bool operator==(MessageDefPtr lhs, MessageDefPtr rhs) { + return lhs.ptr_ == rhs.ptr_; + } + + friend bool operator!=(MessageDefPtr lhs, MessageDefPtr rhs) { + return !(lhs == rhs); + } + + private: + class FieldIter { + public: + explicit FieldIter(const upb_MessageDef* m, int i) : m_(m), i_(i) {} + void operator++() { i_++; } + + FieldDefPtr operator*() { + return FieldDefPtr(upb_MessageDef_Field(m_, i_)); + } + bool operator!=(const FieldIter& other) { return i_ != other.i_; } + bool operator==(const FieldIter& other) { return i_ == other.i_; } + + private: + const upb_MessageDef* m_; + int i_; + }; + + class FieldAccessor { + public: + explicit FieldAccessor(const upb_MessageDef* md) : md_(md) {} + FieldIter begin() { return FieldIter(md_, 0); } + FieldIter end() { return FieldIter(md_, upb_MessageDef_FieldCount(md_)); } + + private: + const upb_MessageDef* md_; + }; + + class OneofIter { + public: + explicit OneofIter(const upb_MessageDef* m, int i) : m_(m), i_(i) {} + void operator++() { i_++; } + + OneofDefPtr operator*() { + return OneofDefPtr(upb_MessageDef_Oneof(m_, i_)); + } + bool operator!=(const OneofIter& other) { return i_ != other.i_; } + bool operator==(const OneofIter& other) { return i_ == other.i_; } + + private: + const upb_MessageDef* m_; + int i_; + }; + + class OneofAccessor { + public: + explicit OneofAccessor(const upb_MessageDef* md) : md_(md) {} + OneofIter begin() { return OneofIter(md_, 0); } + OneofIter end() { return OneofIter(md_, upb_MessageDef_OneofCount(md_)); } + + private: + const upb_MessageDef* md_; + }; + + public: + FieldAccessor fields() const { return FieldAccessor(ptr()); } + OneofAccessor oneofs() const { return OneofAccessor(ptr()); } + + private: + const upb_MessageDef* ptr_; +}; + +class EnumValDefPtr { + public: + EnumValDefPtr() : ptr_(nullptr) {} + explicit EnumValDefPtr(const upb_EnumValueDef* ptr) : ptr_(ptr) {} + + const UPB_DESC(EnumValueOptions) * options() const { + return upb_EnumValueDef_Options(ptr_); + } + + int32_t number() const { return upb_EnumValueDef_Number(ptr_); } + const char* full_name() const { return upb_EnumValueDef_FullName(ptr_); } + const char* name() const { return upb_EnumValueDef_Name(ptr_); } + + private: + const upb_EnumValueDef* ptr_; +}; + +class EnumDefPtr { + public: + EnumDefPtr() : ptr_(nullptr) {} + explicit EnumDefPtr(const upb_EnumDef* ptr) : ptr_(ptr) {} + + const UPB_DESC(EnumOptions) * options() const { + return upb_EnumDef_Options(ptr_); + } + + const upb_MiniTableEnum* mini_table() const { + return _upb_EnumDef_MiniTable(ptr_); + } + + std::string MiniDescriptorEncode() const { + upb::Arena arena; + upb_StringView md; + upb_EnumDef_MiniDescriptorEncode(ptr_, arena.ptr(), &md); + return std::string(md.data, md.size); + } + + const upb_EnumDef* ptr() const { return ptr_; } + explicit operator bool() const { return ptr_ != nullptr; } + + const char* full_name() const { return upb_EnumDef_FullName(ptr_); } + const char* name() const { return upb_EnumDef_Name(ptr_); } + bool is_closed() const { return upb_EnumDef_IsClosed(ptr_); } + + // The value that is used as the default when no field default is specified. + // If not set explicitly, the first value that was added will be used. + // The default value must be a member of the enum. + // Requires that value_count() > 0. + int32_t default_value() const { return upb_EnumDef_Default(ptr_); } + + // Returns the number of values currently defined in the enum. Note that + // multiple names can refer to the same number, so this may be greater than + // the total number of unique numbers. + int value_count() const { return upb_EnumDef_ValueCount(ptr_); } + EnumValDefPtr value(int i) const { + return EnumValDefPtr(upb_EnumDef_Value(ptr_, i)); + } + + // Lookups from name to integer, returning true if found. + EnumValDefPtr FindValueByName(const char* name) const { + return EnumValDefPtr(upb_EnumDef_FindValueByName(ptr_, name)); + } + + // Finds the name corresponding to the given number, or NULL if none was + // found. If more than one name corresponds to this number, returns the + // first one that was added. + EnumValDefPtr FindValueByNumber(int32_t num) const { + return EnumValDefPtr(upb_EnumDef_FindValueByNumber(ptr_, num)); + } + + private: + const upb_EnumDef* ptr_; +}; + +// Class that represents a .proto file with some things defined in it. +// +// Many users won't care about FileDefs, but they are necessary if you want to +// read the values of file-level options. +class FileDefPtr { + public: + explicit FileDefPtr(const upb_FileDef* ptr) : ptr_(ptr) {} + + const UPB_DESC(FileOptions) * options() const { + return upb_FileDef_Options(ptr_); + } + + const upb_FileDef* ptr() const { return ptr_; } + + // Get/set name of the file (eg. "foo/bar.proto"). + const char* name() const { return upb_FileDef_Name(ptr_); } + + // Package name for definitions inside the file (eg. "foo.bar"). + const char* package() const { return upb_FileDef_Package(ptr_); } + + // Syntax for the file. Defaults to proto2. + upb_Syntax syntax() const { return upb_FileDef_Syntax(ptr_); } + + // Get the list of dependencies from the file. These are returned in the + // order that they were added to the FileDefPtr. + int dependency_count() const { return upb_FileDef_DependencyCount(ptr_); } + FileDefPtr dependency(int index) const { + return FileDefPtr(upb_FileDef_Dependency(ptr_, index)); + } + + int public_dependency_count() const { + return upb_FileDef_PublicDependencyCount(ptr_); + } + FileDefPtr public_dependency(int index) const { + return FileDefPtr(upb_FileDef_PublicDependency(ptr_, index)); + } + + int toplevel_enum_count() const { + return upb_FileDef_TopLevelEnumCount(ptr_); + } + EnumDefPtr toplevel_enum(int index) const { + return EnumDefPtr(upb_FileDef_TopLevelEnum(ptr_, index)); + } + + int toplevel_message_count() const { + return upb_FileDef_TopLevelMessageCount(ptr_); + } + MessageDefPtr toplevel_message(int index) const { + return MessageDefPtr(upb_FileDef_TopLevelMessage(ptr_, index)); + } + + int toplevel_extension_count() const { + return upb_FileDef_TopLevelExtensionCount(ptr_); + } + FieldDefPtr toplevel_extension(int index) const { + return FieldDefPtr(upb_FileDef_TopLevelExtension(ptr_, index)); + } + + explicit operator bool() const { return ptr_ != nullptr; } + + friend bool operator==(FileDefPtr lhs, FileDefPtr rhs) { + return lhs.ptr_ == rhs.ptr_; + } + + friend bool operator!=(FileDefPtr lhs, FileDefPtr rhs) { + return !(lhs == rhs); + } + + private: + const upb_FileDef* ptr_; +}; + +// Non-const methods in upb::DefPool are NOT thread-safe. +class DefPool { + public: + 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(); } + + // Finds an entry in the symbol table with this exact name. If not found, + // returns NULL. + MessageDefPtr FindMessageByName(const char* sym) const { + return MessageDefPtr(upb_DefPool_FindMessageByName(ptr_.get(), sym)); + } + + EnumDefPtr FindEnumByName(const char* sym) const { + return EnumDefPtr(upb_DefPool_FindEnumByName(ptr_.get(), sym)); + } + + FileDefPtr FindFileByName(const char* name) const { + return FileDefPtr(upb_DefPool_FindFileByName(ptr_.get(), name)); + } + + FieldDefPtr FindExtensionByName(const char* name) const { + return FieldDefPtr(upb_DefPool_FindExtensionByName(ptr_.get(), name)); + } + + void _SetPlatform(upb_MiniTablePlatform platform) { + _upb_DefPool_SetPlatform(ptr_.get(), platform); + } + + // TODO: iteration? + + // Adds the given serialized FileDescriptorProto to the pool. + FileDefPtr AddFile(const UPB_DESC(FileDescriptorProto) * file_proto, + Status* status) { + return FileDefPtr( + upb_DefPool_AddFile(ptr_.get(), file_proto, status->ptr())); + } + + private: + std::unique_ptr ptr_; +}; + +// TODO(b/236632406): This typedef is deprecated. Delete it. +using SymbolTable = DefPool; + +inline FileDefPtr FieldDefPtr::file() const { + return FileDefPtr(upb_FieldDef_File(ptr_)); +} + +inline FileDefPtr MessageDefPtr::file() const { + return FileDefPtr(upb_MessageDef_File(ptr_)); +} + +inline EnumDefPtr MessageDefPtr::enum_type(int i) const { + return EnumDefPtr(upb_MessageDef_NestedEnum(ptr_, i)); +} + +inline MessageDefPtr FieldDefPtr::message_type() const { + return MessageDefPtr(upb_FieldDef_MessageSubDef(ptr_)); +} + +inline MessageDefPtr FieldDefPtr::containing_type() const { + return MessageDefPtr(upb_FieldDef_ContainingType(ptr_)); +} + +inline MessageDefPtr FieldDefPtr::extension_scope() const { + return MessageDefPtr(upb_FieldDef_ExtensionScope(ptr_)); +} + +inline MessageDefPtr OneofDefPtr::containing_type() const { + return MessageDefPtr(upb_OneofDef_ContainingType(ptr_)); +} + +inline OneofDefPtr FieldDefPtr::containing_oneof() const { + return OneofDefPtr(upb_FieldDef_ContainingOneof(ptr_)); +} + +inline OneofDefPtr FieldDefPtr::real_containing_oneof() const { + return OneofDefPtr(upb_FieldDef_RealContainingOneof(ptr_)); +} + +inline EnumDefPtr FieldDefPtr::enum_subdef() const { + return EnumDefPtr(upb_FieldDef_EnumSubDef(ptr_)); +} + +} // namespace upb + +#include "upb/port/undef.inc" + +#endif // UPB_REFLECTION_DEF_HPP_ diff --git a/third_party/upb/upb/reflection/def_builder.c b/third_party/upb/upb/reflection/def_builder.c new file mode 100644 index 00000000000..a23a8721e0f --- /dev/null +++ b/third_party/upb/upb/reflection/def_builder.c @@ -0,0 +1,357 @@ +/* + * 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 + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/field_def.h" + +// Must be last. +#include "upb/port/def.inc" + +/* The upb core does not generally have a concept of default instances. However + * for descriptor options we make an exception since the max size is known and + * modest (<200 bytes). All types can share a default instance since it is + * initialized to zeroes. + * + * We have to allocate an extra pointer for upb's internal metadata. */ +static const char opt_default_buf[_UPB_MAXOPT_SIZE + sizeof(void*)] = {0}; +const char* kUpbDefOptDefault = &opt_default_buf[sizeof(void*)]; + +const char* _upb_DefBuilder_FullToShort(const char* fullname) { + const char* p; + + if (fullname == NULL) { + return NULL; + } else if ((p = strrchr(fullname, '.')) == NULL) { + /* No '.' in the name, return the full string. */ + return fullname; + } else { + /* Return one past the last '.'. */ + return p + 1; + } +} + +void _upb_DefBuilder_FailJmp(upb_DefBuilder* ctx) { UPB_LONGJMP(ctx->err, 1); } + +void _upb_DefBuilder_Errf(upb_DefBuilder* ctx, const char* fmt, ...) { + va_list argp; + va_start(argp, fmt); + upb_Status_VSetErrorFormat(ctx->status, fmt, argp); + va_end(argp); + _upb_DefBuilder_FailJmp(ctx); +} + +void _upb_DefBuilder_OomErr(upb_DefBuilder* ctx) { + upb_Status_SetErrorMessage(ctx->status, "out of memory"); + _upb_DefBuilder_FailJmp(ctx); +} + +// Verify a relative identifier string. The loop is branchless for speed. +static void _upb_DefBuilder_CheckIdentNotFull(upb_DefBuilder* ctx, + upb_StringView name) { + bool good = name.size > 0; + + for (size_t i = 0; i < name.size; i++) { + const char c = name.data[i]; + const char d = c | 0x20; // force lowercase + const bool is_alpha = (('a' <= d) & (d <= 'z')) | (c == '_'); + const bool is_numer = ('0' <= c) & (c <= '9') & (i != 0); + + good &= is_alpha | is_numer; + } + + if (!good) _upb_DefBuilder_CheckIdentSlow(ctx, name, false); +} + +const char* _upb_DefBuilder_MakeFullName(upb_DefBuilder* ctx, + const char* prefix, + upb_StringView name) { + _upb_DefBuilder_CheckIdentNotFull(ctx, name); + if (prefix) { + // ret = prefix + '.' + name; + size_t n = strlen(prefix); + char* ret = _upb_DefBuilder_Alloc(ctx, n + name.size + 2); + strcpy(ret, prefix); + ret[n] = '.'; + memcpy(&ret[n + 1], name.data, name.size); + ret[n + 1 + name.size] = '\0'; + return ret; + } else { + char* ret = upb_strdup2(name.data, name.size, ctx->arena); + if (!ret) _upb_DefBuilder_OomErr(ctx); + return ret; + } +} + +static bool remove_component(char* base, size_t* len) { + if (*len == 0) return false; + + for (size_t i = *len - 1; i > 0; i--) { + if (base[i] == '.') { + *len = i; + return true; + } + } + + *len = 0; + return true; +} + +const void* _upb_DefBuilder_ResolveAny(upb_DefBuilder* ctx, + const char* from_name_dbg, + const char* base, upb_StringView sym, + upb_deftype_t* type) { + if (sym.size == 0) goto notfound; + upb_value v; + if (sym.data[0] == '.') { + /* Symbols starting with '.' are absolute, so we do a single lookup. + * Slice to omit the leading '.' */ + if (!_upb_DefPool_LookupSym(ctx->symtab, sym.data + 1, sym.size - 1, &v)) { + goto notfound; + } + } else { + /* Remove components from base until we find an entry or run out. */ + size_t baselen = base ? strlen(base) : 0; + char* tmp = malloc(sym.size + baselen + 1); + while (1) { + char* p = tmp; + if (baselen) { + memcpy(p, base, baselen); + p[baselen] = '.'; + p += baselen + 1; + } + memcpy(p, sym.data, sym.size); + p += sym.size; + if (_upb_DefPool_LookupSym(ctx->symtab, tmp, p - tmp, &v)) { + break; + } + if (!remove_component(tmp, &baselen)) { + free(tmp); + goto notfound; + } + } + free(tmp); + } + + *type = _upb_DefType_Type(v); + return _upb_DefType_Unpack(v, *type); + +notfound: + _upb_DefBuilder_Errf(ctx, "couldn't resolve name '" UPB_STRINGVIEW_FORMAT "'", + UPB_STRINGVIEW_ARGS(sym)); +} + +const void* _upb_DefBuilder_Resolve(upb_DefBuilder* ctx, + const char* from_name_dbg, const char* base, + upb_StringView sym, upb_deftype_t type) { + upb_deftype_t found_type; + const void* ret = + _upb_DefBuilder_ResolveAny(ctx, from_name_dbg, base, sym, &found_type); + if (ret && found_type != type) { + _upb_DefBuilder_Errf(ctx, + "type mismatch when resolving %s: couldn't find " + "name " UPB_STRINGVIEW_FORMAT " with type=%d", + from_name_dbg, UPB_STRINGVIEW_ARGS(sym), (int)type); + } + return ret; +} + +// Per ASCII this will lower-case a letter. If the result is a letter, the +// input was definitely a letter. If the output is not a letter, this may +// have transformed the character unpredictably. +static char upb_ascii_lower(char ch) { return ch | 0x20; } + +// isalpha() etc. from are locale-dependent, which we don't want. +static bool upb_isbetween(uint8_t c, uint8_t low, uint8_t high) { + return low <= c && c <= high; +} + +static bool upb_isletter(char c) { + char lower = upb_ascii_lower(c); + return upb_isbetween(lower, 'a', 'z') || c == '_'; +} + +static bool upb_isalphanum(char c) { + return upb_isletter(c) || upb_isbetween(c, '0', '9'); +} + +static bool TryGetChar(const char** src, const char* end, char* ch) { + if (*src == end) return false; + *ch = **src; + *src += 1; + return true; +} + +static int TryGetHexDigit(const char** src, const char* end) { + char ch; + if (!TryGetChar(src, end, &ch)) return -1; + if ('0' <= ch && ch <= '9') { + return ch - '0'; + } + ch = upb_ascii_lower(ch); + if ('a' <= ch && ch <= 'f') { + return ch - 'a' + 0xa; + } + *src -= 1; // Char wasn't actually a hex digit. + return -1; +} + +static char upb_DefBuilder_ParseHexEscape(upb_DefBuilder* ctx, + const upb_FieldDef* f, + const char** src, const char* end) { + int hex_digit = TryGetHexDigit(src, end); + if (hex_digit < 0) { + _upb_DefBuilder_Errf( + ctx, "\\x must be followed by at least one hex digit (field='%s')", + upb_FieldDef_FullName(f)); + return 0; + } + unsigned int ret = hex_digit; + while ((hex_digit = TryGetHexDigit(src, end)) >= 0) { + ret = (ret << 4) | hex_digit; + } + if (ret > 0xff) { + _upb_DefBuilder_Errf(ctx, "Value of hex escape in field %s exceeds 8 bits", + upb_FieldDef_FullName(f)); + return 0; + } + return ret; +} + +static char TryGetOctalDigit(const char** src, const char* end) { + char ch; + if (!TryGetChar(src, end, &ch)) return -1; + if ('0' <= ch && ch <= '7') { + return ch - '0'; + } + *src -= 1; // Char wasn't actually an octal digit. + return -1; +} + +static char upb_DefBuilder_ParseOctalEscape(upb_DefBuilder* ctx, + const upb_FieldDef* f, + const char** src, const char* end) { + char ch = 0; + for (int i = 0; i < 3; i++) { + char digit; + if ((digit = TryGetOctalDigit(src, end)) >= 0) { + ch = (ch << 3) | digit; + } + } + return ch; +} + +char _upb_DefBuilder_ParseEscape(upb_DefBuilder* ctx, const upb_FieldDef* f, + const char** src, const char* end) { + char ch; + if (!TryGetChar(src, end, &ch)) { + _upb_DefBuilder_Errf(ctx, "unterminated escape sequence in field %s", + upb_FieldDef_FullName(f)); + return 0; + } + switch (ch) { + case 'a': + return '\a'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'v': + return '\v'; + case '\\': + return '\\'; + case '\'': + return '\''; + case '\"': + return '\"'; + case '?': + return '\?'; + case 'x': + case 'X': + return upb_DefBuilder_ParseHexEscape(ctx, f, src, end); + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + *src -= 1; + return upb_DefBuilder_ParseOctalEscape(ctx, f, src, end); + } + _upb_DefBuilder_Errf(ctx, "Unknown escape sequence: \\%c", ch); +} + +void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name, + bool full) { + const char* str = name.data; + const size_t len = name.size; + bool start = true; + for (size_t i = 0; i < len; i++) { + const char c = str[i]; + if (c == '.') { + if (start || !full) { + _upb_DefBuilder_Errf( + ctx, "invalid name: unexpected '.' (" UPB_STRINGVIEW_FORMAT ")", + UPB_STRINGVIEW_ARGS(name)); + } + start = true; + } else if (start) { + if (!upb_isletter(c)) { + _upb_DefBuilder_Errf(ctx, + "invalid name: path components must start with a " + "letter (" UPB_STRINGVIEW_FORMAT ")", + UPB_STRINGVIEW_ARGS(name)); + } + start = false; + } else if (!upb_isalphanum(c)) { + _upb_DefBuilder_Errf( + ctx, + "invalid name: non-alphanumeric character (" UPB_STRINGVIEW_FORMAT + ")", + UPB_STRINGVIEW_ARGS(name)); + } + } + if (start) { + _upb_DefBuilder_Errf(ctx, + "invalid name: empty part (" UPB_STRINGVIEW_FORMAT ")", + UPB_STRINGVIEW_ARGS(name)); + } + + // We should never reach this point. + UPB_ASSERT(false); +} diff --git a/third_party/upb/upb/reflection/def_builder_internal.h b/third_party/upb/upb/reflection/def_builder_internal.h new file mode 100644 index 00000000000..a4725c38cde --- /dev/null +++ b/third_party/upb/upb/reflection/def_builder_internal.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ +#define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ + +#include "upb/reflection/common.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/reflection/def_type.h" + +// Must be last. +#include "upb/port/def.inc" + +// We want to copy the options verbatim into the destination options proto. +// We use serialize+parse as our deep copy. +#define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto) \ + if (UPB_DESC(desc_type##_has_options)(proto)) { \ + size_t size; \ + char* pb = UPB_DESC(options_type##_serialize)( \ + UPB_DESC(desc_type##_options)(proto), ctx->tmp_arena, &size); \ + if (!pb) _upb_DefBuilder_OomErr(ctx); \ + target = \ + UPB_DESC(options_type##_parse)(pb, size, _upb_DefBuilder_Arena(ctx)); \ + if (!target) _upb_DefBuilder_OomErr(ctx); \ + } else { \ + target = (const UPB_DESC(options_type)*)kUpbDefOptDefault; \ + } + +#ifdef __cplusplus +extern "C" { +#endif + +struct upb_DefBuilder { + upb_DefPool* symtab; + upb_FileDef* file; // File we are building. + upb_Arena* arena; // Allocate defs here. + upb_Arena* tmp_arena; // For temporary allocations. + upb_Status* status; // Record errors here. + const upb_MiniTableFile* layout; // NULL if we should build layouts. + upb_MiniTablePlatform platform; // Platform we are targeting. + int enum_count; // Count of enums built so far. + int msg_count; // Count of messages built so far. + int ext_count; // Count of extensions built so far. + jmp_buf err; // longjmp() on error. +}; + +extern const char* kUpbDefOptDefault; + +// ctx->status has already been set elsewhere so just fail/longjmp() +UPB_NORETURN void _upb_DefBuilder_FailJmp(upb_DefBuilder* ctx); + +UPB_NORETURN void _upb_DefBuilder_Errf(upb_DefBuilder* ctx, const char* fmt, + ...) UPB_PRINTF(2, 3); +UPB_NORETURN void _upb_DefBuilder_OomErr(upb_DefBuilder* ctx); + +const char* _upb_DefBuilder_MakeFullName(upb_DefBuilder* ctx, + const char* prefix, + upb_StringView name); + +// Given a symbol and the base symbol inside which it is defined, +// find the symbol's definition. +const void* _upb_DefBuilder_ResolveAny(upb_DefBuilder* ctx, + const char* from_name_dbg, + const char* base, upb_StringView sym, + upb_deftype_t* type); + +const void* _upb_DefBuilder_Resolve(upb_DefBuilder* ctx, + const char* from_name_dbg, const char* base, + upb_StringView sym, upb_deftype_t type); + +char _upb_DefBuilder_ParseEscape(upb_DefBuilder* ctx, const upb_FieldDef* f, + const char** src, const char* end); + +const char* _upb_DefBuilder_FullToShort(const char* fullname); + +UPB_INLINE void* _upb_DefBuilder_Alloc(upb_DefBuilder* ctx, size_t bytes) { + if (bytes == 0) return NULL; + void* ret = upb_Arena_Malloc(ctx->arena, bytes); + if (!ret) _upb_DefBuilder_OomErr(ctx); + return ret; +} + +// Adds a symbol |v| to the symtab, which must be a def pointer previously +// packed with pack_def(). The def's pointer to upb_FileDef* must be set before +// adding, so we know which entries to remove if building this file fails. +UPB_INLINE void _upb_DefBuilder_Add(upb_DefBuilder* ctx, const char* name, + upb_value v) { + upb_StringView sym = {.data = name, .size = strlen(name)}; + bool ok = _upb_DefPool_InsertSym(ctx->symtab, sym, v, ctx->status); + if (!ok) _upb_DefBuilder_FailJmp(ctx); +} + +UPB_INLINE upb_Arena* _upb_DefBuilder_Arena(const upb_DefBuilder* ctx) { + return ctx->arena; +} + +UPB_INLINE upb_FileDef* _upb_DefBuilder_File(const upb_DefBuilder* ctx) { + return ctx->file; +} + +// This version of CheckIdent() is only called by other, faster versions after +// they detect a parsing error. +void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name, + bool full); + +// Verify a full identifier string. This is slightly more complicated than +// verifying a relative identifier string because we must track '.' chars. +UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx, + upb_StringView name) { + bool good = name.size > 0; + bool start = true; + + for (size_t i = 0; i < name.size; i++) { + const char c = name.data[i]; + const char d = c | 0x20; // force lowercase + const bool is_alpha = (('a' <= d) & (d <= 'z')) | (c == '_'); + const bool is_numer = ('0' <= c) & (c <= '9') & !start; + const bool is_dot = (c == '.') & !start; + + good &= is_alpha | is_numer | is_dot; + start = is_dot; + } + + if (!good) _upb_DefBuilder_CheckIdentSlow(ctx, name, true); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/def_builder_test.cc b/third_party/upb/upb/reflection/def_builder_test.cc new file mode 100644 index 00000000000..b57ae285e02 --- /dev/null +++ b/third_party/upb/upb/reflection/def_builder_test.cc @@ -0,0 +1,86 @@ +/* + * 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 "gtest/gtest.h" +#include "upb/reflection/def.hpp" +#include "upb/reflection/def_builder_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct IdentTest { + const char* text; + bool ok; +}; + +static const std::vector FullIdentTests = { + {"foo.bar", true}, {"foo.", true}, {"foo", true}, + + {"foo.7bar", false}, {".foo", false}, {"#", false}, + {".", false}, {"", false}, +}; + +static const std::vector NotFullIdentTests = { + {"foo", true}, {"foo1", true}, + + {"foo.bar", false}, {"1foo", false}, {"#", false}, + {".", false}, {"", false}, +}; + +TEST(DefBuilder, TestIdents) { + upb_StringView sv; + upb_Status status; + upb_DefBuilder ctx; + upb::Arena arena; + ctx.status = &status; + ctx.arena = arena.ptr(); + upb_Status_Clear(&status); + + for (const auto& test : FullIdentTests) { + sv.data = test.text; + sv.size = strlen(test.text); + + if (UPB_SETJMP(ctx.err)) { + EXPECT_FALSE(test.ok); + } else { + _upb_DefBuilder_CheckIdentFull(&ctx, sv); + EXPECT_TRUE(test.ok); + } + } + + for (const auto& test : NotFullIdentTests) { + sv.data = test.text; + sv.size = strlen(test.text); + + if (UPB_SETJMP(ctx.err)) { + EXPECT_FALSE(test.ok); + } else { + _upb_DefBuilder_MakeFullName(&ctx, "abc", sv); + EXPECT_TRUE(test.ok); + } + } +} diff --git a/third_party/upb/upb/reflection/def_pool.c b/third_party/upb/upb/reflection/def_pool.c new file mode 100644 index 00000000000..da8838c20cf --- /dev/null +++ b/third_party/upb/upb/reflection/def_pool.c @@ -0,0 +1,462 @@ +/* + * 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/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_pool_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/enum_value_def_internal.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/message_def_internal.h" +#include "upb/reflection/service_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_DefPool { + upb_Arena* arena; + upb_strtable syms; // full_name -> packed def ptr + upb_strtable files; // file_name -> (upb_FileDef*) + upb_inttable exts; // (upb_MiniTableExtension*) -> (upb_FieldDef*) + upb_ExtensionRegistry* extreg; + upb_MiniTablePlatform platform; + void* scratch_data; + size_t scratch_size; + size_t bytes_loaded; +}; + +void upb_DefPool_Free(upb_DefPool* s) { + upb_Arena_Free(s->arena); + upb_gfree(s->scratch_data); + upb_gfree(s); +} + +upb_DefPool* upb_DefPool_New(void) { + upb_DefPool* s = upb_gmalloc(sizeof(*s)); + if (!s) return NULL; + + s->arena = upb_Arena_New(); + s->bytes_loaded = 0; + + s->scratch_size = 240; + s->scratch_data = upb_gmalloc(s->scratch_size); + if (!s->scratch_data) goto err; + + if (!upb_strtable_init(&s->syms, 32, s->arena)) goto err; + if (!upb_strtable_init(&s->files, 4, s->arena)) goto err; + if (!upb_inttable_init(&s->exts, s->arena)) goto err; + + s->extreg = upb_ExtensionRegistry_New(s->arena); + if (!s->extreg) goto err; + + s->platform = kUpb_MiniTablePlatform_Native; + + return s; + +err: + upb_DefPool_Free(s); + return NULL; +} + +bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext, + const upb_FieldDef* f) { + return upb_inttable_insert(&s->exts, (uintptr_t)ext, upb_value_constptr(f), + s->arena); +} + +bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v, + upb_Status* status) { + // TODO: table should support an operation "tryinsert" to avoid the double + // lookup. + if (upb_strtable_lookup2(&s->syms, sym.data, sym.size, NULL)) { + upb_Status_SetErrorFormat(status, "duplicate symbol '%s'", sym.data); + return false; + } + if (!upb_strtable_insert(&s->syms, sym.data, sym.size, v, s->arena)) { + upb_Status_SetErrorMessage(status, "out of memory"); + return false; + } + return true; +} + +static const void* _upb_DefPool_Unpack(const upb_DefPool* s, const char* sym, + size_t size, upb_deftype_t type) { + upb_value v; + return upb_strtable_lookup2(&s->syms, sym, size, &v) + ? _upb_DefType_Unpack(v, type) + : NULL; +} + +bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size, + upb_value* v) { + return upb_strtable_lookup2(&s->syms, sym, size, v); +} + +upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s) { + return s->extreg; +} + +void** _upb_DefPool_ScratchData(const upb_DefPool* s) { + return (void**)&s->scratch_data; +} + +size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s) { + return (size_t*)&s->scratch_size; +} + +void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform) { + assert(upb_strtable_count(&s->files) == 0); + s->platform = platform; +} + +const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s, + const char* sym) { + return _upb_DefPool_Unpack(s, sym, strlen(sym), UPB_DEFTYPE_MSG); +} + +const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize( + const upb_DefPool* s, const char* sym, size_t len) { + return _upb_DefPool_Unpack(s, sym, len, UPB_DEFTYPE_MSG); +} + +const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s, + const char* sym) { + return _upb_DefPool_Unpack(s, sym, strlen(sym), UPB_DEFTYPE_ENUM); +} + +const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s, + const char* sym) { + return _upb_DefPool_Unpack(s, sym, strlen(sym), UPB_DEFTYPE_ENUMVAL); +} + +const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s, + const char* name) { + upb_value v; + return upb_strtable_lookup(&s->files, name, &v) ? upb_value_getconstptr(v) + : NULL; +} + +const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s, + const char* name, + size_t len) { + upb_value v; + return upb_strtable_lookup2(&s->files, name, len, &v) + ? upb_value_getconstptr(v) + : NULL; +} + +const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( + const upb_DefPool* s, const char* name, size_t size) { + upb_value v; + if (!upb_strtable_lookup2(&s->syms, name, size, &v)) return NULL; + + switch (_upb_DefType_Type(v)) { + case UPB_DEFTYPE_FIELD: + return _upb_DefType_Unpack(v, UPB_DEFTYPE_FIELD); + case UPB_DEFTYPE_MSG: { + const upb_MessageDef* m = _upb_DefType_Unpack(v, UPB_DEFTYPE_MSG); + return _upb_MessageDef_InMessageSet(m) + ? upb_MessageDef_NestedExtension(m, 0) + : NULL; + } + default: + break; + } + + return NULL; +} + +const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s, + const char* sym) { + return upb_DefPool_FindExtensionByNameWithSize(s, sym, strlen(sym)); +} + +const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s, + const char* name) { + return _upb_DefPool_Unpack(s, name, strlen(name), UPB_DEFTYPE_SERVICE); +} + +const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( + const upb_DefPool* s, const char* name, size_t size) { + return _upb_DefPool_Unpack(s, name, size, UPB_DEFTYPE_SERVICE); +} + +const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, + const char* name) { + upb_value v; + // TODO(haberman): non-extension fields and oneofs. + if (upb_strtable_lookup(&s->syms, name, &v)) { + switch (_upb_DefType_Type(v)) { + case UPB_DEFTYPE_EXT: { + const upb_FieldDef* f = _upb_DefType_Unpack(v, UPB_DEFTYPE_EXT); + return upb_FieldDef_File(f); + } + case UPB_DEFTYPE_MSG: { + const upb_MessageDef* m = _upb_DefType_Unpack(v, UPB_DEFTYPE_MSG); + return upb_MessageDef_File(m); + } + case UPB_DEFTYPE_ENUM: { + const upb_EnumDef* e = _upb_DefType_Unpack(v, UPB_DEFTYPE_ENUM); + return upb_EnumDef_File(e); + } + case UPB_DEFTYPE_ENUMVAL: { + const upb_EnumValueDef* ev = + _upb_DefType_Unpack(v, UPB_DEFTYPE_ENUMVAL); + return upb_EnumDef_File(upb_EnumValueDef_Enum(ev)); + } + case UPB_DEFTYPE_SERVICE: { + const upb_ServiceDef* service = + _upb_DefType_Unpack(v, UPB_DEFTYPE_SERVICE); + return upb_ServiceDef_File(service); + } + default: + UPB_UNREACHABLE(); + } + } + + const char* last_dot = strrchr(name, '.'); + if (last_dot) { + const upb_MessageDef* parent = + upb_DefPool_FindMessageByNameWithSize(s, name, last_dot - name); + if (parent) { + const char* shortname = last_dot + 1; + if (upb_MessageDef_FindByNameWithSize(parent, shortname, + strlen(shortname), NULL, NULL)) { + return upb_MessageDef_File(parent); + } + } + } + + return NULL; +} + +static void remove_filedef(upb_DefPool* s, upb_FileDef* file) { + intptr_t iter = UPB_INTTABLE_BEGIN; + upb_StringView key; + upb_value val; + while (upb_strtable_next2(&s->syms, &key, &val, &iter)) { + const upb_FileDef* f; + switch (_upb_DefType_Type(val)) { + case UPB_DEFTYPE_EXT: + f = upb_FieldDef_File(_upb_DefType_Unpack(val, UPB_DEFTYPE_EXT)); + break; + case UPB_DEFTYPE_MSG: + f = upb_MessageDef_File(_upb_DefType_Unpack(val, UPB_DEFTYPE_MSG)); + break; + case UPB_DEFTYPE_ENUM: + f = upb_EnumDef_File(_upb_DefType_Unpack(val, UPB_DEFTYPE_ENUM)); + break; + case UPB_DEFTYPE_ENUMVAL: + f = upb_EnumDef_File(upb_EnumValueDef_Enum( + _upb_DefType_Unpack(val, UPB_DEFTYPE_ENUMVAL))); + break; + case UPB_DEFTYPE_SERVICE: + f = upb_ServiceDef_File(_upb_DefType_Unpack(val, UPB_DEFTYPE_SERVICE)); + break; + default: + UPB_UNREACHABLE(); + } + + if (f == file) upb_strtable_removeiter(&s->syms, &iter); + } +} + +static const upb_FileDef* upb_DefBuilder_AddFileToPool( + upb_DefBuilder* const builder, upb_DefPool* const s, + const UPB_DESC(FileDescriptorProto) * const file_proto, + const upb_StringView name, upb_Status* const status) { + if (UPB_SETJMP(builder->err) != 0) { + UPB_ASSERT(!upb_Status_IsOk(status)); + if (builder->file) { + remove_filedef(s, builder->file); + builder->file = NULL; + } + } else if (!builder->arena || !builder->tmp_arena) { + _upb_DefBuilder_OomErr(builder); + } else { + _upb_FileDef_Create(builder, file_proto); + upb_strtable_insert(&s->files, name.data, name.size, + upb_value_constptr(builder->file), builder->arena); + UPB_ASSERT(upb_Status_IsOk(status)); + upb_Arena_Fuse(s->arena, builder->arena); + } + + if (builder->arena) upb_Arena_Free(builder->arena); + if (builder->tmp_arena) upb_Arena_Free(builder->tmp_arena); + return builder->file; +} + +static const upb_FileDef* _upb_DefPool_AddFile( + upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto, + const upb_MiniTableFile* layout, upb_Status* status) { + const upb_StringView name = UPB_DESC(FileDescriptorProto_name)(file_proto); + + // Determine whether we already know about this file. + { + upb_value v; + if (upb_strtable_lookup2(&s->files, name.data, name.size, &v)) { + upb_Status_SetErrorFormat(status, + "duplicate file name " UPB_STRINGVIEW_FORMAT, + UPB_STRINGVIEW_ARGS(name)); + return NULL; + } + } + + upb_DefBuilder ctx = { + .symtab = s, + .layout = layout, + .platform = s->platform, + .msg_count = 0, + .enum_count = 0, + .ext_count = 0, + .status = status, + .file = NULL, + .arena = upb_Arena_New(), + .tmp_arena = upb_Arena_New(), + }; + + return upb_DefBuilder_AddFileToPool(&ctx, s, file_proto, name, status); +} + +const upb_FileDef* upb_DefPool_AddFile(upb_DefPool* s, + const UPB_DESC(FileDescriptorProto) * + file_proto, + upb_Status* status) { + return _upb_DefPool_AddFile(s, file_proto, NULL, status); +} + +bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, + bool rebuild_minitable) { + /* Since this function should never fail (it would indicate a bug in upb) we + * print errors to stderr instead of returning error status to the user. */ + _upb_DefPool_Init** deps = init->deps; + UPB_DESC(FileDescriptorProto) * file; + upb_Arena* arena; + upb_Status status; + + upb_Status_Clear(&status); + + if (upb_DefPool_FindFileByName(s, init->filename)) { + return true; + } + + arena = upb_Arena_New(); + + for (; *deps; deps++) { + if (!_upb_DefPool_LoadDefInitEx(s, *deps, rebuild_minitable)) goto err; + } + + file = UPB_DESC(FileDescriptorProto_parse_ex)( + init->descriptor.data, init->descriptor.size, NULL, + kUpb_DecodeOption_AliasString, arena); + s->bytes_loaded += init->descriptor.size; + + if (!file) { + upb_Status_SetErrorFormat( + &status, + "Failed to parse compiled-in descriptor for file '%s'. This should " + "never happen.", + init->filename); + goto err; + } + + const upb_MiniTableFile* mt = rebuild_minitable ? NULL : init->layout; + if (!_upb_DefPool_AddFile(s, file, mt, &status)) { + goto err; + } + + upb_Arena_Free(arena); + return true; + +err: + fprintf(stderr, + "Error loading compiled-in descriptor for file '%s' (this should " + "never happen): %s\n", + init->filename, upb_Status_ErrorMessage(&status)); + upb_Arena_Free(arena); + return false; +} + +size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s) { + return s->bytes_loaded; +} + +upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s) { return s->arena; } + +const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable( + const upb_DefPool* s, const upb_MiniTableExtension* ext) { + upb_value v; + bool ok = upb_inttable_lookup(&s->exts, (uintptr_t)ext, &v); + UPB_ASSERT(ok); + return upb_value_getconstptr(v); +} + +const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, + const upb_MessageDef* m, + int32_t fieldnum) { + const upb_MiniTable* t = upb_MessageDef_MiniTable(m); + const upb_MiniTableExtension* ext = + upb_ExtensionRegistry_Lookup(s->extreg, t, fieldnum); + return ext ? upb_DefPool_FindExtensionByMiniTable(s, ext) : NULL; +} + +const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( + const upb_DefPool* s) { + return s->extreg; +} + +const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s, + const upb_MessageDef* m, + size_t* count) { + size_t n = 0; + intptr_t iter = UPB_INTTABLE_BEGIN; + uintptr_t key; + upb_value val; + // This is O(all exts) instead of O(exts for m). If we need this to be + // efficient we may need to make extreg into a two-level table, or have a + // second per-message index. + while (upb_inttable_next(&s->exts, &key, &val, &iter)) { + const upb_FieldDef* f = upb_value_getconstptr(val); + if (upb_FieldDef_ContainingType(f) == m) n++; + } + const upb_FieldDef** exts = malloc(n * sizeof(*exts)); + iter = UPB_INTTABLE_BEGIN; + size_t i = 0; + while (upb_inttable_next(&s->exts, &key, &val, &iter)) { + const upb_FieldDef* f = upb_value_getconstptr(val); + if (upb_FieldDef_ContainingType(f) == m) exts[i++] = f; + } + *count = n; + return exts; +} + +bool _upb_DefPool_LoadDefInit(upb_DefPool* s, const _upb_DefPool_Init* init) { + return _upb_DefPool_LoadDefInitEx(s, init, false); +} diff --git a/third_party/upb/upb/reflection/def_pool.h b/third_party/upb/upb/reflection/def_pool.h new file mode 100644 index 00000000000..157ff3aa833 --- /dev/null +++ b/third_party/upb/upb/reflection/def_pool.h @@ -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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_DEF_POOL_H_ +#define UPB_REFLECTION_DEF_POOL_H_ + +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" +#include "upb/reflection/def_type.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +void upb_DefPool_Free(upb_DefPool* s); + +upb_DefPool* upb_DefPool_New(void); + +const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s, + const char* sym); + +const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize( + const upb_DefPool* s, const char* sym, size_t len); + +const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s, + const char* sym); + +const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s, + const char* sym); + +const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s, + const char* name); + +const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s, + const char* name, + size_t len); + +const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable( + const upb_DefPool* s, const upb_MiniTableExtension* ext); + +const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s, + const char* sym); + +const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( + const upb_DefPool* s, const char* name, size_t size); + +const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, + const upb_MessageDef* m, + int32_t fieldnum); + +const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s, + const char* name); + +const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( + const upb_DefPool* s, const char* name, size_t size); + +const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, + const char* name); + +const upb_FileDef* upb_DefPool_AddFile(upb_DefPool* s, + const UPB_DESC(FileDescriptorProto) * + file_proto, + upb_Status* status); + +const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( + const upb_DefPool* s); + +const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s, + const upb_MessageDef* m, + size_t* count); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_DEF_POOL_H_ */ diff --git a/third_party/upb/upb/reflection/def_pool_internal.h b/third_party/upb/upb/reflection/def_pool_internal.h new file mode 100644 index 00000000000..7fa600153e6 --- /dev/null +++ b/third_party/upb/upb/reflection/def_pool_internal.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_ +#define UPB_REFLECTION_DEF_POOL_INTERNAL_H_ + +#include "upb/mini_table/decode.h" +#include "upb/reflection/def_pool.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s); +size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s); +upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s); + +bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext, + const upb_FieldDef* f); +bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v, + upb_Status* status); +bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size, + upb_value* v); + +void** _upb_DefPool_ScratchData(const upb_DefPool* s); +size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s); +void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform); + +// For generated code only: loads a generated descriptor. +typedef struct _upb_DefPool_Init { + struct _upb_DefPool_Init** deps; // Dependencies of this file. + const upb_MiniTableFile* layout; + const char* filename; + upb_StringView descriptor; // Serialized descriptor. +} _upb_DefPool_Init; + +bool _upb_DefPool_LoadDefInit(upb_DefPool* s, const _upb_DefPool_Init* init); + +// Should only be directly called by tests. This variant lets us suppress +// the use of compiled-in tables, forcing a rebuild of the tables at runtime. +bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, + bool rebuild_minitable); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/def_type.c b/third_party/upb/upb/reflection/def_type.c new file mode 100644 index 00000000000..110cc35d98a --- /dev/null +++ b/third_party/upb/upb/reflection/def_type.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/def_type.h" + +// Must be last. +#include "upb/port/def.inc" + +upb_deftype_t _upb_DefType_Type(upb_value v) { + const uintptr_t num = (uintptr_t)upb_value_getconstptr(v); + return num & UPB_DEFTYPE_MASK; +} + +upb_value _upb_DefType_Pack(const void* ptr, upb_deftype_t type) { + uintptr_t num = (uintptr_t)ptr; + UPB_ASSERT((num & UPB_DEFTYPE_MASK) == 0); + num |= type; + return upb_value_constptr((const void*)num); +} + +const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type) { + uintptr_t num = (uintptr_t)upb_value_getconstptr(v); + return (num & UPB_DEFTYPE_MASK) == type + ? (const void*)(num & ~UPB_DEFTYPE_MASK) + : NULL; +} diff --git a/third_party/upb/upb/reflection/def_type.h b/third_party/upb/upb/reflection/def_type.h new file mode 100644 index 00000000000..a6d5341d39f --- /dev/null +++ b/third_party/upb/upb/reflection/def_type.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_DEF_TYPE_H_ +#define UPB_REFLECTION_DEF_TYPE_H_ + +#include "upb/hash/common.h" + +// Must be last. +#include "upb/port/def.inc" + +// Inside a symtab we store tagged pointers to specific def types. +typedef enum { + UPB_DEFTYPE_MASK = 7, + + // Only inside symtab table. + UPB_DEFTYPE_EXT = 0, + UPB_DEFTYPE_MSG = 1, + UPB_DEFTYPE_ENUM = 2, + UPB_DEFTYPE_ENUMVAL = 3, + UPB_DEFTYPE_SERVICE = 4, + + // Only inside message table. + UPB_DEFTYPE_FIELD = 0, + UPB_DEFTYPE_ONEOF = 1, + UPB_DEFTYPE_FIELD_JSONNAME = 2, +} upb_deftype_t; + +#ifdef __cplusplus +extern "C" { +#endif + +// Our 3-bit pointer tagging requires all pointers to be multiples of 8. +// The arena will always yield 8-byte-aligned addresses, however we put +// the defs into arrays. For each element in the array to be 8-byte-aligned, +// the sizes of each def type must also be a multiple of 8. +// +// If any of these asserts fail, we need to add or remove padding on 32-bit +// machines (64-bit machines will have 8-byte alignment already due to +// pointers, which all of these structs have). +UPB_INLINE void _upb_DefType_CheckPadding(size_t size) { + UPB_ASSERT((size & UPB_DEFTYPE_MASK) == 0); +} + +upb_deftype_t _upb_DefType_Type(upb_value v); + +upb_value _upb_DefType_Pack(const void* ptr, upb_deftype_t type); + +const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_DEF_TYPE_H_ */ diff --git a/third_party/upb/upb/reflection/desc_state.c b/third_party/upb/upb/reflection/desc_state.c new file mode 100644 index 00000000000..09f4c2af0e8 --- /dev/null +++ b/third_party/upb/upb/reflection/desc_state.c @@ -0,0 +1,53 @@ +/* + * 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/reflection/desc_state_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +bool _upb_DescState_Grow(upb_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; +} diff --git a/third_party/upb/upb/reflection/desc_state_internal.h b/third_party/upb/upb/reflection/desc_state_internal.h new file mode 100644 index 00000000000..f25724e92c2 --- /dev/null +++ b/third_party/upb/upb/reflection/desc_state_internal.h @@ -0,0 +1,64 @@ +/* + * 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_REFLECTION_DESC_STATE_INTERNAL_H_ +#define UPB_REFLECTION_DESC_STATE_INTERNAL_H_ + +#include "upb/mem/arena.h" +#include "upb/mini_table/encode_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +// 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; +} upb_DescState; + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE void _upb_DescState_Init(upb_DescState* d) { + d->bufsize = kUpb_MtDataEncoder_MinSize * 2; + d->buf = NULL; + d->ptr = NULL; +} + +bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/enum_def.c b/third_party/upb/upb/reflection/enum_def.c new file mode 100644 index 00000000000..49f047c5be4 --- /dev/null +++ b/third_party/upb/upb/reflection/enum_def.c @@ -0,0 +1,310 @@ +/* + * 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/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/mini_table/decode.h" +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/desc_state_internal.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/enum_reserved_range_internal.h" +#include "upb/reflection/enum_value_def_internal.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/message_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_EnumDef { + const UPB_DESC(EnumOptions) * opts; + const upb_MiniTableEnum* layout; // Only for proto2. + const upb_FileDef* file; + const upb_MessageDef* containing_type; // Could be merged with "file". + const char* full_name; + upb_strtable ntoi; + upb_inttable iton; + const upb_EnumValueDef* values; + const upb_EnumReservedRange* res_ranges; + const upb_StringView* res_names; + int value_count; + int res_range_count; + int res_name_count; + int32_t defaultval; + bool is_closed; + bool is_sorted; // Whether all of the values are defined in ascending order. +}; + +upb_EnumDef* _upb_EnumDef_At(const upb_EnumDef* e, int i) { + return (upb_EnumDef*)&e[i]; +} + +const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e) { + return e->layout; +} + +bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a) { + const char* name = upb_EnumValueDef_Name(v); + const upb_value val = upb_value_constptr(v); + bool ok = upb_strtable_insert(&e->ntoi, name, strlen(name), val, a); + if (!ok) return false; + + // Multiple enumerators can have the same number, first one wins. + const int number = upb_EnumValueDef_Number(v); + if (!upb_inttable_lookup(&e->iton, number, NULL)) { + return upb_inttable_insert(&e->iton, number, val, a); + } + return true; +} + +const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e) { + return e->opts; +} + +bool upb_EnumDef_HasOptions(const upb_EnumDef* e) { + return e->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_EnumDef_FullName(const upb_EnumDef* e) { return e->full_name; } + +const char* upb_EnumDef_Name(const upb_EnumDef* e) { + return _upb_DefBuilder_FullToShort(e->full_name); +} + +const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e) { return e->file; } + +const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e) { + return e->containing_type; +} + +int32_t upb_EnumDef_Default(const upb_EnumDef* e) { + UPB_ASSERT(upb_EnumDef_FindValueByNumber(e, e->defaultval)); + return e->defaultval; +} + +int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e) { + return e->res_range_count; +} + +const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e, + int i) { + UPB_ASSERT(0 <= i && i < e->res_range_count); + return _upb_EnumReservedRange_At(e->res_ranges, i); +} + +int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e) { + return e->res_name_count; +} + +upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i) { + UPB_ASSERT(0 <= i && i < e->res_name_count); + return e->res_names[i]; +} + +int upb_EnumDef_ValueCount(const upb_EnumDef* e) { return e->value_count; } + +const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e, + const char* name) { + return upb_EnumDef_FindValueByNameWithSize(e, name, strlen(name)); +} + +const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize( + const upb_EnumDef* e, const char* name, size_t size) { + upb_value v; + return upb_strtable_lookup2(&e->ntoi, name, size, &v) + ? upb_value_getconstptr(v) + : NULL; +} + +const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* e, + int32_t num) { + upb_value v; + return upb_inttable_lookup(&e->iton, num, &v) ? upb_value_getconstptr(v) + : NULL; +} + +bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num) { + // We could use upb_EnumDef_FindValueByNumber(e, num) != NULL, but we expect + // this to be faster (especially for small numbers). + return upb_MiniTableEnum_CheckValue(e->layout, num); +} + +const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i) { + UPB_ASSERT(0 <= i && i < e->value_count); + return _upb_EnumValueDef_At(e->values, i); +} + +bool upb_EnumDef_IsClosed(const upb_EnumDef* e) { return e->is_closed; } + +bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a, + upb_StringView* out) { + upb_DescState s; + _upb_DescState_Init(&s); + + const upb_EnumValueDef** sorted = NULL; + if (!e->is_sorted) { + sorted = _upb_EnumValueDefs_Sorted(e->values, e->value_count, a); + if (!sorted) return false; + } + + if (!_upb_DescState_Grow(&s, a)) return false; + s.ptr = upb_MtDataEncoder_StartEnum(&s.e, s.ptr); + + // Duplicate values are allowed but we only encode each value once. + uint32_t previous = 0; + + for (size_t i = 0; i < e->value_count; i++) { + const uint32_t current = + upb_EnumValueDef_Number(sorted ? sorted[i] : upb_EnumDef_Value(e, i)); + if (i != 0 && previous == current) continue; + + if (!_upb_DescState_Grow(&s, a)) return false; + s.ptr = upb_MtDataEncoder_PutEnumValue(&s.e, s.ptr, current); + previous = current; + } + + if (!_upb_DescState_Grow(&s, a)) return false; + s.ptr = upb_MtDataEncoder_EndEnum(&s.e, s.ptr); + + // There will always be room for this '\0' in the encoder buffer because + // kUpb_MtDataEncoder_MinSize is overkill for upb_MtDataEncoder_EndEnum(). + UPB_ASSERT(s.ptr < s.buf + s.bufsize); + *s.ptr = '\0'; + + out->data = s.buf; + out->size = s.ptr - s.buf; + return true; +} + +static upb_MiniTableEnum* create_enumlayout(upb_DefBuilder* ctx, + const upb_EnumDef* e) { + upb_StringView sv; + bool ok = upb_EnumDef_MiniDescriptorEncode(e, ctx->tmp_arena, &sv); + if (!ok) _upb_DefBuilder_Errf(ctx, "OOM while building enum MiniDescriptor"); + + upb_Status status; + upb_MiniTableEnum* layout = + upb_MiniTableEnum_Build(sv.data, sv.size, ctx->arena, &status); + if (!layout) + _upb_DefBuilder_Errf(ctx, "Error building enum MiniTable: %s", status.msg); + return layout; +} + +static upb_StringView* _upb_EnumReservedNames_New( + upb_DefBuilder* ctx, int n, const upb_StringView* protos) { + upb_StringView* sv = _upb_DefBuilder_Alloc(ctx, sizeof(upb_StringView) * n); + for (size_t i = 0; i < n; i++) { + sv[i].data = + upb_strdup2(protos[i].data, protos[i].size, _upb_DefBuilder_Arena(ctx)); + sv[i].size = protos[i].size; + } + return sv; +} + +static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(EnumDescriptorProto) * enum_proto, + upb_EnumDef* e) { + const UPB_DESC(EnumValueDescriptorProto)* const* values; + const UPB_DESC(EnumDescriptorProto_EnumReservedRange)* const* res_ranges; + const upb_StringView* res_names; + upb_StringView name; + size_t n_value, n_res_range, n_res_name; + + // Must happen before _upb_DefBuilder_Add() + e->file = _upb_DefBuilder_File(ctx); + + name = UPB_DESC(EnumDescriptorProto_name)(enum_proto); + + e->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); + _upb_DefBuilder_Add(ctx, e->full_name, + _upb_DefType_Pack(e, UPB_DEFTYPE_ENUM)); + + e->is_closed = (!UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3) && + (upb_FileDef_Syntax(e->file) == kUpb_Syntax_Proto2); + + values = UPB_DESC(EnumDescriptorProto_value)(enum_proto, &n_value); + + bool ok = upb_strtable_init(&e->ntoi, n_value, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + ok = upb_inttable_init(&e->iton, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + e->defaultval = 0; + e->value_count = n_value; + e->values = + _upb_EnumValueDefs_New(ctx, prefix, n_value, values, e, &e->is_sorted); + + if (n_value == 0) { + _upb_DefBuilder_Errf(ctx, "enums must contain at least one value (%s)", + e->full_name); + } + + res_ranges = + UPB_DESC(EnumDescriptorProto_reserved_range)(enum_proto, &n_res_range); + e->res_range_count = n_res_range; + e->res_ranges = _upb_EnumReservedRanges_New(ctx, n_res_range, res_ranges, e); + + res_names = + UPB_DESC(EnumDescriptorProto_reserved_name)(enum_proto, &n_res_name); + e->res_name_count = n_res_name; + e->res_names = _upb_EnumReservedNames_New(ctx, n_res_name, res_names); + + UPB_DEF_SET_OPTIONS(e->opts, EnumDescriptorProto, EnumOptions, enum_proto); + + upb_inttable_compact(&e->iton, ctx->arena); + + if (e->is_closed) { + if (ctx->layout) { + UPB_ASSERT(ctx->enum_count < ctx->layout->enum_count); + e->layout = ctx->layout->enums[ctx->enum_count++]; + } else { + e->layout = create_enumlayout(ctx, e); + } + } else { + e->layout = NULL; + } +} + +upb_EnumDef* _upb_EnumDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto) * const* protos, + const upb_MessageDef* containing_type) { + _upb_DefType_CheckPadding(sizeof(upb_EnumDef)); + + // If a containing type is defined then get the full name from that. + // Otherwise use the package name from the file def. + const char* name = containing_type ? upb_MessageDef_FullName(containing_type) + : _upb_FileDef_RawPackage(ctx->file); + + upb_EnumDef* e = _upb_DefBuilder_Alloc(ctx, sizeof(upb_EnumDef) * n); + for (size_t i = 0; i < n; i++) { + create_enumdef(ctx, name, protos[i], &e[i]); + e[i].containing_type = containing_type; + } + return e; +} diff --git a/third_party/upb/upb/reflection/enum_def.h b/third_party/upb/upb/reflection/enum_def.h new file mode 100644 index 00000000000..f115e88923e --- /dev/null +++ b/third_party/upb/upb/reflection/enum_def.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_ENUM_DEF_H_ +#define UPB_REFLECTION_ENUM_DEF_H_ + +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num); +const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e); +int32_t upb_EnumDef_Default(const upb_EnumDef* e); +const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e); +const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e, + const char* name); +const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize( + const upb_EnumDef* e, const char* name, size_t size); +const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* e, + int32_t num); +const char* upb_EnumDef_FullName(const upb_EnumDef* e); +bool upb_EnumDef_HasOptions(const upb_EnumDef* e); +bool upb_EnumDef_IsClosed(const upb_EnumDef* e); + +// Creates a mini descriptor string for an enum, returns true on success. +bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a, + upb_StringView* out); + +const char* upb_EnumDef_Name(const upb_EnumDef* e); +const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e); + +upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i); +int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e); + +const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e, + int i); +int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e); + +const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i); +int upb_EnumDef_ValueCount(const upb_EnumDef* e); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ENUM_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/enum_def_internal.h b/third_party/upb/upb/reflection/enum_def_internal.h new file mode 100644 index 00000000000..41f99586835 --- /dev/null +++ b/third_party/upb/upb/reflection/enum_def_internal.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ +#define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ + +#include "upb/reflection/enum_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_EnumDef* _upb_EnumDef_At(const upb_EnumDef* e, int i); +bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a); +const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e); + +// Allocate and initialize an array of |n| enum defs. +upb_EnumDef* _upb_EnumDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto) * const* protos, + const upb_MessageDef* containing_type); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/enum_reserved_range.c b/third_party/upb/upb/reflection/enum_reserved_range.c new file mode 100644 index 00000000000..f6e22686689 --- /dev/null +++ b/third_party/upb/upb/reflection/enum_reserved_range.c @@ -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. + */ + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/enum_def.h" +#include "upb/reflection/enum_reserved_range_internal.h" +// #include "upb/reflection/extension_range_internal.h" +#include "upb/reflection/field_def.h" +// #include "upb/reflection/message_def.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_EnumReservedRange { + int32_t start; + int32_t end; +}; + +upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r, + int i) { + return (upb_EnumReservedRange*)&r[i]; +} + +int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r) { + return r->start; +} +int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r) { + return r->end; +} + +upb_EnumReservedRange* _upb_EnumReservedRanges_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto_EnumReservedRange) * const* protos, + const upb_EnumDef* e) { + upb_EnumReservedRange* r = + _upb_DefBuilder_Alloc(ctx, sizeof(upb_EnumReservedRange) * n); + + for (int i = 0; i < n; i++) { + const int32_t start = + UPB_DESC(EnumDescriptorProto_EnumReservedRange_start)(protos[i]); + const int32_t end = + UPB_DESC(EnumDescriptorProto_EnumReservedRange_end)(protos[i]); + + // A full validation would also check that each range is disjoint, and that + // none of the fields overlap with the extension ranges, but we are just + // sanity checking here. + + // Note: Not a typo! Unlike extension ranges and message reserved ranges, + // the end value of an enum reserved range is *inclusive*! + if (end < start) { + _upb_DefBuilder_Errf(ctx, "Reserved range (%d, %d) is invalid, enum=%s\n", + (int)start, (int)end, upb_EnumDef_FullName(e)); + } + + r[i].start = start; + r[i].end = end; + } + + return r; +} diff --git a/third_party/upb/upb/reflection/enum_reserved_range.h b/third_party/upb/upb/reflection/enum_reserved_range.h new file mode 100644 index 00000000000..7276bf69d76 --- /dev/null +++ b/third_party/upb/upb/reflection/enum_reserved_range.h @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ +#define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r); +int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */ diff --git a/third_party/upb/upb/reflection/enum_reserved_range_internal.h b/third_party/upb/upb/reflection/enum_reserved_range_internal.h new file mode 100644 index 00000000000..869f3b60ca7 --- /dev/null +++ b/third_party/upb/upb/reflection/enum_reserved_range_internal.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ +#define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ + +#include "upb/reflection/enum_reserved_range.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r, + int i); + +// Allocate and initialize an array of |n| reserved ranges owned by |e|. +upb_EnumReservedRange* _upb_EnumReservedRanges_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto_EnumReservedRange) * const* protos, + const upb_EnumDef* e); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/enum_value_def.c b/third_party/upb/upb/reflection/enum_value_def.c new file mode 100644 index 00000000000..70d2f1a45ab --- /dev/null +++ b/third_party/upb/upb/reflection/enum_value_def.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/enum_value_def_internal.h" +#include "upb/reflection/file_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_EnumValueDef { + const UPB_DESC(EnumValueOptions) * opts; + const upb_EnumDef* parent; + const char* full_name; + int32_t number; +}; + +upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i) { + return (upb_EnumValueDef*)&v[i]; +} + +static int _upb_EnumValueDef_Compare(const void* p1, const void* p2) { + const uint32_t v1 = (*(const upb_EnumValueDef**)p1)->number; + const uint32_t v2 = (*(const upb_EnumValueDef**)p2)->number; + return (v1 < v2) ? -1 : (v1 > v2); +} + +const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, + int n, upb_Arena* a) { + // TODO: Try to replace this arena alloc with a persistent scratch buffer. + upb_EnumValueDef** out = + (upb_EnumValueDef**)upb_Arena_Malloc(a, n * sizeof(void*)); + if (!out) return NULL; + + for (int i = 0; i < n; i++) { + out[i] = (upb_EnumValueDef*)&v[i]; + } + qsort(out, n, sizeof(void*), _upb_EnumValueDef_Compare); + + return (const upb_EnumValueDef**)out; +} + +const UPB_DESC(EnumValueOptions) * + upb_EnumValueDef_Options(const upb_EnumValueDef* v) { + return v->opts; +} + +bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v) { + return v->opts != (void*)kUpbDefOptDefault; +} + +const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* v) { + return v->parent; +} + +const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* v) { + return v->full_name; +} + +const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v) { + return _upb_DefBuilder_FullToShort(v->full_name); +} + +int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v) { return v->number; } + +uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v) { + // Compute index in our parent's array. + return v - upb_EnumDef_Value(v->parent, 0); +} + +static void create_enumvaldef(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(EnumValueDescriptorProto) * + val_proto, + upb_EnumDef* e, upb_EnumValueDef* v) { + upb_StringView name = UPB_DESC(EnumValueDescriptorProto_name)(val_proto); + + v->parent = e; // Must happen prior to _upb_DefBuilder_Add() + v->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); + v->number = UPB_DESC(EnumValueDescriptorProto_number)(val_proto); + _upb_DefBuilder_Add(ctx, v->full_name, + _upb_DefType_Pack(v, UPB_DEFTYPE_ENUMVAL)); + + UPB_DEF_SET_OPTIONS(v->opts, EnumValueDescriptorProto, EnumValueOptions, + val_proto); + + bool ok = _upb_EnumDef_Insert(e, v, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); +} + +// Allocate and initialize an array of |n| enum value defs owned by |e|. +upb_EnumValueDef* _upb_EnumValueDefs_New( + upb_DefBuilder* ctx, const char* prefix, int n, + const UPB_DESC(EnumValueDescriptorProto) * const* protos, upb_EnumDef* e, + bool* is_sorted) { + _upb_DefType_CheckPadding(sizeof(upb_EnumValueDef)); + + upb_EnumValueDef* v = + _upb_DefBuilder_Alloc(ctx, sizeof(upb_EnumValueDef) * n); + + *is_sorted = true; + uint32_t previous = 0; + for (size_t i = 0; i < n; i++) { + create_enumvaldef(ctx, prefix, protos[i], e, &v[i]); + + const uint32_t current = v[i].number; + if (previous > current) *is_sorted = false; + previous = current; + } + + if (upb_FileDef_Syntax(ctx->file) == kUpb_Syntax_Proto3 && n > 0 && + v[0].number != 0) { + _upb_DefBuilder_Errf(ctx, + "for proto3, the first enum value must be zero (%s)", + upb_EnumDef_FullName(e)); + } + + return v; +} diff --git a/third_party/upb/upb/reflection/enum_value_def.h b/third_party/upb/upb/reflection/enum_value_def.h new file mode 100644 index 00000000000..9f01edbff0e --- /dev/null +++ b/third_party/upb/upb/reflection/enum_value_def.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_ +#define UPB_REFLECTION_ENUM_VALUE_DEF_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* v); +const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* v); +bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v); +uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v); +const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v); +int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v); +const UPB_DESC(EnumValueOptions) * + upb_EnumValueDef_Options(const upb_EnumValueDef* v); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/enum_value_def_internal.h b/third_party/upb/upb/reflection/enum_value_def_internal.h new file mode 100644 index 00000000000..09f0644da0f --- /dev/null +++ b/third_party/upb/upb/reflection/enum_value_def_internal.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ +#define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ + +#include "upb/reflection/enum_value_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i); + +// Allocate and initialize an array of |n| enum value defs owned by |e|. +upb_EnumValueDef* _upb_EnumValueDefs_New( + upb_DefBuilder* ctx, const char* prefix, int n, + const UPB_DESC(EnumValueDescriptorProto) * const* protos, upb_EnumDef* e, + bool* is_sorted); + +const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, + int n, upb_Arena* a); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/extension_range.c b/third_party/upb/upb/reflection/extension_range.c new file mode 100644 index 00000000000..d7dfebdd62f --- /dev/null +++ b/third_party/upb/upb/reflection/extension_range.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/reflection/def_builder_internal.h" +#include "upb/reflection/extension_range_internal.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/message_def.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_ExtensionRange { + const UPB_DESC(ExtensionRangeOptions) * opts; + int32_t start; + int32_t end; +}; + +upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i) { + return (upb_ExtensionRange*)&r[i]; +} + +const UPB_DESC(ExtensionRangeOptions) * + upb_ExtensionRange_Options(const upb_ExtensionRange* r) { + return r->opts; +} + +bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r) { + return r->opts != (void*)kUpbDefOptDefault; +} + +int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r) { + return r->start; +} + +int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r) { return r->end; } + +upb_ExtensionRange* _upb_ExtensionRanges_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(DescriptorProto_ExtensionRange) * const* protos, + const upb_MessageDef* m) { + upb_ExtensionRange* r = + _upb_DefBuilder_Alloc(ctx, sizeof(upb_ExtensionRange) * n); + + for (int i = 0; i < n; i++) { + const int32_t start = + UPB_DESC(DescriptorProto_ExtensionRange_start)(protos[i]); + const int32_t end = UPB_DESC(DescriptorProto_ExtensionRange_end)(protos[i]); + const int32_t max = UPB_DESC(MessageOptions_message_set_wire_format)( + upb_MessageDef_Options(m)) + ? INT32_MAX + : kUpb_MaxFieldNumber + 1; + + // A full validation would also check that each range is disjoint, and that + // none of the fields overlap with the extension ranges, but we are just + // sanity checking here. + if (start < 1 || end <= start || end > max) { + _upb_DefBuilder_Errf(ctx, + "Extension range (%d, %d) is invalid, message=%s\n", + (int)start, (int)end, upb_MessageDef_FullName(m)); + } + + r[i].start = start; + r[i].end = end; + UPB_DEF_SET_OPTIONS(r[i].opts, DescriptorProto_ExtensionRange, + ExtensionRangeOptions, protos[i]); + } + + return r; +} diff --git a/third_party/upb/upb/reflection/extension_range.h b/third_party/upb/upb/reflection/extension_range.h new file mode 100644 index 00000000000..c8d56be5040 --- /dev/null +++ b/third_party/upb/upb/reflection/extension_range.h @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_EXTENSION_RANGE_H_ +#define UPB_REFLECTION_EXTENSION_RANGE_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r); +int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r); + +bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r); +const UPB_DESC(ExtensionRangeOptions) * + upb_ExtensionRange_Options(const upb_ExtensionRange* r); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */ diff --git a/third_party/upb/upb/reflection/extension_range_internal.h b/third_party/upb/upb/reflection/extension_range_internal.h new file mode 100644 index 00000000000..fde3d941f34 --- /dev/null +++ b/third_party/upb/upb/reflection/extension_range_internal.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ +#define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ + +#include "upb/reflection/extension_range.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i); + +// Allocate and initialize an array of |n| extension ranges owned by |m|. +upb_ExtensionRange* _upb_ExtensionRanges_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(DescriptorProto_ExtensionRange) * const* protos, + const upb_MessageDef* m); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/field_def.c b/third_party/upb/upb/reflection/field_def.c new file mode 100644 index 00000000000..f9b667fe286 --- /dev/null +++ b/third_party/upb/upb/reflection/field_def.c @@ -0,0 +1,931 @@ +/* + * 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 +#include + +#include "upb/mini_table/decode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/desc_state_internal.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/enum_value_def_internal.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/message_def_internal.h" +#include "upb/reflection/oneof_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +#define UPB_FIELD_TYPE_UNSPECIFIED 0 + +typedef struct { + size_t len; + char str[1]; // Null-terminated string data follows. +} str_t; + +struct upb_FieldDef { + const UPB_DESC(FieldOptions) * opts; + const upb_FileDef* file; + const upb_MessageDef* msgdef; + const char* full_name; + const char* json_name; + union { + int64_t sint; + uint64_t uint; + double dbl; + float flt; + bool boolean; + str_t* str; + void* msg; // Always NULL. + } defaultval; + union { + const upb_OneofDef* oneof; + const upb_MessageDef* extension_scope; + } scope; + union { + const upb_MessageDef* msgdef; + const upb_EnumDef* enumdef; + const UPB_DESC(FieldDescriptorProto) * unresolved; + } sub; + uint32_t number_; + uint16_t index_; + uint16_t layout_index; // Index into msgdef->layout->fields or file->exts + bool has_default; + bool has_json_name; + bool has_presence; + bool is_extension; + bool is_packed; + bool is_proto3_optional; + upb_FieldType type_; + upb_Label label_; +#if UINTPTR_MAX == 0xffffffff + uint32_t padding; // Increase size to a multiple of 8. +#endif +}; + +upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i) { + return (upb_FieldDef*)&f[i]; +} + +const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f) { + return f->opts; +} + +bool upb_FieldDef_HasOptions(const upb_FieldDef* f) { + return f->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_FieldDef_FullName(const upb_FieldDef* f) { + return f->full_name; +} + +upb_CType upb_FieldDef_CType(const upb_FieldDef* f) { + switch (f->type_) { + case kUpb_FieldType_Double: + return kUpb_CType_Double; + case kUpb_FieldType_Float: + return kUpb_CType_Float; + case kUpb_FieldType_Int64: + case kUpb_FieldType_SInt64: + case kUpb_FieldType_SFixed64: + return kUpb_CType_Int64; + case kUpb_FieldType_Int32: + case kUpb_FieldType_SFixed32: + case kUpb_FieldType_SInt32: + return kUpb_CType_Int32; + case kUpb_FieldType_UInt64: + case kUpb_FieldType_Fixed64: + return kUpb_CType_UInt64; + case kUpb_FieldType_UInt32: + case kUpb_FieldType_Fixed32: + return kUpb_CType_UInt32; + case kUpb_FieldType_Enum: + return kUpb_CType_Enum; + case kUpb_FieldType_Bool: + return kUpb_CType_Bool; + case kUpb_FieldType_String: + return kUpb_CType_String; + case kUpb_FieldType_Bytes: + return kUpb_CType_Bytes; + case kUpb_FieldType_Group: + case kUpb_FieldType_Message: + return kUpb_CType_Message; + } + UPB_UNREACHABLE(); +} + +upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) { return f->type_; } + +uint32_t upb_FieldDef_Index(const upb_FieldDef* f) { return f->index_; } + +upb_Label upb_FieldDef_Label(const upb_FieldDef* f) { return f->label_; } + +uint32_t upb_FieldDef_Number(const upb_FieldDef* f) { return f->number_; } + +bool upb_FieldDef_IsExtension(const upb_FieldDef* f) { return f->is_extension; } + +bool upb_FieldDef_IsPacked(const upb_FieldDef* f) { return f->is_packed; } + +const char* upb_FieldDef_Name(const upb_FieldDef* f) { + return _upb_DefBuilder_FullToShort(f->full_name); +} + +const char* upb_FieldDef_JsonName(const upb_FieldDef* f) { + return f->json_name; +} + +bool upb_FieldDef_HasJsonName(const upb_FieldDef* f) { + return f->has_json_name; +} + +const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f) { return f->file; } + +const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f) { + return f->msgdef; +} + +const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f) { + return f->is_extension ? f->scope.extension_scope : NULL; +} + +const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f) { + return f->is_extension ? NULL : f->scope.oneof; +} + +const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f) { + const upb_OneofDef* oneof = upb_FieldDef_ContainingOneof(f); + if (!oneof || upb_OneofDef_IsSynthetic(oneof)) return NULL; + return oneof; +} + +upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f) { + upb_MessageValue ret; + + if (upb_FieldDef_IsRepeated(f) || upb_FieldDef_IsSubMessage(f)) { + return (upb_MessageValue){.msg_val = NULL}; + } + + switch (upb_FieldDef_CType(f)) { + case kUpb_CType_Bool: + return (upb_MessageValue){.bool_val = f->defaultval.boolean}; + case kUpb_CType_Int64: + return (upb_MessageValue){.int64_val = f->defaultval.sint}; + case kUpb_CType_UInt64: + return (upb_MessageValue){.uint64_val = f->defaultval.uint}; + case kUpb_CType_Enum: + case kUpb_CType_Int32: + return (upb_MessageValue){.int32_val = (int32_t)f->defaultval.sint}; + case kUpb_CType_UInt32: + return (upb_MessageValue){.uint32_val = (uint32_t)f->defaultval.uint}; + case kUpb_CType_Float: + return (upb_MessageValue){.float_val = f->defaultval.flt}; + case kUpb_CType_Double: + return (upb_MessageValue){.double_val = f->defaultval.dbl}; + case kUpb_CType_String: + case kUpb_CType_Bytes: { + str_t* str = f->defaultval.str; + if (str) { + return (upb_MessageValue){ + .str_val = (upb_StringView){.data = str->str, .size = str->len}}; + } else { + return (upb_MessageValue){ + .str_val = (upb_StringView){.data = NULL, .size = 0}}; + } + } + default: + UPB_UNREACHABLE(); + } + + return ret; +} + +const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f) { + return upb_FieldDef_CType(f) == kUpb_CType_Message ? f->sub.msgdef : NULL; +} + +const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f) { + return upb_FieldDef_CType(f) == kUpb_CType_Enum ? f->sub.enumdef : NULL; +} + +const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f) { + if (upb_FieldDef_IsExtension(f)) { + const upb_FileDef* file = upb_FieldDef_File(f); + return (upb_MiniTableField*)_upb_FileDef_ExtensionMiniTable( + file, f->layout_index); + } else { + const upb_MiniTable* layout = upb_MessageDef_MiniTable(f->msgdef); + return &layout->fields[f->layout_index]; + } +} + +const upb_MiniTableExtension* _upb_FieldDef_ExtensionMiniTable( + const upb_FieldDef* f) { + UPB_ASSERT(upb_FieldDef_IsExtension(f)); + const upb_FileDef* file = upb_FieldDef_File(f); + return _upb_FileDef_ExtensionMiniTable(file, f->layout_index); +} + +bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f) { + if (f->type_ != kUpb_FieldType_Enum) return false; + return upb_EnumDef_IsClosed(f->sub.enumdef); +} + +bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f) { + return f->is_proto3_optional; +} + +int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f) { return f->layout_index; } + +uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f) { + uint64_t out = f->is_packed ? kUpb_FieldModifier_IsPacked : 0; + + switch (f->label_) { + case kUpb_Label_Optional: + if (!upb_FieldDef_HasPresence(f)) { + out |= kUpb_FieldModifier_IsProto3Singular; + } + break; + case kUpb_Label_Repeated: + out |= kUpb_FieldModifier_IsRepeated; + break; + case kUpb_Label_Required: + out |= kUpb_FieldModifier_IsRequired; + break; + } + + if (_upb_FieldDef_IsClosedEnum(f)) { + out |= kUpb_FieldModifier_IsClosedEnum; + } + return out; +} + +bool upb_FieldDef_HasDefault(const upb_FieldDef* f) { return f->has_default; } +bool upb_FieldDef_HasPresence(const upb_FieldDef* f) { return f->has_presence; } + +bool upb_FieldDef_HasSubDef(const upb_FieldDef* f) { + return upb_FieldDef_IsSubMessage(f) || + upb_FieldDef_CType(f) == kUpb_CType_Enum; +} + +bool upb_FieldDef_IsMap(const upb_FieldDef* f) { + return upb_FieldDef_IsRepeated(f) && upb_FieldDef_IsSubMessage(f) && + upb_MessageDef_IsMapEntry(upb_FieldDef_MessageSubDef(f)); +} + +bool upb_FieldDef_IsOptional(const upb_FieldDef* f) { + return upb_FieldDef_Label(f) == kUpb_Label_Optional; +} + +bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f) { + return !upb_FieldDef_IsString(f) && !upb_FieldDef_IsSubMessage(f); +} + +bool upb_FieldDef_IsRepeated(const upb_FieldDef* f) { + return upb_FieldDef_Label(f) == kUpb_Label_Repeated; +} + +bool upb_FieldDef_IsRequired(const upb_FieldDef* f) { + return upb_FieldDef_Label(f) == kUpb_Label_Required; +} + +bool upb_FieldDef_IsString(const upb_FieldDef* f) { + return upb_FieldDef_CType(f) == kUpb_CType_String || + upb_FieldDef_CType(f) == kUpb_CType_Bytes; +} + +bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f) { + return upb_FieldDef_CType(f) == kUpb_CType_Message; +} + +static bool between(int32_t x, int32_t low, int32_t high) { + return x >= low && x <= high; +} + +bool upb_FieldDef_checklabel(int32_t label) { return between(label, 1, 3); } +bool upb_FieldDef_checktype(int32_t type) { return between(type, 1, 11); } +bool upb_FieldDef_checkintfmt(int32_t fmt) { return between(fmt, 1, 3); } + +bool upb_FieldDef_checkdescriptortype(int32_t type) { + return between(type, 1, 18); +} + +static bool streql2(const char* a, size_t n, const char* b) { + return n == strlen(b) && memcmp(a, b, n) == 0; +} + +// Implement the transformation as described in the spec: +// 1. upper case all letters after an underscore. +// 2. remove all underscores. +static char* make_json_name(const char* name, size_t size, upb_Arena* a) { + char* out = upb_Arena_Malloc(a, size + 1); // +1 is to add a trailing '\0' + if (out == NULL) return NULL; + + bool ucase_next = false; + char* des = out; + for (size_t i = 0; i < size; i++) { + if (name[i] == '_') { + ucase_next = true; + } else { + *des++ = ucase_next ? toupper(name[i]) : name[i]; + ucase_next = false; + } + } + *des++ = '\0'; + return out; +} + +static str_t* newstr(upb_DefBuilder* ctx, const char* data, size_t len) { + str_t* ret = _upb_DefBuilder_Alloc(ctx, sizeof(*ret) + len); + if (!ret) _upb_DefBuilder_OomErr(ctx); + ret->len = len; + if (len) memcpy(ret->str, data, len); + ret->str[len] = '\0'; + return ret; +} + +static str_t* unescape(upb_DefBuilder* ctx, const upb_FieldDef* f, + const char* data, size_t len) { + // Size here is an upper bound; escape sequences could ultimately shrink it. + str_t* ret = _upb_DefBuilder_Alloc(ctx, sizeof(*ret) + len); + char* dst = &ret->str[0]; + const char* src = data; + const char* end = data + len; + + while (src < end) { + if (*src == '\\') { + src++; + *dst++ = _upb_DefBuilder_ParseEscape(ctx, f, &src, end); + } else { + *dst++ = *src++; + } + } + + ret->len = dst - &ret->str[0]; + return ret; +} + +static void parse_default(upb_DefBuilder* ctx, const char* str, size_t len, + upb_FieldDef* f) { + char* end; + char nullz[64]; + errno = 0; + + switch (upb_FieldDef_CType(f)) { + case kUpb_CType_Int32: + case kUpb_CType_Int64: + case kUpb_CType_UInt32: + case kUpb_CType_UInt64: + case kUpb_CType_Double: + case kUpb_CType_Float: + // Standard C number parsing functions expect null-terminated strings. + if (len >= sizeof(nullz) - 1) { + _upb_DefBuilder_Errf(ctx, "Default too long: %.*s", (int)len, str); + } + memcpy(nullz, str, len); + nullz[len] = '\0'; + str = nullz; + break; + default: + break; + } + + switch (upb_FieldDef_CType(f)) { + case kUpb_CType_Int32: { + long val = strtol(str, &end, 0); + if (val > INT32_MAX || val < INT32_MIN || errno == ERANGE || *end) { + goto invalid; + } + f->defaultval.sint = val; + break; + } + case kUpb_CType_Enum: { + const upb_EnumDef* e = f->sub.enumdef; + const upb_EnumValueDef* ev = + upb_EnumDef_FindValueByNameWithSize(e, str, len); + if (!ev) { + goto invalid; + } + f->defaultval.sint = upb_EnumValueDef_Number(ev); + break; + } + case kUpb_CType_Int64: { + long long val = strtoll(str, &end, 0); + if (val > INT64_MAX || val < INT64_MIN || errno == ERANGE || *end) { + goto invalid; + } + f->defaultval.sint = val; + break; + } + case kUpb_CType_UInt32: { + unsigned long val = strtoul(str, &end, 0); + if (val > UINT32_MAX || errno == ERANGE || *end) { + goto invalid; + } + f->defaultval.uint = val; + break; + } + case kUpb_CType_UInt64: { + unsigned long long val = strtoull(str, &end, 0); + if (val > UINT64_MAX || errno == ERANGE || *end) { + goto invalid; + } + f->defaultval.uint = val; + break; + } + case kUpb_CType_Double: { + double val = strtod(str, &end); + if (errno == ERANGE || *end) { + goto invalid; + } + f->defaultval.dbl = val; + break; + } + case kUpb_CType_Float: { + float val = strtof(str, &end); + if (errno == ERANGE || *end) { + goto invalid; + } + f->defaultval.flt = val; + break; + } + case kUpb_CType_Bool: { + if (streql2(str, len, "false")) { + f->defaultval.boolean = false; + } else if (streql2(str, len, "true")) { + f->defaultval.boolean = true; + } else { + goto invalid; + } + break; + } + case kUpb_CType_String: + f->defaultval.str = newstr(ctx, str, len); + break; + case kUpb_CType_Bytes: + f->defaultval.str = unescape(ctx, f, str, len); + break; + case kUpb_CType_Message: + /* Should not have a default value. */ + _upb_DefBuilder_Errf(ctx, "Message should not have a default (%s)", + upb_FieldDef_FullName(f)); + } + + return; + +invalid: + _upb_DefBuilder_Errf(ctx, "Invalid default '%.*s' for field %s of type %d", + (int)len, str, upb_FieldDef_FullName(f), + (int)upb_FieldDef_Type(f)); +} + +static void set_default_default(upb_DefBuilder* ctx, upb_FieldDef* f) { + switch (upb_FieldDef_CType(f)) { + case kUpb_CType_Int32: + case kUpb_CType_Int64: + f->defaultval.sint = 0; + break; + case kUpb_CType_UInt64: + case kUpb_CType_UInt32: + f->defaultval.uint = 0; + break; + case kUpb_CType_Double: + case kUpb_CType_Float: + f->defaultval.dbl = 0; + break; + case kUpb_CType_String: + case kUpb_CType_Bytes: + f->defaultval.str = newstr(ctx, NULL, 0); + break; + case kUpb_CType_Bool: + f->defaultval.boolean = false; + break; + case kUpb_CType_Enum: { + const upb_EnumValueDef* v = upb_EnumDef_Value(f->sub.enumdef, 0); + f->defaultval.sint = upb_EnumValueDef_Number(v); + break; + } + case kUpb_CType_Message: + break; + } +} + +static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { + // Must happen before _upb_DefBuilder_Add() + f->file = _upb_DefBuilder_File(ctx); + + if (!UPB_DESC(FieldDescriptorProto_has_name)(field_proto)) { + _upb_DefBuilder_Errf(ctx, "field has no name"); + } + + const upb_StringView name = UPB_DESC(FieldDescriptorProto_name)(field_proto); + + f->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); + f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto); + f->number_ = UPB_DESC(FieldDescriptorProto_number)(field_proto); + f->is_proto3_optional = + UPB_DESC(FieldDescriptorProto_proto3_optional)(field_proto); + f->msgdef = m; + f->scope.oneof = NULL; + + f->has_json_name = UPB_DESC(FieldDescriptorProto_has_json_name)(field_proto); + if (f->has_json_name) { + const upb_StringView sv = + UPB_DESC(FieldDescriptorProto_json_name)(field_proto); + f->json_name = upb_strdup2(sv.data, sv.size, ctx->arena); + } else { + f->json_name = make_json_name(name.data, name.size, ctx->arena); + } + if (!f->json_name) _upb_DefBuilder_OomErr(ctx); + + const bool has_type = UPB_DESC(FieldDescriptorProto_has_type)(field_proto); + const bool has_type_name = + UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto); + + f->type_ = (int)UPB_DESC(FieldDescriptorProto_type)(field_proto); + + if (has_type) { + switch (f->type_) { + case kUpb_FieldType_Message: + case kUpb_FieldType_Group: + case kUpb_FieldType_Enum: + if (!has_type_name) { + _upb_DefBuilder_Errf(ctx, "field of type %d requires type name (%s)", + (int)f->type_, f->full_name); + } + break; + default: + if (has_type_name) { + _upb_DefBuilder_Errf( + ctx, "invalid type for field with type_name set (%s, %d)", + f->full_name, (int)f->type_); + } + } + } else if (has_type_name) { + f->type_ = + UPB_FIELD_TYPE_UNSPECIFIED; // We'll fill this in in resolve_fielddef() + } + + if (f->type_ < kUpb_FieldType_Double || f->type_ > kUpb_FieldType_SInt64) { + _upb_DefBuilder_Errf(ctx, "invalid type for field %s (%d)", f->full_name, + f->type_); + } + + if (f->label_ < kUpb_Label_Optional || f->label_ > kUpb_Label_Repeated) { + _upb_DefBuilder_Errf(ctx, "invalid label for field %s (%d)", f->full_name, + f->label_); + } + + /* We can't resolve the subdef or (in the case of extensions) the containing + * message yet, because it may not have been defined yet. We stash a pointer + * to the field_proto until later when we can properly resolve it. */ + f->sub.unresolved = field_proto; + + if (f->label_ == kUpb_Label_Required && + upb_FileDef_Syntax(f->file) == kUpb_Syntax_Proto3) { + _upb_DefBuilder_Errf(ctx, "proto3 fields cannot be required (%s)", + f->full_name); + } + + if (UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { + uint32_t oneof_index = + UPB_DESC(FieldDescriptorProto_oneof_index)(field_proto); + + if (upb_FieldDef_Label(f) != kUpb_Label_Optional) { + _upb_DefBuilder_Errf(ctx, "fields in oneof must have OPTIONAL label (%s)", + f->full_name); + } + + if (!m) { + _upb_DefBuilder_Errf(ctx, "oneof field (%s) has no containing msg", + f->full_name); + } + + if (oneof_index >= upb_MessageDef_OneofCount(m)) { + _upb_DefBuilder_Errf(ctx, "oneof_index out of range (%s)", f->full_name); + } + + upb_OneofDef* oneof = (upb_OneofDef*)upb_MessageDef_Oneof(m, oneof_index); + f->scope.oneof = oneof; + + bool ok = _upb_OneofDef_Insert(oneof, f, name.data, name.size, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + } + + UPB_DEF_SET_OPTIONS(f->opts, FieldDescriptorProto, FieldOptions, field_proto); + + if (UPB_DESC(FieldOptions_has_packed)(f->opts)) { + f->is_packed = UPB_DESC(FieldOptions_packed)(f->opts); + } else { + // Repeated fields default to packed for proto3 only. + f->is_packed = upb_FieldDef_IsPrimitive(f) && + f->label_ == kUpb_Label_Repeated && + upb_FileDef_Syntax(f->file) == kUpb_Syntax_Proto3; + } + + f->has_presence = + (!upb_FieldDef_IsRepeated(f)) && + (upb_FieldDef_IsSubMessage(f) || upb_FieldDef_ContainingOneof(f) || + (upb_FileDef_Syntax(f->file) == kUpb_Syntax_Proto2)); +} + +static void _upb_FieldDef_CreateExt(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { + f->is_extension = true; + _upb_FieldDef_Create(ctx, prefix, field_proto, m, f); + + if (UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { + _upb_DefBuilder_Errf(ctx, "oneof_index provided for extension field (%s)", + f->full_name); + } + + f->scope.extension_scope = m; + _upb_DefBuilder_Add(ctx, f->full_name, _upb_DefType_Pack(f, UPB_DEFTYPE_EXT)); + f->layout_index = ctx->ext_count++; + + if (ctx->layout) { + UPB_ASSERT(_upb_FieldDef_ExtensionMiniTable(f)->field.number == f->number_); + } +} + +static void _upb_FieldDef_CreateNotExt(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { + f->is_extension = false; + _upb_FieldDef_Create(ctx, prefix, field_proto, m, f); + + if (!UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { + if (f->is_proto3_optional) { + _upb_DefBuilder_Errf( + ctx, + "non-extension field (%s) with proto3_optional was not in a oneof", + f->full_name); + } + } + + _upb_MessageDef_InsertField(ctx, m, f); +} + +upb_FieldDef* _upb_Extensions_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, + upb_MessageDef* m) { + _upb_DefType_CheckPadding(sizeof(upb_FieldDef)); + upb_FieldDef* defs = + (upb_FieldDef*)_upb_DefBuilder_Alloc(ctx, sizeof(upb_FieldDef) * n); + + for (int i = 0; i < n; i++) { + upb_FieldDef* f = &defs[i]; + + _upb_FieldDef_CreateExt(ctx, prefix, protos[i], m, f); + f->index_ = i; + } + + return defs; +} + +upb_FieldDef* _upb_FieldDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, + upb_MessageDef* m, bool* is_sorted) { + _upb_DefType_CheckPadding(sizeof(upb_FieldDef)); + upb_FieldDef* defs = + (upb_FieldDef*)_upb_DefBuilder_Alloc(ctx, sizeof(upb_FieldDef) * n); + + uint32_t previous = 0; + for (int i = 0; i < n; i++) { + upb_FieldDef* f = &defs[i]; + + _upb_FieldDef_CreateNotExt(ctx, prefix, protos[i], m, f); + f->index_ = i; + if (!ctx->layout) { + // Speculate that the def fields are sorted. We will always sort the + // MiniTable fields, so if defs are sorted then indices will match. + // + // If this is incorrect, we will overwrite later. + f->layout_index = i; + } + + const uint32_t current = f->number_; + if (previous > current) *is_sorted = false; + previous = current; + } + + return defs; +} + +static void resolve_subdef(upb_DefBuilder* ctx, const char* prefix, + upb_FieldDef* f) { + const UPB_DESC(FieldDescriptorProto)* field_proto = f->sub.unresolved; + upb_StringView name = UPB_DESC(FieldDescriptorProto_type_name)(field_proto); + bool has_name = UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto); + switch ((int)f->type_) { + case UPB_FIELD_TYPE_UNSPECIFIED: { + // Type was not specified and must be inferred. + UPB_ASSERT(has_name); + upb_deftype_t type; + const void* def = + _upb_DefBuilder_ResolveAny(ctx, f->full_name, prefix, name, &type); + switch (type) { + case UPB_DEFTYPE_ENUM: + f->sub.enumdef = def; + f->type_ = kUpb_FieldType_Enum; + break; + case UPB_DEFTYPE_MSG: + f->sub.msgdef = def; + f->type_ = kUpb_FieldType_Message; // It appears there is no way of + // this being a group. + break; + default: + _upb_DefBuilder_Errf(ctx, "Couldn't resolve type name for field %s", + f->full_name); + } + } + case kUpb_FieldType_Message: + case kUpb_FieldType_Group: + UPB_ASSERT(has_name); + f->sub.msgdef = _upb_DefBuilder_Resolve(ctx, f->full_name, prefix, name, + UPB_DEFTYPE_MSG); + break; + case kUpb_FieldType_Enum: + UPB_ASSERT(has_name); + f->sub.enumdef = _upb_DefBuilder_Resolve(ctx, f->full_name, prefix, name, + UPB_DEFTYPE_ENUM); + break; + default: + // No resolution necessary. + break; + } +} + +static int _upb_FieldDef_Compare(const void* p1, const void* p2) { + const uint32_t v1 = (*(upb_FieldDef**)p1)->number_; + const uint32_t v2 = (*(upb_FieldDef**)p2)->number_; + return (v1 < v2) ? -1 : (v1 > v2); +} + +// _upb_FieldDefs_Sorted() is mostly a pure function of its inputs, but has one +// critical side effect that we depend on: it sets layout_index appropriately +// for non-sorted lists of fields. +const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n, + upb_Arena* a) { + // TODO(salo): Replace this arena alloc with a persistent scratch buffer. + upb_FieldDef** out = (upb_FieldDef**)upb_Arena_Malloc(a, n * sizeof(void*)); + if (!out) return NULL; + + for (int i = 0; i < n; i++) { + out[i] = (upb_FieldDef*)&f[i]; + } + qsort(out, n, sizeof(void*), _upb_FieldDef_Compare); + + for (int i = 0; i < n; i++) { + out[i]->layout_index = i; + } + return (const upb_FieldDef**)out; +} + +bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, + upb_StringView* out) { + UPB_ASSERT(f->is_extension); + + upb_DescState s; + _upb_DescState_Init(&s); + + const int number = upb_FieldDef_Number(f); + const uint64_t modifiers = _upb_FieldDef_Modifiers(f); + + if (!_upb_DescState_Grow(&s, a)) return false; + s.ptr = upb_MtDataEncoder_EncodeExtension(&s.e, s.ptr, f->type_, number, + modifiers); + *s.ptr = '\0'; + + out->data = s.buf; + out->size = s.ptr - s.buf; + return true; +} + +static void resolve_extension(upb_DefBuilder* ctx, const char* prefix, + upb_FieldDef* f, + const UPB_DESC(FieldDescriptorProto) * + field_proto) { + if (!UPB_DESC(FieldDescriptorProto_has_extendee)(field_proto)) { + _upb_DefBuilder_Errf(ctx, "extension for field '%s' had no extendee", + f->full_name); + } + + upb_StringView name = UPB_DESC(FieldDescriptorProto_extendee)(field_proto); + const upb_MessageDef* m = + _upb_DefBuilder_Resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG); + f->msgdef = m; + + if (!_upb_MessageDef_IsValidExtensionNumber(m, f->number_)) { + _upb_DefBuilder_Errf( + ctx, + "field number %u in extension %s has no extension range in message %s", + (unsigned)f->number_, f->full_name, upb_MessageDef_FullName(m)); + } +} + +void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx, + const upb_FieldDef* f) { + const upb_MiniTableExtension* ext = _upb_FieldDef_ExtensionMiniTable(f); + + if (ctx->layout) { + UPB_ASSERT(upb_FieldDef_Number(f) == ext->field.number); + } else { + upb_StringView desc; + if (!upb_FieldDef_MiniDescriptorEncode(f, ctx->tmp_arena, &desc)) { + _upb_DefBuilder_OomErr(ctx); + } + + upb_MiniTableExtension* mut_ext = (upb_MiniTableExtension*)ext; + upb_MiniTableSub sub = {NULL}; + if (upb_FieldDef_IsSubMessage(f)) { + sub.submsg = upb_MessageDef_MiniTable(f->sub.msgdef); + } else if (_upb_FieldDef_IsClosedEnum(f)) { + sub.subenum = _upb_EnumDef_MiniTable(f->sub.enumdef); + } + bool ok2 = upb_MiniTableExtension_Build(desc.data, desc.size, mut_ext, + upb_MessageDef_MiniTable(f->msgdef), + sub, ctx->status); + if (!ok2) _upb_DefBuilder_Errf(ctx, "Could not build extension mini table"); + } + + bool ok = _upb_DefPool_InsertExt(ctx->symtab, ext, f); + if (!ok) _upb_DefBuilder_OomErr(ctx); +} + +static void resolve_default(upb_DefBuilder* ctx, upb_FieldDef* f, + const UPB_DESC(FieldDescriptorProto) * + field_proto) { + // Have to delay resolving of the default value until now because of the enum + // case, since enum defaults are specified with a label. + if (UPB_DESC(FieldDescriptorProto_has_default_value)(field_proto)) { + upb_StringView defaultval = + UPB_DESC(FieldDescriptorProto_default_value)(field_proto); + + if (upb_FileDef_Syntax(f->file) == kUpb_Syntax_Proto3) { + _upb_DefBuilder_Errf(ctx, + "proto3 fields cannot have explicit defaults (%s)", + f->full_name); + } + + if (upb_FieldDef_IsSubMessage(f)) { + _upb_DefBuilder_Errf(ctx, + "message fields cannot have explicit defaults (%s)", + f->full_name); + } + + parse_default(ctx, defaultval.data, defaultval.size, f); + f->has_default = true; + } else { + set_default_default(ctx, f); + f->has_default = false; + } +} + +void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, + upb_FieldDef* f) { + // We have to stash this away since resolve_subdef() may overwrite it. + const UPB_DESC(FieldDescriptorProto)* field_proto = f->sub.unresolved; + + resolve_subdef(ctx, prefix, f); + resolve_default(ctx, f, field_proto); + + if (f->is_extension) { + resolve_extension(ctx, prefix, f, field_proto); + } +} diff --git a/third_party/upb/upb/reflection/field_def.h b/third_party/upb/upb/reflection/field_def.h new file mode 100644 index 00000000000..4502162f329 --- /dev/null +++ b/third_party/upb/upb/reflection/field_def.h @@ -0,0 +1,91 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_FIELD_DEF_H_ +#define UPB_REFLECTION_FIELD_DEF_H_ + +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +// Maximum field number allowed for FieldDefs. +// This is an inherent limit of the protobuf wire format. +#define kUpb_MaxFieldNumber ((1 << 29) - 1) + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f); +const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f); +upb_CType upb_FieldDef_CType(const upb_FieldDef* f); +upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f); +const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f); +const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f); +const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f); +const char* upb_FieldDef_FullName(const upb_FieldDef* f); +bool upb_FieldDef_HasDefault(const upb_FieldDef* f); +bool upb_FieldDef_HasJsonName(const upb_FieldDef* f); +bool upb_FieldDef_HasOptions(const upb_FieldDef* f); +bool upb_FieldDef_HasPresence(const upb_FieldDef* f); +bool upb_FieldDef_HasSubDef(const upb_FieldDef* f); +uint32_t upb_FieldDef_Index(const upb_FieldDef* f); +bool upb_FieldDef_IsExtension(const upb_FieldDef* f); +bool upb_FieldDef_IsMap(const upb_FieldDef* f); +bool upb_FieldDef_IsOptional(const upb_FieldDef* f); +bool upb_FieldDef_IsPacked(const upb_FieldDef* f); +bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f); +bool upb_FieldDef_IsRepeated(const upb_FieldDef* f); +bool upb_FieldDef_IsRequired(const upb_FieldDef* f); +bool upb_FieldDef_IsString(const upb_FieldDef* f); +bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f); +const char* upb_FieldDef_JsonName(const upb_FieldDef* f); +upb_Label upb_FieldDef_Label(const upb_FieldDef* f); +const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f); + +// Creates a mini descriptor string for a field, returns true on success. +bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, + upb_StringView* out); + +const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f); +const char* upb_FieldDef_Name(const upb_FieldDef* f); +uint32_t upb_FieldDef_Number(const upb_FieldDef* f); +const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f); +const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f); +upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_FIELD_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/field_def_internal.h b/third_party/upb/upb/reflection/field_def_internal.h new file mode 100644 index 00000000000..63acf64fa32 --- /dev/null +++ b/third_party/upb/upb/reflection/field_def_internal.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ +#define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ + +#include "upb/reflection/field_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i); + +const upb_MiniTableExtension* _upb_FieldDef_ExtensionMiniTable( + const upb_FieldDef* f); +bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f); +bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f); +int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f); +uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f); +void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, + upb_FieldDef* f); +void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx, + const upb_FieldDef* f); + +// Allocate and initialize an array of |n| extensions (field defs). +upb_FieldDef* _upb_Extensions_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, + upb_MessageDef* m); + +// Allocate and initialize an array of |n| field defs. +upb_FieldDef* _upb_FieldDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, + upb_MessageDef* m, bool* is_sorted); + +// Allocate and return a list of pointers to the |n| field defs in |ff|, +// sorted by field number. +const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n, + upb_Arena* a); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/file_def.c b/third_party/upb/upb/reflection/file_def.c new file mode 100644 index 00000000000..a448377d923 --- /dev/null +++ b/third_party/upb/upb/reflection/file_def.c @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/message_def_internal.h" +#include "upb/reflection/service_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_FileDef { + const UPB_DESC(FileOptions) * opts; + const char* name; + const char* package; + const char* edition; + + const upb_FileDef** deps; + const int32_t* public_deps; + const int32_t* weak_deps; + const upb_MessageDef* top_lvl_msgs; + const upb_EnumDef* top_lvl_enums; + const upb_FieldDef* top_lvl_exts; + const upb_ServiceDef* services; + const upb_MiniTableExtension** ext_layouts; + const upb_DefPool* symtab; + + int dep_count; + int public_dep_count; + int weak_dep_count; + int top_lvl_msg_count; + int top_lvl_enum_count; + int top_lvl_ext_count; + int service_count; + int ext_count; // All exts in the file. + upb_Syntax syntax; +}; + +const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f) { + return f->opts; +} + +bool upb_FileDef_HasOptions(const upb_FileDef* f) { + return f->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_FileDef_Name(const upb_FileDef* f) { return f->name; } + +const char* upb_FileDef_Package(const upb_FileDef* f) { + return f->package ? f->package : ""; +} + +const char* upb_FileDef_Edition(const upb_FileDef* f) { + return f->edition ? f->edition : ""; +} + +const char* _upb_FileDef_RawPackage(const upb_FileDef* f) { return f->package; } + +upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f) { return f->syntax; } + +int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f) { + return f->top_lvl_msg_count; +} + +int upb_FileDef_DependencyCount(const upb_FileDef* f) { return f->dep_count; } + +int upb_FileDef_PublicDependencyCount(const upb_FileDef* f) { + return f->public_dep_count; +} + +int upb_FileDef_WeakDependencyCount(const upb_FileDef* f) { + return f->weak_dep_count; +} + +const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f) { + return f->public_deps; +} + +const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f) { + return f->weak_deps; +} + +int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f) { + return f->top_lvl_enum_count; +} + +int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f) { + return f->top_lvl_ext_count; +} + +int upb_FileDef_ServiceCount(const upb_FileDef* f) { return f->service_count; } + +const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->dep_count); + return f->deps[i]; +} + +const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->public_dep_count); + return f->deps[f->public_deps[i]]; +} + +const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->public_dep_count); + return f->deps[f->weak_deps[i]]; +} + +const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->top_lvl_msg_count); + return _upb_MessageDef_At(f->top_lvl_msgs, i); +} + +const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->top_lvl_enum_count); + return _upb_EnumDef_At(f->top_lvl_enums, i); +} + +const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->top_lvl_ext_count); + return _upb_FieldDef_At(f->top_lvl_exts, i); +} + +const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i) { + UPB_ASSERT(0 <= i && i < f->service_count); + return _upb_ServiceDef_At(f->services, i); +} + +const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f) { return f->symtab; } + +const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable( + const upb_FileDef* f, int i) { + return f->ext_layouts[i]; +} + +static char* strviewdup(upb_DefBuilder* ctx, upb_StringView view) { + char* ret = upb_strdup2(view.data, view.size, _upb_DefBuilder_Arena(ctx)); + if (!ret) _upb_DefBuilder_OomErr(ctx); + return ret; +} + +static bool streql_view(upb_StringView view, const char* b) { + return view.size == strlen(b) && memcmp(view.data, b, view.size) == 0; +} + +static int count_exts_in_msg(const UPB_DESC(DescriptorProto) * msg_proto) { + size_t n; + UPB_DESC(DescriptorProto_extension)(msg_proto, &n); + int ext_count = n; + + const UPB_DESC(DescriptorProto)* const* nested_msgs = + UPB_DESC(DescriptorProto_nested_type)(msg_proto, &n); + for (size_t i = 0; i < n; i++) { + ext_count += count_exts_in_msg(nested_msgs[i]); + } + + return ext_count; +} + +// Allocate and initialize one file def, and add it to the context object. +void _upb_FileDef_Create(upb_DefBuilder* ctx, + const UPB_DESC(FileDescriptorProto) * file_proto) { + upb_FileDef* file = _upb_DefBuilder_Alloc(ctx, sizeof(upb_FileDef)); + ctx->file = file; + + const UPB_DESC(DescriptorProto)* const* msgs; + const UPB_DESC(EnumDescriptorProto)* const* enums; + const UPB_DESC(FieldDescriptorProto)* const* exts; + const UPB_DESC(ServiceDescriptorProto)* const* services; + const upb_StringView* strs; + const int32_t* public_deps; + const int32_t* weak_deps; + size_t n; + + file->symtab = ctx->symtab; + + // Count all extensions in the file, to build a flat array of layouts. + UPB_DESC(FileDescriptorProto_extension)(file_proto, &n); + int ext_count = n; + msgs = UPB_DESC(FileDescriptorProto_message_type)(file_proto, &n); + for (int i = 0; i < n; i++) { + ext_count += count_exts_in_msg(msgs[i]); + } + file->ext_count = ext_count; + + if (ctx->layout) { + // We are using the ext layouts that were passed in. + file->ext_layouts = ctx->layout->exts; + if (ctx->layout->ext_count != file->ext_count) { + _upb_DefBuilder_Errf(ctx, + "Extension count did not match layout (%d vs %d)", + ctx->layout->ext_count, file->ext_count); + } + } else { + // We are building ext layouts from scratch. + file->ext_layouts = _upb_DefBuilder_Alloc( + ctx, sizeof(*file->ext_layouts) * file->ext_count); + upb_MiniTableExtension* ext = + _upb_DefBuilder_Alloc(ctx, sizeof(*ext) * file->ext_count); + for (int i = 0; i < file->ext_count; i++) { + file->ext_layouts[i] = &ext[i]; + } + } + + upb_StringView name = UPB_DESC(FileDescriptorProto_name)(file_proto); + file->name = strviewdup(ctx, name); + if (strlen(file->name) != name.size) { + _upb_DefBuilder_Errf(ctx, "File name contained embedded NULL"); + } + + upb_StringView package = UPB_DESC(FileDescriptorProto_package)(file_proto); + + if (package.size) { + _upb_DefBuilder_CheckIdentFull(ctx, package); + file->package = strviewdup(ctx, package); + } else { + file->package = NULL; + } + + upb_StringView edition = UPB_DESC(FileDescriptorProto_edition)(file_proto); + + if (edition.size == 0) { + file->edition = NULL; + } else { + // TODO(b/267770604): How should we validate this? + file->edition = strviewdup(ctx, edition); + if (strlen(file->edition) != edition.size) { + _upb_DefBuilder_Errf(ctx, "Edition name contained embedded NULL"); + } + } + + if (UPB_DESC(FileDescriptorProto_has_syntax)(file_proto)) { + upb_StringView syntax = UPB_DESC(FileDescriptorProto_syntax)(file_proto); + + if (streql_view(syntax, "proto2")) { + file->syntax = kUpb_Syntax_Proto2; + } else if (streql_view(syntax, "proto3")) { + file->syntax = kUpb_Syntax_Proto3; + } else { + _upb_DefBuilder_Errf(ctx, "Invalid syntax '" UPB_STRINGVIEW_FORMAT "'", + UPB_STRINGVIEW_ARGS(syntax)); + } + } else { + file->syntax = kUpb_Syntax_Proto2; + } + + // Read options. + UPB_DEF_SET_OPTIONS(file->opts, FileDescriptorProto, FileOptions, file_proto); + + // Verify dependencies. + strs = UPB_DESC(FileDescriptorProto_dependency)(file_proto, &n); + file->dep_count = n; + file->deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->deps) * n); + + for (size_t i = 0; i < n; i++) { + upb_StringView str = strs[i]; + file->deps[i] = + upb_DefPool_FindFileByNameWithSize(ctx->symtab, str.data, str.size); + if (!file->deps[i]) { + _upb_DefBuilder_Errf(ctx, + "Depends on file '" UPB_STRINGVIEW_FORMAT + "', but it has not been loaded", + UPB_STRINGVIEW_ARGS(str)); + } + } + + public_deps = UPB_DESC(FileDescriptorProto_public_dependency)(file_proto, &n); + file->public_dep_count = n; + file->public_deps = + _upb_DefBuilder_Alloc(ctx, sizeof(*file->public_deps) * n); + int32_t* mutable_public_deps = (int32_t*)file->public_deps; + for (size_t i = 0; i < n; i++) { + if (public_deps[i] >= file->dep_count) { + _upb_DefBuilder_Errf(ctx, "public_dep %d is out of range", + (int)public_deps[i]); + } + mutable_public_deps[i] = public_deps[i]; + } + + weak_deps = UPB_DESC(FileDescriptorProto_weak_dependency)(file_proto, &n); + file->weak_dep_count = n; + file->weak_deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->weak_deps) * n); + int32_t* mutable_weak_deps = (int32_t*)file->weak_deps; + for (size_t i = 0; i < n; i++) { + if (weak_deps[i] >= file->dep_count) { + _upb_DefBuilder_Errf(ctx, "weak_dep %d is out of range", + (int)weak_deps[i]); + } + mutable_weak_deps[i] = weak_deps[i]; + } + + // Create enums. + enums = UPB_DESC(FileDescriptorProto_enum_type)(file_proto, &n); + file->top_lvl_enum_count = n; + file->top_lvl_enums = _upb_EnumDefs_New(ctx, n, enums, NULL); + + // Create extensions. + exts = UPB_DESC(FileDescriptorProto_extension)(file_proto, &n); + file->top_lvl_ext_count = n; + file->top_lvl_exts = _upb_Extensions_New(ctx, n, exts, file->package, NULL); + + // Create messages. + msgs = UPB_DESC(FileDescriptorProto_message_type)(file_proto, &n); + file->top_lvl_msg_count = n; + file->top_lvl_msgs = _upb_MessageDefs_New(ctx, n, msgs, NULL); + + // Create services. + services = UPB_DESC(FileDescriptorProto_service)(file_proto, &n); + file->service_count = n; + file->services = _upb_ServiceDefs_New(ctx, n, services); + + // Now that all names are in the table, build layouts and resolve refs. + + for (int i = 0; i < file->top_lvl_msg_count; i++) { + upb_MessageDef* m = (upb_MessageDef*)upb_FileDef_TopLevelMessage(file, i); + _upb_MessageDef_Resolve(ctx, m); + } + + for (int i = 0; i < file->top_lvl_ext_count; i++) { + upb_FieldDef* f = (upb_FieldDef*)upb_FileDef_TopLevelExtension(file, i); + _upb_FieldDef_Resolve(ctx, file->package, f); + } + + for (int i = 0; i < file->top_lvl_msg_count; i++) { + upb_MessageDef* m = (upb_MessageDef*)upb_FileDef_TopLevelMessage(file, i); + _upb_MessageDef_CreateMiniTable(ctx, (upb_MessageDef*)m); + } + + for (int i = 0; i < file->top_lvl_ext_count; i++) { + upb_FieldDef* f = (upb_FieldDef*)upb_FileDef_TopLevelExtension(file, i); + _upb_FieldDef_BuildMiniTableExtension(ctx, f); + } + + for (int i = 0; i < file->top_lvl_msg_count; i++) { + upb_MessageDef* m = (upb_MessageDef*)upb_FileDef_TopLevelMessage(file, i); + _upb_MessageDef_LinkMiniTable(ctx, m); + } + + if (file->ext_count) { + bool ok = upb_ExtensionRegistry_AddArray( + _upb_DefPool_ExtReg(ctx->symtab), file->ext_layouts, file->ext_count); + if (!ok) _upb_DefBuilder_OomErr(ctx); + } +} diff --git a/third_party/upb/upb/reflection/file_def.h b/third_party/upb/upb/reflection/file_def.h new file mode 100644 index 00000000000..a8557cb9024 --- /dev/null +++ b/third_party/upb/upb/reflection/file_def.h @@ -0,0 +1,77 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_FILE_DEF_H_ +#define UPB_REFLECTION_FILE_DEF_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i); +int upb_FileDef_DependencyCount(const upb_FileDef* f); +bool upb_FileDef_HasOptions(const upb_FileDef* f); +const char* upb_FileDef_Name(const upb_FileDef* f); +const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f); +const char* upb_FileDef_Package(const upb_FileDef* f); +const char* upb_FileDef_Edition(const upb_FileDef* f); +const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f); + +const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i); +int upb_FileDef_PublicDependencyCount(const upb_FileDef* f); + +const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i); +int upb_FileDef_ServiceCount(const upb_FileDef* f); + +upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f); + +const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i); +int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f); + +const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i); +int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f); + +const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i); +int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f); + +const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i); +int upb_FileDef_WeakDependencyCount(const upb_FileDef* f); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_FILE_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/file_def_internal.h b/third_party/upb/upb/reflection/file_def_internal.h new file mode 100644 index 00000000000..1d29bb6fabe --- /dev/null +++ b/third_party/upb/upb/reflection/file_def_internal.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_ +#define UPB_REFLECTION_FILE_DEF_INTERNAL_H_ + +#include "upb/reflection/file_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable( + const upb_FileDef* f, int i); +const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f); +const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f); + +// upb_FileDef_Package() returns "" if f->package is NULL, this does not. +const char* _upb_FileDef_RawPackage(const upb_FileDef* f); + +void _upb_FileDef_Create(upb_DefBuilder* ctx, + const UPB_DESC(FileDescriptorProto) * file_proto); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/message.c b/third_party/upb/upb/reflection/message.c new file mode 100644 index 00000000000..dc683c1df0e --- /dev/null +++ b/third_party/upb/upb/reflection/message.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/message.h" + +#include + +#include "upb/collections/map.h" +#include "upb/hash/common.h" +#include "upb/message/accessors.h" +#include "upb/message/message.h" +#include "upb/mini_table/field_internal.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/message_def.h" +#include "upb/reflection/oneof_def.h" + +// Must be last. +#include "upb/port/def.inc" + +bool upb_Message_HasFieldByDef(const upb_Message* msg, const upb_FieldDef* f) { + UPB_ASSERT(upb_FieldDef_HasPresence(f)); + return upb_Message_HasField(msg, upb_FieldDef_MiniTable(f)); +} + +const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg, + const upb_OneofDef* o) { + const upb_FieldDef* f = upb_OneofDef_Field(o, 0); + if (upb_OneofDef_IsSynthetic(o)) { + UPB_ASSERT(upb_OneofDef_FieldCount(o) == 1); + return upb_Message_HasFieldByDef(msg, f) ? f : NULL; + } else { + const upb_MiniTableField* field = upb_FieldDef_MiniTable(f); + uint32_t oneof_case = upb_Message_WhichOneofFieldNumber(msg, field); + f = oneof_case ? upb_OneofDef_LookupNumber(o, oneof_case) : NULL; + UPB_ASSERT((f != NULL) == (oneof_case != 0)); + return f; + } +} + +upb_MessageValue upb_Message_GetFieldByDef(const upb_Message* msg, + const upb_FieldDef* f) { + upb_MessageValue default_val = upb_FieldDef_Default(f); + upb_MessageValue ret; + _upb_Message_GetField(msg, upb_FieldDef_MiniTable(f), &default_val, &ret); + return ret; +} + +upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg, + const upb_FieldDef* f, + upb_Arena* a) { + UPB_ASSERT(upb_FieldDef_IsSubMessage(f) || upb_FieldDef_IsRepeated(f)); + if (upb_FieldDef_HasPresence(f) && !upb_Message_HasFieldByDef(msg, f)) { + // We need to skip the upb_Message_GetFieldByDef() call in this case. + goto make; + } + + upb_MessageValue val = upb_Message_GetFieldByDef(msg, f); + if (val.array_val) { + return (upb_MutableMessageValue){.array = (upb_Array*)val.array_val}; + } + + upb_MutableMessageValue ret; +make: + if (!a) return (upb_MutableMessageValue){.array = NULL}; + if (upb_FieldDef_IsMap(f)) { + const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f); + const upb_FieldDef* key = + upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_KeyFieldNumber); + const upb_FieldDef* value = + upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_ValueFieldNumber); + ret.map = + upb_Map_New(a, upb_FieldDef_CType(key), upb_FieldDef_CType(value)); + } else if (upb_FieldDef_IsRepeated(f)) { + ret.array = upb_Array_New(a, upb_FieldDef_CType(f)); + } else { + UPB_ASSERT(upb_FieldDef_IsSubMessage(f)); + const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f); + ret.msg = upb_Message_New(upb_MessageDef_MiniTable(m), a); + } + + val.array_val = ret.array; + upb_Message_SetFieldByDef(msg, f, val, a); + + return ret; +} + +bool upb_Message_SetFieldByDef(upb_Message* msg, const upb_FieldDef* f, + upb_MessageValue val, upb_Arena* a) { + return _upb_Message_SetField(msg, upb_FieldDef_MiniTable(f), &val, a); +} + +void upb_Message_ClearFieldByDef(upb_Message* msg, const upb_FieldDef* f) { + upb_Message_ClearField(msg, upb_FieldDef_MiniTable(f)); +} + +void upb_Message_ClearByDef(upb_Message* msg, const upb_MessageDef* m) { + _upb_Message_Clear(msg, upb_MessageDef_MiniTable(m)); +} + +bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, + const upb_DefPool* ext_pool, const upb_FieldDef** out_f, + upb_MessageValue* out_val, size_t* iter) { + size_t i = *iter; + size_t n = upb_MessageDef_FieldCount(m); + UPB_UNUSED(ext_pool); + + // Iterate over normal fields, returning the first one that is set. + while (++i < n) { + const upb_FieldDef* f = upb_MessageDef_Field(m, i); + const upb_MiniTableField* field = upb_FieldDef_MiniTable(f); + upb_MessageValue val = upb_Message_GetFieldByDef(msg, f); + + // Skip field if unset or empty. + if (upb_MiniTableField_HasPresence(field)) { + if (!upb_Message_HasFieldByDef(msg, f)) continue; + } else { + switch (upb_FieldMode_Get(field)) { + case kUpb_FieldMode_Map: + if (!val.map_val || upb_Map_Size(val.map_val) == 0) continue; + break; + case kUpb_FieldMode_Array: + if (!val.array_val || upb_Array_Size(val.array_val) == 0) continue; + break; + case kUpb_FieldMode_Scalar: + if (!_upb_MiniTable_ValueIsNonZero(&val, field)) continue; + break; + } + } + + *out_val = val; + *out_f = f; + *iter = i; + return true; + } + + if (ext_pool) { + // Return any extensions that are set. + size_t count; + const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count); + if (i - n < count) { + ext += count - 1 - (i - n); + memcpy(out_val, &ext->data, sizeof(*out_val)); + *out_f = upb_DefPool_FindExtensionByMiniTable(ext_pool, ext->ext); + *iter = i; + return true; + } + } + + *iter = i; + return false; +} + +bool _upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, + int depth) { + size_t iter = kUpb_Message_Begin; + const upb_FieldDef* f; + upb_MessageValue val; + bool ret = true; + + if (--depth == 0) return false; + + _upb_Message_DiscardUnknown_shallow(msg); + + while (upb_Message_Next(msg, m, NULL /*ext_pool*/, &f, &val, &iter)) { + const upb_MessageDef* subm = upb_FieldDef_MessageSubDef(f); + if (!subm) continue; + if (upb_FieldDef_IsMap(f)) { + const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(subm, 2); + const upb_MessageDef* val_m = upb_FieldDef_MessageSubDef(val_f); + upb_Map* map = (upb_Map*)val.map_val; + size_t iter = kUpb_Map_Begin; + + if (!val_m) continue; + + upb_MessageValue map_key, map_val; + while (upb_Map_Next(map, &map_key, &map_val, &iter)) { + if (!_upb_Message_DiscardUnknown((upb_Message*)map_val.msg_val, val_m, + depth)) { + ret = false; + } + } + } else if (upb_FieldDef_IsRepeated(f)) { + const upb_Array* arr = val.array_val; + size_t i, n = upb_Array_Size(arr); + for (i = 0; i < n; i++) { + upb_MessageValue elem = upb_Array_Get(arr, i); + if (!_upb_Message_DiscardUnknown((upb_Message*)elem.msg_val, subm, + depth)) { + ret = false; + } + } + } else { + if (!_upb_Message_DiscardUnknown((upb_Message*)val.msg_val, subm, + depth)) { + ret = false; + } + } + } + + return ret; +} + +bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, + int maxdepth) { + return _upb_Message_DiscardUnknown(msg, m, maxdepth); +} diff --git a/third_party/upb/upb/reflection/message.h b/third_party/upb/upb/reflection/message.h new file mode 100644 index 00000000000..8dfc5f46c88 --- /dev/null +++ b/third_party/upb/upb/reflection/message.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_MESSAGE_H_ +#define UPB_REFLECTION_MESSAGE_H_ + +#include "upb/collections/map.h" +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns a mutable pointer to a map, array, or submessage value. If the given +// arena is non-NULL this will construct a new object if it was not previously +// present. May not be called for primitive fields. +upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg, + const upb_FieldDef* f, + upb_Arena* a); + +// Returns the field that is set in the oneof, or NULL if none are set. +const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg, + const upb_OneofDef* o); + +// Clear all data and unknown fields. +void upb_Message_ClearByDef(upb_Message* msg, const upb_MessageDef* m); + +// Clears any field presence and sets the value back to its default. +void upb_Message_ClearFieldByDef(upb_Message* msg, const upb_FieldDef* f); + +// May only be called for fields where upb_FieldDef_HasPresence(f) == true. +bool upb_Message_HasFieldByDef(const upb_Message* msg, const upb_FieldDef* f); + +// Returns the value in the message associated with this field def. +upb_MessageValue upb_Message_GetFieldByDef(const upb_Message* msg, + const upb_FieldDef* f); + +// Sets the given field to the given value. For a msg/array/map/string, the +// caller must ensure that the target data outlives |msg| (by living either in +// the same arena or a different arena that outlives it). +// +// Returns false if allocation fails. +bool upb_Message_SetFieldByDef(upb_Message* msg, const upb_FieldDef* f, + upb_MessageValue val, upb_Arena* a); + +// Iterate over present fields. +// +// size_t iter = kUpb_Message_Begin; +// const upb_FieldDef *f; +// upb_MessageValue val; +// while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) { +// process_field(f, val); +// } +// +// If ext_pool is NULL, no extensions will be returned. If the given symtab +// returns extensions that don't match what is in this message, those extensions +// will be skipped. + +#define kUpb_Message_Begin -1 + +bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, + const upb_DefPool* ext_pool, const upb_FieldDef** f, + upb_MessageValue* val, size_t* iter); + +// Clears all unknown field data from this message and all submessages. +bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, + int maxdepth); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_MESSAGE_H_ */ diff --git a/third_party/upb/upb/reflection/message.hpp b/third_party/upb/upb/reflection/message.hpp new file mode 100644 index 00000000000..425be98d2d5 --- /dev/null +++ b/third_party/upb/upb/reflection/message.hpp @@ -0,0 +1,37 @@ +// Copyright (c) 2009-2021, Google LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of Google LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef UPB_REFLECTION_MESSAGE_HPP_ +#define UPB_REFLECTION_MESSAGE_HPP_ + +#include "upb/reflection/message.h" + +namespace upb { + +typedef upb_MessageValue MessageValue; + +} // namespace upb + +#endif // UPB_REFLECTION_MESSAGE_HPP_ diff --git a/third_party/upb/upb/reflection/message_def.c b/third_party/upb/upb/reflection/message_def.c new file mode 100644 index 00000000000..a45f339b0e1 --- /dev/null +++ b/third_party/upb/upb/reflection/message_def.c @@ -0,0 +1,718 @@ +/* + * 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/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/mini_table/decode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/desc_state_internal.h" +#include "upb/reflection/enum_def_internal.h" +#include "upb/reflection/extension_range_internal.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/message_def_internal.h" +#include "upb/reflection/message_reserved_range_internal.h" +#include "upb/reflection/oneof_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MessageDef { + const UPB_DESC(MessageOptions) * opts; + const upb_MiniTable* layout; + const upb_FileDef* file; + const upb_MessageDef* containing_type; + const char* full_name; + + // Tables for looking up fields by number and name. + upb_inttable itof; + upb_strtable ntof; + + /* All nested defs. + * MEM: We could save some space here by putting nested defs in a contiguous + * region and calculating counts from offsets or vice-versa. */ + const upb_FieldDef* fields; + const upb_OneofDef* oneofs; + const upb_ExtensionRange* ext_ranges; + const upb_StringView* res_names; + const upb_MessageDef* nested_msgs; + const upb_MessageReservedRange* res_ranges; + const upb_EnumDef* nested_enums; + const upb_FieldDef* nested_exts; + + // TODO(salo): These counters don't need anywhere near 32 bits. + int field_count; + int real_oneof_count; + int oneof_count; + int ext_range_count; + int res_range_count; + int res_name_count; + int nested_msg_count; + int nested_enum_count; + int nested_ext_count; + bool in_message_set; + bool is_sorted; + upb_WellKnown well_known_type; +#if UINTPTR_MAX == 0xffffffff + uint32_t padding; // Increase size to a multiple of 8. +#endif +}; + +static void assign_msg_wellknowntype(upb_MessageDef* m) { + const char* name = m->full_name; + if (name == NULL) { + m->well_known_type = kUpb_WellKnown_Unspecified; + return; + } + if (!strcmp(name, "google.protobuf.Any")) { + m->well_known_type = kUpb_WellKnown_Any; + } else if (!strcmp(name, "google.protobuf.FieldMask")) { + m->well_known_type = kUpb_WellKnown_FieldMask; + } else if (!strcmp(name, "google.protobuf.Duration")) { + m->well_known_type = kUpb_WellKnown_Duration; + } else if (!strcmp(name, "google.protobuf.Timestamp")) { + m->well_known_type = kUpb_WellKnown_Timestamp; + } else if (!strcmp(name, "google.protobuf.DoubleValue")) { + m->well_known_type = kUpb_WellKnown_DoubleValue; + } else if (!strcmp(name, "google.protobuf.FloatValue")) { + m->well_known_type = kUpb_WellKnown_FloatValue; + } else if (!strcmp(name, "google.protobuf.Int64Value")) { + m->well_known_type = kUpb_WellKnown_Int64Value; + } else if (!strcmp(name, "google.protobuf.UInt64Value")) { + m->well_known_type = kUpb_WellKnown_UInt64Value; + } else if (!strcmp(name, "google.protobuf.Int32Value")) { + m->well_known_type = kUpb_WellKnown_Int32Value; + } else if (!strcmp(name, "google.protobuf.UInt32Value")) { + m->well_known_type = kUpb_WellKnown_UInt32Value; + } else if (!strcmp(name, "google.protobuf.BoolValue")) { + m->well_known_type = kUpb_WellKnown_BoolValue; + } else if (!strcmp(name, "google.protobuf.StringValue")) { + m->well_known_type = kUpb_WellKnown_StringValue; + } else if (!strcmp(name, "google.protobuf.BytesValue")) { + m->well_known_type = kUpb_WellKnown_BytesValue; + } else if (!strcmp(name, "google.protobuf.Value")) { + m->well_known_type = kUpb_WellKnown_Value; + } else if (!strcmp(name, "google.protobuf.ListValue")) { + m->well_known_type = kUpb_WellKnown_ListValue; + } else if (!strcmp(name, "google.protobuf.Struct")) { + m->well_known_type = kUpb_WellKnown_Struct; + } else { + m->well_known_type = kUpb_WellKnown_Unspecified; + } +} + +upb_MessageDef* _upb_MessageDef_At(const upb_MessageDef* m, int i) { + return (upb_MessageDef*)&m[i]; +} + +bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n) { + for (int i = 0; i < m->ext_range_count; i++) { + const upb_ExtensionRange* r = upb_MessageDef_ExtensionRange(m, i); + if (upb_ExtensionRange_Start(r) <= n && n < upb_ExtensionRange_End(r)) { + return true; + } + } + return false; +} + +const UPB_DESC(MessageOptions) * + upb_MessageDef_Options(const upb_MessageDef* m) { + return m->opts; +} + +bool upb_MessageDef_HasOptions(const upb_MessageDef* m) { + return m->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_MessageDef_FullName(const upb_MessageDef* m) { + return m->full_name; +} + +const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m) { + return m->file; +} + +const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m) { + return m->containing_type; +} + +const char* upb_MessageDef_Name(const upb_MessageDef* m) { + return _upb_DefBuilder_FullToShort(m->full_name); +} + +upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m) { + return upb_FileDef_Syntax(m->file); +} + +const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m, + uint32_t i) { + upb_value val; + return upb_inttable_lookup(&m->itof, i, &val) ? upb_value_getconstptr(val) + : NULL; +} + +const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize( + const upb_MessageDef* m, const char* name, size_t size) { + upb_value val; + + if (!upb_strtable_lookup2(&m->ntof, name, size, &val)) { + return NULL; + } + + return _upb_DefType_Unpack(val, UPB_DEFTYPE_FIELD); +} + +const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize( + const upb_MessageDef* m, const char* name, size_t size) { + upb_value val; + + if (!upb_strtable_lookup2(&m->ntof, name, size, &val)) { + return NULL; + } + + return _upb_DefType_Unpack(val, UPB_DEFTYPE_ONEOF); +} + +bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t len, + upb_value v, upb_Arena* a) { + return upb_strtable_insert(&m->ntof, name, len, v, a); +} + +bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m, + const char* name, size_t len, + const upb_FieldDef** out_f, + const upb_OneofDef** out_o) { + upb_value val; + + if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) { + return false; + } + + const upb_FieldDef* f = _upb_DefType_Unpack(val, UPB_DEFTYPE_FIELD); + const upb_OneofDef* o = _upb_DefType_Unpack(val, UPB_DEFTYPE_ONEOF); + if (out_f) *out_f = f; + if (out_o) *out_o = o; + return f || o; /* False if this was a JSON name. */ +} + +const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize( + const upb_MessageDef* m, const char* name, size_t size) { + upb_value val; + const upb_FieldDef* f; + + if (!upb_strtable_lookup2(&m->ntof, name, size, &val)) { + return NULL; + } + + f = _upb_DefType_Unpack(val, UPB_DEFTYPE_FIELD); + if (!f) f = _upb_DefType_Unpack(val, UPB_DEFTYPE_FIELD_JSONNAME); + + return f; +} + +int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m) { + return m->ext_range_count; +} + +int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m) { + return m->res_range_count; +} + +int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m) { + return m->res_name_count; +} + +int upb_MessageDef_FieldCount(const upb_MessageDef* m) { + return m->field_count; +} + +int upb_MessageDef_OneofCount(const upb_MessageDef* m) { + return m->oneof_count; +} + +int upb_MessageDef_RealOneofCount(const upb_MessageDef* m) { + return m->real_oneof_count; +} + +int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m) { + return m->nested_msg_count; +} + +int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m) { + return m->nested_enum_count; +} + +int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m) { + return m->nested_ext_count; +} + +const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m) { + return m->layout; +} + +const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m, + int i) { + UPB_ASSERT(0 <= i && i < m->ext_range_count); + return _upb_ExtensionRange_At(m->ext_ranges, i); +} + +const upb_MessageReservedRange* upb_MessageDef_ReservedRange( + const upb_MessageDef* m, int i) { + UPB_ASSERT(0 <= i && i < m->res_range_count); + return _upb_MessageReservedRange_At(m->res_ranges, i); +} + +upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i) { + UPB_ASSERT(0 <= i && i < m->res_name_count); + return m->res_names[i]; +} + +const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i) { + UPB_ASSERT(0 <= i && i < m->field_count); + return _upb_FieldDef_At(m->fields, i); +} + +const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i) { + UPB_ASSERT(0 <= i && i < m->oneof_count); + return _upb_OneofDef_At(m->oneofs, i); +} + +const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m, + int i) { + UPB_ASSERT(0 <= i && i < m->nested_msg_count); + return &m->nested_msgs[i]; +} + +const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i) { + UPB_ASSERT(0 <= i && i < m->nested_enum_count); + return _upb_EnumDef_At(m->nested_enums, i); +} + +const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m, + int i) { + UPB_ASSERT(0 <= i && i < m->nested_ext_count); + return _upb_FieldDef_At(m->nested_exts, i); +} + +upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m) { + return m->well_known_type; +} + +bool _upb_MessageDef_InMessageSet(const upb_MessageDef* m) { + return m->in_message_set; +} + +const upb_FieldDef* upb_MessageDef_FindFieldByName(const upb_MessageDef* m, + const char* name) { + return upb_MessageDef_FindFieldByNameWithSize(m, name, strlen(name)); +} + +const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m, + const char* name) { + return upb_MessageDef_FindOneofByNameWithSize(m, name, strlen(name)); +} + +bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) { + return UPB_DESC(MessageOptions_map_entry)(m->opts); +} + +bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m) { + return UPB_DESC(MessageOptions_message_set_wire_format)(m->opts); +} + +static upb_MiniTable* _upb_MessageDef_MakeMiniTable(upb_DefBuilder* ctx, + const upb_MessageDef* m) { + upb_StringView desc; + // Note: this will assign layout_index for fields, so upb_FieldDef_MiniTable() + // is safe to call only after this call. + bool ok = upb_MessageDef_MiniDescriptorEncode(m, ctx->tmp_arena, &desc); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + void** scratch_data = _upb_DefPool_ScratchData(ctx->symtab); + size_t* scratch_size = _upb_DefPool_ScratchSize(ctx->symtab); + upb_MiniTable* ret = upb_MiniTable_BuildWithBuf( + desc.data, desc.size, ctx->platform, ctx->arena, scratch_data, + scratch_size, ctx->status); + if (!ret) _upb_DefBuilder_FailJmp(ctx); + + return ret; +} + +void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m) { + for (int i = 0; i < m->field_count; i++) { + upb_FieldDef* f = (upb_FieldDef*)upb_MessageDef_Field(m, i); + _upb_FieldDef_Resolve(ctx, m->full_name, f); + } + + m->in_message_set = false; + for (int i = 0; i < upb_MessageDef_NestedExtensionCount(m); i++) { + upb_FieldDef* ext = (upb_FieldDef*)upb_MessageDef_NestedExtension(m, i); + _upb_FieldDef_Resolve(ctx, m->full_name, ext); + if (upb_FieldDef_Type(ext) == kUpb_FieldType_Message && + upb_FieldDef_Label(ext) == kUpb_Label_Optional && + upb_FieldDef_MessageSubDef(ext) == m && + UPB_DESC(MessageOptions_message_set_wire_format)( + upb_MessageDef_Options(upb_FieldDef_ContainingType(ext)))) { + m->in_message_set = true; + } + } + + for (int i = 0; i < upb_MessageDef_NestedMessageCount(m); i++) { + upb_MessageDef* n = (upb_MessageDef*)upb_MessageDef_NestedMessage(m, i); + _upb_MessageDef_Resolve(ctx, n); + } +} + +void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m, + const upb_FieldDef* f) { + const int32_t field_number = upb_FieldDef_Number(f); + + if (field_number <= 0 || field_number > kUpb_MaxFieldNumber) { + _upb_DefBuilder_Errf(ctx, "invalid field number (%u)", field_number); + } + + const char* json_name = upb_FieldDef_JsonName(f); + const char* shortname = upb_FieldDef_Name(f); + const size_t shortnamelen = strlen(shortname); + + upb_value v = upb_value_constptr(f); + + upb_value existing_v; + if (upb_strtable_lookup(&m->ntof, shortname, &existing_v)) { + _upb_DefBuilder_Errf(ctx, "duplicate field name (%s)", shortname); + } + + const upb_value field_v = _upb_DefType_Pack(f, UPB_DEFTYPE_FIELD); + bool ok = + _upb_MessageDef_Insert(m, shortname, shortnamelen, field_v, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + if (strcmp(shortname, json_name) != 0) { + if (upb_strtable_lookup(&m->ntof, json_name, &v)) { + _upb_DefBuilder_Errf(ctx, "duplicate json_name (%s)", json_name); + } + + const size_t json_size = strlen(json_name); + const upb_value json_v = _upb_DefType_Pack(f, UPB_DEFTYPE_FIELD_JSONNAME); + ok = _upb_MessageDef_Insert(m, json_name, json_size, json_v, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + } + + if (upb_inttable_lookup(&m->itof, field_number, NULL)) { + _upb_DefBuilder_Errf(ctx, "duplicate field number (%u)", field_number); + } + + ok = upb_inttable_insert(&m->itof, field_number, v, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); +} + +void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m) { + if (ctx->layout == NULL) { + m->layout = _upb_MessageDef_MakeMiniTable(ctx, m); + } else { + UPB_ASSERT(ctx->msg_count < ctx->layout->msg_count); + m->layout = ctx->layout->msgs[ctx->msg_count++]; + UPB_ASSERT(m->field_count == m->layout->field_count); + + // We don't need the result of this call, but it will assign layout_index + // for all the fields in O(n lg n) time. + _upb_FieldDefs_Sorted(m->fields, m->field_count, ctx->tmp_arena); + } + + for (int i = 0; i < m->nested_msg_count; i++) { + upb_MessageDef* nested = + (upb_MessageDef*)upb_MessageDef_NestedMessage(m, i); + _upb_MessageDef_CreateMiniTable(ctx, nested); + } +} + +void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx, + const upb_MessageDef* m) { + for (int i = 0; i < upb_MessageDef_NestedExtensionCount(m); i++) { + const upb_FieldDef* ext = upb_MessageDef_NestedExtension(m, i); + _upb_FieldDef_BuildMiniTableExtension(ctx, ext); + } + + for (int i = 0; i < m->nested_msg_count; i++) { + _upb_MessageDef_LinkMiniTable(ctx, upb_MessageDef_NestedMessage(m, i)); + } + + if (ctx->layout) return; + + for (int i = 0; i < m->field_count; i++) { + const upb_FieldDef* f = upb_MessageDef_Field(m, i); + const upb_MessageDef* sub_m = upb_FieldDef_MessageSubDef(f); + const upb_EnumDef* sub_e = upb_FieldDef_EnumSubDef(f); + const int layout_index = _upb_FieldDef_LayoutIndex(f); + upb_MiniTable* mt = (upb_MiniTable*)upb_MessageDef_MiniTable(m); + + UPB_ASSERT(layout_index < m->field_count); + upb_MiniTableField* mt_f = + (upb_MiniTableField*)&m->layout->fields[layout_index]; + if (sub_m) { + if (!mt->subs) { + _upb_DefBuilder_Errf(ctx, "unexpected submsg for (%s)", m->full_name); + } + UPB_ASSERT(mt_f); + UPB_ASSERT(sub_m->layout); + if (UPB_UNLIKELY(!upb_MiniTable_SetSubMessage(mt, mt_f, sub_m->layout))) { + _upb_DefBuilder_Errf(ctx, "invalid submsg for (%s)", m->full_name); + } + } else if (_upb_FieldDef_IsClosedEnum(f)) { + const upb_MiniTableEnum* mt_e = _upb_EnumDef_MiniTable(sub_e); + if (UPB_UNLIKELY(!upb_MiniTable_SetSubEnum(mt, mt_f, mt_e))) { + _upb_DefBuilder_Errf(ctx, "invalid subenum for (%s)", m->full_name); + } + } + } + +#ifndef NDEBUG + for (int i = 0; i < m->field_count; i++) { + const upb_FieldDef* f = upb_MessageDef_Field(m, i); + const int layout_index = _upb_FieldDef_LayoutIndex(f); + UPB_ASSERT(layout_index < m->layout->field_count); + const upb_MiniTableField* mt_f = &m->layout->fields[layout_index]; + UPB_ASSERT(upb_FieldDef_Type(f) == upb_MiniTableField_Type(mt_f)); + UPB_ASSERT(upb_FieldDef_HasPresence(f) == + upb_MiniTableField_HasPresence(mt_f)); + } +#endif +} + +static uint64_t _upb_MessageDef_Modifiers(const upb_MessageDef* m) { + uint64_t out = 0; + if (upb_FileDef_Syntax(m->file) == kUpb_Syntax_Proto3) { + out |= kUpb_MessageModifier_ValidateUtf8; + out |= kUpb_MessageModifier_DefaultIsPacked; + } + if (m->ext_range_count) { + out |= kUpb_MessageModifier_IsExtendable; + } + return out; +} + +static bool _upb_MessageDef_EncodeMap(upb_DescState* s, const upb_MessageDef* m, + upb_Arena* a) { + if (m->field_count != 2) return false; + + const upb_FieldDef* key_field = upb_MessageDef_Field(m, 0); + const upb_FieldDef* val_field = upb_MessageDef_Field(m, 1); + if (key_field == NULL || val_field == NULL) return false; + + UPB_ASSERT(_upb_FieldDef_LayoutIndex(key_field) == 0); + UPB_ASSERT(_upb_FieldDef_LayoutIndex(val_field) == 1); + + s->ptr = upb_MtDataEncoder_EncodeMap( + &s->e, s->ptr, upb_FieldDef_Type(key_field), upb_FieldDef_Type(val_field), + _upb_FieldDef_Modifiers(key_field), _upb_FieldDef_Modifiers(val_field)); + return true; +} + +static bool _upb_MessageDef_EncodeMessage(upb_DescState* s, + const upb_MessageDef* m, + upb_Arena* a) { + const upb_FieldDef** sorted = NULL; + if (!m->is_sorted) { + sorted = _upb_FieldDefs_Sorted(m->fields, m->field_count, a); + if (!sorted) return false; + } + + s->ptr = upb_MtDataEncoder_StartMessage(&s->e, s->ptr, + _upb_MessageDef_Modifiers(m)); + + for (int i = 0; i < m->field_count; i++) { + const upb_FieldDef* f = sorted ? sorted[i] : upb_MessageDef_Field(m, i); + const upb_FieldType type = upb_FieldDef_Type(f); + const int number = upb_FieldDef_Number(f); + const uint64_t modifiers = _upb_FieldDef_Modifiers(f); + + if (!_upb_DescState_Grow(s, a)) return false; + s->ptr = upb_MtDataEncoder_PutField(&s->e, s->ptr, type, number, modifiers); + } + + for (int i = 0; i < m->real_oneof_count; i++) { + if (!_upb_DescState_Grow(s, a)) return false; + s->ptr = upb_MtDataEncoder_StartOneof(&s->e, s->ptr); + + const upb_OneofDef* o = upb_MessageDef_Oneof(m, i); + const int field_count = upb_OneofDef_FieldCount(o); + for (int j = 0; j < field_count; j++) { + const int number = upb_FieldDef_Number(upb_OneofDef_Field(o, j)); + + if (!_upb_DescState_Grow(s, a)) return false; + s->ptr = upb_MtDataEncoder_PutOneofField(&s->e, s->ptr, number); + } + } + + return true; +} + +static bool _upb_MessageDef_EncodeMessageSet(upb_DescState* s, + const upb_MessageDef* m, + upb_Arena* a) { + s->ptr = upb_MtDataEncoder_EncodeMessageSet(&s->e, s->ptr); + + return true; +} + +bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a, + upb_StringView* out) { + upb_DescState s; + _upb_DescState_Init(&s); + + if (!_upb_DescState_Grow(&s, a)) return false; + + if (upb_MessageDef_IsMapEntry(m)) { + if (!_upb_MessageDef_EncodeMap(&s, m, a)) return false; + } else if (UPB_DESC(MessageOptions_message_set_wire_format)(m->opts)) { + if (!_upb_MessageDef_EncodeMessageSet(&s, m, a)) return false; + } else { + if (!_upb_MessageDef_EncodeMessage(&s, m, a)) return false; + } + + if (!_upb_DescState_Grow(&s, a)) return false; + *s.ptr = '\0'; + + out->data = s.buf; + out->size = s.ptr - s.buf; + return true; +} + +static upb_StringView* _upb_ReservedNames_New(upb_DefBuilder* ctx, int n, + const upb_StringView* protos) { + upb_StringView* sv = _upb_DefBuilder_Alloc(ctx, sizeof(upb_StringView) * n); + for (size_t i = 0; i < n; i++) { + sv[i].data = + upb_strdup2(protos[i].data, protos[i].size, _upb_DefBuilder_Arena(ctx)); + sv[i].size = protos[i].size; + } + return sv; +} + +static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(DescriptorProto) * msg_proto, + const upb_MessageDef* containing_type, + upb_MessageDef* m) { + const UPB_DESC(OneofDescriptorProto)* const* oneofs; + const UPB_DESC(FieldDescriptorProto)* const* fields; + const UPB_DESC(DescriptorProto_ExtensionRange)* const* ext_ranges; + const UPB_DESC(DescriptorProto_ReservedRange)* const* res_ranges; + const upb_StringView* res_names; + size_t n_oneof, n_field, n_enum, n_ext, n_msg; + size_t n_ext_range, n_res_range, n_res_name; + upb_StringView name; + + // Must happen before _upb_DefBuilder_Add() + m->file = _upb_DefBuilder_File(ctx); + + m->containing_type = containing_type; + m->is_sorted = true; + + name = UPB_DESC(DescriptorProto_name)(msg_proto); + + m->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); + _upb_DefBuilder_Add(ctx, m->full_name, _upb_DefType_Pack(m, UPB_DEFTYPE_MSG)); + + oneofs = UPB_DESC(DescriptorProto_oneof_decl)(msg_proto, &n_oneof); + fields = UPB_DESC(DescriptorProto_field)(msg_proto, &n_field); + ext_ranges = + UPB_DESC(DescriptorProto_extension_range)(msg_proto, &n_ext_range); + res_ranges = + UPB_DESC(DescriptorProto_reserved_range)(msg_proto, &n_res_range); + res_names = UPB_DESC(DescriptorProto_reserved_name)(msg_proto, &n_res_name); + + bool ok = upb_inttable_init(&m->itof, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + ok = upb_strtable_init(&m->ntof, n_oneof + n_field, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + UPB_DEF_SET_OPTIONS(m->opts, DescriptorProto, MessageOptions, msg_proto); + + m->oneof_count = n_oneof; + m->oneofs = _upb_OneofDefs_New(ctx, n_oneof, oneofs, m); + + m->field_count = n_field; + m->fields = + _upb_FieldDefs_New(ctx, n_field, fields, m->full_name, m, &m->is_sorted); + + // Message Sets may not contain fields. + if (UPB_UNLIKELY(UPB_DESC(MessageOptions_message_set_wire_format)(m->opts))) { + if (UPB_UNLIKELY(n_field > 0)) { + _upb_DefBuilder_Errf(ctx, "invalid message set (%s)", m->full_name); + } + } + + m->ext_range_count = n_ext_range; + m->ext_ranges = _upb_ExtensionRanges_New(ctx, n_ext_range, ext_ranges, m); + + m->res_range_count = n_res_range; + m->res_ranges = + _upb_MessageReservedRanges_New(ctx, n_res_range, res_ranges, m); + + m->res_name_count = n_res_name; + m->res_names = _upb_ReservedNames_New(ctx, n_res_name, res_names); + + const size_t synthetic_count = _upb_OneofDefs_Finalize(ctx, m); + m->real_oneof_count = m->oneof_count - synthetic_count; + + assign_msg_wellknowntype(m); + upb_inttable_compact(&m->itof, ctx->arena); + + const UPB_DESC(EnumDescriptorProto)* const* enums = + UPB_DESC(DescriptorProto_enum_type)(msg_proto, &n_enum); + m->nested_enum_count = n_enum; + m->nested_enums = _upb_EnumDefs_New(ctx, n_enum, enums, m); + + const UPB_DESC(FieldDescriptorProto)* const* exts = + UPB_DESC(DescriptorProto_extension)(msg_proto, &n_ext); + m->nested_ext_count = n_ext; + m->nested_exts = _upb_Extensions_New(ctx, n_ext, exts, m->full_name, m); + + const UPB_DESC(DescriptorProto)* const* msgs = + UPB_DESC(DescriptorProto_nested_type)(msg_proto, &n_msg); + m->nested_msg_count = n_msg; + m->nested_msgs = _upb_MessageDefs_New(ctx, n_msg, msgs, m); +} + +// Allocate and initialize an array of |n| message defs. +upb_MessageDef* _upb_MessageDefs_New( + upb_DefBuilder* ctx, int n, const UPB_DESC(DescriptorProto) * const* protos, + const upb_MessageDef* containing_type) { + _upb_DefType_CheckPadding(sizeof(upb_MessageDef)); + + const char* name = containing_type ? containing_type->full_name + : _upb_FileDef_RawPackage(ctx->file); + + upb_MessageDef* m = _upb_DefBuilder_Alloc(ctx, sizeof(upb_MessageDef) * n); + for (int i = 0; i < n; i++) { + create_msgdef(ctx, name, protos[i], containing_type, &m[i]); + } + return m; +} diff --git a/third_party/upb/upb/reflection/message_def.h b/third_party/upb/upb/reflection/message_def.h new file mode 100644 index 00000000000..d1d9891c01f --- /dev/null +++ b/third_party/upb/upb/reflection/message_def.h @@ -0,0 +1,174 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_MESSAGE_DEF_H_ +#define UPB_REFLECTION_MESSAGE_DEF_H_ + +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +// Well-known field tag numbers for map-entry messages. +#define kUpb_MapEntry_KeyFieldNumber 1 +#define kUpb_MapEntry_ValueFieldNumber 2 + +// Well-known field tag numbers for Any messages. +#define kUpb_Any_TypeFieldNumber 1 +#define kUpb_Any_ValueFieldNumber 2 + +// Well-known field tag numbers for duration messages. +#define kUpb_Duration_SecondsFieldNumber 1 +#define kUpb_Duration_NanosFieldNumber 2 + +// Well-known field tag numbers for timestamp messages. +#define kUpb_Timestamp_SecondsFieldNumber 1 +#define kUpb_Timestamp_NanosFieldNumber 2 + +// All the different kind of well known type messages. For simplicity of check, +// number wrappers and string wrappers are grouped together. Make sure the +// order and number of these groups are not changed. +typedef enum { + kUpb_WellKnown_Unspecified, + kUpb_WellKnown_Any, + kUpb_WellKnown_FieldMask, + kUpb_WellKnown_Duration, + kUpb_WellKnown_Timestamp, + + // number wrappers + kUpb_WellKnown_DoubleValue, + kUpb_WellKnown_FloatValue, + kUpb_WellKnown_Int64Value, + kUpb_WellKnown_UInt64Value, + kUpb_WellKnown_Int32Value, + kUpb_WellKnown_UInt32Value, + + // string wrappers + kUpb_WellKnown_StringValue, + kUpb_WellKnown_BytesValue, + kUpb_WellKnown_BoolValue, + kUpb_WellKnown_Value, + kUpb_WellKnown_ListValue, + kUpb_WellKnown_Struct, +} upb_WellKnown; + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m); + +const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m, + int i); +int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m); + +const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i); +int upb_MessageDef_FieldCount(const upb_MessageDef* m); + +const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m); + +// Returns a field by either JSON name or regular proto name. +const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize( + const upb_MessageDef* m, const char* name, size_t size); +UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName( + const upb_MessageDef* m, const char* name) { + return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name)); +} + +// Lookup of either field or oneof by name. Returns whether either was found. +// If the return is true, then the found def will be set, and the non-found +// one set to NULL. +bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m, + const char* name, size_t size, + const upb_FieldDef** f, + const upb_OneofDef** o); +UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m, + const char* name, + const upb_FieldDef** f, + const upb_OneofDef** o) { + return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o); +} + +const upb_FieldDef* upb_MessageDef_FindFieldByName(const upb_MessageDef* m, + const char* name); +const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize( + const upb_MessageDef* m, const char* name, size_t size); +const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m, + uint32_t i); +const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m, + const char* name); +const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize( + const upb_MessageDef* m, const char* name, size_t size); +const char* upb_MessageDef_FullName(const upb_MessageDef* m); +bool upb_MessageDef_HasOptions(const upb_MessageDef* m); +bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m); +bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m); + +// Creates a mini descriptor string for a message, returns true on success. +bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a, + upb_StringView* out); + +const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m); +const char* upb_MessageDef_Name(const upb_MessageDef* m); + +const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i); +const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m, + int i); +const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m, + int i); + +int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m); +int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m); +int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m); + +const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i); +int upb_MessageDef_OneofCount(const upb_MessageDef* m); +int upb_MessageDef_RealOneofCount(const upb_MessageDef* m); + +const UPB_DESC(MessageOptions) * + upb_MessageDef_Options(const upb_MessageDef* m); + +upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i); +int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m); + +const upb_MessageReservedRange* upb_MessageDef_ReservedRange( + const upb_MessageDef* m, int i); +int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m); + +upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m); +upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/message_def_internal.h b/third_party/upb/upb/reflection/message_def_internal.h new file mode 100644 index 00000000000..af90c4e1609 --- /dev/null +++ b/third_party/upb/upb/reflection/message_def_internal.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ +#define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ + +#include "upb/reflection/message_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_MessageDef* _upb_MessageDef_At(const upb_MessageDef* m, int i); +bool _upb_MessageDef_InMessageSet(const upb_MessageDef* m); +bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t size, + upb_value v, upb_Arena* a); +void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m, + const upb_FieldDef* f); +bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n); +void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m); +void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx, + const upb_MessageDef* m); +void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m); + +// Allocate and initialize an array of |n| message defs. +upb_MessageDef* _upb_MessageDefs_New( + upb_DefBuilder* ctx, int n, const UPB_DESC(DescriptorProto) * const* protos, + const upb_MessageDef* containing_type); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/message_reserved_range.c b/third_party/upb/upb/reflection/message_reserved_range.c new file mode 100644 index 00000000000..5b6bf006647 --- /dev/null +++ b/third_party/upb/upb/reflection/message_reserved_range.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/enum_def.h" +#include "upb/reflection/extension_range_internal.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/message_def.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MessageReservedRange { + int32_t start; + int32_t end; +}; + +upb_MessageReservedRange* _upb_MessageReservedRange_At( + const upb_MessageReservedRange* r, int i) { + return (upb_MessageReservedRange*)&r[i]; +} + +int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r) { + return r->start; +} +int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r) { + return r->end; +} + +upb_MessageReservedRange* _upb_MessageReservedRanges_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, + const upb_MessageDef* m) { + upb_MessageReservedRange* r = + _upb_DefBuilder_Alloc(ctx, sizeof(upb_MessageReservedRange) * n); + + for (int i = 0; i < n; i++) { + const int32_t start = + UPB_DESC(DescriptorProto_ReservedRange_start)(protos[i]); + const int32_t end = UPB_DESC(DescriptorProto_ReservedRange_end)(protos[i]); + const int32_t max = kUpb_MaxFieldNumber + 1; + + // A full validation would also check that each range is disjoint, and that + // none of the fields overlap with the extension ranges, but we are just + // sanity checking here. + if (start < 1 || end <= start || end > max) { + _upb_DefBuilder_Errf(ctx, + "Reserved range (%d, %d) is invalid, message=%s\n", + (int)start, (int)end, upb_MessageDef_FullName(m)); + } + + r[i].start = start; + r[i].end = end; + } + + return r; +} diff --git a/third_party/upb/upb/reflection/message_reserved_range.h b/third_party/upb/upb/reflection/message_reserved_range.h new file mode 100644 index 00000000000..dcdf4e3ae4f --- /dev/null +++ b/third_party/upb/upb/reflection/message_reserved_range.h @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ +#define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r); +int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */ diff --git a/third_party/upb/upb/reflection/message_reserved_range_internal.h b/third_party/upb/upb/reflection/message_reserved_range_internal.h new file mode 100644 index 00000000000..37b10be24ca --- /dev/null +++ b/third_party/upb/upb/reflection/message_reserved_range_internal.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ +#define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ + +#include "upb/reflection/message_reserved_range.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_MessageReservedRange* _upb_MessageReservedRange_At( + const upb_MessageReservedRange* r, int i); + +// Allocate and initialize an array of |n| reserved ranges owned by |m|. +upb_MessageReservedRange* _upb_MessageReservedRanges_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, + const upb_MessageDef* m); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/method_def.c b/third_party/upb/upb/reflection/method_def.c new file mode 100644 index 00000000000..7c4fd30d41e --- /dev/null +++ b/third_party/upb/upb/reflection/method_def.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/method_def_internal.h" +#include "upb/reflection/service_def.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_MethodDef { + const UPB_DESC(MethodOptions) * opts; + upb_ServiceDef* service; + const char* full_name; + const upb_MessageDef* input_type; + const upb_MessageDef* output_type; + int index; + bool client_streaming; + bool server_streaming; +}; + +upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i) { + return (upb_MethodDef*)&m[i]; +} + +const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m) { + return m->service; +} + +const UPB_DESC(MethodOptions) * upb_MethodDef_Options(const upb_MethodDef* m) { + return m->opts; +} + +bool upb_MethodDef_HasOptions(const upb_MethodDef* m) { + return m->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_MethodDef_FullName(const upb_MethodDef* m) { + return m->full_name; +} + +const char* upb_MethodDef_Name(const upb_MethodDef* m) { + return _upb_DefBuilder_FullToShort(m->full_name); +} + +int upb_MethodDef_Index(const upb_MethodDef* m) { return m->index; } + +const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m) { + return m->input_type; +} + +const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m) { + return m->output_type; +} + +bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m) { + return m->client_streaming; +} + +bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m) { + return m->server_streaming; +} + +static void create_method(upb_DefBuilder* ctx, + const UPB_DESC(MethodDescriptorProto) * method_proto, + upb_ServiceDef* s, upb_MethodDef* m) { + upb_StringView name = UPB_DESC(MethodDescriptorProto_name)(method_proto); + + m->service = s; + m->full_name = + _upb_DefBuilder_MakeFullName(ctx, upb_ServiceDef_FullName(s), name); + m->client_streaming = + UPB_DESC(MethodDescriptorProto_client_streaming)(method_proto); + m->server_streaming = + UPB_DESC(MethodDescriptorProto_server_streaming)(method_proto); + m->input_type = _upb_DefBuilder_Resolve( + ctx, m->full_name, m->full_name, + UPB_DESC(MethodDescriptorProto_input_type)(method_proto), + UPB_DEFTYPE_MSG); + m->output_type = _upb_DefBuilder_Resolve( + ctx, m->full_name, m->full_name, + UPB_DESC(MethodDescriptorProto_output_type)(method_proto), + UPB_DEFTYPE_MSG); + + UPB_DEF_SET_OPTIONS(m->opts, MethodDescriptorProto, MethodOptions, + method_proto); +} + +// Allocate and initialize an array of |n| method defs belonging to |s|. +upb_MethodDef* _upb_MethodDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(MethodDescriptorProto) * const* protos, upb_ServiceDef* s) { + upb_MethodDef* m = _upb_DefBuilder_Alloc(ctx, sizeof(upb_MethodDef) * n); + for (int i = 0; i < n; i++) { + create_method(ctx, protos[i], s, &m[i]); + m[i].index = i; + } + return m; +} diff --git a/third_party/upb/upb/reflection/method_def.h b/third_party/upb/upb/reflection/method_def.h new file mode 100644 index 00000000000..fdf0534db00 --- /dev/null +++ b/third_party/upb/upb/reflection/method_def.h @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_METHOD_DEF_H_ +#define UPB_REFLECTION_METHOD_DEF_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m); +const char* upb_MethodDef_FullName(const upb_MethodDef* m); +bool upb_MethodDef_HasOptions(const upb_MethodDef* m); +int upb_MethodDef_Index(const upb_MethodDef* m); +const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m); +const char* upb_MethodDef_Name(const upb_MethodDef* m); +const UPB_DESC(MethodOptions) * upb_MethodDef_Options(const upb_MethodDef* m); +const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m); +bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m); +const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_METHOD_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/method_def_internal.h b/third_party/upb/upb/reflection/method_def_internal.h new file mode 100644 index 00000000000..c6629ff9f29 --- /dev/null +++ b/third_party/upb/upb/reflection/method_def_internal.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ +#define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ + +#include "upb/reflection/method_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i); + +// Allocate and initialize an array of |n| method defs owned by |s|. +upb_MethodDef* _upb_MethodDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(MethodDescriptorProto) * const* protos, upb_ServiceDef* s); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/oneof_def.c b/third_party/upb/upb/reflection/oneof_def.c new file mode 100644 index 00000000000..767bdc49cff --- /dev/null +++ b/third_party/upb/upb/reflection/oneof_def.c @@ -0,0 +1,206 @@ +/* + * 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 +#include +#include + +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/message_def_internal.h" +#include "upb/reflection/oneof_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_OneofDef { + const UPB_DESC(OneofOptions) * opts; + const upb_MessageDef* parent; + const char* full_name; + int field_count; + bool synthetic; + const upb_FieldDef** fields; + upb_strtable ntof; // lookup a field by name + upb_inttable itof; // lookup a field by number (index) +#if UINTPTR_MAX == 0xffffffff + uint32_t padding; // Increase size to a multiple of 8. +#endif +}; + +upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i) { + return (upb_OneofDef*)&o[i]; +} + +const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o) { + return o->opts; +} + +bool upb_OneofDef_HasOptions(const upb_OneofDef* o) { + return o->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_OneofDef_FullName(const upb_OneofDef* o) { + return o->full_name; +} + +const char* upb_OneofDef_Name(const upb_OneofDef* o) { + return _upb_DefBuilder_FullToShort(o->full_name); +} + +const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o) { + return o->parent; +} + +int upb_OneofDef_FieldCount(const upb_OneofDef* o) { return o->field_count; } + +const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i) { + UPB_ASSERT(i < o->field_count); + return o->fields[i]; +} + +int upb_OneofDef_numfields(const upb_OneofDef* o) { return o->field_count; } + +uint32_t upb_OneofDef_Index(const upb_OneofDef* o) { + // Compute index in our parent's array. + return o - upb_MessageDef_Oneof(o->parent, 0); +} + +bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o) { return o->synthetic; } + +const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o, + const char* name, + size_t size) { + upb_value val; + return upb_strtable_lookup2(&o->ntof, name, size, &val) + ? upb_value_getptr(val) + : NULL; +} + +const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o, + const char* name) { + return upb_OneofDef_LookupNameWithSize(o, name, strlen(name)); +} + +const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, + uint32_t num) { + upb_value val; + return upb_inttable_lookup(&o->itof, num, &val) ? upb_value_getptr(val) + : NULL; +} + +bool _upb_OneofDef_Insert(upb_OneofDef* o, const upb_FieldDef* f, + const char* name, size_t size, upb_Arena* a) { + o->field_count++; + if (_upb_FieldDef_IsProto3Optional(f)) o->synthetic = true; + + const int number = upb_FieldDef_Number(f); + const upb_value v = upb_value_constptr(f); + return upb_inttable_insert(&o->itof, number, v, a) && + upb_strtable_insert(&o->ntof, name, size, v, a); +} + +// Returns the synthetic count. +size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m) { + int synthetic_count = 0; + + for (int i = 0; i < upb_MessageDef_OneofCount(m); i++) { + upb_OneofDef* o = (upb_OneofDef*)upb_MessageDef_Oneof(m, i); + + if (o->synthetic && o->field_count != 1) { + _upb_DefBuilder_Errf(ctx, + "Synthetic oneofs must have one field, not %d: %s", + o->field_count, upb_OneofDef_Name(o)); + } + + if (o->synthetic) { + synthetic_count++; + } else if (synthetic_count != 0) { + _upb_DefBuilder_Errf( + ctx, "Synthetic oneofs must be after all other oneofs: %s", + upb_OneofDef_Name(o)); + } + + o->fields = + _upb_DefBuilder_Alloc(ctx, sizeof(upb_FieldDef*) * o->field_count); + o->field_count = 0; + } + + for (int i = 0; i < upb_MessageDef_FieldCount(m); i++) { + const upb_FieldDef* f = upb_MessageDef_Field(m, i); + upb_OneofDef* o = (upb_OneofDef*)upb_FieldDef_ContainingOneof(f); + if (o) { + o->fields[o->field_count++] = f; + } + } + + return synthetic_count; +} + +static void create_oneofdef(upb_DefBuilder* ctx, upb_MessageDef* m, + const UPB_DESC(OneofDescriptorProto) * oneof_proto, + const upb_OneofDef* _o) { + upb_OneofDef* o = (upb_OneofDef*)_o; + upb_StringView name = UPB_DESC(OneofDescriptorProto_name)(oneof_proto); + + o->parent = m; + o->full_name = + _upb_DefBuilder_MakeFullName(ctx, upb_MessageDef_FullName(m), name); + o->field_count = 0; + o->synthetic = false; + + UPB_DEF_SET_OPTIONS(o->opts, OneofDescriptorProto, OneofOptions, oneof_proto); + + if (upb_MessageDef_FindByNameWithSize(m, name.data, name.size, NULL, NULL)) { + _upb_DefBuilder_Errf(ctx, "duplicate oneof name (%s)", o->full_name); + } + + upb_value v = _upb_DefType_Pack(o, UPB_DEFTYPE_ONEOF); + bool ok = _upb_MessageDef_Insert(m, name.data, name.size, v, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + ok = upb_inttable_init(&o->itof, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); + + ok = upb_strtable_init(&o->ntof, 4, ctx->arena); + if (!ok) _upb_DefBuilder_OomErr(ctx); +} + +// Allocate and initialize an array of |n| oneof defs. +upb_OneofDef* _upb_OneofDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(OneofDescriptorProto) * const* protos, upb_MessageDef* m) { + _upb_DefType_CheckPadding(sizeof(upb_OneofDef)); + + upb_OneofDef* o = _upb_DefBuilder_Alloc(ctx, sizeof(upb_OneofDef) * n); + for (int i = 0; i < n; i++) { + create_oneofdef(ctx, m, protos[i], &o[i]); + } + return o; +} diff --git a/third_party/upb/upb/reflection/oneof_def.h b/third_party/upb/upb/reflection/oneof_def.h new file mode 100644 index 00000000000..691b40e0fa1 --- /dev/null +++ b/third_party/upb/upb/reflection/oneof_def.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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_ONEOF_DEF_H_ +#define UPB_REFLECTION_ONEOF_DEF_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o); +const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i); +int upb_OneofDef_FieldCount(const upb_OneofDef* o); +const char* upb_OneofDef_FullName(const upb_OneofDef* o); +bool upb_OneofDef_HasOptions(const upb_OneofDef* o); +uint32_t upb_OneofDef_Index(const upb_OneofDef* o); +bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o); +const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o, + const char* name); +const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o, + const char* name, + size_t size); +const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, + uint32_t num); +const char* upb_OneofDef_Name(const upb_OneofDef* o); +int upb_OneofDef_numfields(const upb_OneofDef* o); +const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ONEOF_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/oneof_def_internal.h b/third_party/upb/upb/reflection/oneof_def_internal.h new file mode 100644 index 00000000000..3a98c6739cb --- /dev/null +++ b/third_party/upb/upb/reflection/oneof_def_internal.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ +#define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ + +#include "upb/reflection/oneof_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i); +bool _upb_OneofDef_Insert(upb_OneofDef* o, const upb_FieldDef* f, + const char* name, size_t size, upb_Arena* a); + +// Allocate and initialize an array of |n| oneof defs owned by |m|. +upb_OneofDef* _upb_OneofDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(OneofDescriptorProto) * const* protos, upb_MessageDef* m); + +size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/service_def.c b/third_party/upb/upb/reflection/service_def.c new file mode 100644 index 00000000000..453100f1b81 --- /dev/null +++ b/third_party/upb/upb/reflection/service_def.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "upb/reflection/def_builder_internal.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/method_def_internal.h" +#include "upb/reflection/service_def_internal.h" + +// Must be last. +#include "upb/port/def.inc" + +struct upb_ServiceDef { + const UPB_DESC(ServiceOptions) * opts; + const upb_FileDef* file; + const char* full_name; + upb_MethodDef* methods; + int method_count; + int index; +}; + +upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int index) { + return (upb_ServiceDef*)&s[index]; +} + +const UPB_DESC(ServiceOptions) * + upb_ServiceDef_Options(const upb_ServiceDef* s) { + return s->opts; +} + +bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s) { + return s->opts != (void*)kUpbDefOptDefault; +} + +const char* upb_ServiceDef_FullName(const upb_ServiceDef* s) { + return s->full_name; +} + +const char* upb_ServiceDef_Name(const upb_ServiceDef* s) { + return _upb_DefBuilder_FullToShort(s->full_name); +} + +int upb_ServiceDef_Index(const upb_ServiceDef* s) { return s->index; } + +const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s) { + return s->file; +} + +int upb_ServiceDef_MethodCount(const upb_ServiceDef* s) { + return s->method_count; +} + +const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i) { + return (i < 0 || i >= s->method_count) ? NULL + : _upb_MethodDef_At(s->methods, i); +} + +const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, + const char* name) { + for (int i = 0; i < s->method_count; i++) { + const upb_MethodDef* m = _upb_MethodDef_At(s->methods, i); + if (strcmp(name, upb_MethodDef_Name(m)) == 0) { + return m; + } + } + return NULL; +} + +static void create_service(upb_DefBuilder* ctx, + const UPB_DESC(ServiceDescriptorProto) * svc_proto, + upb_ServiceDef* s) { + upb_StringView name; + size_t n; + + // Must happen before _upb_DefBuilder_Add() + s->file = _upb_DefBuilder_File(ctx); + + name = UPB_DESC(ServiceDescriptorProto_name)(svc_proto); + const char* package = _upb_FileDef_RawPackage(s->file); + s->full_name = _upb_DefBuilder_MakeFullName(ctx, package, name); + _upb_DefBuilder_Add(ctx, s->full_name, + _upb_DefType_Pack(s, UPB_DEFTYPE_SERVICE)); + + const UPB_DESC(MethodDescriptorProto)* const* methods = + UPB_DESC(ServiceDescriptorProto_method)(svc_proto, &n); + s->method_count = n; + s->methods = _upb_MethodDefs_New(ctx, n, methods, s); + + UPB_DEF_SET_OPTIONS(s->opts, ServiceDescriptorProto, ServiceOptions, + svc_proto); +} + +upb_ServiceDef* _upb_ServiceDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(ServiceDescriptorProto) * const* protos) { + _upb_DefType_CheckPadding(sizeof(upb_ServiceDef)); + + upb_ServiceDef* s = _upb_DefBuilder_Alloc(ctx, sizeof(upb_ServiceDef) * n); + for (int i = 0; i < n; i++) { + create_service(ctx, protos[i], &s[i]); + s[i].index = i; + } + return s; +} diff --git a/third_party/upb/upb/reflection/service_def.h b/third_party/upb/upb/reflection/service_def.h new file mode 100644 index 00000000000..7a8f25809ff --- /dev/null +++ b/third_party/upb/upb/reflection/service_def.h @@ -0,0 +1,60 @@ +/* + * 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. + */ + +// IWYU pragma: private, include "upb/reflection/def.h" + +#ifndef UPB_REFLECTION_SERVICE_DEF_H_ +#define UPB_REFLECTION_SERVICE_DEF_H_ + +#include "upb/reflection/common.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s); +const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, + const char* name); +const char* upb_ServiceDef_FullName(const upb_ServiceDef* s); +bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s); +int upb_ServiceDef_Index(const upb_ServiceDef* s); +const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i); +int upb_ServiceDef_MethodCount(const upb_ServiceDef* s); +const char* upb_ServiceDef_Name(const upb_ServiceDef* s); +const UPB_DESC(ServiceOptions) * + upb_ServiceDef_Options(const upb_ServiceDef* s); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_SERVICE_DEF_H_ */ diff --git a/third_party/upb/upb/reflection/service_def_internal.h b/third_party/upb/upb/reflection/service_def_internal.h new file mode 100644 index 00000000000..e79a93c1902 --- /dev/null +++ b/third_party/upb/upb/reflection/service_def_internal.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ +#define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ + +#include "upb/reflection/service_def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i); + +// Allocate and initialize an array of |n| service defs. +upb_ServiceDef* _upb_ServiceDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(ServiceDescriptorProto) * const* protos); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */ diff --git a/third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c b/third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c new file mode 100644 index 00000000000..8620a81a1ab --- /dev/null +++ b/third_party/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c @@ -0,0 +1,417 @@ +#include +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/decode.h" +#include "upb/mini_table/enum_internal.h" +#include "google/protobuf/descriptor.upb.h" + +static upb_Arena* upb_BootstrapArena() { + static upb_Arena* arena = NULL; + if (!arena) arena = upb_Arena_New(); + return arena; +} + +const upb_MiniTable* google_protobuf_FileDescriptorSet_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 1), google_protobuf_FileDescriptorProto_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_FileDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$11EGGGG33<<11"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 4), google_protobuf_DescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 5), google_protobuf_EnumDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 6), google_protobuf_ServiceDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 7), google_protobuf_FieldDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 8), google_protobuf_FileOptions_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 9), google_protobuf_SourceCodeInfo_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_DescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1GGGGG3GGE"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google_protobuf_FieldDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 6), google_protobuf_FieldDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 3), google_protobuf_DescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 4), google_protobuf_EnumDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 5), google_protobuf_DescriptorProto_ExtensionRange_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 8), google_protobuf_OneofDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 7), google_protobuf_MessageOptions_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 9), google_protobuf_DescriptorProto_ReservedRange_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_DescriptorProto_ExtensionRange_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$((3"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 3), google_protobuf_ExtensionRangeOptions_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_DescriptorProto_ReservedRange_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$(("; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + return mini_table; +} + +const upb_MiniTable* google_protobuf_ExtensionRangeOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$Pf~G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_FieldDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$11(44113(1f/"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubEnum(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 4), google_protobuf_FieldDescriptorProto_Label_enum_init()); + upb_MiniTable_SetSubEnum(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 5), google_protobuf_FieldDescriptorProto_Type_enum_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 8), google_protobuf_FieldOptions_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_OneofDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$13"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google_protobuf_OneofOptions_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_EnumDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1G3GE"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google_protobuf_EnumValueDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 3), google_protobuf_EnumOptions_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 4), google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$(("; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + return mini_table; +} + +const upb_MiniTable* google_protobuf_EnumValueDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1(3"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 3), google_protobuf_EnumValueOptions_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_ServiceDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1G3"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google_protobuf_MethodDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 3), google_protobuf_ServiceOptions_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_MethodDescriptorProto_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1113//"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 4), google_protobuf_MethodOptions_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_FileOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$P1f14/1d///a/b/c/c/d11a111/a11y|G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubEnum(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 9), google_protobuf_FileOptions_OptimizeMode_enum_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_MessageOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$P///c/c/{}G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_FieldOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$P4//a/4c/d//v}G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubEnum(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 1), google_protobuf_FieldOptions_CType_enum_init()); + upb_MiniTable_SetSubEnum(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 6), google_protobuf_FieldOptions_JSType_enum_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_OneofOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$Pf~G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_EnumOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$Pa//b/`~G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_EnumValueOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$P/e~G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_ServiceOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$P``/e}G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_MethodOptions_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$P``/4d}G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubEnum(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 34), google_protobuf_MethodOptions_IdempotencyLevel_enum_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google_protobuf_UninterpretedOption_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_UninterpretedOption_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$aG1,+ 01"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google_protobuf_UninterpretedOption_NamePart_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_UninterpretedOption_NamePart_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1N/N"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + return mini_table; +} + +const upb_MiniTable* google_protobuf_SourceCodeInfo_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$G"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 1), google_protobuf_SourceCodeInfo_Location_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_SourceCodeInfo_Location_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$size; + return (const google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) { + size_t size; + google_protobuf_FileDescriptorSet_file(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorSet_msg_init(), 1); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorSet_msg_init(), 1); + return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorSet_msg_init(), 1); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(google_protobuf_FileDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.FileDescriptorProto */ + +UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_FileDescriptorProto*)_upb_Message_New(google_protobuf_FileDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FileDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FileDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FileDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FileDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 3); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 4); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_message_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 5); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_enum_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 6); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_service(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 7); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 7); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_extension(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 8); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) { + const google_protobuf_FileOptions* default_val = NULL; + const google_protobuf_FileOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 8); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 8); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 9); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) { + const google_protobuf_SourceCodeInfo* default_val = NULL; + const google_protobuf_SourceCodeInfo* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 9); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 9); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 10); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 10); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_public_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_public_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 11); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 11); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_weak_dependency(const google_protobuf_FileDescriptorProto* msg) { + size_t size; + google_protobuf_FileDescriptorProto_weak_dependency(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 12); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 12); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 12); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 13); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 13); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 13); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 3); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 3); + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 3); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 4); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 4); + return (google_protobuf_DescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 4); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(google_protobuf_DescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 5); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 5); + return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 5); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(google_protobuf_EnumDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 6); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_ServiceDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 6); + return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 6); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(google_protobuf_ServiceDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 7); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 7); + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 7); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(google_protobuf_FieldDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 8); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FileOptions*)_upb_Message_New(google_protobuf_FileOptions_msg_init(), arena); + if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 9); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg); + if (sub == NULL) { + sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(google_protobuf_SourceCodeInfo_msg_init(), arena); + if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub); + } + return sub; +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 10); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 10); + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 10); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 11); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 11); + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 11); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 12); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileDescriptorProto_msg_init(), 13); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.DescriptorProto */ + +UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_DescriptorProto*)_upb_Message_New(google_protobuf_DescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_DescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_DescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_DescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_DescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 2); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_field(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 3); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_nested_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 4); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_enum_type(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 5); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_extension_range(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 6); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_extension(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 7); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) { + const google_protobuf_MessageOptions* default_val = NULL; + const google_protobuf_MessageOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 7); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 7); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 8); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 8); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_oneof_decl(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 9); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 9); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_reserved_range(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 10); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 10); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_protobuf_DescriptorProto* msg) { + size_t size; + google_protobuf_DescriptorProto_reserved_name(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 2); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 2); + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 2); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(google_protobuf_FieldDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 3); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 3); + return (google_protobuf_DescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 3); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(google_protobuf_DescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 4); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 4); + return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 4); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(google_protobuf_EnumDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 5); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 5); + return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 5); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 6); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 6); + return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 6); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(google_protobuf_FieldDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 7); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(google_protobuf_MessageOptions_msg_init(), arena); + if (sub) google_protobuf_DescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 8); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_OneofDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 8); + return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 8); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(google_protobuf_OneofDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 9); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 9); + return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 9); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(google_protobuf_DescriptorProto_ReservedRange_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 10); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 10); + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_msg_init(), 10); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} + +/* google.protobuf.DescriptorProto.ExtensionRange */ + +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) { + return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), arena); +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_DescriptorProto_ExtensionRange_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_DescriptorProto_ExtensionRange_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_DescriptorProto_ExtensionRange_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const google_protobuf_ExtensionRangeOptions* default_val = NULL; + const google_protobuf_ExtensionRangeOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ExtensionRange_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { + struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(google_protobuf_ExtensionRangeOptions_msg_init(), arena); + if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.DescriptorProto.ReservedRange */ + +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) { + return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(google_protobuf_DescriptorProto_ReservedRange_msg_init(), arena); +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_DescriptorProto_ReservedRange_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_DescriptorProto_ReservedRange_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_DescriptorProto_ReservedRange_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_DescriptorProto_ReservedRange_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_DescriptorProto_ReservedRange_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.ExtensionRangeOptions */ + +UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) { + return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(google_protobuf_ExtensionRangeOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_ExtensionRangeOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_ExtensionRangeOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_ExtensionRangeOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_ExtensionRangeOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ExtensionRangeOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ExtensionRangeOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) { + size_t size; + google_protobuf_ExtensionRangeOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ExtensionRangeOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ExtensionRangeOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ExtensionRangeOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.FieldDescriptorProto */ + +UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(google_protobuf_FieldDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FieldDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FieldDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FieldDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FieldDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 4); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 4); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 5); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 5); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 6); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 6); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 7); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 7); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 7); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 8); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) { + const google_protobuf_FieldOptions* default_val = NULL; + const google_protobuf_FieldOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 8); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 8); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 9); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 9); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 9); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 10); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 10); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 10); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 17); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 17); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 17); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 4); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 5); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 6); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 7); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 8); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(google_protobuf_FieldOptions_msg_init(), arena); + if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 9); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 10); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldDescriptorProto_msg_init(), 17); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.OneofDescriptorProto */ + +UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(google_protobuf_OneofDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_OneofDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_OneofDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_OneofDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_OneofDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) { + const google_protobuf_OneofOptions* default_val = NULL; + const google_protobuf_OneofOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofDescriptorProto_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(google_protobuf_OneofOptions_msg_init(), arena); + if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.EnumDescriptorProto */ + +UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(google_protobuf_EnumDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 2); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_value(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) { + const google_protobuf_EnumOptions* default_val = NULL; + const google_protobuf_EnumOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 4); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_reserved_range(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 5); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const google_protobuf_EnumDescriptorProto* msg) { + size_t size; + google_protobuf_EnumDescriptorProto_reserved_name(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 2); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumValueDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 2); + return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 2); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(google_protobuf_EnumValueDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(google_protobuf_EnumOptions_msg_init(), arena); + if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 4); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 4); + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 4); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 5); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 5); + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_msg_init(), 5); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} + +/* google.protobuf.EnumDescriptorProto.EnumReservedRange */ + +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) { + return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), arena); +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.EnumValueDescriptorProto */ + +UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(google_protobuf_EnumValueDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumValueDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumValueDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumValueDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumValueDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) { + const google_protobuf_EnumValueOptions* default_val = NULL; + const google_protobuf_EnumValueOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueDescriptorProto_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(google_protobuf_EnumValueOptions_msg_init(), arena); + if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.ServiceDescriptorProto */ + +UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(google_protobuf_ServiceDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_ServiceDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_ServiceDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_ServiceDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_ServiceDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 2); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) { + size_t size; + google_protobuf_ServiceDescriptorProto_method(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) { + const google_protobuf_ServiceOptions* default_val = NULL; + const google_protobuf_ServiceOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 2); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_MethodDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 2); + return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 2); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(google_protobuf_MethodDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceDescriptorProto_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(google_protobuf_ServiceOptions_msg_init(), arena); + if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub); + } + return sub; +} + +/* google.protobuf.MethodDescriptorProto */ + +UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) { + return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(google_protobuf_MethodDescriptorProto_msg_init(), arena); +} +UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_MethodDescriptorProto_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_MethodDescriptorProto_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_MethodDescriptorProto_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_MethodDescriptorProto_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) { + const google_protobuf_MethodOptions* default_val = NULL; + const google_protobuf_MethodOptions* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 4); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 4); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 5); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 5); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 6); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 6); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 4); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { + struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg); + if (sub == NULL) { + sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(google_protobuf_MethodOptions_msg_init(), arena); + if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub); + } + return sub; +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 5); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodDescriptorProto_msg_init(), 6); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.FileOptions */ + +UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) { + return (google_protobuf_FileOptions*)_upb_Message_New(google_protobuf_FileOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FileOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FileOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FileOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FileOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 8); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 8); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 8); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 9); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) { + int32_t default_val = 1; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 9); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 9); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 10); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 10); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 10); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 11); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 11); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 11); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 16); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 16); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 16); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 17); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 17); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 17); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 18); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 18); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 18); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 20); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 20); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 20); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 23); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 23); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 23); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 27); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 27); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 27); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 31); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) { + bool default_val = true; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 31); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 31); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 36); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 36); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 36); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 37); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 37); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 37); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 39); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 39); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 39); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 40); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 40); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 40); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 41); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 41); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 41); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 42); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 42); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 42); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 44); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 44); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 44); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 45); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 45); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 45); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) { + size_t size; + google_protobuf_FileOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 8); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 9); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 10); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 11); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 16); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 17); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 18); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 20); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 23); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 27); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 31); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 36); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 37); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 39); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 40); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 41); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 42); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 44); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 45); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FileOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.MessageOptions */ + +UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) { + return (google_protobuf_MessageOptions*)_upb_Message_New(google_protobuf_MessageOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_MessageOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_MessageOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_MessageOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_MessageOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 7); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 7); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 7); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 11); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 11); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 11); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) { + size_t size; + google_protobuf_MessageOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 7); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 11); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MessageOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.FieldOptions */ + +UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) { + return (google_protobuf_FieldOptions*)_upb_Message_New(google_protobuf_FieldOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FieldOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_FieldOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FieldOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_FieldOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 5); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 5); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 6); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 6); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 10); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 10); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 10); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 15); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 15); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 15); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 16); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 16); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 16); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) { + size_t size; + google_protobuf_FieldOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 5); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 6); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 10); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 15); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 16); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_FieldOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.OneofOptions */ + +UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) { + return (google_protobuf_OneofOptions*)_upb_Message_New(google_protobuf_OneofOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_OneofOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_OneofOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_OneofOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_OneofOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) { + size_t size; + google_protobuf_OneofOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_OneofOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.EnumOptions */ + +UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) { + return (google_protobuf_EnumOptions*)_upb_Message_New(google_protobuf_EnumOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 6); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 6); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) { + size_t size; + google_protobuf_EnumOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 6); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.EnumValueOptions */ + +UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) { + return (google_protobuf_EnumValueOptions*)_upb_Message_New(google_protobuf_EnumValueOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumValueOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_EnumValueOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumValueOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_EnumValueOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) { + size_t size; + google_protobuf_EnumValueOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_EnumValueOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.ServiceOptions */ + +UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) { + return (google_protobuf_ServiceOptions*)_upb_Message_New(google_protobuf_ServiceOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_ServiceOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_ServiceOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_ServiceOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_ServiceOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 33); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 33); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 33); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) { + size_t size; + google_protobuf_ServiceOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 33); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_ServiceOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.MethodOptions */ + +UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) { + return (google_protobuf_MethodOptions*)_upb_Message_New(google_protobuf_MethodOptions_msg_init(), arena); +} +UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_MethodOptions_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_MethodOptions_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_MethodOptions_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_MethodOptions_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 33); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 33); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 33); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 34); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 34); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 34); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 999); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 999); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) { + size_t size; + google_protobuf_MethodOptions_uninterpreted_option(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 33); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 34); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 999); + return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_MethodOptions_msg_init(), 999); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.UninterpretedOption */ + +UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) { + return (google_protobuf_UninterpretedOption*)_upb_Message_New(google_protobuf_UninterpretedOption_msg_init(), arena); +} +UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_UninterpretedOption_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_UninterpretedOption_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_UninterpretedOption_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_UninterpretedOption_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 2); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) { + size_t size; + google_protobuf_UninterpretedOption_name(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) { + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 4); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 4); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) { + int64_t default_val = (int64_t)0ll; + int64_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 5); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 5); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) { + double default_val = 0; + double ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 6); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 6); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 7); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 7); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 7); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 8); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 8); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 8); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 2); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 2); + return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 2); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(google_protobuf_UninterpretedOption_NamePart_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 4); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 5); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 6); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 7); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_msg_init(), 8); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.UninterpretedOption.NamePart */ + +UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) { + return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(google_protobuf_UninterpretedOption_NamePart_msg_init(), arena); +} +UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_UninterpretedOption_NamePart_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_UninterpretedOption_NamePart_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_UninterpretedOption_NamePart_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_UninterpretedOption_NamePart_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_UninterpretedOption_NamePart_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.SourceCodeInfo */ + +UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { + return (google_protobuf_SourceCodeInfo*)_upb_Message_New(google_protobuf_SourceCodeInfo_msg_init(), arena); +} +UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_SourceCodeInfo_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_SourceCodeInfo_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_SourceCodeInfo_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_SourceCodeInfo_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_msg_init(), 1); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) { + size_t size; + google_protobuf_SourceCodeInfo_location(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_msg_init(), 1); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_SourceCodeInfo_Location**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_msg_init(), 1); + return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_msg_init(), 1); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(google_protobuf_SourceCodeInfo_Location_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.SourceCodeInfo.Location */ + +UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) { + return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(google_protobuf_SourceCodeInfo_Location_msg_init(), arena); +} +UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_SourceCodeInfo_Location_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_SourceCodeInfo_Location_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_SourceCodeInfo_Location_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_SourceCodeInfo_Location_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 1); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_path(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_path(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 2); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_span(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_span(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 4); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 4); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 6); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 6); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) { + size_t size; + google_protobuf_SourceCodeInfo_Location_leading_detached_comments(msg, &size); + return size != 0; +} + +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 1); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 1); + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 1); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 2); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 2); + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 2); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 4); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 6); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 6); + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_SourceCodeInfo_Location_msg_init(), 6); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} + +/* google.protobuf.GeneratedCodeInfo */ + +UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) { + return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(google_protobuf_GeneratedCodeInfo_msg_init(), arena); +} +UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_GeneratedCodeInfo_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_GeneratedCodeInfo_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_GeneratedCodeInfo_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_GeneratedCodeInfo_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_msg_init(), 1); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) { + size_t size; + google_protobuf_GeneratedCodeInfo_annotation(msg, &size); + return size != 0; +} + +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_msg_init(), 1); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_msg_init(), 1); + return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_msg_init(), 1); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.GeneratedCodeInfo.Annotation */ + +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) { + return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), arena); +} +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 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) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 1); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + size_t size; + google_protobuf_GeneratedCodeInfo_Annotation_path(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 4); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 4); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 5); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 5); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 5); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 1); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (int32_t*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 1); + return (int32_t*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 1); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 4); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_GeneratedCodeInfo_Annotation_msg_init(), 5); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +extern const upb_MiniTableFile 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, 192) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */ diff --git a/third_party/upb/upb/status.h b/third_party/upb/upb/status.h index 2c5c2a7f8be..fcd2bf73eea 100644 --- a/third_party/upb/upb/status.h +++ b/third_party/upb/upb/status.h @@ -25,42 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/base/status.h instead +// IWYU pragma: private, include "upb/base/status.h" + #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 +#include "upb/base/status.h" #endif /* UPB_STATUS_H_ */ diff --git a/third_party/upb/upb/decode_internal.h b/third_party/upb/upb/string_view.h similarity index 86% rename from third_party/upb/upb/decode_internal.h rename to third_party/upb/upb/string_view.h index fe3cbc7d493..add8275281c 100644 --- a/third_party/upb/upb/decode_internal.h +++ b/third_party/upb/upb/string_view.h @@ -25,12 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UPB_DECODE_INT_H_ -#define UPB_DECODE_INT_H_ +// This header is deprecated, use upb/base/string_view.h instead +// IWYU pragma: private, include "upb/base/string_view.h" -// TODO(b/232091617): Delete this entire header which currently exists only for -// temporary backwards compatibility. +#ifndef UPB_STRING_VIEW_H_ +#define UPB_STRING_VIEW_H_ -#include "upb/internal/decode.h" +#include "upb/base/string_view.h" -#endif /* UPB_DECODE_INT_H_ */ +#endif /* UPB_STRING_VIEW_H_ */ diff --git a/third_party/upb/upb/test/BUILD b/third_party/upb/upb/test/BUILD new file mode 100644 index 00000000000..7e41faecff1 --- /dev/null +++ b/third_party/upb/upb/test/BUILD @@ -0,0 +1,202 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google LLC nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +load( + "//bazel:build_defs.bzl", + "UPB_DEFAULT_CPPOPTS", +) +load( + "//bazel:upb_proto_library.bzl", + "upb_proto_library", + "upb_proto_reflection_library", +) + +cc_library( + name = "parse_text_proto", + testonly = 1, + hdrs = ["parse_text_proto.h"], + visibility = ["//:__subpackages__"], + deps = [ + "@com_google_googletest//:gtest", + "@com_google_protobuf//:protobuf", + ], +) + +proto_library( + name = "empty_proto", + srcs = ["empty.proto"], +) + +upb_proto_reflection_library( + name = "empty_upb_proto_reflection", + testonly = 1, + deps = [":empty_proto"], +) + +proto_library( + name = "proto3_test_proto", + testonly = 1, + srcs = ["proto3_test.proto"], + deps = ["@com_google_protobuf//:descriptor_proto"], +) + +upb_proto_library( + name = "proto3_test_upb_proto", + testonly = 1, + deps = [":proto3_test_proto"], +) + +upb_proto_reflection_library( + name = "proto3_test_upb_proto_reflection", + testonly = 1, + deps = [":proto3_test_proto"], +) + +proto_library( + name = "test_proto", + testonly = 1, + srcs = ["test.proto"], +) + +upb_proto_library( + name = "test_upb_proto", + testonly = 1, + visibility = ["//:__subpackages__"], + deps = [":test_proto"], +) + +proto_library( + name = "test_cpp_proto", + srcs = ["test_cpp.proto"], + deps = ["@com_google_protobuf//:timestamp_proto"], +) + +upb_proto_library( + name = "test_cpp_upb_proto", + deps = ["test_cpp_proto"], +) + +upb_proto_reflection_library( + name = "test_cpp_upb_proto_reflection", + deps = ["test_cpp_proto"], +) + +upb_proto_library( + name = "test_messages_proto2_upb_proto", + testonly = 1, + visibility = ["//:__subpackages__"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], +) + +upb_proto_library( + name = "test_messages_proto3_upb_proto", + testonly = 1, + visibility = ["//:__subpackages__"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], +) + +upb_proto_library( + name = "timestamp_upb_proto", + deps = ["@com_google_protobuf//:timestamp_proto"], +) + +upb_proto_reflection_library( + name = "timestamp_upb_proto_reflection", + deps = ["@com_google_protobuf//:timestamp_proto"], +) + +cc_library( + name = "fuzz_util", + testonly = 1, + srcs = ["fuzz_util.cc"], + hdrs = ["fuzz_util.h"], + visibility = ["//:__subpackages__"], + deps = [ + "//:upb", + "//:mini_table_internal", + ], +) + +cc_test( + name = "proto3_test", + srcs = ["proto3_test.cc"], + copts = UPB_DEFAULT_CPPOPTS, + deps = [ + ":proto3_test_upb_proto", + ":proto3_test_upb_proto_reflection", + "//:reflection", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "test_cpp", + srcs = ["test_cpp.cc"], + copts = UPB_DEFAULT_CPPOPTS, + deps = [ + ":test_cpp_upb_proto", + ":test_cpp_upb_proto_reflection", + ":timestamp_upb_proto", + ":timestamp_upb_proto_reflection", + "//:upb", + "//:json", + "//:port", + "//:reflection", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "test_generated_code", + srcs = [ + "test_generated_code.cc", + ], + deps = [ + ":empty_upb_proto_reflection", + ":test_messages_proto2_upb_proto", + ":test_messages_proto3_upb_proto", + ":test_upb_proto", + "//:upb", + "//:port", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "test_mini_table_oneof", + srcs = [ + "test_mini_table_oneof.cc", + ], + deps = [ + ":empty_upb_proto_reflection", + ":test_messages_proto2_upb_proto", + ":test_messages_proto3_upb_proto", + ":test_upb_proto", + "//:upb", + "//:mini_table_internal", + "//:port", + "@com_google_googletest//:gtest_main", + ], +) diff --git a/third_party/upb/upb/empty.proto b/third_party/upb/upb/test/empty.proto similarity index 51% rename from third_party/upb/upb/empty.proto rename to third_party/upb/upb/test/empty.proto index fddb20b36c4..7e54f1bd46b 100644 --- a/third_party/upb/upb/empty.proto +++ b/third_party/upb/upb/test/empty.proto @@ -1 +1,2 @@ syntax = "proto2"; +package upb_test; diff --git a/third_party/upb/upb/test/fuzz_util.cc b/third_party/upb/upb/test/fuzz_util.cc new file mode 100644 index 00000000000..8fafc000a35 --- /dev/null +++ b/third_party/upb/upb/test/fuzz_util.cc @@ -0,0 +1,188 @@ +/* + * 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/test/fuzz_util.h" + +#include "upb/message/message.h" +#include "upb/mini_table/decode.h" +#include "upb/mini_table/extension_internal.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/upb.hpp" + +namespace upb { +namespace fuzz { + +namespace { + +class Builder { + public: + Builder(const MiniTableFuzzInput& input, upb_Arena* arena) + : input_(&input), arena_(arena) {} + + const upb_MiniTable* Build(upb_ExtensionRegistry** exts) { + BuildMessages(); + BuildEnums(); + BuildExtensions(exts); + if (!LinkMessages()) return nullptr; + return mini_tables_.empty() ? nullptr : mini_tables_.front(); + } + + private: + void BuildMessages(); + void BuildEnums(); + void BuildExtensions(upb_ExtensionRegistry** exts); + bool LinkExtension(upb_MiniTableExtension* ext); + bool LinkMessages(); + + size_t NextLink() { + if (input_->links.empty()) return 0; + if (link_ == input_->links.size()) link_ = 0; + return input_->links[link_++]; + } + + const upb_MiniTable* NextMiniTable() { + return mini_tables_.empty() + ? nullptr + : mini_tables_[NextLink() % mini_tables_.size()]; + } + + const upb_MiniTableEnum* NextEnumTable() { + return enum_tables_.empty() + ? nullptr + : enum_tables_[NextLink() % enum_tables_.size()]; + } + + const MiniTableFuzzInput* input_; + upb_Arena* arena_; + std::vector mini_tables_; + std::vector enum_tables_; + size_t link_ = 0; +}; + +void Builder::BuildMessages() { + upb::Status status; + mini_tables_.reserve(input_->mini_descriptors.size()); + for (const auto& d : input_->mini_descriptors) { + upb_MiniTable* table = + upb_MiniTable_Build(d.data(), d.size(), arena_, status.ptr()); + if (table) mini_tables_.push_back(table); + } +} + +void Builder::BuildEnums() { + upb::Status status; + enum_tables_.reserve(input_->enum_mini_descriptors.size()); + for (const auto& d : input_->enum_mini_descriptors) { + upb_MiniTableEnum* enum_table = + upb_MiniTableEnum_Build(d.data(), d.size(), arena_, status.ptr()); + if (enum_table) enum_tables_.push_back(enum_table); + } +} + +bool Builder::LinkExtension(upb_MiniTableExtension* ext) { + upb_MiniTableField* field = &ext->field; + if (field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group) { + auto mt = NextMiniTable(); + if (!mt) field->descriptortype = kUpb_FieldType_Int32; + ext->sub.submsg = mt; + } + if (field->descriptortype == kUpb_FieldType_Enum) { + auto et = NextEnumTable(); + if (!et) field->descriptortype = kUpb_FieldType_Int32; + ext->sub.subenum = et; + } + return true; +} + +void Builder::BuildExtensions(upb_ExtensionRegistry** exts) { + upb::Status status; + if (input_->extensions.empty()) { + *exts = nullptr; + } else { + *exts = upb_ExtensionRegistry_New(arena_); + const char* ptr = input_->extensions.data(); + const char* end = ptr + input_->extensions.size(); + // Iterate through the buffer, building extensions as long as we can. + while (ptr < end) { + upb_MiniTableExtension* ext = reinterpret_cast( + upb_Arena_Malloc(arena_, sizeof(*ext))); + upb_MiniTableSub sub; + const upb_MiniTable* extendee = NextMiniTable(); + if (!extendee) break; + ptr = upb_MiniTableExtension_Build(ptr, end - ptr, ext, extendee, sub, + status.ptr()); + if (!ptr) break; + if (!LinkExtension(ext)) continue; + if (upb_ExtensionRegistry_Lookup(*exts, ext->extendee, ext->field.number)) + continue; + upb_ExtensionRegistry_AddArray( + *exts, const_cast(&ext), 1); + } + } +} + +bool Builder::LinkMessages() { + for (auto* t : mini_tables_) { + upb_MiniTable* table = const_cast(t); + // For each field that requires a sub-table, assign one as appropriate. + for (size_t i = 0; i < table->field_count; i++) { + upb_MiniTableField* field = + const_cast(&table->fields[i]); + if (link_ == input_->links.size()) link_ = 0; + if (field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group) { + if (!upb_MiniTable_SetSubMessage(table, field, NextMiniTable())) { + return false; + } + } + if (field->descriptortype == kUpb_FieldType_Enum) { + auto* et = NextEnumTable(); + if (et) { + if (!upb_MiniTable_SetSubEnum(table, field, et)) return false; + } else { + // We don't have any sub-enums. Override the field type so that it is + // not needed. + field->descriptortype = kUpb_FieldType_Int32; + } + } + } + } + return true; +} + +} // namespace + +const upb_MiniTable* BuildMiniTable(const MiniTableFuzzInput& input, + upb_ExtensionRegistry** exts, + upb_Arena* arena) { + Builder builder(input, arena); + return builder.Build(exts); +} + +} // namespace fuzz +} // namespace upb diff --git a/third_party/upb/upb/test/fuzz_util.h b/third_party/upb/upb/test/fuzz_util.h new file mode 100644 index 00000000000..301dfcb0065 --- /dev/null +++ b/third_party/upb/upb/test/fuzz_util.h @@ -0,0 +1,81 @@ +/* + * 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_TEST_FUZZ_UTIL_H_ +#define UPB_TEST_FUZZ_UTIL_H_ + +#include +#include + +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/types.h" + +namespace upb { +namespace fuzz { + +struct MiniTableFuzzInput { + // MiniDescripotrs for N messages, in the format accepted by + // upb_MiniTable_Build(). + std::vector mini_descriptors; + + // MiniDescripotrs for N enums, in the format accepted by + // upb_MiniTableEnum_Build(). + std::vector enum_mini_descriptors; + + // A MiniDescriptor for N extensions, in the format accepted by + // upb_MiniTableExtension_Build(). + std::string extensions; + + // Integer indexes into the message or enum mini tables lists. These specify + // which message or enum to use for each sub-message or enum field. We mod + // by the total number of enums or messages so that any link value can be + // valid. + std::vector links; +}; + +// Builds an arbitrary mini table corresponding to the random data in `input`. +// This function should be capable of producing any mini table that can +// successfully build, and any topology of messages and enums (including +// cycles). +// +// As currently written, it effectively fuzzes the mini descriptor parser also, +// and can therefore trigger any bugs in that parser. To better isolate these +// two, we may want to change this implementation to use the mini descriptor +// builder API so we are producing mini descriptors in a known good format. That +// would mostly eliminate the chance of crashing the mini descriptor parser +// itself. +// +// TODO: maps. If we give maps some space in the regular encoding instead of +// using a separate function, we could get that for free. +const upb_MiniTable* BuildMiniTable(const MiniTableFuzzInput& input, + upb_ExtensionRegistry** exts, + upb_Arena* arena); + +} // namespace fuzz +} // namespace upb + +#endif // UPB_TEST_FUZZ_UTIL_H_ diff --git a/third_party/upb/upb/test/parse_text_proto.h b/third_party/upb/upb/test/parse_text_proto.h new file mode 100644 index 00000000000..96137c13eb9 --- /dev/null +++ b/third_party/upb/upb/test/parse_text_proto.h @@ -0,0 +1,37 @@ +#ifndef UPB_UPB_TEST_PARSE_TEXT_PROTO_H_ +#define UPB_UPB_TEST_PARSE_TEXT_PROTO_H_ + +#include + +#include "gtest/gtest.h" +#include "google/protobuf/message.h" +#include "google/protobuf/text_format.h" + +namespace upb_test { + +// Replacement for Google ParseTextProtoOrDie. +// Only to be used in unit tests. +// Usage: MyMessage msg = ParseTextProtoOrDie(my_text_proto); +class ParseTextProtoOrDie { + public: + explicit ParseTextProtoOrDie(absl::string_view text_proto) + : text_proto_(text_proto) {} + + template + operator T() { // NOLINT: Needed to support parsing text proto as appropriate + // type. + T message; + if (!google::protobuf::TextFormat::ParseFromString(text_proto_, &message)) { + ADD_FAILURE() << "Failed to parse textproto: " << text_proto_; + abort(); + } + return message; + } + + private: + std::string text_proto_; +}; + +} // namespace upb_test + +#endif // UPB_UPB_TEST_PARSE_TEXT_PROTO_H_ diff --git a/third_party/upb/upb/test/proto3_test.cc b/third_party/upb/upb/test/proto3_test.cc new file mode 100644 index 00000000000..9c202a9139d --- /dev/null +++ b/third_party/upb/upb/test/proto3_test.cc @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "gtest/gtest.h" +#include "upb/reflection/def.hpp" +#include "upb/test/proto3_test.upb.h" +#include "upb/test/proto3_test.upbdefs.h" + +TEST(Proto3Test, SyntheticOneofExtension) { + upb::DefPool defpool; + upb::MessageDefPtr md(upb_test_TestMessage3_getmsgdef(defpool.ptr())); + ASSERT_EQ(md.field_count(), 6); +} diff --git a/third_party/upb/upb/test/proto3_test.proto b/third_party/upb/upb/test/proto3_test.proto new file mode 100644 index 00000000000..f83a8b8c4b2 --- /dev/null +++ b/third_party/upb/upb/test/proto3_test.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package upb.test; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + optional string my_option = 51235; +} + +message MyMessage3 { + option (my_option) = "Hello world!"; +} + +message TestMessage3 { + optional int32 i32 = 1; + repeated int32 r_i32 = 2; + optional string str = 3; + repeated string r_str = 4; + optional TestMessage3 msg = 5; + repeated TestMessage3 r_msg = 6; +} diff --git a/third_party/upb/upb/test.proto b/third_party/upb/upb/test/test.proto similarity index 81% rename from third_party/upb/upb/test.proto rename to third_party/upb/upb/test/test.proto index d4e6b84488b..2310f342d83 100644 --- a/third_party/upb/upb/test.proto +++ b/third_party/upb/upb/test/test.proto @@ -69,6 +69,22 @@ message ModelExtension1 { message ModelExtension2 { extend ModelWithExtensions { optional ModelExtension2 model_ext = 4135; + optional ModelExtension2 model_ext_2 = 4136; + optional ModelExtension2 model_ext_3 = 4137; + optional ModelExtension2 model_ext_4 = 4138; + optional ModelExtension2 model_ext_5 = 4139; } optional int32 i = 9; } + +message ModelWithSubMessages { + optional int32 id = 4; + optional ModelWithExtensions optional_child = 5; + repeated ModelWithExtensions items = 6; +} + +message ModelWithMaps { + optional int32 id = 1; + map map_ss = 3; + map map_ii = 4; +} diff --git a/third_party/upb/upb/test_cpp.cc b/third_party/upb/upb/test/test_cpp.cc similarity index 93% rename from third_party/upb/upb/test_cpp.cc rename to third_party/upb/upb/test/test_cpp.cc index 4d4aec6253f..57dee8c1608 100644 --- a/third_party/upb/upb/test_cpp.cc +++ b/third_party/upb/upb/test/test_cpp.cc @@ -23,11 +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. -/* - * Tests for C++ wrappers. - */ +// Tests for C++ wrappers. -#include #include #include @@ -38,16 +35,15 @@ #include "google/protobuf/timestamp.upb.h" #include "google/protobuf/timestamp.upbdefs.h" #include "gtest/gtest.h" -#include "upb/def.h" -#include "upb/def.hpp" -#include "upb/json_decode.h" -#include "upb/json_encode.h" -#include "upb/test_cpp.upb.h" -#include "upb/test_cpp.upbdefs.h" -#include "upb/upb.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def.hpp" +#include "upb/test/test_cpp.upb.h" +#include "upb/test/test_cpp.upbdefs.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" TEST(Cpp, Iteration) { upb::DefPool defpool; @@ -160,7 +156,7 @@ TEST(Cpp, TimestampEncoder) { google_protobuf_Timestamp* timestamp_upb_decoded = google_protobuf_Timestamp_new(arena.ptr()); - long timestamps[] = { + int64_t timestamps[] = { 253402300799, // 9999-12-31T23:59:59Z 1641006000, // 2022-01-01T03:00:00Z 0, // 1970-01-01T00:00:00Z @@ -169,7 +165,7 @@ TEST(Cpp, TimestampEncoder) { -62135596800, // 0000-01-01T00:00:00Z }; - for (long timestamp : timestamps) { + for (int64_t timestamp : timestamps) { google_protobuf_Timestamp_set_seconds(timestamp_upb, timestamp); char json[128]; @@ -177,7 +173,7 @@ TEST(Cpp, TimestampEncoder) { sizeof(json), NULL); bool result = upb_JsonDecode(json, size, timestamp_upb_decoded, md.ptr(), NULL, 0, arena.ptr(), NULL); - const long timestamp_decoded = + const int64_t timestamp_decoded = google_protobuf_Timestamp_seconds(timestamp_upb_decoded); ASSERT_TRUE(result); diff --git a/third_party/upb/upb/test_cpp.proto b/third_party/upb/upb/test/test_cpp.proto similarity index 100% rename from third_party/upb/upb/test_cpp.proto rename to third_party/upb/upb/test/test_cpp.proto diff --git a/third_party/upb/upb/test_generated_code.cc b/third_party/upb/upb/test/test_generated_code.cc similarity index 91% rename from third_party/upb/upb/test_generated_code.cc rename to third_party/upb/upb/test/test_generated_code.cc index b74b148aba7..e2db7d97dc1 100644 --- a/third_party/upb/upb/test_generated_code.cc +++ b/third_party/upb/upb/test/test_generated_code.cc @@ -33,11 +33,11 @@ #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/test.upb.h" +#include "upb/test/test.upb.h" #include "upb/upb.hpp" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" #if !defined(MIN) #define MIN(x, y) ((x) < (y) ? (x) : (y)) @@ -361,6 +361,68 @@ TEST(GeneratedCode, ScalarsProto2) { upb_Arena_Free(arena); } +TEST(GeneratedCode, RepeatedClear) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + size_t len = 0; + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len); + EXPECT_EQ(0, len); + protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 2, + arena); + protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 3, + arena); + protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 4, + arena); + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len); + EXPECT_EQ(3, len); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_repeated_int32(msg); + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len); + EXPECT_EQ(0, len); + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, Clear) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + // Test clear. + protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_int32(msg, 1); + EXPECT_TRUE( + protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int32(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_int32(msg); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg)); + EXPECT_FALSE( + protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int32(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_int64(msg); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int64(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_uint32(msg); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_uint64(msg); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint64(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_float(msg); + EXPECT_EQ( + 0.0f, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_float(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_double(msg); + EXPECT_EQ( + 0.0, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_double(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_bool(msg); + EXPECT_EQ( + false, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_bool(msg)); + protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_string(msg); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg) + .size); + upb_Arena_Free(arena); +} + TEST(GeneratedCode, Bytes) { upb_Arena* arena = upb_Arena_New(); protobuf_test_messages_proto2_TestAllTypesProto2* msg = @@ -425,86 +487,6 @@ TEST(GeneratedCode, Bytes) { upb_Arena_Free(arena); } -TEST(GeneratedCode, Extension) { - upb_Arena* arena = upb_Arena_New(); - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect* msg = - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect_new( - arena); - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect* msg2; - upb_StringView serialized; - - EXPECT_EQ( - false, - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_has_message_set_extension( - msg)); - - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2* ext = - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_new( - arena); - EXPECT_EQ( - 0, - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_i( - ext)); - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_set_i( - ext, 5); - EXPECT_EQ( - 5, - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_i( - ext)); - // Test setter/hazzer. - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_set_message_set_extension( - msg, ext, arena); - EXPECT_EQ( - true, - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_has_message_set_extension( - msg)); - // Test serialize. - serialized.data = - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect_serialize( - msg, arena, &serialized.size); - msg2 = - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect_parse( - serialized.data, serialized.size, arena); - const protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2* - ext2 = - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_message_set_extension( - msg); - EXPECT_EQ( - 5, - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_i( - ext2)); - - // Test Clear. - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_clear_message_set_extension( - msg); - EXPECT_EQ( - false, - protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_has_message_set_extension( - msg)); - upb_Arena_Free(arena); -} - -TEST(GeneratedCode, RepeatedClear) { - upb_Arena* arena = upb_Arena_New(); - protobuf_test_messages_proto2_TestAllTypesProto2* msg = - protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); - size_t len = 0; - protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len); - EXPECT_EQ(0, len); - protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 2, - arena); - protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 3, - arena); - protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 4, - arena); - protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len); - EXPECT_EQ(3, len); - protobuf_test_messages_proto2_TestAllTypesProto2_clear_repeated_int32(msg); - protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len); - EXPECT_EQ(0, len); - upb_Arena_Free(arena); -} - TEST(GeneratedCode, UTF8) { const char invalid_utf8[] = "\xff"; const upb_StringView invalid_utf8_view = @@ -979,3 +961,38 @@ TEST(GeneratedCode, ArenaUnaligned) { EXPECT_EQ(0, reinterpret_cast(mem) & low_bits); upb_Arena_Free(arena); } + +TEST(GeneratedCode, Extensions) { + upb::Arena arena; + upb_test_ModelExtension1* extension1 = + upb_test_ModelExtension1_new(arena.ptr()); + upb_test_ModelExtension1_set_str(extension1, + upb_StringView_FromString("Hello")); + + upb_test_ModelExtension2* extension2 = + upb_test_ModelExtension2_new(arena.ptr()); + upb_test_ModelExtension2_set_i(extension2, 5); + + upb_test_ModelWithExtensions* msg1 = + upb_test_ModelWithExtensions_new(arena.ptr()); + upb_test_ModelWithExtensions* msg2 = + upb_test_ModelWithExtensions_new(arena.ptr()); + + // msg1: [extension1, extension2] + upb_test_ModelExtension1_set_model_ext(msg1, extension1, arena.ptr()); + upb_test_ModelExtension2_set_model_ext(msg1, extension2, arena.ptr()); + + // msg2: [extension2, extension1] + upb_test_ModelExtension2_set_model_ext(msg2, extension2, arena.ptr()); + upb_test_ModelExtension1_set_model_ext(msg2, extension1, arena.ptr()); + + size_t size1, size2; + int opts = kUpb_EncodeOption_Deterministic; + char* pb1 = upb_test_ModelWithExtensions_serialize_ex(msg1, opts, arena.ptr(), + &size1); + char* pb2 = upb_test_ModelWithExtensions_serialize_ex(msg2, opts, arena.ptr(), + &size2); + + ASSERT_EQ(size1, size2); + ASSERT_EQ(0, memcmp(pb1, pb2, size1)); +} diff --git a/third_party/upb/upb/test/test_mini_table_oneof.cc b/third_party/upb/upb/test/test_mini_table_oneof.cc new file mode 100644 index 00000000000..14601ebfca8 --- /dev/null +++ b/third_party/upb/upb/test/test_mini_table_oneof.cc @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "gtest/gtest.h" +#include "google/protobuf/test_messages_proto2.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" +#include "upb/mini_table/common.h" +#include "upb/test/test.upb.h" +#include "upb/upb.hpp" + +// Must be last. +#include "upb/port/def.inc" + +TEST(MiniTableOneofTest, OneOfIteratorProto2) { + constexpr int oneof_first_field_number = 111; + constexpr int oneof_test_field_number = 116; + + const upb_MiniTable* google_protobuf_table = + &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init; + const upb_MiniTableField* field = + upb_MiniTable_FindFieldByNumber(google_protobuf_table, oneof_test_field_number); + ASSERT_TRUE(field != nullptr); + const upb_MiniTableField* ptr = upb_MiniTable_GetOneof(google_protobuf_table, field); + int field_num = oneof_first_field_number; + do { + EXPECT_EQ(ptr->number, field_num++); + } while (upb_MiniTable_NextOneofField(google_protobuf_table, &ptr)); +} + +TEST(MiniTableOneofTest, InitialFieldNotOneOf) { + constexpr int test_field_number = 1; // optional int that is not a oneof + const upb_MiniTable* google_protobuf_table = + &protobuf_test_messages_proto2_TestAllTypesProto2_msg_init; + const upb_MiniTableField* field = + upb_MiniTable_FindFieldByNumber(google_protobuf_table, test_field_number); + ASSERT_TRUE(field != nullptr); + const upb_MiniTableField* first_field = + upb_MiniTable_GetOneof(google_protobuf_table, field); + EXPECT_EQ(first_field, nullptr); +} diff --git a/third_party/upb/upb/test_table.cc b/third_party/upb/upb/test_table.cc deleted file mode 100644 index ddb129a38e7..00000000000 --- a/third_party/upb/upb/test_table.cc +++ /dev/null @@ -1,580 +0,0 @@ -// Copyright (c) 2009-2021, Google LLC -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// * Neither the name of Google LLC nor the -// names of its contributors may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* - * Tests for upb_table. - */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "gtest/gtest.h" -#include "upb/internal/table.h" -#include "upb/upb.hpp" - -// Must be last. -#include "upb/port_def.inc" - -// Convenience interface for C++. We don't put this in upb itself because -// the table is not exposed to users. - -namespace upb { - -template -upb_value MakeUpbValue(T val); -template -T GetUpbValue(upb_value val); - -#define FUNCS(name, type_t, enumval) \ - template <> \ - upb_value MakeUpbValue(type_t val) { \ - return upb_value_##name(val); \ - } \ - template <> \ - type_t GetUpbValue(upb_value val) { \ - return upb_value_get##name(val); \ - } - -FUNCS(int32, int32_t, UPB_CTYPE_INT32) -FUNCS(int64, int64_t, UPB_CTYPE_INT64) -FUNCS(uint32, uint32_t, UPB_CTYPE_UINT32) -FUNCS(uint64, uint64_t, UPB_CTYPE_UINT64) -FUNCS(bool, bool, UPB_CTYPE_BOOL) -FUNCS(cstr, char*, UPB_CTYPE_CSTR) -FUNCS(ptr, void*, UPB_CTYPE_PTR) -FUNCS(constptr, const void*, UPB_CTYPE_CONSTPTR) - -#undef FUNCS - -class IntTable { - public: - IntTable() { upb_inttable_init(&table_, arena_.ptr()); } - - size_t count() { return upb_inttable_count(&table_); } - - bool Insert(uintptr_t key, upb_value val) { - return upb_inttable_insert(&table_, key, val, arena_.ptr()); - } - - bool Replace(uintptr_t key, upb_value val) { - return upb_inttable_replace(&table_, key, val); - } - - std::pair Remove(uintptr_t key) { - std::pair ret; - ret.first = upb_inttable_remove(&table_, key, &ret.second); - return ret; - } - - std::pair Lookup(uintptr_t key) const { - std::pair ret; - ret.first = upb_inttable_lookup(&table_, key, &ret.second); - return ret; - } - - std::pair Lookup32(uint32_t key) const { - std::pair ret; - ret.first = upb_inttable_lookup(&table_, key, &ret.second); - return ret; - } - - void Compact() { upb_inttable_compact(&table_, arena_.ptr()); } - - class iterator : public std::iterator > { - public: - explicit iterator(IntTable* table) { - upb_inttable_begin(&iter_, &table->table_); - } - - static iterator end(IntTable* table) { - iterator iter(table); - upb_inttable_iter_setdone(&iter.iter_); - return iter; - } - - void operator++() { return upb_inttable_next(&iter_); } - - std::pair operator*() const { - std::pair ret; - ret.first = upb_inttable_iter_key(&iter_); - ret.second = upb_inttable_iter_value(&iter_); - return ret; - } - - bool operator==(const iterator& other) const { - return upb_inttable_iter_isequal(&iter_, &other.iter_); - } - - bool operator!=(const iterator& other) const { return !(*this == other); } - - private: - upb_inttable_iter iter_; - }; - - upb::Arena arena_; - upb_inttable table_; -}; - -class StrTable { - public: - StrTable() { upb_strtable_init(&table_, 4, arena_.ptr()); } - - size_t count() { return upb_strtable_count(&table_); } - - bool Insert(const std::string& key, upb_value val) { - return upb_strtable_insert(&table_, key.c_str(), key.size(), val, - arena_.ptr()); - } - - std::pair Remove(const std::string& key) { - std::pair ret; - ret.first = - upb_strtable_remove2(&table_, key.c_str(), key.size(), &ret.second); - return ret; - } - - std::pair Lookup(const std::string& key) const { - std::pair ret; - ret.first = - upb_strtable_lookup2(&table_, key.c_str(), key.size(), &ret.second); - return ret; - } - - void Resize(size_t size_lg2) { - upb_strtable_resize(&table_, size_lg2, arena_.ptr()); - } - - class iterator : public std::iterator > { - public: - explicit iterator(StrTable* table) { - upb_strtable_begin(&iter_, &table->table_); - } - - static iterator end(StrTable* table) { - iterator iter(table); - upb_strtable_iter_setdone(&iter.iter_); - return iter; - } - - void operator++() { return upb_strtable_next(&iter_); } - - std::pair operator*() const { - std::pair ret; - upb_StringView view = upb_strtable_iter_key(&iter_); - ret.first.assign(view.data, view.size); - ret.second = upb_strtable_iter_value(&iter_); - return ret; - } - - bool operator==(const iterator& other) const { - return upb_strtable_iter_isequal(&iter_, &other.iter_); - } - - bool operator!=(const iterator& other) const { return !(*this == other); } - - private: - upb_strtable_iter iter_; - }; - - upb::Arena arena_; - upb_strtable table_; -}; - -template -class TypedStrTable { - public: - size_t count() { return table_.count(); } - - bool Insert(const std::string& key, T val) { - return table_.Insert(key, MakeUpbValue(val)); - } - - std::pair Remove(const std::string& key) { - std::pair found = table_.Remove(key); - std::pair ret; - ret.first = found.first; - if (ret.first) { - ret.second = GetUpbValue(found.second); - } - return ret; - } - - std::pair Lookup(const std::string& key) const { - std::pair found = table_.Lookup(key); - std::pair ret; - ret.first = found.first; - if (ret.first) { - ret.second = GetUpbValue(found.second); - } - return ret; - } - - void Resize(size_t size_lg2) { table_.Resize(size_lg2); } - - class iterator : public std::iterator > { - public: - explicit iterator(TypedStrTable* table) : iter_(&table->table_) {} - static iterator end(TypedStrTable* table) { - iterator iter(table); - iter.iter_ = StrTable::iterator::end(&table->table_); - return iter; - } - - void operator++() { ++iter_; } - - std::pair operator*() const { - std::pair val = *iter_; - std::pair ret; - ret.first = val.first; - ret.second = GetUpbValue(val.second); - return ret; - } - - bool operator==(const iterator& other) const { - return iter_ == other.iter_; - } - - bool operator!=(const iterator& other) const { - return iter_ != other.iter_; - } - - private: - StrTable::iterator iter_; - }; - - iterator begin() { return iterator(this); } - iterator end() { return iterator::end(this); } - - StrTable table_; -}; - -template -class TypedIntTable { - public: - size_t count() { return table_.count(); } - - bool Insert(uintptr_t key, T val) { - return table_.Insert(key, MakeUpbValue(val)); - } - - bool Replace(uintptr_t key, T val) { - return table_.Replace(key, MakeUpbValue(val)); - } - - std::pair Remove(uintptr_t key) { - std::pair found = table_.Remove(key); - std::pair ret; - ret.first = found.first; - if (ret.first) { - ret.second = GetUpbValue(found.second); - } - return ret; - } - - std::pair Lookup(uintptr_t key) const { - std::pair found = table_.Lookup(key); - std::pair ret; - ret.first = found.first; - if (ret.first) { - ret.second = GetUpbValue(found.second); - } - return ret; - } - - void Compact() { table_.Compact(); } - - class iterator : public std::iterator > { - public: - explicit iterator(TypedIntTable* table) : iter_(&table->table_) {} - static iterator end(TypedIntTable* table) { - return IntTable::iterator::end(&table->table_); - } - - void operator++() { ++iter_; } - - std::pair operator*() const { - std::pair val = *iter_; - std::pair ret; - ret.first = val.first; - ret.second = GetUpbValue(val.second); - return ret; - } - - bool operator==(const iterator& other) const { - return iter_ == other.iter_; - } - - bool operator!=(const iterator& other) const { - return iter_ != other.iter_; - } - - private: - IntTable::iterator iter_; - }; - - iterator begin() { return iterator(this); } - iterator end() { return iterator::end(this); } - - IntTable table_; -}; - -} // namespace upb - -#define CPU_TIME_PER_TEST 0.5 - -using std::vector; - -double get_usertime() { - struct rusage usage; - getrusage(RUSAGE_SELF, &usage); - return usage.ru_utime.tv_sec + (usage.ru_utime.tv_usec / 1000000.0); -} - -TEST(Table, StringTable) { - vector keys; - keys.push_back("google.protobuf.FileDescriptorSet"); - keys.push_back("google.protobuf.FileDescriptorProto"); - keys.push_back("google.protobuf.DescriptorProto"); - keys.push_back("google.protobuf.DescriptorProto.ExtensionRange"); - keys.push_back("google.protobuf.FieldDescriptorProto"); - keys.push_back("google.protobuf.EnumDescriptorProto"); - keys.push_back("google.protobuf.EnumValueDescriptorProto"); - keys.push_back("google.protobuf.ServiceDescriptorProto"); - keys.push_back("google.protobuf.MethodDescriptorProto"); - keys.push_back("google.protobuf.FileOptions"); - keys.push_back("google.protobuf.MessageOptions"); - keys.push_back("google.protobuf.FieldOptions"); - keys.push_back("google.protobuf.EnumOptions"); - keys.push_back("google.protobuf.EnumValueOptions"); - keys.push_back("google.protobuf.ServiceOptions"); - keys.push_back("google.protobuf.MethodOptions"); - keys.push_back("google.protobuf.UninterpretedOption"); - keys.push_back("google.protobuf.UninterpretedOption.NamePart"); - - /* Initialize structures. */ - std::map m; - typedef upb::TypedStrTable Table; - Table table; - std::set all; - for (const auto& key : keys) { - all.insert(key); - table.Insert(key, key[0]); - m[key] = key[0]; - } - - /* Test correctness. */ - for (const auto& key : keys) { - std::pair found = table.Lookup(key); - if (m.find(key) != m.end()) { /* Assume map implementation is correct. */ - EXPECT_TRUE(found.first); - EXPECT_EQ(found.second, key[0]); - EXPECT_EQ(m[key], key[0]); - } else { - EXPECT_FALSE(found.first); - } - } - - for (Table::iterator it = table.begin(); it != table.end(); ++it) { - std::set::iterator i = all.find((*it).first); - EXPECT_NE(i, all.end()); - all.erase(i); - } - EXPECT_TRUE(all.empty()); - - // Test iteration with resizes. - - for (int i = 0; i < 10; i++) { - for (Table::iterator it = table.begin(); it != table.end(); ++it) { - // Even if we invalidate the iterator it should only return real elements. - EXPECT_EQ((*it).second, m[(*it).first]); - - // Force a resize even though the size isn't changing. - // Also forces the table size to grow so some new buckets end up empty. - int new_lg2 = table.table_.table_.t.size_lg2 + 1; - // Don't use more than 64k tables, to avoid exhausting memory. - new_lg2 = UPB_MIN(new_lg2, 16); - table.Resize(new_lg2); - } - } -} - -class IntTableTest : public testing::TestWithParam { - void SetUp() override { - if (GetParam() > 0) { - for (int i = 0; i < GetParam(); i++) { - keys_.push_back(i + 1); - } - } else { - for (int32_t i = 0; i < 64; i++) { - if (i < 32) - keys_.push_back(i + 1); - else - keys_.push_back(10101 + i); - } - } - } - - protected: - std::vector keys_; -}; - -TEST_P(IntTableTest, TestIntTable) { - /* Initialize structures. */ - typedef upb::TypedIntTable Table; - Table table; - uint32_t largest_key = 0; - std::map m; - std::unordered_map hm; - for (const auto& key : keys_) { - largest_key = UPB_MAX((int32_t)largest_key, key); - table.Insert(key, key * 2); - m[key] = key * 2; - hm[key] = key * 2; - } - - /* Test correctness. */ - for (uint32_t i = 0; i <= largest_key; i++) { - std::pair found = table.Lookup(i); - if (m.find(i) != m.end()) { /* Assume map implementation is correct. */ - EXPECT_TRUE(found.first); - EXPECT_EQ(found.second, i * 2); - EXPECT_EQ(m[i], i * 2); - EXPECT_EQ(hm[i], i * 2); - } else { - EXPECT_FALSE(found.first); - } - } - - for (size_t i = 0; i < keys_.size(); i += 2) { - std::pair found = table.Remove(keys_[i]); - EXPECT_EQ(found.first, m.erase(keys_[i]) == 1); - if (found.first) { - EXPECT_EQ(found.second, (uint32_t)keys_[i] * 2); - } - hm.erase(keys_[i]); - m.erase(keys_[i]); - } - - EXPECT_EQ(table.count(), hm.size()); - - /* Test correctness. */ - for (uint32_t i = 0; i <= largest_key; i++) { - std::pair found = table.Lookup(i); - if (m.find(i) != m.end()) { /* Assume map implementation is correct. */ - EXPECT_TRUE(found.first); - EXPECT_EQ(found.second, i * 2); - EXPECT_EQ(m[i], i * 2); - EXPECT_EQ(hm[i], i * 2); - } else { - EXPECT_FALSE(found.first); - } - } - - // Test replace. - for (uint32_t i = 0; i <= largest_key; i++) { - bool replaced = table.Replace(i, i * 3); - if (m.find(i) != m.end()) { /* Assume map implementation is correct. */ - EXPECT_TRUE(replaced); - m[i] = i * 3; - hm[i] = i * 3; - } else { - EXPECT_FALSE(replaced); - } - } - - // Compact and test correctness again. - table.Compact(); - for (uint32_t i = 0; i <= largest_key; i++) { - std::pair found = table.Lookup(i); - if (m.find(i) != m.end()) { /* Assume map implementation is correct. */ - EXPECT_TRUE(found.first); - EXPECT_EQ(found.second, i * 3); - EXPECT_EQ(m[i], i * 3); - EXPECT_EQ(hm[i], i * 3); - } else { - EXPECT_FALSE(found.first); - } - } -} - -INSTANTIATE_TEST_SUITE_P(IntTableParams, IntTableTest, - testing::Values(8, 64, 512, -32)); - -/* - * This test can't pass right now because the table can't store a value of - * (uint64_t)-1. - */ -TEST(Table, MaxValue) { - /* - typedef upb::TypedIntTable Table; - Table table; - uintptr_t uint64_max = (uint64_t)-1; - table.Insert(1, uint64_max); - std::pair found = table.Lookup(1); - ASSERT(found.first); - ASSERT(found.second == uint64_max); - */ -} - -TEST(Table, Delete) { - upb::Arena arena; - upb_inttable t; - upb_inttable_init(&t, arena.ptr()); - upb_inttable_insert(&t, 0, upb_value_bool(true), arena.ptr()); - upb_inttable_insert(&t, 2, upb_value_bool(true), arena.ptr()); - upb_inttable_insert(&t, 4, upb_value_bool(true), arena.ptr()); - upb_inttable_compact(&t, arena.ptr()); - upb_inttable_remove(&t, 0, NULL); - upb_inttable_remove(&t, 2, NULL); - upb_inttable_remove(&t, 4, NULL); - - upb_inttable_iter iter; - for (upb_inttable_begin(&iter, &t); !upb_inttable_done(&iter); - upb_inttable_next(&iter)) { - ASSERT_TRUE(false); - } -} - -TEST(Table, Init) { - for (int i = 0; i < 2048; i++) { - /* Tests that the size calculations in init() (lg2 size for target load) - * work for all expected sizes. */ - upb::Arena arena; - upb_strtable t; - upb_strtable_init(&t, i, arena.ptr()); - } -} diff --git a/third_party/upb/upb/text_encode.c b/third_party/upb/upb/text/encode.c similarity index 76% rename from third_party/upb/upb/text_encode.c rename to third_party/upb/upb/text/encode.c index dfb213f2bba..c694088fc2d 100644 --- a/third_party/upb/upb/text_encode.c +++ b/third_party/upb/upb/text/encode.c @@ -25,21 +25,25 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "upb/text_encode.h" +#include "upb/text/encode.h" #include #include #include #include -#include #include -#include "upb/internal/upb.h" -#include "upb/internal/vsnprintf_compat.h" -#include "upb/reflection.h" +#include "upb/collections/map.h" +#include "upb/collections/map_sorter_internal.h" +#include "upb/lex/round_trip.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/message.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/types.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" typedef struct { char *buf, *ptr, *end; @@ -158,11 +162,17 @@ static void txtenc_string(txtenc* e, upb_StringView str, bool bytes) { static void txtenc_field(txtenc* e, upb_MessageValue val, const upb_FieldDef* f) { txtenc_indent(e); - upb_CType type = upb_FieldDef_CType(f); + const upb_CType type = upb_FieldDef_CType(f); + const bool is_ext = upb_FieldDef_IsExtension(f); + const char* full = upb_FieldDef_FullName(f); const char* name = upb_FieldDef_Name(f); if (type == kUpb_CType_Message) { - txtenc_printf(e, "%s {", name); + if (is_ext) { + txtenc_printf(e, "[%s] {", full); + } else { + txtenc_printf(e, "%s {", name); + } txtenc_endfield(e); e->indent_depth++; txtenc_msg(e, val.msg_val, upb_FieldDef_MessageSubDef(f)); @@ -173,7 +183,11 @@ static void txtenc_field(txtenc* e, upb_MessageValue val, return; } - txtenc_printf(e, "%s: ", name); + if (is_ext) { + txtenc_printf(e, "[%s]: ", full); + } else { + txtenc_printf(e, "%s: ", name); + } switch (type) { case kUpb_CType_Bool: @@ -270,9 +284,8 @@ static void txtenc_mapentry(txtenc* e, upb_MessageValue key, static void txtenc_map(txtenc* e, const upb_Map* map, const upb_FieldDef* f) { if (e->options & UPB_TXTENC_NOSORT) { 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); + upb_MessageValue key, val; + while (upb_Map_Next(map, &key, &val, &iter)) { txtenc_mapentry(e, key, val, f); } } else { @@ -284,8 +297,8 @@ static void txtenc_map(txtenc* e, const upb_Map* map, const upb_FieldDef* f) { _upb_mapsorter_pushmap(&e->sorter, upb_FieldDef_Type(key_f), map, &sorted); while (_upb_sortedmap_next(&e->sorter, map, &sorted, &ent)) { upb_MessageValue key, val; - memcpy(&key, &ent.k, sizeof(key)); - memcpy(&val, &ent.v, sizeof(val)); + memcpy(&key, &ent.data.k, sizeof(key)); + memcpy(&val, &ent.data.v, sizeof(val)); txtenc_mapentry(e, key, val, f); } _upb_mapsorter_popmap(&e->sorter, &sorted); @@ -299,23 +312,6 @@ static void txtenc_map(txtenc* e, const upb_Map* map, const upb_FieldDef* f) { } \ } while (0) -static const char* txtenc_parsevarint(const char* ptr, const char* limit, - uint64_t* val) { - uint8_t byte; - int bitpos = 0; - *val = 0; - - do { - CHK(bitpos < 70 && ptr < limit); - byte = *ptr; - *val |= (uint64_t)(byte & 0x7F) << bitpos; - ptr++; - bitpos += 7; - } while (byte & 0x80); - - return ptr; -} - /* * Unknown fields are printed by number. * @@ -326,89 +322,95 @@ static const char* txtenc_parsevarint(const char* ptr, const char* limit, * 1: 111 * } */ -static const char* txtenc_unknown(txtenc* e, const char* ptr, const char* end, +static const char* txtenc_unknown(txtenc* e, const char* ptr, + upb_EpsCopyInputStream* stream, int groupnum) { - while (ptr < end) { - uint64_t tag_64; - uint32_t tag; - CHK(ptr = txtenc_parsevarint(ptr, end, &tag_64)); - CHK(tag_64 < UINT32_MAX); - tag = (uint32_t)tag_64; + // We are guaranteed that the unknown data is valid wire format, and will not + // contain tag zero. + uint32_t end_group = groupnum > 0 + ? ((groupnum << kUpb_WireReader_WireTypeBits) | + kUpb_WireType_EndGroup) + : 0; - if ((tag & 7) == kUpb_WireType_EndGroup) { - CHK((tag >> 3) == (uint32_t)groupnum); - return ptr; - } + while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { + uint32_t tag; + CHK(ptr = upb_WireReader_ReadTag(ptr, &tag)); + if (tag == end_group) return ptr; txtenc_indent(e); - txtenc_printf(e, "%d: ", (int)(tag >> 3)); + txtenc_printf(e, "%d: ", (int)upb_WireReader_GetFieldNumber(tag)); - switch (tag & 7) { + switch (upb_WireReader_GetWireType(tag)) { case kUpb_WireType_Varint: { uint64_t val; - CHK(ptr = txtenc_parsevarint(ptr, end, &val)); + CHK(ptr = upb_WireReader_ReadVarint(ptr, &val)); txtenc_printf(e, "%" PRIu64, val); break; } case kUpb_WireType_32Bit: { uint32_t val; - CHK(end - ptr >= 4); - memcpy(&val, ptr, 4); - ptr += 4; + ptr = upb_WireReader_ReadFixed32(ptr, &val); txtenc_printf(e, "0x%08" PRIu32, val); break; } case kUpb_WireType_64Bit: { uint64_t val; - CHK(end - ptr >= 8); - memcpy(&val, ptr, 8); - ptr += 8; + ptr = upb_WireReader_ReadFixed64(ptr, &val); txtenc_printf(e, "0x%016" PRIu64, val); break; } case kUpb_WireType_Delimited: { - uint64_t len; - size_t avail = end - ptr; + int size; char* start = e->ptr; size_t start_overflow = e->overflow; - CHK(ptr = txtenc_parsevarint(ptr, end, &len)); - CHK(avail >= len); + CHK(ptr = upb_WireReader_ReadSize(ptr, &size)); + CHK(upb_EpsCopyInputStream_CheckDataSizeAvailable(stream, ptr, size)); - /* Speculatively try to parse as message. */ + // Speculatively try to parse as message. txtenc_putstr(e, "{"); txtenc_endfield(e); + + // EpsCopyInputStream can't back up, so create a sub-stream for the + // speculative parse. + upb_EpsCopyInputStream sub_stream; + const char* sub_ptr = upb_EpsCopyInputStream_GetAliasedPtr(stream, ptr); + upb_EpsCopyInputStream_Init(&sub_stream, &sub_ptr, size, true); + e->indent_depth++; - if (txtenc_unknown(e, ptr, end, -1)) { + if (txtenc_unknown(e, sub_ptr, &sub_stream, -1)) { + ptr = upb_EpsCopyInputStream_Skip(stream, ptr, size); e->indent_depth--; txtenc_indent(e); txtenc_putstr(e, "}"); } else { - /* Didn't work out, print as raw bytes. */ - upb_StringView str; + // Didn't work out, print as raw bytes. e->indent_depth--; e->ptr = start; e->overflow = start_overflow; - str.data = ptr; - str.size = len; - txtenc_string(e, str, true); + const char* str = ptr; + ptr = upb_EpsCopyInputStream_ReadString(stream, &str, size, NULL); + assert(ptr); + txtenc_string(e, (upb_StringView){.data = str, .size = size}, true); } - ptr += len; break; } case kUpb_WireType_StartGroup: txtenc_putstr(e, "{"); txtenc_endfield(e); e->indent_depth++; - CHK(ptr = txtenc_unknown(e, ptr, end, tag >> 3)); + CHK(ptr = txtenc_unknown(e, ptr, stream, + upb_WireReader_GetFieldNumber(tag))); e->indent_depth--; txtenc_indent(e); txtenc_putstr(e, "}"); break; + default: + return NULL; } txtenc_endfield(e); } - return groupnum == -1 ? ptr : NULL; + return end_group == 0 && !upb_EpsCopyInputStream_IsError(stream) ? ptr : NULL; } #undef CHK @@ -430,11 +432,13 @@ static void txtenc_msg(txtenc* e, const upb_Message* msg, } if ((e->options & UPB_TXTENC_SKIPUNKNOWN) == 0) { - size_t len; - const char* ptr = upb_Message_GetUnknown(msg, &len); - char* start = e->ptr; - if (ptr) { - if (!txtenc_unknown(e, ptr, ptr + len, -1)) { + size_t size; + const char* ptr = upb_Message_GetUnknown(msg, &size); + if (size != 0) { + char* start = e->ptr; + upb_EpsCopyInputStream stream; + upb_EpsCopyInputStream_Init(&stream, &ptr, size, true); + if (!txtenc_unknown(e, ptr, &stream, -1)) { /* Unknown failed to parse, back up and don't print it at all. */ e->ptr = start; } diff --git a/third_party/upb/upb/text/encode.h b/third_party/upb/upb/text/encode.h new file mode 100644 index 00000000000..3e3d1d528e2 --- /dev/null +++ b/third_party/upb/upb/text/encode.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_TEXT_ENCODE_H_ +#define UPB_TEXT_ENCODE_H_ + +#include "upb/reflection/def.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + // When set, prints everything on a single line. + UPB_TXTENC_SINGLELINE = 1, + + // When set, unknown fields are not printed. + UPB_TXTENC_SKIPUNKNOWN = 2, + + // When set, maps are *not* sorted (this avoids allocating tmp mem). + UPB_TXTENC_NOSORT = 4 +}; + +/* Encodes the given |msg| to text format. The message's reflection is given in + * |m|. The symtab in |symtab| is used to find extensions (if NULL, extensions + * will not be printed). + * + * Output is placed in the given buffer, and always NULL-terminated. The output + * size (excluding NULL) is returned. This means that a return value >= |size| + * implies that the output was truncated. (These are the same semantics as + * snprintf()). */ +size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m, + const upb_DefPool* ext_pool, int options, char* buf, + size_t size); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_TEXT_ENCODE_H_ */ diff --git a/third_party/upb/upb/text_encode.h b/third_party/upb/upb/text_encode.h index 2e817a3e508..b0f5792bdac 100644 --- a/third_party/upb/upb/text_encode.h +++ b/third_party/upb/upb/text_encode.h @@ -25,40 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// This header is deprecated, use upb/text/encode.h instead +// IWYU pragma: private, include "upb/text/encode.h" + #ifndef UPB_TEXTENCODE_H_ #define UPB_TEXTENCODE_H_ -#include "upb/def.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - /* When set, prints everything on a single line. */ - UPB_TXTENC_SINGLELINE = 1, - - /* When set, unknown fields are not printed. */ - UPB_TXTENC_SKIPUNKNOWN = 2, - - /* When set, maps are *not* sorted (this avoids allocating tmp mem). */ - UPB_TXTENC_NOSORT = 4 -}; - -/* Encodes the given |msg| to text format. The message's reflection is given in - * |m|. The symtab in |symtab| is used to find extensions (if NULL, extensions - * will not be printed). - * - * Output is placed in the given buffer, and always NULL-terminated. The output - * size (excluding NULL) is returned. This means that a return value >= |size| - * implies that the output was truncated. (These are the same semantics as - * snprintf()). */ -size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m, - const upb_DefPool* ext_pool, int options, char* buf, - size_t size); - -#ifdef __cplusplus -} /* extern "C" */ -#endif +#include "upb/text/encode.h" #endif /* UPB_TEXTENCODE_H_ */ diff --git a/third_party/upb/upb/upb.h b/third_party/upb/upb/upb.h index 7398d09fff5..829c99c4ce4 100644 --- a/third_party/upb/upb/upb.h +++ b/third_party/upb/upb/upb.h @@ -25,160 +25,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * This file contains shared definitions that are widely used across upb. - */ +// This header is deprecated, use the individual #includes below as needed. +// IWYU pragma: private, include "upb/base/status.h" #ifndef UPB_H_ #define UPB_H_ -#include -#include -#include -#include -#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_StringView ************************************************************/ - -typedef struct { - const char* data; - size_t size; -} upb_StringView; - -UPB_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data, - size_t size) { - upb_StringView ret; - ret.data = data; - ret.size = size; - return ret; -} - -UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) { - return upb_StringView_FromDataAndSize(data, strlen(data)); -} - -UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) { - return a.size == b.size && memcmp(a.data, b.data, a.size) == 0; -} - -#define UPB_STRINGVIEW_INIT(ptr, len) \ - { ptr, len } - -#define UPB_STRINGVIEW_FORMAT "%.*s" -#define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data - -/* Constants ******************************************************************/ - -/* A list of types as they are encoded on-the-wire. */ -typedef enum { - kUpb_WireType_Varint = 0, - kUpb_WireType_64Bit = 1, - kUpb_WireType_Delimited = 2, - kUpb_WireType_StartGroup = 3, - kUpb_WireType_EndGroup = 4, - kUpb_WireType_32Bit = 5 -} upb_WireType; - -/* The types a field can have. Note that this list is not identical to the - * types defined in descriptor.proto, which gives INT32 and SINT32 separate - * types (we distinguish the two with the "integer encoding" enum below). */ -typedef enum { - kUpb_CType_Bool = 1, - kUpb_CType_Float = 2, - kUpb_CType_Int32 = 3, - kUpb_CType_UInt32 = 4, - kUpb_CType_Enum = 5, /* Enum values are int32. */ - kUpb_CType_Message = 6, - kUpb_CType_Double = 7, - kUpb_CType_Int64 = 8, - kUpb_CType_UInt64 = 9, - kUpb_CType_String = 10, - kUpb_CType_Bytes = 11 -} upb_CType; - -/* The repeated-ness of each field; this matches descriptor.proto. */ -typedef enum { - kUpb_Label_Optional = 1, - kUpb_Label_Required = 2, - kUpb_Label_Repeated = 3 -} upb_Label; - -/* Descriptor types, as defined in descriptor.proto. */ -typedef enum { - kUpb_FieldType_Double = 1, - kUpb_FieldType_Float = 2, - kUpb_FieldType_Int64 = 3, - kUpb_FieldType_UInt64 = 4, - kUpb_FieldType_Int32 = 5, - kUpb_FieldType_Fixed64 = 6, - kUpb_FieldType_Fixed32 = 7, - kUpb_FieldType_Bool = 8, - kUpb_FieldType_String = 9, - kUpb_FieldType_Group = 10, - kUpb_FieldType_Message = 11, - kUpb_FieldType_Bytes = 12, - kUpb_FieldType_UInt32 = 13, - kUpb_FieldType_Enum = 14, - kUpb_FieldType_SFixed32 = 15, - kUpb_FieldType_SFixed64 = 16, - kUpb_FieldType_SInt32 = 17, - kUpb_FieldType_SInt64 = 18 -} upb_FieldType; - -#define kUpb_Map_Begin ((size_t)-1) - -UPB_INLINE bool _upb_IsLittleEndian(void) { - int x = 1; - return *(char*)&x == 1; -} - -UPB_INLINE uint32_t _upb_BigEndian_Swap32(uint32_t val) { - if (_upb_IsLittleEndian()) { - return val; - } else { - return ((val & 0xff) << 24) | ((val & 0xff00) << 8) | - ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24); - } -} - -UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) { - if (_upb_IsLittleEndian()) { - return val; - } else { - return ((uint64_t)_upb_BigEndian_Swap32((uint32_t)val) << 32) | - _upb_BigEndian_Swap32((uint32_t)(val >> 32)); - } -} - -UPB_INLINE int _upb_Log2Ceiling(int x) { - if (x <= 1) return 0; -#ifdef __GNUC__ - return 32 - __builtin_clz(x - 1); -#else - int lg2 = 0; - while (1 << lg2 < x) lg2++; - return lg2; -#endif -} - -UPB_INLINE int _upb_Log2CeilingSize(int x) { return 1 << _upb_Log2Ceiling(x); } - -#include "upb/port_undef.inc" - -#ifdef __cplusplus -} /* extern "C" */ -#endif +#include "upb/base/descriptor_constants.h" +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" #endif /* UPB_H_ */ diff --git a/third_party/upb/upb/upb.hpp b/third_party/upb/upb/upb.hpp index 2e4a21beac1..c17aa6a9416 100644 --- a/third_party/upb/upb/upb.hpp +++ b/third_party/upb/upb/upb.hpp @@ -28,7 +28,9 @@ #include -#include "upb/upb.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/status.h" +#include "upb/mem/arena.h" namespace upb { @@ -73,14 +75,7 @@ class Arena { : ptr_(upb_Arena_Init(initial_block, size, &upb_alloc_global), upb_Arena_Free) {} - upb_Arena* ptr() { return ptr_.get(); } - - // Allows this arena to be used as a generic allocator. - // - // The arena does not need free() calls so when using Arena as an allocator - // it is safe to skip them. However they are no-ops so there is no harm in - // calling free() either. - upb_alloc* allocator() { return upb_Arena_Alloc(ptr_.get()); } + upb_Arena* ptr() const { return ptr_.get(); } // Add a cleanup function to run when the arena is destroyed. // Returns false on out-of-memory. diff --git a/third_party/upb/upb/util/BUILD b/third_party/upb/upb/util/BUILD index 9c34822932e..13945e87952 100644 --- a/third_party/upb/upb/util/BUILD +++ b/third_party/upb/upb/util/BUILD @@ -4,6 +4,10 @@ load( "upb_proto_reflection_library", ) +# begin:github_only +load("@rules_pkg//:mappings.bzl", "pkg_files") +# end:github_only + licenses(["notice"]) # Def to Proto @@ -16,6 +20,7 @@ cc_library( deps = [ "//:port", "//:reflection", + "//:reflection_internal", ], ) @@ -38,22 +43,51 @@ upb_proto_reflection_library( deps = ["def_to_proto_test_proto"], ) +cc_library( + name = "def_to_proto_test_lib", + testonly = 1, + hdrs = ["def_to_proto_test.h"], + deps = [ + ":def_to_proto", + "//:descriptor_upb_proto", + "//:reflection_internal", + "//:upb", + "@com_google_googletest//:gtest", + "@com_google_protobuf//:protobuf", + ], +) + cc_test( name = "def_to_proto_test", srcs = ["def_to_proto_test.cc"], deps = [ ":def_to_proto", + ":def_to_proto_test_lib", ":def_to_proto_test_upb_proto", ":def_to_proto_test_upb_proto_reflection", "//:descriptor_upb_proto_reflection", "//:reflection", "//:upb", + "//upb/test:parse_text_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", ], ) +# begin:google_only +# cc_test( +# name = "def_to_proto_fuzz_test", +# srcs = ["def_to_proto_fuzz_test.cc"], +# tags = ["clang_only"], +# deps = [ +# ":def_to_proto_test_lib", +# "//testing/fuzzing:fuzztest", +# "@com_google_googletest//:gtest_main", +# ], +# ) +# end:google_only + # Required fields cc_library( @@ -62,6 +96,7 @@ cc_library( hdrs = ["required_fields.h"], visibility = ["//visibility:public"], deps = [ + "//:collections", "//:port", "//:reflection", ], @@ -105,17 +140,43 @@ cc_library( hdrs = ["compare.h"], visibility = ["//visibility:public"], deps = [ + "//:eps_copy_input_stream", "//:port", - "//:reflection", + "//:upb", + "//:wire_reader", + "//:wire_types", ], ) cc_test( name = "compare_test", srcs = ["compare_test.cc"], + # TODO(b/259158757): fix this test on Windows. + target_compatible_with = select({ + "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], + "//conditions:default": [], + }), deps = [ ":compare", + "//:wire_internal", + "//:wire_types", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", ], ) + +# begin:github_only +pkg_files( + name = "util_source_files", + srcs = [ + "compare.c", + "compare.h", + "def_to_proto.c", + "def_to_proto.h", + "required_fields.c", + "required_fields.h", + ], + prefix = "upb/util", + visibility = ["//python/dist:__pkg__"], +) +# end:github_only diff --git a/third_party/upb/upb/util/compare.c b/third_party/upb/upb/util/compare.c index b4dcfb54df8..3fbc8f61bf4 100644 --- a/third_party/upb/upb/util/compare.c +++ b/third_party/upb/upb/util/compare.c @@ -27,10 +27,14 @@ #include "upb/util/compare.h" -#include -#include +#include -#include "upb/port_def.inc" +#include "upb/upb.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/types.h" +// Must be last. +#include "upb/port/def.inc" struct upb_UnknownFields; typedef struct upb_UnknownFields upb_UnknownFields; @@ -53,14 +57,21 @@ struct upb_UnknownFields { }; typedef struct { - const char* end; + upb_EpsCopyInputStream stream; upb_Arena* arena; upb_UnknownField* tmp; size_t tmp_size; int depth; + upb_UnknownCompareResult status; jmp_buf err; } upb_UnknownField_Context; +UPB_NORETURN static void upb_UnknownFields_OutOfMemory( + upb_UnknownField_Context* ctx) { + ctx->status = kUpb_UnknownCompareResult_OutOfMemory; + UPB_LONGJMP(ctx->err, 1); +} + static void upb_UnknownFields_Grow(upb_UnknownField_Context* ctx, upb_UnknownField** base, upb_UnknownField** ptr, @@ -70,31 +81,12 @@ static void upb_UnknownFields_Grow(upb_UnknownField_Context* ctx, *base = upb_Arena_Realloc(ctx->arena, *base, old * sizeof(**base), new * sizeof(**base)); - if (!*base) UPB_LONGJMP(ctx->err, kUpb_UnknownCompareResult_OutOfMemory); + if (!*base) upb_UnknownFields_OutOfMemory(ctx); *ptr = *base + old; *end = *base + new; } -static const char* upb_UnknownFields_ParseVarint(const char* ptr, - const char* limit, - uint64_t* val) { - uint8_t byte; - int bitpos = 0; - *val = 0; - - do { - // Unknown field data must be valid. - UPB_ASSERT(bitpos < 70 && ptr < limit); - byte = *ptr; - *val |= (uint64_t)(byte & 0x7F) << bitpos; - ptr++; - bitpos += 7; - } while (byte & 0x80); - - return ptr; -} - // We have to implement our own sort here, since qsort() is not an in-order // sort. Here we use merge sort, the simplest in-order sort. static void upb_UnknownFields_Merge(upb_UnknownField* arr, size_t start, @@ -151,11 +143,11 @@ static upb_UnknownFields* upb_UnknownFields_DoBuild( const char* ptr = *buf; uint32_t last_tag = 0; bool sorted = true; - while (ptr < ctx->end) { - uint64_t tag; - ptr = upb_UnknownFields_ParseVarint(ptr, ctx->end, &tag); + while (!upb_EpsCopyInputStream_IsDone(&ctx->stream, &ptr)) { + uint32_t tag; + ptr = upb_WireReader_ReadTag(ptr, &tag); UPB_ASSERT(tag <= UINT32_MAX); - int wire_type = tag & 7; + int wire_type = upb_WireReader_GetWireType(tag); if (wire_type == kUpb_WireType_EndGroup) break; if (tag < last_tag) sorted = false; last_tag = tag; @@ -169,30 +161,28 @@ static upb_UnknownFields* upb_UnknownFields_DoBuild( switch (wire_type) { case kUpb_WireType_Varint: - ptr = upb_UnknownFields_ParseVarint(ptr, ctx->end, &field->data.varint); + ptr = upb_WireReader_ReadVarint(ptr, &field->data.varint); break; case kUpb_WireType_64Bit: - UPB_ASSERT(ctx->end - ptr >= 8); - memcpy(&field->data.uint64, ptr, 8); - ptr += 8; + ptr = upb_WireReader_ReadFixed64(ptr, &field->data.uint64); break; case kUpb_WireType_32Bit: - UPB_ASSERT(ctx->end - ptr >= 4); - memcpy(&field->data.uint32, ptr, 4); - ptr += 4; + ptr = upb_WireReader_ReadFixed32(ptr, &field->data.uint32); break; case kUpb_WireType_Delimited: { - uint64_t size; - ptr = upb_UnknownFields_ParseVarint(ptr, ctx->end, &size); - UPB_ASSERT(ctx->end - ptr >= size); - field->data.delimited.data = ptr; + int size; + ptr = upb_WireReader_ReadSize(ptr, &size); + const char* s_ptr = ptr; + ptr = upb_EpsCopyInputStream_ReadStringAliased(&ctx->stream, &s_ptr, + size); + field->data.delimited.data = s_ptr; field->data.delimited.size = size; - ptr += size; break; } case kUpb_WireType_StartGroup: if (--ctx->depth == 0) { - UPB_LONGJMP(ctx->err, kUpb_UnknownCompareResult_MaxDepthExceeded); + ctx->status = kUpb_UnknownCompareResult_MaxDepthExceeded; + UPB_LONGJMP(ctx->err, 1); } field->data.group = upb_UnknownFields_DoBuild(ctx, &ptr); ctx->depth++; @@ -204,7 +194,7 @@ static upb_UnknownFields* upb_UnknownFields_DoBuild( *buf = ptr; upb_UnknownFields* ret = upb_Arena_Malloc(ctx->arena, sizeof(*ret)); - if (!ret) UPB_LONGJMP(ctx->err, kUpb_UnknownCompareResult_OutOfMemory); + if (!ret) upb_UnknownFields_OutOfMemory(ctx); ret->fields = arr_base; ret->size = arr_ptr - arr_base; ret->capacity = arr_end - arr_base; @@ -216,11 +206,12 @@ static upb_UnknownFields* upb_UnknownFields_DoBuild( // Builds a upb_UnknownFields data structure from the binary data in buf. static upb_UnknownFields* upb_UnknownFields_Build(upb_UnknownField_Context* ctx, - const char* buf, + const char* ptr, size_t size) { - ctx->end = buf + size; - upb_UnknownFields* fields = upb_UnknownFields_DoBuild(ctx, &buf); - UPB_ASSERT(buf == ctx->end); + upb_EpsCopyInputStream_Init(&ctx->stream, &ptr, size, true); + upb_UnknownFields* fields = upb_UnknownFields_DoBuild(ctx, &ptr); + UPB_ASSERT(upb_EpsCopyInputStream_IsDone(&ctx->stream, &ptr) && + !upb_EpsCopyInputStream_IsError(&ctx->stream)); return fields; } @@ -260,6 +251,40 @@ static bool upb_UnknownFields_IsEqual(const upb_UnknownFields* uf1, return true; } +static upb_UnknownCompareResult upb_UnknownField_DoCompare( + upb_UnknownField_Context* ctx, const char* buf1, size_t size1, + const char* buf2, size_t size2) { + upb_UnknownCompareResult ret; + // First build both unknown fields into a sorted data structure (similar + // to the UnknownFieldSet in C++). + upb_UnknownFields* uf1 = upb_UnknownFields_Build(ctx, buf1, size1); + upb_UnknownFields* uf2 = upb_UnknownFields_Build(ctx, buf2, size2); + + // Now perform the equality check on the sorted structures. + if (upb_UnknownFields_IsEqual(uf1, uf2)) { + ret = kUpb_UnknownCompareResult_Equal; + } else { + ret = kUpb_UnknownCompareResult_NotEqual; + } + return ret; +} + +static upb_UnknownCompareResult upb_UnknownField_Compare( + upb_UnknownField_Context* const ctx, const char* const buf1, + const size_t size1, const char* const buf2, const size_t size2) { + upb_UnknownCompareResult ret; + if (UPB_SETJMP(ctx->err) == 0) { + ret = upb_UnknownField_DoCompare(ctx, buf1, size1, buf2, size2); + } else { + ret = ctx->status; + UPB_ASSERT(ret != kUpb_UnknownCompareResult_Equal); + } + + upb_Arena_Free(ctx->arena); + free(ctx->tmp); + return ret; +} + upb_UnknownCompareResult upb_Message_UnknownFieldsAreEqual(const char* buf1, size_t size1, const char* buf2, @@ -274,27 +299,10 @@ upb_UnknownCompareResult upb_Message_UnknownFieldsAreEqual(const char* buf1, .depth = max_depth, .tmp = NULL, .tmp_size = 0, + .status = kUpb_UnknownCompareResult_Equal, }; if (!ctx.arena) return kUpb_UnknownCompareResult_OutOfMemory; - int ret = UPB_SETJMP(ctx.err); - - if (UPB_LIKELY(ret == 0)) { - // First build both unknown fields into a sorted data structure (similar - // to the UnknownFieldSet in C++). - upb_UnknownFields* uf1 = upb_UnknownFields_Build(&ctx, buf1, size1); - upb_UnknownFields* uf2 = upb_UnknownFields_Build(&ctx, buf2, size2); - - // Now perform the equality check on the sorted structures. - if (upb_UnknownFields_IsEqual(uf1, uf2)) { - ret = kUpb_UnknownCompareResult_Equal; - } else { - ret = kUpb_UnknownCompareResult_NotEqual; - } - } - - upb_Arena_Free(ctx.arena); - free(ctx.tmp); - return ret; + return upb_UnknownField_Compare(&ctx, buf1, size1, buf2, size2); } diff --git a/third_party/upb/upb/util/compare.h b/third_party/upb/upb/util/compare.h index 92f6d83ab7b..82acd503611 100644 --- a/third_party/upb/upb/util/compare.h +++ b/third_party/upb/upb/util/compare.h @@ -28,7 +28,7 @@ #ifndef UPB_UTIL_COMPARE_H_ #define UPB_UTIL_COMPARE_H_ -#include "upb/def.h" +#include #ifdef __cplusplus extern "C" { diff --git a/third_party/upb/upb/util/compare_test.cc b/third_party/upb/upb/util/compare_test.cc index a35c6b3e750..25e7b2dd0b8 100644 --- a/third_party/upb/upb/util/compare_test.cc +++ b/third_party/upb/upb/util/compare_test.cc @@ -32,9 +32,11 @@ #include #include -#include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" +#include "absl/strings/string_view.h" +#include "upb/wire/swap_internal.h" +#include "upb/wire/types.h" struct UnknownField; diff --git a/third_party/upb/upb/util/def_to_proto.c b/third_party/upb/upb/util/def_to_proto.c index ae9288c9e0f..8513206edfc 100644 --- a/third_party/upb/upb/util/def_to_proto.c +++ b/third_party/upb/upb/util/def_to_proto.c @@ -29,14 +29,17 @@ #include #include -#include -#include -#include "upb/internal/vsnprintf_compat.h" -#include "upb/reflection.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/enum_reserved_range.h" +#include "upb/reflection/extension_range.h" +#include "upb/reflection/field_def_internal.h" +#include "upb/reflection/file_def_internal.h" +#include "upb/reflection/message.h" +#include "upb/reflection/message_reserved_range.h" -/* Must be last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" typedef struct { upb_Arena* arena; @@ -48,17 +51,16 @@ typedef struct { // We want to copy the options verbatim into the destination options proto. // We use serialize+parse as our deep copy. -#define SET_OPTIONS(proto, desc_type, options_type, src) \ - { \ - size_t size; \ - /* MEM: could use a temporary arena here instead. */ \ - char* pb = \ - google_protobuf_##options_type##_serialize(src, ctx->arena, &size); \ - CHK_OOM(pb); \ - google_protobuf_##options_type* dst = \ - google_protobuf_##options_type##_parse(pb, size, ctx->arena); \ - CHK_OOM(dst); \ - google_protobuf_##desc_type##_set_options(proto, dst); \ +#define SET_OPTIONS(proto, desc_type, options_type, src) \ + { \ + size_t size; \ + /* MEM: could use a temporary arena here instead. */ \ + char* pb = google_protobuf_##options_type##_serialize(src, ctx->arena, &size); \ + CHK_OOM(pb); \ + google_protobuf_##options_type* dst = \ + google_protobuf_##options_type##_parse(pb, size, ctx->arena); \ + CHK_OOM(dst); \ + google_protobuf_##desc_type##_set_options(proto, dst); \ } static upb_StringView strviewdup2(upb_ToProto_Context* ctx, @@ -98,11 +100,46 @@ static upb_StringView printf_dup(upb_ToProto_Context* ctx, const char* fmt, static bool upb_isprint(char ch) { return ch >= 0x20 && ch <= 0x7f; } +static int special_escape(char ch) { + switch (ch) { + case '\a': + return 'a'; + case '\b': + return 'b'; + case '\f': + return 'f'; + case '\n': + return 'n'; + case '\r': + return 'r'; + case '\t': + return 't'; + case '\v': + return 'v'; + case '\\': + return '\\'; + case '\'': + return '\''; + case '"': + return '"'; + case '\?': + return '?'; + default: + return -1; + } +} + static upb_StringView default_bytes(upb_ToProto_Context* ctx, upb_StringView val) { size_t n = 0; for (size_t i = 0; i < val.size; i++) { - n += upb_isprint(val.data[i]) ? 1 : 4; // '\123' + char ch = val.data[i]; + if (special_escape(ch) >= 0) + n += 2; // '\C' + else if (upb_isprint(ch)) + n += 1; + else + n += 4; // '\123' } char* p = upb_Arena_Malloc(ctx->arena, n); CHK_OOM(p); @@ -111,7 +148,10 @@ static upb_StringView default_bytes(upb_ToProto_Context* ctx, const char* end = src + val.size; while (src < end) { unsigned char ch = *src++; - if (upb_isprint(ch)) { + if (special_escape(ch) >= 0) { + *dst++ = '\\'; + *dst++ = (char)special_escape(ch); + } else if (upb_isprint(ch)) { *dst++ = ch; } else { *dst++ = '\\'; @@ -169,16 +209,43 @@ static upb_StringView default_string(upb_ToProto_Context* ctx, } } -static google_protobuf_FieldDescriptorProto* fielddef_toproto( - upb_ToProto_Context* ctx, const upb_FieldDef* f) { +static google_protobuf_DescriptorProto_ReservedRange* resrange_toproto( + upb_ToProto_Context* ctx, const upb_MessageReservedRange* r) { + google_protobuf_DescriptorProto_ReservedRange* proto = + google_protobuf_DescriptorProto_ReservedRange_new(ctx->arena); + CHK_OOM(proto); + + google_protobuf_DescriptorProto_ReservedRange_set_start( + proto, upb_MessageReservedRange_Start(r)); + google_protobuf_DescriptorProto_ReservedRange_set_end(proto, + upb_MessageReservedRange_End(r)); + + return proto; +} + +static google_protobuf_EnumDescriptorProto_EnumReservedRange* enumresrange_toproto( + upb_ToProto_Context* ctx, const upb_EnumReservedRange* r) { + google_protobuf_EnumDescriptorProto_EnumReservedRange* proto = + google_protobuf_EnumDescriptorProto_EnumReservedRange_new(ctx->arena); + CHK_OOM(proto); + + google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start( + proto, upb_EnumReservedRange_Start(r)); + google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end( + proto, upb_EnumReservedRange_End(r)); + + return proto; +} + +static google_protobuf_FieldDescriptorProto* fielddef_toproto(upb_ToProto_Context* ctx, + const upb_FieldDef* f) { google_protobuf_FieldDescriptorProto* proto = google_protobuf_FieldDescriptorProto_new(ctx->arena); CHK_OOM(proto); - google_protobuf_FieldDescriptorProto_set_name( - proto, strviewdup(ctx, upb_FieldDef_Name(f))); - google_protobuf_FieldDescriptorProto_set_number(proto, - upb_FieldDef_Number(f)); + google_protobuf_FieldDescriptorProto_set_name(proto, + strviewdup(ctx, upb_FieldDef_Name(f))); + google_protobuf_FieldDescriptorProto_set_number(proto, upb_FieldDef_Number(f)); google_protobuf_FieldDescriptorProto_set_label(proto, upb_FieldDef_Label(f)); google_protobuf_FieldDescriptorProto_set_type(proto, upb_FieldDef_Type(f)); @@ -203,14 +270,13 @@ static google_protobuf_FieldDescriptorProto* fielddef_toproto( } if (upb_FieldDef_HasDefault(f)) { - google_protobuf_FieldDescriptorProto_set_default_value( - proto, default_string(ctx, f)); + google_protobuf_FieldDescriptorProto_set_default_value(proto, + default_string(ctx, f)); } const upb_OneofDef* o = upb_FieldDef_ContainingOneof(f); if (o) { - google_protobuf_FieldDescriptorProto_set_oneof_index(proto, - upb_OneofDef_Index(o)); + google_protobuf_FieldDescriptorProto_set_oneof_index(proto, upb_OneofDef_Index(o)); } if (_upb_FieldDef_IsProto3Optional(f)) { @@ -225,14 +291,14 @@ static google_protobuf_FieldDescriptorProto* fielddef_toproto( return proto; } -static google_protobuf_OneofDescriptorProto* oneofdef_toproto( - upb_ToProto_Context* ctx, const upb_OneofDef* o) { +static google_protobuf_OneofDescriptorProto* oneofdef_toproto(upb_ToProto_Context* ctx, + const upb_OneofDef* o) { google_protobuf_OneofDescriptorProto* proto = google_protobuf_OneofDescriptorProto_new(ctx->arena); CHK_OOM(proto); - google_protobuf_OneofDescriptorProto_set_name( - proto, strviewdup(ctx, upb_OneofDef_Name(o))); + google_protobuf_OneofDescriptorProto_set_name(proto, + strviewdup(ctx, upb_OneofDef_Name(o))); if (upb_OneofDef_HasOptions(o)) { SET_OPTIONS(proto, OneofDescriptorProto, OneofOptions, @@ -250,8 +316,7 @@ static google_protobuf_EnumValueDescriptorProto* enumvaldef_toproto( google_protobuf_EnumValueDescriptorProto_set_name( proto, strviewdup(ctx, upb_EnumValueDef_Name(e))); - google_protobuf_EnumValueDescriptorProto_set_number( - proto, upb_EnumValueDef_Number(e)); + google_protobuf_EnumValueDescriptorProto_set_number(proto, upb_EnumValueDef_Number(e)); if (upb_EnumValueDef_HasOptions(e)) { SET_OPTIONS(proto, EnumValueDescriptorProto, EnumValueOptions, @@ -261,18 +326,16 @@ static google_protobuf_EnumValueDescriptorProto* enumvaldef_toproto( return proto; } -static google_protobuf_EnumDescriptorProto* enumdef_toproto( - upb_ToProto_Context* ctx, const upb_EnumDef* e) { +static google_protobuf_EnumDescriptorProto* enumdef_toproto(upb_ToProto_Context* ctx, + const upb_EnumDef* e) { google_protobuf_EnumDescriptorProto* proto = google_protobuf_EnumDescriptorProto_new(ctx->arena); CHK_OOM(proto); - google_protobuf_EnumDescriptorProto_set_name( - proto, strviewdup(ctx, upb_EnumDef_Name(e))); + google_protobuf_EnumDescriptorProto_set_name(proto, + strviewdup(ctx, upb_EnumDef_Name(e))); - int n; - - n = upb_EnumDef_ValueCount(e); + int n = upb_EnumDef_ValueCount(e); google_protobuf_EnumValueDescriptorProto** vals = google_protobuf_EnumDescriptorProto_resize_value(proto, n, ctx->arena); CHK_OOM(vals); @@ -280,7 +343,19 @@ static google_protobuf_EnumDescriptorProto* enumdef_toproto( vals[i] = enumvaldef_toproto(ctx, upb_EnumDef_Value(e, i)); } - // TODO: reserved range, reserved name + n = upb_EnumDef_ReservedRangeCount(e); + google_protobuf_EnumDescriptorProto_EnumReservedRange** res_ranges = + google_protobuf_EnumDescriptorProto_resize_reserved_range(proto, n, ctx->arena); + for (int i = 0; i < n; i++) { + res_ranges[i] = enumresrange_toproto(ctx, upb_EnumDef_ReservedRange(e, i)); + } + + n = upb_EnumDef_ReservedNameCount(e); + upb_StringView* res_names = + google_protobuf_EnumDescriptorProto_resize_reserved_name(proto, n, ctx->arena); + for (int i = 0; i < n; i++) { + res_names[i] = upb_EnumDef_ReservedName(e, i); + } if (upb_EnumDef_HasOptions(e)) { SET_OPTIONS(proto, EnumDescriptorProto, EnumOptions, @@ -296,10 +371,10 @@ static google_protobuf_DescriptorProto_ExtensionRange* extrange_toproto( google_protobuf_DescriptorProto_ExtensionRange_new(ctx->arena); CHK_OOM(proto); - google_protobuf_DescriptorProto_ExtensionRange_set_start( - proto, upb_ExtensionRange_Start(e)); - google_protobuf_DescriptorProto_ExtensionRange_set_end( - proto, upb_ExtensionRange_End(e)); + google_protobuf_DescriptorProto_ExtensionRange_set_start(proto, + upb_ExtensionRange_Start(e)); + google_protobuf_DescriptorProto_ExtensionRange_set_end(proto, + upb_ExtensionRange_End(e)); if (upb_ExtensionRange_HasOptions(e)) { SET_OPTIONS(proto, DescriptorProto_ExtensionRange, ExtensionRangeOptions, @@ -309,14 +384,13 @@ static google_protobuf_DescriptorProto_ExtensionRange* extrange_toproto( return proto; } -static google_protobuf_DescriptorProto* msgdef_toproto( - upb_ToProto_Context* ctx, const upb_MessageDef* m) { - google_protobuf_DescriptorProto* proto = - google_protobuf_DescriptorProto_new(ctx->arena); +static google_protobuf_DescriptorProto* msgdef_toproto(upb_ToProto_Context* ctx, + const upb_MessageDef* m) { + google_protobuf_DescriptorProto* proto = google_protobuf_DescriptorProto_new(ctx->arena); CHK_OOM(proto); - google_protobuf_DescriptorProto_set_name( - proto, strviewdup(ctx, upb_MessageDef_Name(m))); + google_protobuf_DescriptorProto_set_name(proto, + strviewdup(ctx, upb_MessageDef_Name(m))); int n; @@ -359,13 +433,24 @@ static google_protobuf_DescriptorProto* msgdef_toproto( n = upb_MessageDef_ExtensionRangeCount(m); google_protobuf_DescriptorProto_ExtensionRange** ext_ranges = - google_protobuf_DescriptorProto_resize_extension_range(proto, n, - ctx->arena); + google_protobuf_DescriptorProto_resize_extension_range(proto, n, ctx->arena); for (int i = 0; i < n; i++) { ext_ranges[i] = extrange_toproto(ctx, upb_MessageDef_ExtensionRange(m, i)); } - // TODO: reserved ranges and reserved names + n = upb_MessageDef_ReservedRangeCount(m); + google_protobuf_DescriptorProto_ReservedRange** res_ranges = + google_protobuf_DescriptorProto_resize_reserved_range(proto, n, ctx->arena); + for (int i = 0; i < n; i++) { + res_ranges[i] = resrange_toproto(ctx, upb_MessageDef_ReservedRange(m, i)); + } + + n = upb_MessageDef_ReservedNameCount(m); + upb_StringView* res_names = + google_protobuf_DescriptorProto_resize_reserved_name(proto, n, ctx->arena); + for (int i = 0; i < n; i++) { + res_names[i] = upb_MessageDef_ReservedName(m, i); + } if (upb_MessageDef_HasOptions(m)) { SET_OPTIONS(proto, DescriptorProto, MessageOptions, @@ -375,14 +460,14 @@ static google_protobuf_DescriptorProto* msgdef_toproto( return proto; } -static google_protobuf_MethodDescriptorProto* methoddef_toproto( - upb_ToProto_Context* ctx, const upb_MethodDef* m) { +static google_protobuf_MethodDescriptorProto* methoddef_toproto(upb_ToProto_Context* ctx, + const upb_MethodDef* m) { google_protobuf_MethodDescriptorProto* proto = google_protobuf_MethodDescriptorProto_new(ctx->arena); CHK_OOM(proto); - google_protobuf_MethodDescriptorProto_set_name( - proto, strviewdup(ctx, upb_MethodDef_Name(m))); + google_protobuf_MethodDescriptorProto_set_name(proto, + strviewdup(ctx, upb_MethodDef_Name(m))); google_protobuf_MethodDescriptorProto_set_input_type( proto, @@ -418,8 +503,7 @@ static google_protobuf_ServiceDescriptorProto* servicedef_toproto( size_t n = upb_ServiceDef_MethodCount(s); google_protobuf_MethodDescriptorProto** methods = - google_protobuf_ServiceDescriptorProto_resize_method(proto, n, - ctx->arena); + google_protobuf_ServiceDescriptorProto_resize_method(proto, n, ctx->arena); for (int i = 0; i < n; i++) { methods[i] = methoddef_toproto(ctx, upb_ServiceDef_Method(s, i)); } @@ -432,63 +516,65 @@ static google_protobuf_ServiceDescriptorProto* servicedef_toproto( return proto; } -static google_protobuf_FileDescriptorProto* filedef_toproto( - upb_ToProto_Context* ctx, const upb_FileDef* f) { +static google_protobuf_FileDescriptorProto* filedef_toproto(upb_ToProto_Context* ctx, + const upb_FileDef* f) { google_protobuf_FileDescriptorProto* proto = google_protobuf_FileDescriptorProto_new(ctx->arena); CHK_OOM(proto); - google_protobuf_FileDescriptorProto_set_name( - proto, strviewdup(ctx, upb_FileDef_Name(f))); + google_protobuf_FileDescriptorProto_set_name(proto, + strviewdup(ctx, upb_FileDef_Name(f))); const char* package = upb_FileDef_Package(f); if (package) { size_t n = strlen(package); if (n) { - google_protobuf_FileDescriptorProto_set_package( - proto, strviewdup(ctx, upb_FileDef_Package(f))); + google_protobuf_FileDescriptorProto_set_package(proto, strviewdup(ctx, package)); + } + } + + const char* edition = upb_FileDef_Edition(f); + if (edition != NULL) { + size_t n = strlen(edition); + if (n != 0) { + google_protobuf_FileDescriptorProto_set_edition(proto, strviewdup(ctx, edition)); } } if (upb_FileDef_Syntax(f) == kUpb_Syntax_Proto3) { - google_protobuf_FileDescriptorProto_set_syntax(proto, - strviewdup(ctx, "proto3")); + google_protobuf_FileDescriptorProto_set_syntax(proto, strviewdup(ctx, "proto3")); } size_t n; n = upb_FileDef_DependencyCount(f); - upb_StringView* deps = google_protobuf_FileDescriptorProto_resize_dependency( - proto, n, ctx->arena); + upb_StringView* deps = + google_protobuf_FileDescriptorProto_resize_dependency(proto, n, ctx->arena); for (int i = 0; i < n; i++) { deps[i] = strviewdup(ctx, upb_FileDef_Name(upb_FileDef_Dependency(f, i))); } n = upb_FileDef_PublicDependencyCount(f); int32_t* public_deps = - google_protobuf_FileDescriptorProto_resize_public_dependency(proto, n, - ctx->arena); + google_protobuf_FileDescriptorProto_resize_public_dependency(proto, n, ctx->arena); const int32_t* public_dep_nums = _upb_FileDef_PublicDependencyIndexes(f); if (n) memcpy(public_deps, public_dep_nums, n * sizeof(int32_t)); n = upb_FileDef_WeakDependencyCount(f); int32_t* weak_deps = - google_protobuf_FileDescriptorProto_resize_weak_dependency(proto, n, - ctx->arena); + google_protobuf_FileDescriptorProto_resize_weak_dependency(proto, n, ctx->arena); const int32_t* weak_dep_nums = _upb_FileDef_WeakDependencyIndexes(f); if (n) memcpy(weak_deps, weak_dep_nums, n * sizeof(int32_t)); n = upb_FileDef_TopLevelMessageCount(f); google_protobuf_DescriptorProto** msgs = - google_protobuf_FileDescriptorProto_resize_message_type(proto, n, - ctx->arena); + google_protobuf_FileDescriptorProto_resize_message_type(proto, n, ctx->arena); for (int i = 0; i < n; i++) { msgs[i] = msgdef_toproto(ctx, upb_FileDef_TopLevelMessage(f, i)); } n = upb_FileDef_TopLevelEnumCount(f); google_protobuf_EnumDescriptorProto** enums = - google_protobuf_FileDescriptorProto_resize_enum_type(proto, n, - ctx->arena); + google_protobuf_FileDescriptorProto_resize_enum_type(proto, n, ctx->arena); for (int i = 0; i < n; i++) { enums[i] = enumdef_toproto(ctx, upb_FileDef_TopLevelEnum(f, i)); } @@ -502,8 +588,7 @@ static google_protobuf_FileDescriptorProto* filedef_toproto( n = upb_FileDef_TopLevelExtensionCount(f); google_protobuf_FieldDescriptorProto** exts = - google_protobuf_FileDescriptorProto_resize_extension(proto, n, - ctx->arena); + google_protobuf_FileDescriptorProto_resize_extension(proto, n, ctx->arena); for (int i = 0; i < n; i++) { exts[i] = fielddef_toproto(ctx, upb_FileDef_TopLevelExtension(f, i)); } @@ -516,58 +601,98 @@ static google_protobuf_FileDescriptorProto* filedef_toproto( return proto; } +static google_protobuf_DescriptorProto* upb_ToProto_ConvertMessageDef( + upb_ToProto_Context* const ctx, const upb_MessageDef* const m) { + if (UPB_SETJMP(ctx->err)) return NULL; + return msgdef_toproto(ctx, m); +} + google_protobuf_DescriptorProto* upb_MessageDef_ToProto(const upb_MessageDef* m, - upb_Arena* a) { + upb_Arena* a) { upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return msgdef_toproto(&ctx, m); + return upb_ToProto_ConvertMessageDef(&ctx, m); +} + +google_protobuf_EnumDescriptorProto* upb_ToProto_ConvertEnumDef( + upb_ToProto_Context* const ctx, const upb_EnumDef* const e) { + if (UPB_SETJMP(ctx->err)) return NULL; + return enumdef_toproto(ctx, e); } google_protobuf_EnumDescriptorProto* upb_EnumDef_ToProto(const upb_EnumDef* e, - upb_Arena* a) { + upb_Arena* a) { upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return enumdef_toproto(&ctx, e); + return upb_ToProto_ConvertEnumDef(&ctx, e); +} + +google_protobuf_EnumValueDescriptorProto* upb_ToProto_ConvertEnumValueDef( + upb_ToProto_Context* const ctx, const upb_EnumValueDef* e) { + if (UPB_SETJMP(ctx->err)) return NULL; + return enumvaldef_toproto(ctx, e); } google_protobuf_EnumValueDescriptorProto* upb_EnumValueDef_ToProto( const upb_EnumValueDef* e, upb_Arena* a) { upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return enumvaldef_toproto(&ctx, e); + return upb_ToProto_ConvertEnumValueDef(&ctx, e); } -google_protobuf_FieldDescriptorProto* upb_FieldDef_ToProto( - const upb_FieldDef* f, upb_Arena* a) { - upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return fielddef_toproto(&ctx, f); +google_protobuf_FieldDescriptorProto* upb_ToProto_ConvertFieldDef( + upb_ToProto_Context* const ctx, const upb_FieldDef* f) { + if (UPB_SETJMP(ctx->err)) return NULL; + return fielddef_toproto(ctx, f); } -google_protobuf_OneofDescriptorProto* upb_OneofDef_ToProto( - const upb_OneofDef* o, upb_Arena* a) { +google_protobuf_FieldDescriptorProto* upb_FieldDef_ToProto(const upb_FieldDef* f, + upb_Arena* a) { upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return oneofdef_toproto(&ctx, o); + return upb_ToProto_ConvertFieldDef(&ctx, f); +} + +google_protobuf_OneofDescriptorProto* upb_ToProto_ConvertOneofDef( + upb_ToProto_Context* const ctx, const upb_OneofDef* o) { + if (UPB_SETJMP(ctx->err)) return NULL; + return oneofdef_toproto(ctx, o); +} + +google_protobuf_OneofDescriptorProto* upb_OneofDef_ToProto(const upb_OneofDef* o, + upb_Arena* a) { + upb_ToProto_Context ctx = {a}; + return upb_ToProto_ConvertOneofDef(&ctx, o); +} + +google_protobuf_FileDescriptorProto* upb_ToProto_ConvertFileDef( + upb_ToProto_Context* const ctx, const upb_FileDef* const f) { + if (UPB_SETJMP(ctx->err)) return NULL; + return filedef_toproto(ctx, f); } google_protobuf_FileDescriptorProto* upb_FileDef_ToProto(const upb_FileDef* f, - upb_Arena* a) { + upb_Arena* a) { upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return filedef_toproto(&ctx, f); + return upb_ToProto_ConvertFileDef(&ctx, f); +} + +google_protobuf_MethodDescriptorProto* upb_ToProto_ConvertMethodDef( + upb_ToProto_Context* const ctx, const upb_MethodDef* m) { + if (UPB_SETJMP(ctx->err)) return NULL; + return methoddef_toproto(ctx, m); } google_protobuf_MethodDescriptorProto* upb_MethodDef_ToProto( - const upb_MethodDef* m, upb_Arena* a) { + const upb_MethodDef* const m, upb_Arena* a) { upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return methoddef_toproto(&ctx, m); + return upb_ToProto_ConvertMethodDef(&ctx, m); } -google_protobuf_ServiceDescriptorProto* upb_ServiceDef_ToProto( - const upb_ServiceDef* s, upb_Arena* a) { - upb_ToProto_Context ctx = {a}; - if (UPB_SETJMP(ctx.err)) return NULL; - return servicedef_toproto(&ctx, s); +google_protobuf_ServiceDescriptorProto* upb_ToProto_ConvertServiceDef( + upb_ToProto_Context* const ctx, const upb_ServiceDef* const s) { + if (UPB_SETJMP(ctx->err)) return NULL; + return servicedef_toproto(ctx, s); +} + +google_protobuf_ServiceDescriptorProto* upb_ServiceDef_ToProto(const upb_ServiceDef* s, + upb_Arena* a) { + upb_ToProto_Context ctx = {a}; + return upb_ToProto_ConvertServiceDef(&ctx, s); } diff --git a/third_party/upb/upb/util/def_to_proto.h b/third_party/upb/upb/util/def_to_proto.h index 24f65b9bfbb..08c64532e90 100644 --- a/third_party/upb/upb/util/def_to_proto.h +++ b/third_party/upb/upb/util/def_to_proto.h @@ -28,7 +28,7 @@ #ifndef UPB_UTIL_DEF_TO_PROTO_H_ #define UPB_UTIL_DEF_TO_PROTO_H_ -#include "upb/def.h" +#include "upb/reflection/def.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/upb/upb/util/def_to_proto_fuzz_test.cc b/third_party/upb/upb/util/def_to_proto_fuzz_test.cc new file mode 100644 index 00000000000..a2177c8cd62 --- /dev/null +++ b/third_party/upb/upb/util/def_to_proto_fuzz_test.cc @@ -0,0 +1,26 @@ + +#include + +#include "google/protobuf/descriptor.proto.h" +#include "gtest/gtest.h" +#include "testing/fuzzing/fuzztest.h" +#include "upb/util/def_to_proto_test.h" + +namespace upb_test { + +FUZZ_TEST(FuzzTest, RoundTripDescriptor) + .WithDomains( + ::fuzztest::Arbitrary().WithProtobufField( + "file", + ::fuzztest::Arbitrary() + // upb_FileDef_ToProto() does not attempt to preserve + // source_code_info. + .WithFieldUnset("source_code_info") + .WithProtobufField( + "service", + ::fuzztest::Arbitrary() + // streams are google3-only, and we do not currently + // attempt to preserve them. + .WithFieldUnset("stream")))); + +} // namespace upb_test 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 d8156e39891..e5d4b370866 100644 --- a/third_party/upb/upb/util/def_to_proto_test.cc +++ b/third_party/upb/upb/util/def_to_proto_test.cc @@ -27,16 +27,23 @@ #include "upb/util/def_to_proto.h" -#include "gmock/gmock.h" +#include +#include + #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor.upbdefs.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" #include "google/protobuf/dynamic_message.h" #include "google/protobuf/util/message_differencer.h" -#include "gtest/gtest.h" -#include "upb/def.hpp" +#include "upb/reflection/def.hpp" +#include "upb/test/parse_text_proto.h" #include "upb/upb.hpp" +#include "upb/util/def_to_proto_test.h" #include "upb/util/def_to_proto_test.upbdefs.h" +namespace upb_test { + // Loads and retrieves a descriptor for `msgdef` into the given `pool`. const google::protobuf::Descriptor* AddMessageDescriptor( upb::MessageDefPtr msgdef, google::protobuf::DescriptorPool* pool) { @@ -144,3 +151,141 @@ TEST(DefToProto, TestRuntimeReflection) { upb_util_def_to_proto_test_proto_upbdefinit.filename); CheckFile(file, file_desc); } + +// Fuzz test regressions. + +TEST(FuzzTest, EmptyPackage) { + RoundTripDescriptor(ParseTextProtoOrDie(R"pb(file { package: "" })pb")); +} + +TEST(FuzzTest, EmptyName) { + RoundTripDescriptor(ParseTextProtoOrDie(R"pb(file { name: "" })pb")); +} + +TEST(FuzzTest, EmptyPackage2) { + RoundTripDescriptor( + ParseTextProtoOrDie(R"pb(file { name: "n" package: "" })pb")); +} + +TEST(FuzzTest, FileNameEmbeddedNull) { + RoundTripDescriptor(ParseTextProtoOrDie(R"pb(file { name: "\000" })pb")); +} + +TEST(FuzzTest, EditionEmbeddedNull) { + RoundTripDescriptor( + ParseTextProtoOrDie(R"pb(file { name: "n" edition: "\000" })pb")); +} + +TEST(FuzzTest, NanValue) { + RoundTripDescriptor(ParseTextProtoOrDie( + R"pb(file { + enum_type { + value { + number: 0 + options { uninterpreted_option { double_value: nan } } + } + } + })pb")); +} + +TEST(FuzzTest, EnumValueEmbeddedNull) { + RoundTripDescriptor(ParseTextProtoOrDie( + R"pb(file { + name: "\035" + enum_type { + name: "f" + value { name: "\000" number: 0 } + } + })pb")); +} + +TEST(FuzzTest, EnumValueNoNumber) { + RoundTripDescriptor(ParseTextProtoOrDie( + R"pb(file { + name: "\035" + enum_type { + name: "f" + value { name: "abc" } + } + })pb")); +} + +TEST(FuzzTest, DefaultWithUnterminatedHex) { + RoundTripDescriptor(ParseTextProtoOrDie( + R"pb(file { + name: "\035" + message_type { + name: "A" + field { + name: "f" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_BYTES + default_value: "\\x" + } + } + })pb")); +} + +TEST(FuzzTest, DefaultWithValidHexEscape) { + RoundTripDescriptor(ParseTextProtoOrDie( + R"pb(file { + name: "\035" + message_type { + name: "A" + field { + name: "f" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_BYTES + default_value: "\\x03" + } + } + })pb")); +} + +TEST(FuzzTest, DefaultWithValidHexEscapePrintable) { + RoundTripDescriptor(ParseTextProtoOrDie( + R"pb(file { + name: "\035" + message_type { + name: "A" + field { + name: "f" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_BYTES + default_value: "\\x23" # 0x32 = '#' + } + } + })pb")); +} + +// begin:google_only +// TEST(FuzzTest, DependencyWithEmbeddedNull) { +// RoundTripDescriptor(ParseTextProtoOrDie(R"pb(file { +// name: "a" +// dependency: "a\000" +// options { cc_api_version: 0 } +// weak_dependency: 0 +// })pb")); +// } +// +// TEST(FuzzTest, NanInOptions) { +// RoundTripDescriptor( +// ParseTextProtoOrDie(R"pb(file { +// name: "" +// service { +// name: "A" +// options { failure_detection_delay: nan } +// } +// })pb")); +// } +// end:google_only + +TEST(FuzzTest, PackageStartsWithNumber) { + RoundTripDescriptor( + ParseTextProtoOrDie(R"pb(file { name: "" package: "0" })pb")); +} + +} // namespace upb_test diff --git a/third_party/upb/upb/util/def_to_proto_test.h b/third_party/upb/upb/util/def_to_proto_test.h new file mode 100644 index 00000000000..76682238580 --- /dev/null +++ b/third_party/upb/upb/util/def_to_proto_test.h @@ -0,0 +1,117 @@ +#ifndef UPB_UTIL_DEF_TO_PROTO_TEST_H_ +#define UPB_UTIL_DEF_TO_PROTO_TEST_H_ + +#include + +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/descriptor.upb.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/dynamic_message.h" +#include "google/protobuf/util/field_comparator.h" +#include "upb/reflection/def.hpp" +#include "upb/upb.hpp" +#include "upb/util/def_to_proto.h" + +namespace upb_test { + +// 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 defpool). +MATCHER_P(EqualsProtoTreatNansAsEqual, proto, + negation ? "are not equal" : "are equal") { + upb::DefPool defpool; + google::protobuf::DescriptorPool pool; + google::protobuf::DynamicMessageFactory factory; + std::string differences; + google::protobuf::util::DefaultFieldComparator comparator; + comparator.set_treat_nan_as_equal(true); + google::protobuf::util::MessageDifferencer differencer; + differencer.set_field_comparator(&comparator); + differencer.ReportDifferencesToString(&differences); + bool eq = differencer.Compare(proto, arg); + if (!eq) { + *result_listener << differences; + } + return eq; +} + +class NullErrorCollector : public google::protobuf::DescriptorPool::ErrorCollector { + void AddError(const std::string& filename, const std::string& element_name, + const google::protobuf::Message* descriptor, ErrorLocation location, + const std::string& message) override {} + void RecordWarning(absl::string_view filename, absl::string_view element_name, + const google::protobuf::Message* descriptor, ErrorLocation location, + absl::string_view message) override {} +}; + +static void AddFile(google::protobuf::FileDescriptorProto& file, upb::DefPool* pool, + google::protobuf::DescriptorPool* desc_pool) { + NullErrorCollector collector; + const google::protobuf::FileDescriptor* file_desc = + desc_pool->BuildFileCollectingErrors(file, &collector); + + if (file_desc != nullptr) { + // The file descriptor was valid according to proto2. + google::protobuf::FileDescriptorProto normalized_file; + file_desc->CopyTo(&normalized_file); + std::string serialized; + normalized_file.SerializeToString(&serialized); + upb::Arena arena; + upb::Status status; + google_protobuf_FileDescriptorProto* proto = google_protobuf_FileDescriptorProto_parse( + serialized.data(), serialized.size(), arena.ptr()); + ASSERT_NE(proto, nullptr); + upb::FileDefPtr file_def = pool->AddFile(proto, &status); + + // Ideally we could assert that file_def is present here. After all, any + // descriptor accepted by C++ should be by definition valid. However C++ + // performs some of its validation at the .proto file parser level instead + // of when validating descriptors. As as result, C++ will accept some + // unreasonable descriptors like: + // file { name: "" package: "0" } + // + // There is no .proto file that will produce this descriptor, but + // BuildFile() accepts it. We should probably clean up these cases so C++ + // will reject them too. + if (!file_def) return; + + ASSERT_TRUE(status.ok()) << status.error_message(); + google_protobuf_FileDescriptorProto* upb_proto = + upb_FileDef_ToProto(file_def.ptr(), arena.ptr()); + size_t size; + const char* buf = + google_protobuf_FileDescriptorProto_serialize(upb_proto, arena.ptr(), &size); + google::protobuf::FileDescriptorProto google_proto; + bool ok = google_proto.ParseFromArray(buf, size); + ASSERT_TRUE(ok); + EXPECT_THAT(google_proto, EqualsProtoTreatNansAsEqual(normalized_file)); + } else { + // This file was invalid according to proto2. When we parse it with upb, + // it may or may not be accepted, since upb does not perform as much + // validation as proto2. However it must not crash. + std::string serialized; + file.SerializeToString(&serialized); + upb::Arena arena; + upb::Status status; + google_protobuf_FileDescriptorProto* proto = google_protobuf_FileDescriptorProto_parse( + serialized.data(), serialized.size(), arena.ptr()); + ASSERT_NE(proto, nullptr); + pool->AddFile(proto, &status); + } +} + +inline void RoundTripDescriptor(const google::protobuf::FileDescriptorSet& set) { + upb::DefPool defpool; + google::protobuf::DescriptorPool desc_pool; + desc_pool.EnforceWeakDependencies(true); + for (const auto& file : set.file()) { + google::protobuf::FileDescriptorProto mutable_file(file); + AddFile(mutable_file, &defpool, &desc_pool); + } +} + +} // namespace upb_test + +#endif // UPB_UTIL_DEF_TO_PROTO_TEST_H_ diff --git a/third_party/upb/upb/util/def_to_proto_test.proto b/third_party/upb/upb/util/def_to_proto_test.proto index 5d154106c73..a28c1c55d7f 100644 --- a/third_party/upb/upb/util/def_to_proto_test.proto +++ b/third_party/upb/upb/util/def_to_proto_test.proto @@ -117,3 +117,8 @@ message MessageSetItem { optional MessageSetItem message_set_extension = 2147483646; } } + +message UnusualDefaults { + optional bytes foo = 1 [default = "\\X"]; + optional string bar = 2 [default = "\\X"]; +} diff --git a/third_party/upb/upb/util/required_fields.c b/third_party/upb/upb/util/required_fields.c index 90f40b65166..01dfd28b8c6 100644 --- a/third_party/upb/upb/util/required_fields.c +++ b/third_party/upb/upb/util/required_fields.c @@ -28,15 +28,14 @@ #include "upb/util/required_fields.h" #include -#include #include -#include -#include "upb/internal/vsnprintf_compat.h" -#include "upb/reflection.h" +#include "upb/collections/map.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/message.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" //////////////////////////////////////////////////////////////////////////////// // upb_FieldPath_ToText() @@ -209,7 +208,7 @@ static void upb_util_FindUnsetInMessage(upb_FindContext* ctx, const upb_FieldDef* f = upb_MessageDef_Field(m, i); if (upb_FieldDef_Label(f) != kUpb_Label_Required) continue; - if (!msg || !upb_Message_Has(msg, f)) { + if (!msg || !upb_Message_HasFieldByDef(msg, f)) { // A required field is missing. ctx->has_unset_required = true; @@ -266,9 +265,8 @@ static void upb_util_FindUnsetRequiredInternal(upb_FindContext* ctx, if (!val_m) continue; const upb_Map* map = val.map_val; size_t iter = kUpb_Map_Begin; - while (upb_MapIterator_Next(map, &iter)) { - upb_MessageValue key = upb_MapIterator_Key(map, iter); - upb_MessageValue map_val = upb_MapIterator_Value(map, iter); + upb_MessageValue key, map_val; + while (upb_Map_Next(map, &key, &map_val, &iter)) { upb_FindContext_Push(ctx, (upb_FieldPathEntry){.map_key = key}); upb_util_FindUnsetRequiredInternal(ctx, map_val.msg_val, val_m); upb_FindContext_Pop(ctx); diff --git a/third_party/upb/upb/util/required_fields.h b/third_party/upb/upb/util/required_fields.h index 874914bd676..c415215ec59 100644 --- a/third_party/upb/upb/util/required_fields.h +++ b/third_party/upb/upb/util/required_fields.h @@ -28,11 +28,11 @@ #ifndef UPB_UTIL_REQUIRED_FIELDS_H_ #define UPB_UTIL_REQUIRED_FIELDS_H_ -#include "upb/def.h" -#include "upb/reflection.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" -/* Must be last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -89,6 +89,6 @@ bool upb_util_HasUnsetRequired(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_UTIL_REQUIRED_FIELDS_H_ */ diff --git a/third_party/upb/upb/util/required_fields_test.cc b/third_party/upb/upb/util/required_fields_test.cc index 85504101e65..7d44ef79544 100644 --- a/third_party/upb/upb/util/required_fields_test.cc +++ b/third_party/upb/upb/util/required_fields_test.cc @@ -27,11 +27,11 @@ #include "upb/util/required_fields.h" -#include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "upb/def.hpp" +#include "absl/strings/string_view.h" #include "upb/json_decode.h" +#include "upb/reflection/def.hpp" #include "upb/upb.hpp" #include "upb/util/required_fields_test.upb.h" #include "upb/util/required_fields_test.upbdefs.h" diff --git a/third_party/upb/upb/wire/common_internal.h b/third_party/upb/upb/wire/common_internal.h new file mode 100644 index 00000000000..93e6d99b679 --- /dev/null +++ b/third_party/upb/upb/wire/common_internal.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_WIRE_COMMON_INTERNAL_H_ +#define UPB_WIRE_COMMON_INTERNAL_H_ + +// Must be last. +#include "upb/port/def.inc" + +// MessageSet wire format is: +// message MessageSet { +// repeated group Item = 1 { +// required int32 type_id = 2; +// required bytes message = 3; +// } +// } + +enum { + kUpb_MsgSet_Item = 1, + kUpb_MsgSet_TypeId = 2, + kUpb_MsgSet_Message = 3, +}; + +#include "upb/port/undef.inc" + +#endif /* UPB_WIRE_COMMON_INTERNAL_H_ */ diff --git a/third_party/upb/upb/wire/decode.c b/third_party/upb/upb/wire/decode.c new file mode 100644 index 00000000000..852052f9cd9 --- /dev/null +++ b/third_party/upb/upb/wire/decode.c @@ -0,0 +1,1315 @@ +/* + * 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/wire/decode.h" + +#include + +#include "upb/collections/array_internal.h" +#include "upb/collections/map_internal.h" +#include "upb/mini_table/common.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/common_internal.h" +#include "upb/wire/decode_internal.h" +#include "upb/wire/encode.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/swap_internal.h" +#include "upb/wire/types.h" + +// Must be last. +#include "upb/port/def.inc" + +// A few fake field types for our tables. +enum { + kUpb_FakeFieldType_FieldNotFound = 0, + kUpb_FakeFieldType_MessageSetItem = 19, +}; + +// DecodeOp: an action to be performed for a wire-type/field-type combination. +enum { + // Special ops: we don't write data to regular fields for these. + kUpb_DecodeOp_UnknownField = -1, + kUpb_DecodeOp_MessageSetItem = -2, + + // Scalar-only ops. + kUpb_DecodeOp_Scalar1Byte = 0, + kUpb_DecodeOp_Scalar4Byte = 2, + kUpb_DecodeOp_Scalar8Byte = 3, + kUpb_DecodeOp_Enum = 1, + + // Scalar/repeated ops. + kUpb_DecodeOp_String = 4, + kUpb_DecodeOp_Bytes = 5, + kUpb_DecodeOp_SubMessage = 6, + + // Repeated-only ops (also see macros below). + kUpb_DecodeOp_PackedEnum = 13, +}; + +// For packed fields it is helpful to be able to recover the lg2 of the data +// size from the op. +#define OP_FIXPCK_LG2(n) (n + 5) /* n in [2, 3] => op in [7, 8] */ +#define OP_VARPCK_LG2(n) (n + 9) /* n in [0, 2, 3] => op in [9, 11, 12] */ + +typedef union { + bool bool_val; + uint32_t uint32_val; + uint64_t uint64_val; + uint32_t size; +} wireval; + +static const char* _upb_Decoder_DecodeMessage(upb_Decoder* d, const char* ptr, + upb_Message* msg, + const upb_MiniTable* layout); + +UPB_NORETURN static void* _upb_Decoder_ErrorJmp(upb_Decoder* d, + upb_DecodeStatus status) { + assert(status != kUpb_DecodeStatus_Ok); + d->status = status; + UPB_LONGJMP(d->err, 1); +} + +const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status) { + assert(status != kUpb_DecodeStatus_Ok); + d->status = status; + UPB_LONGJMP(d->err, 1); + return NULL; +} + +static void _upb_Decoder_VerifyUtf8(upb_Decoder* d, const char* buf, int len) { + if (!_upb_Decoder_VerifyUtf8Inline(buf, len)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8); + } +} + +static bool _upb_Decoder_Reserve(upb_Decoder* d, upb_Array* arr, size_t elem) { + bool need_realloc = arr->capacity - arr->size < elem; + if (need_realloc && !_upb_array_realloc(arr, arr->size + elem, &d->arena)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + return need_realloc; +} + +typedef struct { + const char* ptr; + uint64_t val; +} _upb_DecodeLongVarintReturn; + +UPB_NOINLINE +static _upb_DecodeLongVarintReturn _upb_Decoder_DecodeLongVarint( + const char* ptr, uint64_t val) { + _upb_DecodeLongVarintReturn 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* _upb_Decoder_DecodeVarint(upb_Decoder* d, const char* ptr, + uint64_t* val) { + uint64_t byte = (uint8_t)*ptr; + if (UPB_LIKELY((byte & 0x80) == 0)) { + *val = byte; + return ptr + 1; + } else { + _upb_DecodeLongVarintReturn res = _upb_Decoder_DecodeLongVarint(ptr, byte); + if (!res.ptr) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + *val = res.val; + return res.ptr; + } +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeTag(upb_Decoder* d, const char* ptr, + uint32_t* val) { + uint64_t byte = (uint8_t)*ptr; + if (UPB_LIKELY((byte & 0x80) == 0)) { + *val = byte; + return ptr + 1; + } else { + const char* start = ptr; + _upb_DecodeLongVarintReturn res = _upb_Decoder_DecodeLongVarint(ptr, byte); + if (!res.ptr || res.ptr - start > 5 || res.val > UINT32_MAX) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + } + *val = res.val; + return res.ptr; + } +} + +UPB_FORCEINLINE +static const char* upb_Decoder_DecodeSize(upb_Decoder* d, const char* ptr, + uint32_t* size) { + uint64_t size64; + ptr = _upb_Decoder_DecodeVarint(d, ptr, &size64); + if (size64 >= INT32_MAX || + !upb_EpsCopyInputStream_CheckSize(&d->input, ptr, (int)size64)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + } + *size = size64; + return ptr; +} + +static void _upb_Decoder_MungeInt32(wireval* val) { + if (!_upb_IsLittleEndian()) { + /* The next stage will memcpy(dst, &val, 4) */ + val->uint32_val = val->uint64_val; + } +} + +static void _upb_Decoder_Munge(int type, wireval* val) { + switch (type) { + case kUpb_FieldType_Bool: + val->bool_val = val->uint64_val != 0; + break; + case kUpb_FieldType_SInt32: { + uint32_t n = val->uint64_val; + val->uint32_val = (n >> 1) ^ -(int32_t)(n & 1); + break; + } + case kUpb_FieldType_SInt64: { + uint64_t n = val->uint64_val; + val->uint64_val = (n >> 1) ^ -(int64_t)(n & 1); + break; + } + case kUpb_FieldType_Int32: + case kUpb_FieldType_UInt32: + case kUpb_FieldType_Enum: + _upb_Decoder_MungeInt32(val); + break; + } +} + +static upb_Message* _upb_Decoder_NewSubMessage( + upb_Decoder* d, const upb_MiniTableSub* subs, + const upb_MiniTableField* field) { + const upb_MiniTable* subl = subs[field->submsg_index].submsg; + UPB_ASSERT(subl); + upb_Message* msg = _upb_Message_New(subl, &d->arena); + if (!msg) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + return msg; +} + +static const char* _upb_Decoder_ReadString(upb_Decoder* d, const char* ptr, + int size, upb_StringView* str) { + const char* str_ptr = ptr; + ptr = upb_EpsCopyInputStream_ReadString(&d->input, &str_ptr, size, &d->arena); + if (!ptr) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + str->data = str_ptr; + str->size = size; + return ptr; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_RecurseSubMessage(upb_Decoder* d, + const char* ptr, + upb_Message* submsg, + const upb_MiniTable* subl, + uint32_t expected_end_group) { + if (--d->depth < 0) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_MaxDepthExceeded); + } + ptr = _upb_Decoder_DecodeMessage(d, ptr, submsg, subl); + d->depth++; + if (d->end_group != expected_end_group) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + } + return ptr; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeSubMessage( + upb_Decoder* d, const char* ptr, upb_Message* submsg, + const upb_MiniTableSub* subs, const upb_MiniTableField* field, int size) { + int saved_delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, size); + const upb_MiniTable* subl = subs[field->submsg_index].submsg; + UPB_ASSERT(subl); + ptr = _upb_Decoder_RecurseSubMessage(d, ptr, submsg, subl, DECODE_NOGROUP); + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, saved_delta); + return ptr; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeGroup(upb_Decoder* d, const char* ptr, + upb_Message* submsg, + const upb_MiniTable* subl, + uint32_t number) { + if (_upb_Decoder_IsDone(d, &ptr)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + } + ptr = _upb_Decoder_RecurseSubMessage(d, ptr, submsg, subl, number); + d->end_group = DECODE_NOGROUP; + return ptr; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeUnknownGroup(upb_Decoder* d, + const char* ptr, + uint32_t number) { + return _upb_Decoder_DecodeGroup(d, ptr, NULL, NULL, number); +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeKnownGroup( + upb_Decoder* d, const char* ptr, upb_Message* submsg, + const upb_MiniTableSub* subs, const upb_MiniTableField* field) { + const upb_MiniTable* subl = subs[field->submsg_index].submsg; + UPB_ASSERT(subl); + return _upb_Decoder_DecodeGroup(d, ptr, submsg, subl, field->number); +} + +static char* upb_Decoder_EncodeVarint32(uint32_t val, char* ptr) { + do { + uint8_t byte = val & 0x7fU; + val >>= 7; + if (val) byte |= 0x80U; + *(ptr++) = byte; + } while (val); + return ptr; +} + +static void _upb_Decoder_AddUnknownVarints(upb_Decoder* d, upb_Message* msg, + uint32_t val1, uint32_t val2) { + char buf[20]; + char* end = buf; + end = upb_Decoder_EncodeVarint32(val1, end); + end = upb_Decoder_EncodeVarint32(val2, end); + + if (!_upb_Message_AddUnknown(msg, buf, end - buf, &d->arena)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } +} + +UPB_NOINLINE +static bool _upb_Decoder_CheckEnumSlow(upb_Decoder* d, const char* ptr, + upb_Message* msg, + const upb_MiniTableEnum* e, + const upb_MiniTableField* field, + uint32_t v) { + if (_upb_MiniTable_CheckEnumValueSlow(e, v)) return true; + + // Unrecognized enum goes into unknown fields. + // For packed fields the tag could be arbitrarily far in the past, so we + // just re-encode the tag and value here. + uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Varint; + upb_Message* unknown_msg = + field->mode & kUpb_LabelFlags_IsExtension ? d->unknown_msg : msg; + _upb_Decoder_AddUnknownVarints(d, unknown_msg, tag, v); + return false; +} + +UPB_FORCEINLINE +static bool _upb_Decoder_CheckEnum(upb_Decoder* d, const char* ptr, + upb_Message* msg, const upb_MiniTableEnum* e, + const upb_MiniTableField* field, + wireval* val) { + uint32_t v = val->uint32_val; + + _kUpb_FastEnumCheck_Status status = _upb_MiniTable_CheckEnumValueFast(e, v); + if (UPB_LIKELY(status == _kUpb_FastEnumCheck_ValueIsInEnum)) return true; + return _upb_Decoder_CheckEnumSlow(d, ptr, msg, e, field, v); +} + +UPB_NOINLINE +static const char* _upb_Decoder_DecodeEnumArray(upb_Decoder* d, const char* ptr, + upb_Message* msg, + upb_Array* arr, + const upb_MiniTableSub* subs, + const upb_MiniTableField* field, + wireval* val) { + const upb_MiniTableEnum* e = subs[field->submsg_index].subenum; + if (!_upb_Decoder_CheckEnum(d, ptr, msg, e, field, val)) return ptr; + void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void); + arr->size++; + memcpy(mem, val, 4); + return ptr; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeFixedPacked( + upb_Decoder* d, const char* ptr, upb_Array* arr, wireval* val, + const upb_MiniTableField* field, int lg2) { + int mask = (1 << lg2) - 1; + size_t count = val->size >> lg2; + if ((val->size & mask) != 0) { + // Length isn't a round multiple of elem size. + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + } + _upb_Decoder_Reserve(d, arr, count); + void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << lg2, void); + arr->size += count; + // Note: if/when the decoder supports multi-buffer input, we will need to + // handle buffer seams here. + if (_upb_IsLittleEndian()) { + ptr = upb_EpsCopyInputStream_Copy(&d->input, ptr, mem, val->size); + } else { + int delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); + char* dst = mem; + while (!_upb_Decoder_IsDone(d, &ptr)) { + if (lg2 == 2) { + ptr = upb_WireReader_ReadFixed32(ptr, dst); + dst += 4; + } else { + UPB_ASSERT(lg2 == 3); + ptr = upb_WireReader_ReadFixed64(ptr, dst); + dst += 8; + } + } + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, delta); + } + + return ptr; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeVarintPacked( + upb_Decoder* d, const char* ptr, upb_Array* arr, wireval* val, + const upb_MiniTableField* field, int lg2) { + int scale = 1 << lg2; + int saved_limit = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); + char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << lg2, void); + while (!_upb_Decoder_IsDone(d, &ptr)) { + wireval elem; + ptr = _upb_Decoder_DecodeVarint(d, ptr, &elem.uint64_val); + _upb_Decoder_Munge(field->descriptortype, &elem); + if (_upb_Decoder_Reserve(d, arr, 1)) { + out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << lg2, void); + } + arr->size++; + memcpy(out, &elem, scale); + out += scale; + } + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, saved_limit); + return ptr; +} + +UPB_NOINLINE +static const char* _upb_Decoder_DecodeEnumPacked( + upb_Decoder* d, const char* ptr, upb_Message* msg, upb_Array* arr, + const upb_MiniTableSub* subs, const upb_MiniTableField* field, + wireval* val) { + const upb_MiniTableEnum* e = subs[field->submsg_index].subenum; + int saved_limit = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); + char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void); + while (!_upb_Decoder_IsDone(d, &ptr)) { + wireval elem; + ptr = _upb_Decoder_DecodeVarint(d, ptr, &elem.uint64_val); + _upb_Decoder_MungeInt32(&elem); + if (!_upb_Decoder_CheckEnum(d, ptr, msg, e, field, &elem)) { + continue; + } + if (_upb_Decoder_Reserve(d, arr, 1)) { + out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void); + } + arr->size++; + memcpy(out, &elem, 4); + out += 4; + } + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, saved_limit); + return ptr; +} + +upb_Array* _upb_Decoder_CreateArray(upb_Decoder* d, + const upb_MiniTableField* field) { + /* Maps descriptor type -> elem_size_lg2. */ + static const uint8_t kElemSizeLg2[] = { + [0] = -1, // invalid descriptor type + [kUpb_FieldType_Double] = 3, + [kUpb_FieldType_Float] = 2, + [kUpb_FieldType_Int64] = 3, + [kUpb_FieldType_UInt64] = 3, + [kUpb_FieldType_Int32] = 2, + [kUpb_FieldType_Fixed64] = 3, + [kUpb_FieldType_Fixed32] = 2, + [kUpb_FieldType_Bool] = 0, + [kUpb_FieldType_String] = UPB_SIZE(3, 4), + [kUpb_FieldType_Group] = UPB_SIZE(2, 3), + [kUpb_FieldType_Message] = UPB_SIZE(2, 3), + [kUpb_FieldType_Bytes] = UPB_SIZE(3, 4), + [kUpb_FieldType_UInt32] = 2, + [kUpb_FieldType_Enum] = 2, + [kUpb_FieldType_SFixed32] = 2, + [kUpb_FieldType_SFixed64] = 3, + [kUpb_FieldType_SInt32] = 2, + [kUpb_FieldType_SInt64] = 3, + }; + + size_t lg2 = kElemSizeLg2[field->descriptortype]; + upb_Array* ret = _upb_Array_New(&d->arena, 4, lg2); + if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + return ret; +} + +static const char* _upb_Decoder_DecodeToArray(upb_Decoder* d, const char* ptr, + upb_Message* msg, + const upb_MiniTableSub* subs, + const upb_MiniTableField* field, + wireval* val, int op) { + upb_Array** arrp = UPB_PTR_AT(msg, field->offset, void); + upb_Array* arr = *arrp; + void* mem; + + if (arr) { + _upb_Decoder_Reserve(d, arr, 1); + } else { + arr = _upb_Decoder_CreateArray(d, field); + *arrp = arr; + } + + switch (op) { + case kUpb_DecodeOp_Scalar1Byte: + case kUpb_DecodeOp_Scalar4Byte: + case kUpb_DecodeOp_Scalar8Byte: + /* Append scalar value. */ + mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << op, void); + arr->size++; + memcpy(mem, val, 1 << op); + return ptr; + case kUpb_DecodeOp_String: + _upb_Decoder_VerifyUtf8(d, ptr, val->size); + /* Fallthrough. */ + case kUpb_DecodeOp_Bytes: { + /* Append bytes. */ + upb_StringView* str = (upb_StringView*)_upb_array_ptr(arr) + arr->size; + arr->size++; + return _upb_Decoder_ReadString(d, ptr, val->size, str); + } + case kUpb_DecodeOp_SubMessage: { + /* Append submessage / group. */ + upb_Message* submsg = _upb_Decoder_NewSubMessage(d, subs, field); + *UPB_PTR_AT(_upb_array_ptr(arr), arr->size * sizeof(void*), + upb_Message*) = submsg; + arr->size++; + if (UPB_UNLIKELY(field->descriptortype == kUpb_FieldType_Group)) { + return _upb_Decoder_DecodeKnownGroup(d, ptr, submsg, subs, field); + } else { + return _upb_Decoder_DecodeSubMessage(d, ptr, submsg, subs, field, + val->size); + } + } + case OP_FIXPCK_LG2(2): + case OP_FIXPCK_LG2(3): + return _upb_Decoder_DecodeFixedPacked(d, ptr, arr, val, field, + op - OP_FIXPCK_LG2(0)); + case OP_VARPCK_LG2(0): + case OP_VARPCK_LG2(2): + case OP_VARPCK_LG2(3): + return _upb_Decoder_DecodeVarintPacked(d, ptr, arr, val, field, + op - OP_VARPCK_LG2(0)); + case kUpb_DecodeOp_Enum: + return _upb_Decoder_DecodeEnumArray(d, ptr, msg, arr, subs, field, val); + case kUpb_DecodeOp_PackedEnum: + return _upb_Decoder_DecodeEnumPacked(d, ptr, msg, arr, subs, field, val); + default: + UPB_UNREACHABLE(); + } +} + +upb_Map* _upb_Decoder_CreateMap(upb_Decoder* d, const upb_MiniTable* entry) { + /* Maps descriptor type -> upb map size. */ + static const uint8_t kSizeInMap[] = { + [0] = -1, // invalid descriptor type */ + [kUpb_FieldType_Double] = 8, + [kUpb_FieldType_Float] = 4, + [kUpb_FieldType_Int64] = 8, + [kUpb_FieldType_UInt64] = 8, + [kUpb_FieldType_Int32] = 4, + [kUpb_FieldType_Fixed64] = 8, + [kUpb_FieldType_Fixed32] = 4, + [kUpb_FieldType_Bool] = 1, + [kUpb_FieldType_String] = UPB_MAPTYPE_STRING, + [kUpb_FieldType_Group] = sizeof(void*), + [kUpb_FieldType_Message] = sizeof(void*), + [kUpb_FieldType_Bytes] = UPB_MAPTYPE_STRING, + [kUpb_FieldType_UInt32] = 4, + [kUpb_FieldType_Enum] = 4, + [kUpb_FieldType_SFixed32] = 4, + [kUpb_FieldType_SFixed64] = 8, + [kUpb_FieldType_SInt32] = 4, + [kUpb_FieldType_SInt64] = 8, + }; + + const upb_MiniTableField* key_field = &entry->fields[0]; + const upb_MiniTableField* val_field = &entry->fields[1]; + char key_size = kSizeInMap[key_field->descriptortype]; + char val_size = kSizeInMap[val_field->descriptortype]; + UPB_ASSERT(key_field->offset == offsetof(upb_MapEntryData, k)); + UPB_ASSERT(val_field->offset == offsetof(upb_MapEntryData, v)); + upb_Map* ret = _upb_Map_New(&d->arena, key_size, val_size); + if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + return ret; +} + +static const char* _upb_Decoder_DecodeToMap(upb_Decoder* d, const char* ptr, + upb_Message* msg, + const upb_MiniTableSub* subs, + const upb_MiniTableField* field, + wireval* val) { + upb_Map** map_p = UPB_PTR_AT(msg, field->offset, upb_Map*); + upb_Map* map = *map_p; + upb_MapEntry ent; + UPB_ASSERT(upb_MiniTableField_Type(field) == kUpb_FieldType_Message); + const upb_MiniTable* entry = subs[field->submsg_index].submsg; + + UPB_ASSERT(entry->field_count == 2); + UPB_ASSERT(!upb_IsRepeatedOrMap(&entry->fields[0])); + UPB_ASSERT(!upb_IsRepeatedOrMap(&entry->fields[1])); + + if (!map) { + map = _upb_Decoder_CreateMap(d, entry); + *map_p = map; + } + + // Parse map entry. + memset(&ent, 0, sizeof(ent)); + + if (entry->fields[1].descriptortype == kUpb_FieldType_Message || + entry->fields[1].descriptortype == kUpb_FieldType_Group) { + const upb_MiniTable* submsg_table = entry->subs[0].submsg; + // Any sub-message entry must be linked. We do not allow dynamic tree + // shaking in this case. + UPB_ASSERT(submsg_table); + + // Create proactively to handle the case where it doesn't appear. */ + ent.data.v.val = upb_value_ptr(_upb_Message_New(submsg_table, &d->arena)); + } + + ptr = + _upb_Decoder_DecodeSubMessage(d, ptr, &ent.data, subs, field, val->size); + // check if ent had any unknown fields + size_t size; + upb_Message_GetUnknown(&ent.data, &size); + if (size != 0) { + char* buf; + size_t size; + uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Delimited; + upb_EncodeStatus status = + upb_Encode(&ent.data, entry, 0, &d->arena, &buf, &size); + if (status != kUpb_EncodeStatus_Ok) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + _upb_Decoder_AddUnknownVarints(d, msg, tag, size); + if (!_upb_Message_AddUnknown(msg, buf, size, &d->arena)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + } else { + if (_upb_Map_Insert(map, &ent.data.k, map->key_size, &ent.data.v, + map->val_size, + &d->arena) == kUpb_MapInsertStatus_OutOfMemory) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + } + return ptr; +} + +static const char* _upb_Decoder_DecodeToSubMessage( + upb_Decoder* d, const char* ptr, upb_Message* msg, + const upb_MiniTableSub* subs, const upb_MiniTableField* field, wireval* val, + int op) { + void* mem = UPB_PTR_AT(msg, field->offset, void); + int type = field->descriptortype; + + if (UPB_UNLIKELY(op == kUpb_DecodeOp_Enum) && + !_upb_Decoder_CheckEnum(d, ptr, msg, subs[field->submsg_index].subenum, + field, val)) { + return ptr; + } + + /* Set presence if necessary. */ + if (field->presence > 0) { + _upb_sethas_field(msg, field); + } else if (field->presence < 0) { + /* Oneof case */ + uint32_t* oneof_case = _upb_oneofcase_field(msg, field); + if (op == kUpb_DecodeOp_SubMessage && *oneof_case != field->number) { + memset(mem, 0, sizeof(void*)); + } + *oneof_case = field->number; + } + + /* Store into message. */ + switch (op) { + case kUpb_DecodeOp_SubMessage: { + upb_Message** submsgp = mem; + upb_Message* submsg = *submsgp; + if (!submsg) { + submsg = _upb_Decoder_NewSubMessage(d, subs, field); + *submsgp = submsg; + } + if (UPB_UNLIKELY(type == kUpb_FieldType_Group)) { + ptr = _upb_Decoder_DecodeKnownGroup(d, ptr, submsg, subs, field); + } else { + ptr = _upb_Decoder_DecodeSubMessage(d, ptr, submsg, subs, field, + val->size); + } + break; + } + case kUpb_DecodeOp_String: + _upb_Decoder_VerifyUtf8(d, ptr, val->size); + /* Fallthrough. */ + case kUpb_DecodeOp_Bytes: + return _upb_Decoder_ReadString(d, ptr, val->size, mem); + case kUpb_DecodeOp_Scalar8Byte: + memcpy(mem, val, 8); + break; + case kUpb_DecodeOp_Enum: + case kUpb_DecodeOp_Scalar4Byte: + memcpy(mem, val, 4); + break; + case kUpb_DecodeOp_Scalar1Byte: + memcpy(mem, val, 1); + break; + default: + UPB_UNREACHABLE(); + } + + return ptr; +} + +UPB_NOINLINE +const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr, + const upb_Message* msg, + const upb_MiniTable* l) { + assert(l->required_count); + if (UPB_LIKELY((d->options & kUpb_DecodeOption_CheckRequired) == 0)) { + return ptr; + } + uint64_t msg_head; + memcpy(&msg_head, msg, 8); + msg_head = _upb_BigEndian_Swap64(msg_head); + if (upb_MiniTable_requiredmask(l) & ~msg_head) { + d->missing_required = true; + } + return ptr; +} + +UPB_FORCEINLINE +static bool _upb_Decoder_TryFastDispatch(upb_Decoder* d, const char** ptr, + upb_Message* msg, + const upb_MiniTable* layout) { +#if UPB_FASTTABLE + if (layout && layout->table_mask != (unsigned char)-1) { + uint16_t tag = _upb_FastDecoder_LoadTag(*ptr); + intptr_t table = decode_totable(layout); + *ptr = _upb_FastDecoder_TagDispatch(d, *ptr, msg, table, 0, tag); + return true; + } +#endif + return false; +} + +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 _upb_Decoder_DecodeVarint(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 _upb_Decoder_DecodeUnknownGroup(d, ptr, field_number); + default: + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + } +} + +enum { + kStartItemTag = ((kUpb_MsgSet_Item << 3) | kUpb_WireType_StartGroup), + kEndItemTag = ((kUpb_MsgSet_Item << 3) | kUpb_WireType_EndGroup), + kTypeIdTag = ((kUpb_MsgSet_TypeId << 3) | kUpb_WireType_Varint), + kMessageTag = ((kUpb_MsgSet_Message << 3) | kUpb_WireType_Delimited), +}; + +static void upb_Decoder_AddKnownMessageSetItem( + upb_Decoder* d, upb_Message* msg, const upb_MiniTableExtension* item_mt, + const char* data, uint32_t size) { + upb_Message_Extension* ext = + _upb_Message_GetOrCreateExtension(msg, item_mt, &d->arena); + if (UPB_UNLIKELY(!ext)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + upb_Message* submsg = + _upb_Decoder_NewSubMessage(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) _upb_Decoder_ErrorJmp(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)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } +} + +static void upb_Decoder_AddMessageSetItem(upb_Decoder* d, upb_Message* msg, + const upb_MiniTable* t, + uint32_t type_id, const char* data, + uint32_t size) { + const upb_MiniTableExtension* item_mt = + upb_ExtensionRegistry_Lookup(d->extreg, t, 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 (!_upb_Decoder_IsDone(d, &ptr)) { + uint32_t tag; + ptr = _upb_Decoder_DecodeTag(d, ptr, &tag); + switch (tag) { + case kEndItemTag: + return ptr; + case kTypeIdTag: { + uint64_t tmp; + ptr = _upb_Decoder_DecodeVarint(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; + } + } + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); +} + +static const upb_MiniTableField* _upb_Decoder_FindField(upb_Decoder* d, + const upb_MiniTable* t, + uint32_t field_number, + int* last_field_index) { + static upb_MiniTableField none = { + 0, 0, 0, 0, kUpb_FakeFieldType_FieldNotFound, 0}; + if (t == NULL) return &none; + + size_t idx = ((size_t)field_number) - 1; // 0 wraps to SIZE_MAX + if (idx < t->dense_below) { + /* Fastest case: index into dense fields. */ + goto found; + } + + if (t->dense_below < t->field_count) { + /* Linear search non-dense fields. Resume scanning from last_field_index + * since fields are usually in order. */ + int last = *last_field_index; + for (idx = last; idx < t->field_count; idx++) { + if (t->fields[idx].number == field_number) { + goto found; + } + } + + for (idx = t->dense_below; idx < last; idx++) { + if (t->fields[idx].number == field_number) { + goto found; + } + } + } + + if (d->extreg) { + switch (t->ext) { + case kUpb_ExtMode_Extendable: { + const upb_MiniTableExtension* ext = + upb_ExtensionRegistry_Lookup(d->extreg, t, field_number); + if (ext) return &ext->field; + break; + } + case kUpb_ExtMode_IsMessageSet: + if (field_number == kUpb_MsgSet_Item) { + static upb_MiniTableField item = { + 0, 0, 0, 0, kUpb_FakeFieldType_MessageSetItem, 0}; + return &item; + } + break; + } + } + + return &none; /* Unknown field. */ + +found: + UPB_ASSERT(t->fields[idx].number == field_number); + *last_field_index = idx; + return &t->fields[idx]; +} + +int _upb_Decoder_GetVarintOp(const upb_MiniTableField* field) { + static const int8_t kVarintOps[] = { + [kUpb_FakeFieldType_FieldNotFound] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Double] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Float] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Int64] = kUpb_DecodeOp_Scalar8Byte, + [kUpb_FieldType_UInt64] = kUpb_DecodeOp_Scalar8Byte, + [kUpb_FieldType_Int32] = kUpb_DecodeOp_Scalar4Byte, + [kUpb_FieldType_Fixed64] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Fixed32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Bool] = kUpb_DecodeOp_Scalar1Byte, + [kUpb_FieldType_String] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Group] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Message] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Bytes] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_UInt32] = kUpb_DecodeOp_Scalar4Byte, + [kUpb_FieldType_Enum] = kUpb_DecodeOp_Enum, + [kUpb_FieldType_SFixed32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_SFixed64] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_SInt32] = kUpb_DecodeOp_Scalar4Byte, + [kUpb_FieldType_SInt64] = kUpb_DecodeOp_Scalar8Byte, + [kUpb_FakeFieldType_MessageSetItem] = kUpb_DecodeOp_UnknownField, + }; + + return kVarintOps[field->descriptortype]; +} + +UPB_FORCEINLINE +static void _upb_Decoder_CheckUnlinked(const upb_MiniTable* mt, + const upb_MiniTableField* field, + int* op) { + // If sub-message is not linked, treat as unknown. + if (field->mode & kUpb_LabelFlags_IsExtension) return; + const upb_MiniTableSub* sub = &mt->subs[field->submsg_index]; + if (!sub->submsg) *op = kUpb_DecodeOp_UnknownField; +} + +int _upb_Decoder_GetDelimitedOp(const upb_MiniTable* mt, + const upb_MiniTableField* field) { + enum { kRepeatedBase = 19 }; + + static const int8_t kDelimitedOps[] = { + /* For non-repeated field type. */ + [kUpb_FakeFieldType_FieldNotFound] = + kUpb_DecodeOp_UnknownField, // Field not found. + [kUpb_FieldType_Double] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Float] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Int64] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_UInt64] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Int32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Fixed64] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Fixed32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Bool] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_String] = kUpb_DecodeOp_String, + [kUpb_FieldType_Group] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Message] = kUpb_DecodeOp_SubMessage, + [kUpb_FieldType_Bytes] = kUpb_DecodeOp_Bytes, + [kUpb_FieldType_UInt32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_Enum] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_SFixed32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_SFixed64] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_SInt32] = kUpb_DecodeOp_UnknownField, + [kUpb_FieldType_SInt64] = kUpb_DecodeOp_UnknownField, + [kUpb_FakeFieldType_MessageSetItem] = kUpb_DecodeOp_UnknownField, + // For repeated field type. */ + [kRepeatedBase + kUpb_FieldType_Double] = OP_FIXPCK_LG2(3), + [kRepeatedBase + kUpb_FieldType_Float] = OP_FIXPCK_LG2(2), + [kRepeatedBase + kUpb_FieldType_Int64] = OP_VARPCK_LG2(3), + [kRepeatedBase + kUpb_FieldType_UInt64] = OP_VARPCK_LG2(3), + [kRepeatedBase + kUpb_FieldType_Int32] = OP_VARPCK_LG2(2), + [kRepeatedBase + kUpb_FieldType_Fixed64] = OP_FIXPCK_LG2(3), + [kRepeatedBase + kUpb_FieldType_Fixed32] = OP_FIXPCK_LG2(2), + [kRepeatedBase + kUpb_FieldType_Bool] = OP_VARPCK_LG2(0), + [kRepeatedBase + kUpb_FieldType_String] = kUpb_DecodeOp_String, + [kRepeatedBase + kUpb_FieldType_Group] = kUpb_DecodeOp_SubMessage, + [kRepeatedBase + kUpb_FieldType_Message] = kUpb_DecodeOp_SubMessage, + [kRepeatedBase + kUpb_FieldType_Bytes] = kUpb_DecodeOp_Bytes, + [kRepeatedBase + kUpb_FieldType_UInt32] = OP_VARPCK_LG2(2), + [kRepeatedBase + kUpb_FieldType_Enum] = kUpb_DecodeOp_PackedEnum, + [kRepeatedBase + kUpb_FieldType_SFixed32] = OP_FIXPCK_LG2(2), + [kRepeatedBase + kUpb_FieldType_SFixed64] = OP_FIXPCK_LG2(3), + [kRepeatedBase + kUpb_FieldType_SInt32] = OP_VARPCK_LG2(2), + [kRepeatedBase + kUpb_FieldType_SInt64] = OP_VARPCK_LG2(3), + // Omitting kUpb_FakeFieldType_MessageSetItem, because we never emit a + // repeated msgset type + }; + + int ndx = field->descriptortype; + if (upb_FieldMode_Get(field) == kUpb_FieldMode_Array) ndx += kRepeatedBase; + int op = kDelimitedOps[ndx]; + + if (op == kUpb_DecodeOp_SubMessage) { + _upb_Decoder_CheckUnlinked(mt, field, &op); + } + + return op; +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeWireValue(upb_Decoder* d, const char* ptr, + const upb_MiniTable* mt, + const upb_MiniTableField* field, + int wire_type, wireval* val, + int* op) { + static const unsigned kFixed32OkMask = (1 << kUpb_FieldType_Float) | + (1 << kUpb_FieldType_Fixed32) | + (1 << kUpb_FieldType_SFixed32); + + static const unsigned kFixed64OkMask = (1 << kUpb_FieldType_Double) | + (1 << kUpb_FieldType_Fixed64) | + (1 << kUpb_FieldType_SFixed64); + + switch (wire_type) { + case kUpb_WireType_Varint: + ptr = _upb_Decoder_DecodeVarint(d, ptr, &val->uint64_val); + *op = _upb_Decoder_GetVarintOp(field); + _upb_Decoder_Munge(field->descriptortype, val); + return ptr; + case kUpb_WireType_32Bit: + *op = kUpb_DecodeOp_Scalar4Byte; + if (((1 << field->descriptortype) & kFixed32OkMask) == 0) { + *op = kUpb_DecodeOp_UnknownField; + } + return upb_WireReader_ReadFixed32(ptr, &val->uint32_val); + case kUpb_WireType_64Bit: + *op = kUpb_DecodeOp_Scalar8Byte; + if (((1 << field->descriptortype) & kFixed64OkMask) == 0) { + *op = kUpb_DecodeOp_UnknownField; + } + return upb_WireReader_ReadFixed64(ptr, &val->uint64_val); + case kUpb_WireType_Delimited: + ptr = upb_Decoder_DecodeSize(d, ptr, &val->size); + *op = _upb_Decoder_GetDelimitedOp(mt, field); + return ptr; + case kUpb_WireType_StartGroup: + val->uint32_val = field->number; + if (field->descriptortype == kUpb_FieldType_Group) { + *op = kUpb_DecodeOp_SubMessage; + _upb_Decoder_CheckUnlinked(mt, field, op); + } else if (field->descriptortype == kUpb_FakeFieldType_MessageSetItem) { + *op = kUpb_DecodeOp_MessageSetItem; + } else { + *op = kUpb_DecodeOp_UnknownField; + } + return ptr; + default: + break; + } + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); +} + +UPB_FORCEINLINE +static const char* _upb_Decoder_DecodeKnownField( + upb_Decoder* d, const char* ptr, upb_Message* msg, + const upb_MiniTable* layout, const upb_MiniTableField* field, int op, + wireval* val) { + const upb_MiniTableSub* subs = layout->subs; + uint8_t mode = field->mode; + + if (UPB_UNLIKELY(mode & kUpb_LabelFlags_IsExtension)) { + const upb_MiniTableExtension* ext_layout = + (const upb_MiniTableExtension*)field; + upb_Message_Extension* ext = + _upb_Message_GetOrCreateExtension(msg, ext_layout, &d->arena); + if (UPB_UNLIKELY(!ext)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + d->unknown_msg = msg; + msg = &ext->data; + subs = &ext->ext->sub; + } + + switch (mode & kUpb_FieldMode_Mask) { + case kUpb_FieldMode_Array: + return _upb_Decoder_DecodeToArray(d, ptr, msg, subs, field, val, op); + case kUpb_FieldMode_Map: + return _upb_Decoder_DecodeToMap(d, ptr, msg, subs, field, val); + case kUpb_FieldMode_Scalar: + return _upb_Decoder_DecodeToSubMessage(d, ptr, msg, subs, field, val, op); + default: + UPB_UNREACHABLE(); + } +} + +static const char* _upb_Decoder_ReverseSkipVarint(const char* ptr, + uint32_t val) { + uint32_t seen = 0; + do { + ptr--; + seen <<= 7; + seen |= *ptr & 0x7f; + } while (seen != val); + return ptr; +} + +static const char* _upb_Decoder_DecodeUnknownField(upb_Decoder* d, + const char* ptr, + upb_Message* msg, + int field_number, + int wire_type, wireval val) { + if (field_number == 0) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); + + // Since unknown fields are the uncommon case, we do a little extra work here + // to walk backwards through the buffer to find the field start. This frees + // up a register in the fast paths (when the field is known), which leads to + // significant speedups in benchmarks. + const char* start = ptr; + + if (wire_type == kUpb_WireType_Delimited) ptr += val.size; + if (msg) { + switch (wire_type) { + case kUpb_WireType_Varint: + case kUpb_WireType_Delimited: + start--; + while (start[-1] & 0x80) start--; + break; + case kUpb_WireType_32Bit: + start -= 4; + break; + case kUpb_WireType_64Bit: + start -= 8; + break; + default: + break; + } + + assert(start == d->debug_valstart); + uint32_t tag = ((uint32_t)field_number << 3) | wire_type; + start = _upb_Decoder_ReverseSkipVarint(start, tag); + assert(start == d->debug_tagstart); + + if (wire_type == kUpb_WireType_StartGroup) { + d->unknown = start; + d->unknown_msg = msg; + ptr = _upb_Decoder_DecodeUnknownGroup(d, ptr, field_number); + start = d->unknown; + d->unknown = NULL; + } + if (!_upb_Message_AddUnknown(msg, start, ptr - start, &d->arena)) { + _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + } else if (wire_type == kUpb_WireType_StartGroup) { + ptr = _upb_Decoder_DecodeUnknownGroup(d, ptr, field_number); + } + return ptr; +} + +UPB_NOINLINE +static const char* _upb_Decoder_DecodeMessage(upb_Decoder* d, const char* ptr, + upb_Message* msg, + const upb_MiniTable* layout) { + int last_field_index = 0; + +#if UPB_FASTTABLE + // The first time we want to skip fast dispatch, because we may have just been + // invoked by the fast parser to handle a case that it bailed on. + if (!_upb_Decoder_IsDone(d, &ptr)) goto nofast; +#endif + + while (!_upb_Decoder_IsDone(d, &ptr)) { + uint32_t tag; + const upb_MiniTableField* field; + int field_number; + int wire_type; + wireval val; + int op; + + if (_upb_Decoder_TryFastDispatch(d, &ptr, msg, layout)) break; + +#if UPB_FASTTABLE + nofast: +#endif + +#ifndef NDEBUG + d->debug_tagstart = ptr; +#endif + + UPB_ASSERT(ptr < d->input.limit_ptr); + ptr = _upb_Decoder_DecodeTag(d, ptr, &tag); + field_number = tag >> 3; + wire_type = tag & 7; + +#ifndef NDEBUG + d->debug_valstart = ptr; +#endif + + if (wire_type == kUpb_WireType_EndGroup) { + d->end_group = field_number; + return ptr; + } + + field = _upb_Decoder_FindField(d, layout, field_number, &last_field_index); + ptr = _upb_Decoder_DecodeWireValue(d, ptr, layout, field, wire_type, &val, + &op); + + if (op >= 0) { + ptr = _upb_Decoder_DecodeKnownField(d, ptr, msg, layout, field, op, &val); + } else { + switch (op) { + case kUpb_DecodeOp_UnknownField: + ptr = _upb_Decoder_DecodeUnknownField(d, ptr, msg, field_number, + wire_type, val); + break; + case kUpb_DecodeOp_MessageSetItem: + ptr = upb_Decoder_DecodeMessageSetItem(d, ptr, msg, layout); + break; + } + } + } + + return UPB_UNLIKELY(layout && layout->required_count) + ? _upb_Decoder_CheckRequired(d, ptr, msg, layout) + : ptr; +} + +const char* _upb_FastDecoder_DecodeGeneric(struct upb_Decoder* d, + const char* ptr, upb_Message* msg, + intptr_t table, uint64_t hasbits, + uint64_t data) { + (void)data; + *(uint32_t*)msg |= hasbits; + return _upb_Decoder_DecodeMessage(d, ptr, msg, decode_totablep(table)); +} + +static upb_DecodeStatus _upb_Decoder_DecodeTop(struct upb_Decoder* d, + const char* buf, void* msg, + const upb_MiniTable* l) { + if (!_upb_Decoder_TryFastDispatch(d, &buf, msg, l)) { + _upb_Decoder_DecodeMessage(d, buf, msg, l); + } + if (d->end_group != DECODE_NOGROUP) return kUpb_DecodeStatus_Malformed; + if (d->missing_required) return kUpb_DecodeStatus_MissingRequired; + return kUpb_DecodeStatus_Ok; +} + +UPB_NOINLINE +const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e, + const char* ptr, int overrun) { + return _upb_EpsCopyInputStream_IsDoneFallbackInline( + e, ptr, overrun, _upb_Decoder_BufferFlipCallback); +} + +static upb_DecodeStatus upb_Decoder_Decode(upb_Decoder* const decoder, + const char* const buf, + void* const msg, + const upb_MiniTable* const l, + upb_Arena* const arena) { + if (UPB_SETJMP(decoder->err) == 0) { + decoder->status = _upb_Decoder_DecodeTop(decoder, buf, msg, l); + } else { + UPB_ASSERT(decoder->status != kUpb_DecodeStatus_Ok); + } + + arena->head.ptr = decoder->arena.head.ptr; + arena->head.end = decoder->arena.head.end; + arena->cleanup_metadata = decoder->arena.cleanup_metadata; + return decoder->status; +} + +upb_DecodeStatus upb_Decode(const char* buf, size_t size, void* msg, + const upb_MiniTable* l, + const upb_ExtensionRegistry* extreg, int options, + upb_Arena* arena) { + upb_Decoder state; + unsigned depth = (unsigned)options >> 16; + + upb_EpsCopyInputStream_Init(&state.input, &buf, size, + options & kUpb_DecodeOption_AliasString); + + state.extreg = extreg; + state.unknown = NULL; + state.depth = depth ? depth : 64; + state.end_group = DECODE_NOGROUP; + state.options = (uint16_t)options; + state.missing_required = false; + state.arena.head = arena->head; + state.arena.last_size = arena->last_size; + state.arena.cleanup_metadata = arena->cleanup_metadata; + state.arena.parent = arena; + state.status = kUpb_DecodeStatus_Ok; + + return upb_Decoder_Decode(&state, buf, msg, l, arena); +} + +#undef OP_FIXPCK_LG2 +#undef OP_VARPCK_LG2 diff --git a/third_party/upb/upb/wire/decode.h b/third_party/upb/upb/wire/decode.h new file mode 100644 index 00000000000..e4423598d41 --- /dev/null +++ b/third_party/upb/upb/wire/decode.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// upb_decode: parsing into a upb_Message using a upb_MiniTable. + +#ifndef UPB_WIRE_DECODE_H_ +#define UPB_WIRE_DECODE_H_ + +#include "upb/mem/arena.h" +#include "upb/message/message.h" +#include "upb/mini_table/extension_registry.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + /* If set, strings will alias the input buffer instead of copying into the + * arena. */ + kUpb_DecodeOption_AliasString = 1, + + /* If set, the parse will return failure if any message is missing any + * required fields when the message data ends. The parse will still continue, + * and the failure will only be reported at the end. + * + * IMPORTANT CAVEATS: + * + * 1. This can throw a false positive failure if an incomplete message is seen + * on the wire but is later completed when the sub-message occurs again. + * For this reason, a second pass is required to verify a failure, to be + * truly robust. + * + * 2. This can return a false success if you are decoding into a message that + * already has some sub-message fields present. If the sub-message does + * not occur in the binary payload, we will never visit it and discover the + * incomplete sub-message. For this reason, this check is only useful for + * implemting ParseFromString() semantics. For MergeFromString(), a + * post-parse validation step will always be necessary. */ + kUpb_DecodeOption_CheckRequired = 2, +}; + +#define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16) + +typedef enum { + kUpb_DecodeStatus_Ok = 0, + kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt + kUpb_DecodeStatus_OutOfMemory = 2, // Arena alloc failed + kUpb_DecodeStatus_BadUtf8 = 3, // String field had bad UTF-8 + kUpb_DecodeStatus_MaxDepthExceeded = 4, // Exceeded UPB_DECODE_MAXDEPTH + + // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise + // succeeded. + kUpb_DecodeStatus_MissingRequired = 5, +} upb_DecodeStatus; + +UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size, + upb_Message* msg, const upb_MiniTable* l, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_WIRE_DECODE_H_ */ diff --git a/third_party/upb/upb/decode_fast.c b/third_party/upb/upb/wire/decode_fast.c similarity index 87% rename from third_party/upb/upb/decode_fast.c rename to third_party/upb/upb/wire/decode_fast.c index a02ad0948fc..6b048a0937f 100644 --- a/third_party/upb/upb/decode_fast.c +++ b/third_party/upb/upb/wire/decode_fast.c @@ -35,12 +35,13 @@ // field type (eg. oneof boolean field with a 1 byte tag) and then dispatch // to the specialized function as quickly as possible. -#include "upb/decode_fast.h" +#include "upb/wire/decode_fast.h" -#include "upb/internal/decode.h" +#include "upb/collections/array_internal.h" +#include "upb/wire/decode_internal.h" -/* Must be last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #if UPB_FASTTABLE @@ -56,7 +57,7 @@ /* Uncomment either of these for debugging purposes. */ \ /* fprintf(stderr, m); */ \ /*__builtin_trap(); */ \ - return fastdecode_generic(d, ptr, msg, table, hasbits, 0); + return _upb_FastDecoder_DecodeGeneric(d, ptr, msg, table, hasbits, 0); typedef enum { CARD_s = 0, /* Singular (optional, non-repeated) */ @@ -68,35 +69,32 @@ typedef enum { UPB_NOINLINE static const char* fastdecode_isdonefallback(UPB_PARSE_PARAMS) { int overrun = data; - int status; - ptr = decode_isdonefallback_inl(d, ptr, overrun, &status); - if (ptr == NULL) { - return fastdecode_err(d, status); - } - data = fastdecode_loadtag(ptr); - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); + ptr = _upb_EpsCopyInputStream_IsDoneFallbackInline( + &d->input, ptr, overrun, _upb_Decoder_BufferFlipCallback); + data = _upb_FastDecoder_LoadTag(ptr); + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); } UPB_FORCEINLINE static const char* fastdecode_dispatch(UPB_PARSE_PARAMS) { - if (UPB_UNLIKELY(ptr >= d->limit_ptr)) { - int overrun = ptr - d->end; - if (UPB_LIKELY(overrun == d->limit)) { - // Parse is finished. + int overrun; + switch (upb_EpsCopyInputStream_IsDoneStatus(&d->input, ptr, &overrun)) { + case kUpb_IsDoneStatus_Done: *(uint32_t*)msg |= hasbits; // Sync hasbits. const upb_MiniTable* l = decode_totablep(table); return UPB_UNLIKELY(l->required_count) - ? decode_checkrequired(d, ptr, msg, l) + ? _upb_Decoder_CheckRequired(d, ptr, msg, l) : ptr; - } else { + case kUpb_IsDoneStatus_NotDone: + break; + case kUpb_IsDoneStatus_NeedFallback: data = overrun; UPB_MUSTTAIL return fastdecode_isdonefallback(UPB_PARSE_ARGS); - } } // Read two bytes of tag data (for a one-byte tag, the high byte is junk). - data = fastdecode_loadtag(ptr); - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); + data = _upb_FastDecoder_LoadTag(ptr); + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); } UPB_FORCEINLINE @@ -129,37 +127,17 @@ static const char* fastdecode_longsize(const char* ptr, int* size) { } UPB_FORCEINLINE -static bool fastdecode_boundscheck(const char* ptr, size_t len, - const char* end) { - uintptr_t uptr = (uintptr_t)ptr; - uintptr_t uend = (uintptr_t)end + 16; - uintptr_t res = uptr + len; - return res < uptr || res > uend; -} - -UPB_FORCEINLINE -static bool fastdecode_boundscheck2(const char* ptr, size_t len, - const char* end) { - // This is one extra branch compared to the more normal: - // return (size_t)(end - ptr) < size; - // However it is one less computation if we are just about to use "ptr + len": - // https://godbolt.org/z/35YGPz - // In microbenchmarks this shows an overall 4% improvement. - uintptr_t uptr = (uintptr_t)ptr; - uintptr_t uend = (uintptr_t)end; - uintptr_t res = uptr + len; - return res < uptr || res > uend; -} - -typedef const char* fastdecode_delimfunc(upb_Decoder* d, const char* ptr, - void* ctx); - -UPB_FORCEINLINE -static const char* fastdecode_delimited(upb_Decoder* d, const char* ptr, - fastdecode_delimfunc* func, void* ctx) { +static const char* fastdecode_delimited( + upb_Decoder* d, const char* ptr, + upb_EpsCopyInputStream_ParseDelimitedFunc* func, void* ctx) { ptr++; + + // Sign-extend so varint greater than one byte becomes negative, causing + // fast delimited parse to fail. int len = (int8_t)ptr[-1]; - if (fastdecode_boundscheck2(ptr, len, d->limit_ptr)) { + + if (!upb_EpsCopyInputStream_TryParseDelimitedFast(&d->input, &ptr, len, func, + ctx)) { // Slow case: Sub-message is >=128 bytes and/or exceeds the current buffer. // If it exceeds the buffer limit, limit/limit_ptr will change during // sub-message parsing, so we need to preserve delta, not limit. @@ -171,25 +149,13 @@ static const char* fastdecode_delimited(upb_Decoder* d, const char* ptr, return NULL; } } - if (ptr - d->end + (int)len > d->limit) { + if (!upb_EpsCopyInputStream_CheckSize(&d->input, ptr, len)) { // Corrupt wire format: invalid limit. return NULL; } - int delta = decode_pushlimit(d, ptr, len); - ptr = func(d, ptr, ctx); - decode_poplimit(d, ptr, delta); - } else { - // Fast case: Sub-message is <128 bytes and fits in the current buffer. - // This means we can preserve limit/limit_ptr verbatim. - const char* saved_limit_ptr = d->limit_ptr; - int saved_limit = d->limit; - d->limit_ptr = ptr + len; - d->limit = d->limit_ptr - d->end; - UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit)); - ptr = func(d, ptr, ctx); - d->limit_ptr = saved_limit_ptr; - d->limit = saved_limit; - UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit)); + int delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, len); + ptr = func(&d->input, ptr, ctx); + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, delta); } return ptr; } @@ -217,14 +183,14 @@ UPB_FORCEINLINE static void* fastdecode_resizearr(upb_Decoder* d, void* dst, fastdecode_arr* farr, int valbytes) { if (UPB_UNLIKELY(dst == farr->end)) { - size_t old_size = farr->arr->size; + size_t old_size = farr->arr->capacity; size_t old_bytes = old_size * valbytes; size_t new_size = old_size * 2; size_t new_bytes = new_size * valbytes; char* old_ptr = _upb_array_ptr(farr->arr); char* new_ptr = upb_Arena_Realloc(&d->arena, old_ptr, old_bytes, new_bytes); uint8_t elem_size_lg2 = __builtin_ctz(valbytes); - farr->arr->size = new_size; + farr->arr->capacity = new_size; farr->arr->data = _upb_array_tagptr(new_ptr, elem_size_lg2); dst = (void*)(new_ptr + (old_size * valbytes)); farr->end = (void*)(new_ptr + (new_size * valbytes)); @@ -244,7 +210,7 @@ static bool fastdecode_tagmatch(uint32_t tag, uint64_t data, int tagbytes) { UPB_FORCEINLINE static void fastdecode_commitarr(void* dst, fastdecode_arr* farr, int valbytes) { - farr->arr->len = + farr->arr->size = (size_t)((char*)dst - (char*)_upb_array_ptr(farr->arr)) / valbytes; } @@ -257,8 +223,8 @@ static fastdecode_nextret fastdecode_nextrepeated(upb_Decoder* d, void* dst, fastdecode_nextret ret; dst = (char*)dst + valbytes; - if (UPB_LIKELY(!decode_isdone(d, ptr))) { - ret.tag = fastdecode_loadtag(*ptr); + if (UPB_LIKELY(!_upb_Decoder_IsDone(d, ptr))) { + ret.tag = _upb_FastDecoder_LoadTag(*ptr); if (fastdecode_tagmatch(ret.tag, data, tagbytes)) { ret.next = FD_NEXT_SAMEFIELD; } else { @@ -313,9 +279,9 @@ static void* fastdecode_getfield(upb_Decoder* d, const char* ptr, farr->arr = *arr_p; } begin = _upb_array_ptr(farr->arr); - farr->end = begin + (farr->arr->size * valbytes); - *data = fastdecode_loadtag(ptr); - return begin + (farr->arr->len * valbytes); + farr->end = begin + (farr->arr->capacity * valbytes); + *data = _upb_FastDecoder_LoadTag(ptr); + return begin + (farr->arr->size * valbytes); } default: UPB_UNREACHABLE(); @@ -401,7 +367,7 @@ done: \ ptr += tagbytes; \ ptr = fastdecode_varint64(ptr, &val); \ - if (ptr == NULL) return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \ + if (ptr == NULL) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \ val = fastdecode_munge(val, valbytes, zigzag); \ memcpy(dst, &val, valbytes); \ \ @@ -414,7 +380,7 @@ done: goto again; \ case FD_NEXT_OTHERFIELD: \ data = ret.tag; \ - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \ + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \ case FD_NEXT_ATLIMIT: \ return ptr; \ } \ @@ -430,13 +396,14 @@ typedef struct { } fastdecode_varintdata; UPB_FORCEINLINE -static const char* fastdecode_topackedvarint(upb_Decoder* d, const char* ptr, - void* ctx) { +static const char* fastdecode_topackedvarint(upb_EpsCopyInputStream* e, + const char* ptr, void* ctx) { + upb_Decoder* d = (upb_Decoder*)e; fastdecode_varintdata* data = ctx; void* dst = data->dst; uint64_t val; - while (!decode_isdone(d, &ptr)) { + while (!_upb_Decoder_IsDone(d, &ptr)) { dst = fastdecode_resizearr(d, dst, &data->farr, data->valbytes); ptr = fastdecode_varint64(ptr, &val); if (ptr == NULL) return NULL; @@ -465,7 +432,7 @@ static const char* fastdecode_topackedvarint(upb_Decoder* d, const char* ptr, ptr = fastdecode_delimited(d, ptr, &fastdecode_topackedvarint, &ctx); \ \ if (UPB_UNLIKELY(ptr == NULL)) { \ - return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \ } \ \ UPB_MUSTTAIL return fastdecode_dispatch(d, ptr, msg, table, hasbits, 0); @@ -560,7 +527,7 @@ TAGBYTES(p) goto again; \ case FD_NEXT_OTHERFIELD: \ data = ret.tag; \ - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \ + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \ case FD_NEXT_ATLIMIT: \ return ptr; \ } \ @@ -579,9 +546,10 @@ TAGBYTES(p) ptr = fastdecode_longsize(ptr, &size); \ } \ \ - if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr) || \ + if (UPB_UNLIKELY(!upb_EpsCopyInputStream_CheckDataSizeAvailable( \ + &d->input, ptr, size) || \ (size % valbytes) != 0)) { \ - return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \ } \ \ upb_Array** arr_p = fastdecode_fieldmem(msg, data); \ @@ -592,15 +560,15 @@ TAGBYTES(p) if (UPB_LIKELY(!arr)) { \ *arr_p = arr = _upb_Array_New(&d->arena, elems, elem_size_lg2); \ if (!arr) { \ - return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \ } \ } else { \ - _upb_Array_Resize(arr, elems, &d->arena); \ + _upb_Array_ResizeUninitialized(arr, elems, &d->arena); \ } \ \ char* dst = _upb_array_ptr(arr); \ memcpy(dst, ptr, size); \ - arr->len = elems; \ + arr->size = elems; \ \ ptr += size; \ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); @@ -658,8 +626,8 @@ static const char* fastdecode_verifyutf8(upb_Decoder* d, const char* ptr, upb_Message* msg, intptr_t table, uint64_t hasbits, uint64_t data) { upb_StringView* dst = (upb_StringView*)data; - if (!decode_verifyutf8_inl(dst->data, dst->size)) { - return fastdecode_err(d, kUpb_DecodeStatus_BadUtf8); + if (!_upb_Decoder_VerifyUtf8Inline(dst->data, dst->size)) { + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8); } UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); } @@ -671,25 +639,17 @@ static const char* fastdecode_verifyutf8(upb_Decoder* d, const char* ptr, ptr = fastdecode_longsize(ptr, &size); \ } \ \ - if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr))) { \ + if (UPB_UNLIKELY(!upb_EpsCopyInputStream_CheckSize(&d->input, ptr, size))) { \ dst->size = 0; \ - return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \ } \ \ - if (d->options & kUpb_DecodeOption_AliasString) { \ - dst->data = ptr; \ - dst->size = size; \ - } else { \ - char* data = upb_Arena_Malloc(&d->arena, size); \ - if (!data) { \ - return fastdecode_err(d, kUpb_DecodeStatus_OutOfMemory); \ - } \ - memcpy(data, ptr, size); \ - dst->data = data; \ - dst->size = size; \ - } \ + const char* s_ptr = ptr; \ + ptr = upb_EpsCopyInputStream_ReadString(&d->input, &s_ptr, size, &d->arena); \ + if (!ptr) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); \ + dst->data = s_ptr; \ + dst->size = size; \ \ - ptr += size; \ if (validate_utf8) { \ data = (uint64_t)dst; \ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \ @@ -724,105 +684,17 @@ static void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size, UPB_POISON_MEMORY_REGION(data + size, copy - size); } -#define FASTDECODE_COPYSTRING(d, ptr, msg, table, hasbits, data, tagbytes, \ - card, validate_utf8) \ - upb_StringView* dst; \ - fastdecode_arr farr; \ - int64_t size; \ - size_t arena_has; \ - size_t common_has; \ - char* buf; \ - \ - UPB_ASSERT((d->options & kUpb_DecodeOption_AliasString) == 0); \ - UPB_ASSERT(fastdecode_checktag(data, tagbytes)); \ - \ - dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \ - sizeof(upb_StringView), card); \ - \ - again: \ - if (card == CARD_r) { \ - dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \ - } \ - \ - size = (uint8_t)ptr[tagbytes]; \ - ptr += tagbytes + 1; \ - dst->size = size; \ - \ - buf = d->arena.head.ptr; \ - arena_has = _upb_ArenaHas(&d->arena); \ - common_has = UPB_MIN(arena_has, (d->end - ptr) + 16); \ - \ - if (UPB_LIKELY(size <= 15 - tagbytes)) { \ - if (arena_has < 16) goto longstr; \ - d->arena.head.ptr += 16; \ - memcpy(buf, ptr - tagbytes - 1, 16); \ - dst->data = buf + tagbytes + 1; \ - } else if (UPB_LIKELY(size <= 32)) { \ - if (UPB_UNLIKELY(common_has < 32)) goto longstr; \ - fastdecode_docopy(d, ptr, size, 32, buf, dst); \ - } else if (UPB_LIKELY(size <= 64)) { \ - if (UPB_UNLIKELY(common_has < 64)) goto longstr; \ - fastdecode_docopy(d, ptr, size, 64, buf, dst); \ - } else if (UPB_LIKELY(size < 128)) { \ - if (UPB_UNLIKELY(common_has < 128)) goto longstr; \ - fastdecode_docopy(d, ptr, size, 128, buf, dst); \ - } else { \ - goto longstr; \ - } \ - \ - ptr += size; \ - \ - if (card == CARD_r) { \ - if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) { \ - return fastdecode_err(d, kUpb_DecodeStatus_BadUtf8); \ - } \ - fastdecode_nextret ret = fastdecode_nextrepeated( \ - d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \ - switch (ret.next) { \ - case FD_NEXT_SAMEFIELD: \ - dst = ret.dst; \ - goto again; \ - case FD_NEXT_OTHERFIELD: \ - data = ret.tag; \ - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \ - case FD_NEXT_ATLIMIT: \ - return ptr; \ - } \ - } \ - \ - if (card != CARD_r && validate_utf8) { \ - data = (uint64_t)dst; \ - UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \ - } \ - \ - UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \ - \ - longstr: \ - if (card == CARD_r) { \ - fastdecode_commitarr(dst + 1, &farr, sizeof(upb_StringView)); \ - } \ - ptr--; \ - if (validate_utf8) { \ - UPB_MUSTTAIL return fastdecode_longstring_utf8(d, ptr, msg, table, \ - hasbits, (uint64_t)dst); \ - } else { \ - UPB_MUSTTAIL return fastdecode_longstring_noutf8(d, ptr, msg, table, \ - hasbits, (uint64_t)dst); \ - } - -#define FASTDECODE_STRING(d, ptr, msg, table, hasbits, data, tagbytes, card, \ - copyfunc, validate_utf8) \ +#define FASTDECODE_COPYSTRING(d, ptr, msg, table, hasbits, data, tagbytes, \ + card, validate_utf8) \ upb_StringView* dst; \ fastdecode_arr farr; \ int64_t size; \ + size_t arena_has; \ + size_t common_has; \ + char* buf; \ \ - if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \ - RETURN_GENERIC("string field tag mismatch\n"); \ - } \ - \ - if (UPB_UNLIKELY((d->options & kUpb_DecodeOption_AliasString) == 0)) { \ - UPB_MUSTTAIL return copyfunc(UPB_PARSE_ARGS); \ - } \ + UPB_ASSERT(!upb_EpsCopyInputStream_AliasingAvailable(&d->input, ptr, 0)); \ + UPB_ASSERT(fastdecode_checktag(data, tagbytes)); \ \ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \ sizeof(upb_StringView), card); \ @@ -832,45 +704,49 @@ static void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size, dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \ } \ \ - size = (int8_t)ptr[tagbytes]; \ + size = (uint8_t)ptr[tagbytes]; \ ptr += tagbytes + 1; \ - dst->data = ptr; \ dst->size = size; \ \ - if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->end))) { \ - ptr--; \ - if (validate_utf8) { \ - return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, \ - (uint64_t)dst); \ - } else { \ - return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, \ - (uint64_t)dst); \ - } \ + buf = d->arena.head.ptr; \ + arena_has = _upb_ArenaHas(&d->arena); \ + common_has = UPB_MIN(arena_has, \ + upb_EpsCopyInputStream_BytesAvailable(&d->input, ptr)); \ + \ + if (UPB_LIKELY(size <= 15 - tagbytes)) { \ + if (arena_has < 16) goto longstr; \ + d->arena.head.ptr += 16; \ + memcpy(buf, ptr - tagbytes - 1, 16); \ + dst->data = buf + tagbytes + 1; \ + } else if (UPB_LIKELY(size <= 32)) { \ + if (UPB_UNLIKELY(common_has < 32)) goto longstr; \ + fastdecode_docopy(d, ptr, size, 32, buf, dst); \ + } else if (UPB_LIKELY(size <= 64)) { \ + if (UPB_UNLIKELY(common_has < 64)) goto longstr; \ + fastdecode_docopy(d, ptr, size, 64, buf, dst); \ + } else if (UPB_LIKELY(size < 128)) { \ + if (UPB_UNLIKELY(common_has < 128)) goto longstr; \ + fastdecode_docopy(d, ptr, size, 128, buf, dst); \ + } else { \ + goto longstr; \ } \ \ ptr += size; \ \ if (card == CARD_r) { \ - if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) { \ - return fastdecode_err(d, kUpb_DecodeStatus_BadUtf8); \ + if (validate_utf8 && \ + !_upb_Decoder_VerifyUtf8Inline(dst->data, dst->size)) { \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8); \ } \ fastdecode_nextret ret = fastdecode_nextrepeated( \ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \ switch (ret.next) { \ case FD_NEXT_SAMEFIELD: \ dst = ret.dst; \ - if (UPB_UNLIKELY((d->options & kUpb_DecodeOption_AliasString) == 0)) { \ - /* Buffer flipped and we can't alias any more. Bounce to */ \ - /* copyfunc(), but via dispatch since we need to reload table */ \ - /* data also. */ \ - fastdecode_commitarr(dst, &farr, sizeof(upb_StringView)); \ - data = ret.tag; \ - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \ - } \ goto again; \ case FD_NEXT_OTHERFIELD: \ data = ret.tag; \ - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \ + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \ case FD_NEXT_ATLIMIT: \ return ptr; \ } \ @@ -881,6 +757,88 @@ static void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size, UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \ } \ \ + UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \ + \ + longstr: \ + if (card == CARD_r) { \ + fastdecode_commitarr(dst + 1, &farr, sizeof(upb_StringView)); \ + } \ + ptr--; \ + if (validate_utf8) { \ + UPB_MUSTTAIL return fastdecode_longstring_utf8(d, ptr, msg, table, \ + hasbits, (uint64_t)dst); \ + } else { \ + UPB_MUSTTAIL return fastdecode_longstring_noutf8(d, ptr, msg, table, \ + hasbits, (uint64_t)dst); \ + } + +#define FASTDECODE_STRING(d, ptr, msg, table, hasbits, data, tagbytes, card, \ + copyfunc, validate_utf8) \ + upb_StringView* dst; \ + fastdecode_arr farr; \ + int64_t size; \ + \ + if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \ + RETURN_GENERIC("string field tag mismatch\n"); \ + } \ + \ + if (UPB_UNLIKELY( \ + !upb_EpsCopyInputStream_AliasingAvailable(&d->input, ptr, 0))) { \ + UPB_MUSTTAIL return copyfunc(UPB_PARSE_ARGS); \ + } \ + \ + dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \ + sizeof(upb_StringView), card); \ + \ + again: \ + if (card == CARD_r) { \ + dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \ + } \ + \ + size = (int8_t)ptr[tagbytes]; \ + ptr += tagbytes + 1; \ + \ + if (UPB_UNLIKELY( \ + !upb_EpsCopyInputStream_AliasingAvailable(&d->input, ptr, size))) { \ + ptr--; \ + if (validate_utf8) { \ + return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, \ + (uint64_t)dst); \ + } else { \ + return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, \ + (uint64_t)dst); \ + } \ + } \ + \ + dst->data = ptr; \ + dst->size = size; \ + ptr = upb_EpsCopyInputStream_ReadStringAliased(&d->input, &dst->data, \ + dst->size); \ + \ + if (card == CARD_r) { \ + if (validate_utf8 && \ + !_upb_Decoder_VerifyUtf8Inline(dst->data, dst->size)) { \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8); \ + } \ + fastdecode_nextret ret = fastdecode_nextrepeated( \ + d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \ + switch (ret.next) { \ + case FD_NEXT_SAMEFIELD: \ + dst = ret.dst; \ + goto again; \ + case FD_NEXT_OTHERFIELD: \ + data = ret.tag; \ + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \ + case FD_NEXT_ATLIMIT: \ + return ptr; \ + } \ + } \ + \ + if (card != CARD_r && validate_utf8) { \ + data = (uint64_t)dst; \ + UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \ + } \ + \ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); /* Generate all combinations: @@ -949,8 +907,9 @@ typedef struct { } fastdecode_submsgdata; UPB_FORCEINLINE -static const char* fastdecode_tosubmsg(upb_Decoder* d, const char* ptr, - void* ctx) { +static const char* fastdecode_tosubmsg(upb_EpsCopyInputStream* e, + const char* ptr, void* ctx) { + upb_Decoder* d = (upb_Decoder*)e; fastdecode_submsgdata* submsg = ctx; ptr = fastdecode_dispatch(d, ptr, submsg->msg, submsg->table, 0, 0); UPB_ASSUME(ptr != NULL); @@ -965,7 +924,7 @@ static const char* fastdecode_tosubmsg(upb_Decoder* d, const char* ptr, } \ \ if (--d->depth == 0) { \ - return fastdecode_err(d, kUpb_DecodeStatus_MaxDepthExceeded); \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_MaxDepthExceeded); \ } \ \ upb_Message** dst; \ @@ -1002,7 +961,7 @@ static const char* fastdecode_tosubmsg(upb_Decoder* d, const char* ptr, ptr = fastdecode_delimited(d, ptr, fastdecode_tosubmsg, &submsg); \ \ if (UPB_UNLIKELY(ptr == NULL || d->end_group != DECODE_NOGROUP)) { \ - return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \ + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \ } \ \ if (card == CARD_r) { \ @@ -1015,7 +974,7 @@ static const char* fastdecode_tosubmsg(upb_Decoder* d, const char* ptr, case FD_NEXT_OTHERFIELD: \ d->depth++; \ data = ret.tag; \ - UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \ + UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \ case FD_NEXT_ATLIMIT: \ d->depth++; \ return ptr; \ diff --git a/third_party/upb/upb/wire/decode_fast.h b/third_party/upb/upb/wire/decode_fast.h new file mode 100644 index 00000000000..da606a832ae --- /dev/null +++ b/third_party/upb/upb/wire/decode_fast.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// These are the specialized field parser functions for the fast parser. +// Generated tables will refer to these by name. +// +// The function names are encoded with names like: +// +// // 123 4 +// upb_pss_1bt(); // Parse singular string, 1 byte tag. +// +// In position 1: +// - 'p' for parse, most function use this +// - 'c' for copy, for when we are copying strings instead of aliasing +// +// In position 2 (cardinality): +// - 's' for singular, with or without hasbit +// - 'o' for oneof +// - 'r' for non-packed repeated +// - 'p' for packed repeated +// +// In position 3 (type): +// - 'b1' for bool +// - 'v4' for 4-byte varint +// - 'v8' for 8-byte varint +// - 'z4' for zig-zag-encoded 4-byte varint +// - 'z8' for zig-zag-encoded 8-byte varint +// - 'f4' for 4-byte fixed +// - 'f8' for 8-byte fixed +// - 'm' for sub-message +// - 's' for string (validate UTF-8) +// - 'b' for bytes +// +// In position 4 (tag length): +// - '1' for one-byte tags (field numbers 1-15) +// - '2' for two-byte tags (field numbers 16-2048) + +#ifndef UPB_WIRE_DECODE_FAST_H_ +#define UPB_WIRE_DECODE_FAST_H_ + +#include "upb/message/message.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +struct upb_Decoder; + +// The fallback, generic parsing function that can handle any field type. +// This just uses the regular (non-fast) parser to parse a single field. +const char* _upb_FastDecoder_DecodeGeneric(struct upb_Decoder* d, + const char* ptr, upb_Message* msg, + intptr_t table, uint64_t hasbits, + uint64_t data); + +#define UPB_PARSE_PARAMS \ + struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \ + uint64_t hasbits, uint64_t data + +/* primitive fields ***********************************************************/ + +#define F(card, type, valbytes, tagbytes) \ + const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS); + +#define TYPES(card, tagbytes) \ + F(card, b, 1, tagbytes) \ + F(card, v, 4, tagbytes) \ + F(card, v, 8, tagbytes) \ + F(card, z, 4, tagbytes) \ + F(card, z, 8, tagbytes) \ + F(card, f, 4, tagbytes) \ + F(card, f, 8, tagbytes) + +#define TAGBYTES(card) \ + TYPES(card, 1) \ + TYPES(card, 2) + +TAGBYTES(s) +TAGBYTES(o) +TAGBYTES(r) +TAGBYTES(p) + +#undef F +#undef TYPES +#undef TAGBYTES + +/* string fields **************************************************************/ + +#define F(card, tagbytes, type) \ + const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \ + const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); + +#define UTF8(card, tagbytes) \ + F(card, tagbytes, s) \ + F(card, tagbytes, b) + +#define TAGBYTES(card) \ + UTF8(card, 1) \ + UTF8(card, 2) + +TAGBYTES(s) +TAGBYTES(o) +TAGBYTES(r) + +#undef F +#undef TAGBYTES + +/* sub-message fields *********************************************************/ + +#define F(card, tagbytes, size_ceil, ceil_arg) \ + const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS); + +#define SIZES(card, tagbytes) \ + F(card, tagbytes, 64, 64) \ + F(card, tagbytes, 128, 128) \ + F(card, tagbytes, 192, 192) \ + F(card, tagbytes, 256, 256) \ + F(card, tagbytes, max, -1) + +#define TAGBYTES(card) \ + SIZES(card, 1) \ + SIZES(card, 2) + +TAGBYTES(s) +TAGBYTES(o) +TAGBYTES(r) + +#undef TAGBYTES +#undef SIZES +#undef F + +#undef UPB_PARSE_PARAMS + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_WIRE_DECODE_FAST_H_ */ diff --git a/third_party/upb/upb/internal/decode.h b/third_party/upb/upb/wire/decode_internal.h similarity index 51% rename from third_party/upb/upb/internal/decode.h rename to third_party/upb/upb/wire/decode_internal.h index 708874c9c73..68677363978 100644 --- a/third_party/upb/upb/internal/decode.h +++ b/third_party/upb/upb/wire/decode_internal.h @@ -30,35 +30,31 @@ * decode.c and decode_fast.c. */ -#ifndef UPB_INTERNAL_DECODE_H_ -#define UPB_INTERNAL_DECODE_H_ +#ifndef UPB_WIRE_DECODE_INTERNAL_H_ +#define UPB_WIRE_DECODE_INTERNAL_H_ -#include +#include "upb/mem/arena_internal.h" +#include "upb/message/internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "utf8_range.h" -#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" +// 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 */ + upb_EpsCopyInputStream input; + const upb_ExtensionRegistry* extreg; + const char* unknown; // Start of unknown data, preserve at buffer flip + upb_Message* unknown_msg; // Pointer to preserve data to + 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; + upb_DecodeStatus status; jmp_buf err; #ifndef NDEBUG @@ -74,12 +70,12 @@ typedef struct upb_Decoder { * 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); +const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status); extern const uint8_t upb_utf8_offsets[]; UPB_INLINE -bool decode_verifyutf8_inl(const char* ptr, int len) { +bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) { const char* end = ptr + len; // Check 8 bytes at a time for any non-ASCII char. @@ -102,9 +98,9 @@ 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); +const char* _upb_Decoder_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. */ @@ -116,55 +112,34 @@ 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* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e, + const char* ptr, int overrun); + +UPB_INLINE bool _upb_Decoder_IsDone(upb_Decoder* d, const char** ptr) { + return upb_EpsCopyInputStream_IsDoneWithCallback( + &d->input, ptr, &_upb_Decoder_IsDoneFallback); } -const char* decode_isdonefallback(upb_Decoder* d, const char* ptr, int overrun); +UPB_INLINE const char* _upb_Decoder_BufferFlipCallback( + upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) { + upb_Decoder* d = (upb_Decoder*)e; + if (!old_end) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); -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 (d->unknown) { + if (!_upb_Message_AddUnknown(d->unknown_msg, d->unknown, + old_end - d->unknown, &d->arena)) { + _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); + } + d->unknown = new_start; } + return new_start; } #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 char* _upb_FastDecoder_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; @@ -177,35 +152,12 @@ const char* fastdecode_tagdispatch(upb_Decoder* d, const char* ptr, } #endif -UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) { +UPB_INLINE uint32_t _upb_FastDecoder_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)); -} +#include "upb/port/undef.inc" -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_ */ +#endif /* UPB_WIRE_DECODE_INTERNAL_H_ */ diff --git a/third_party/upb/upb/encode.c b/third_party/upb/upb/wire/encode.c similarity index 80% rename from third_party/upb/upb/encode.c rename to third_party/upb/upb/wire/encode.c index 048ecd2396a..ef3b4adadf0 100644 --- a/third_party/upb/upb/encode.c +++ b/third_party/upb/upb/wire/encode.c @@ -25,19 +25,22 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* We encode backwards, to avoid pre-computing lengths (one-pass encode). */ +// We encode backwards, to avoid pre-computing lengths (one-pass encode). -#include "upb/encode.h" +#include "upb/wire/encode.h" -#include #include -#include "upb/extension_registry.h" -#include "upb/msg_internal.h" -#include "upb/upb.h" +#include "upb/collections/array_internal.h" +#include "upb/collections/map_sorter_internal.h" +#include "upb/message/extension_internal.h" +#include "upb/mini_table/sub_internal.h" +#include "upb/wire/common_internal.h" +#include "upb/wire/swap_internal.h" +#include "upb/wire/types.h" -/* Must be last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" #define UPB_PB_VARINT_MAX_LEN 10 @@ -61,8 +64,9 @@ static uint64_t encode_zz64(int64_t n) { } typedef struct { + upb_EncodeStatus status; jmp_buf err; - upb_alloc* alloc; + upb_Arena* arena; char *buf, *ptr, *limit; int options; int depth; @@ -78,18 +82,22 @@ static size_t upb_roundup_pow2(size_t bytes) { } UPB_NORETURN static void encode_err(upb_encstate* e, upb_EncodeStatus s) { - UPB_LONGJMP(e->err, s); + UPB_ASSERT(s != kUpb_EncodeStatus_Ok); + e->status = s; + UPB_LONGJMP(e->err, 1); } UPB_NOINLINE static void encode_growbuffer(upb_encstate* e, size_t bytes) { size_t old_size = e->limit - e->buf; size_t new_size = upb_roundup_pow2(bytes + (e->limit - e->ptr)); - char* new_buf = upb_realloc(e->alloc, e->buf, old_size, new_size); + char* new_buf = upb_Arena_Realloc(e->arena, e->buf, old_size, new_size); if (!new_buf) encode_err(e, kUpb_EncodeStatus_OutOfMemory); - /* We want previous data at the end, realloc() put it at the beginning. */ + // We want previous data at the end, realloc() put it at the beginning. + // TODO(salo): This is somewhat inefficient since we are copying twice. + // Maybe create a realloc() that copies to the end of the new buffer? if (old_size > 0) { memmove(new_buf + new_size - old_size, e->buf, old_size); } @@ -173,7 +181,7 @@ static void encode_tag(upb_encstate* e, uint32_t field_number, static void encode_fixedarray(upb_encstate* e, const upb_Array* arr, size_t elem_size, uint32_t tag) { - size_t bytes = arr->len * elem_size; + size_t bytes = arr->size * elem_size; const char* data = _upb_array_constptr(arr); const char* ptr = data + bytes - elem_size; @@ -205,8 +213,8 @@ static void encode_message(upb_encstate* e, const upb_Message* msg, const upb_MiniTable* m, size_t* size); static void encode_scalar(upb_encstate* e, const void* _field_mem, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* f) { + const upb_MiniTableSub* subs, + const upb_MiniTableField* f) { const char* field_mem = _field_mem; int wire_type; @@ -288,20 +296,20 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem, } static void encode_array(upb_encstate* e, const upb_Message* msg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* f) { + const upb_MiniTableSub* subs, + const upb_MiniTableField* f) { const upb_Array* arr = *UPB_PTR_AT(msg, f->offset, upb_Array*); bool packed = f->mode & kUpb_LabelFlags_IsPacked; size_t pre_len = e->limit - e->ptr; - if (arr == NULL || arr->len == 0) { + if (arr == NULL || arr->size == 0) { return; } #define VARINT_CASE(ctype, encode) \ { \ const ctype* start = _upb_array_constptr(arr); \ - const ctype* ptr = start + arr->len; \ + const ctype* ptr = start + arr->size; \ uint32_t tag = packed ? 0 : (f->number << 3) | kUpb_WireType_Varint; \ do { \ ptr--; \ @@ -345,7 +353,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, case kUpb_FieldType_String: case kUpb_FieldType_Bytes: { const upb_StringView* start = _upb_array_constptr(arr); - const upb_StringView* ptr = start + arr->len; + const upb_StringView* ptr = start + arr->size; do { ptr--; encode_bytes(e, ptr->data, ptr->size); @@ -356,7 +364,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, } case kUpb_FieldType_Group: { const void* const* start = _upb_array_constptr(arr); - const void* const* ptr = start + arr->len; + const void* const* ptr = start + arr->size; const upb_MiniTable* subm = subs[f->submsg_index].submsg; if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); do { @@ -371,7 +379,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, } case kUpb_FieldType_Message: { const void* const* start = _upb_array_constptr(arr); - const void* const* ptr = start + arr->len; + const void* const* ptr = start + arr->size; const upb_MiniTable* subm = subs[f->submsg_index].submsg; if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); do { @@ -396,20 +404,20 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, static void encode_mapentry(upb_encstate* e, uint32_t number, const upb_MiniTable* layout, const upb_MapEntry* ent) { - const upb_MiniTable_Field* key_field = &layout->fields[0]; - const upb_MiniTable_Field* val_field = &layout->fields[1]; + const upb_MiniTableField* key_field = &layout->fields[0]; + const upb_MiniTableField* val_field = &layout->fields[1]; size_t pre_len = e->limit - e->ptr; size_t size; - encode_scalar(e, &ent->v, layout->subs, val_field); - encode_scalar(e, &ent->k, layout->subs, key_field); + encode_scalar(e, &ent->data.v, layout->subs, val_field); + encode_scalar(e, &ent->data.k, layout->subs, key_field); size = (e->limit - e->ptr) - pre_len; encode_varint(e, size); encode_tag(e, number, kUpb_WireType_Delimited); } static void encode_map(upb_encstate* e, const upb_Message* msg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* f) { + const upb_MiniTableSub* subs, + const upb_MiniTableField* f) { const upb_Map* map = *UPB_PTR_AT(msg, f->offset, const upb_Map*); const upb_MiniTable* layout = subs[f->submsg_index].submsg; UPB_ASSERT(layout->field_count == 2); @@ -426,42 +434,35 @@ static void encode_map(upb_encstate* e, const upb_Message* msg, } _upb_mapsorter_popmap(&e->sorter, &sorted); } else { - upb_strtable_iter i; - upb_strtable_begin(&i, &map->table); - for (; !upb_strtable_done(&i); upb_strtable_next(&i)) { - upb_StringView key = upb_strtable_iter_key(&i); - const upb_value val = upb_strtable_iter_value(&i); + intptr_t iter = UPB_STRTABLE_BEGIN; + upb_StringView key; + upb_value val; + while (upb_strtable_next2(&map->table, &key, &val, &iter)) { upb_MapEntry ent; - _upb_map_fromkey(key, &ent.k, map->key_size); - _upb_map_fromvalue(val, &ent.v, map->val_size); + _upb_map_fromkey(key, &ent.data.k, map->key_size); + _upb_map_fromvalue(val, &ent.data.v, map->val_size); encode_mapentry(e, f->number, layout, &ent); } } } static bool encode_shouldencode(upb_encstate* e, const upb_Message* msg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* f) { + const upb_MiniTableSub* subs, + const upb_MiniTableField* f) { if (f->presence == 0) { /* Proto3 presence or map/array. */ const void* mem = UPB_PTR_AT(msg, f->offset, void); - switch (f->mode >> kUpb_FieldRep_Shift) { + switch (_upb_MiniTableField_GetRep(f)) { case kUpb_FieldRep_1Byte: { char ch; memcpy(&ch, mem, 1); return ch != 0; } -#if UINTPTR_MAX == 0xffffffff - case kUpb_FieldRep_Pointer: -#endif case kUpb_FieldRep_4Byte: { uint32_t u32; memcpy(&u32, mem, 4); return u32 != 0; } -#if UINTPTR_MAX != 0xffffffff - case kUpb_FieldRep_Pointer: -#endif case kUpb_FieldRep_8Byte: { uint64_t u64; memcpy(&u64, mem, 8); @@ -484,8 +485,8 @@ static bool encode_shouldencode(upb_encstate* e, const upb_Message* msg, } static void encode_field(upb_encstate* e, const upb_Message* msg, - const upb_MiniTable_Sub* subs, - const upb_MiniTable_Field* field) { + const upb_MiniTableSub* subs, + const upb_MiniTableField* field) { switch (upb_FieldMode_Get(field)) { case kUpb_FieldMode_Array: encode_array(e, msg, subs, field); @@ -501,22 +502,25 @@ static void encode_field(upb_encstate* e, const upb_Message* msg, } } -/* message MessageSet { - * repeated group Item = 1 { - * required int32 type_id = 2; - * required string message = 3; - * } - * } */ static void encode_msgset_item(upb_encstate* e, const upb_Message_Extension* ext) { size_t size; - encode_tag(e, 1, kUpb_WireType_EndGroup); + encode_tag(e, kUpb_MsgSet_Item, kUpb_WireType_EndGroup); encode_message(e, ext->data.ptr, ext->ext->sub.submsg, &size); encode_varint(e, size); - encode_tag(e, 3, kUpb_WireType_Delimited); + encode_tag(e, kUpb_MsgSet_Message, kUpb_WireType_Delimited); encode_varint(e, ext->ext->field.number); - encode_tag(e, 2, kUpb_WireType_Varint); - encode_tag(e, 1, kUpb_WireType_StartGroup); + encode_tag(e, kUpb_MsgSet_TypeId, kUpb_WireType_Varint); + encode_tag(e, kUpb_MsgSet_Item, kUpb_WireType_StartGroup); +} + +static void encode_ext(upb_encstate* e, const upb_Message_Extension* ext, + bool is_message_set) { + if (UPB_UNLIKELY(is_message_set)) { + encode_msgset_item(e, ext); + } else { + encode_field(e, &ext->data, &ext->ext->sub, &ext->ext->field); + } } static void encode_message(upb_encstate* e, const upb_Message* msg, @@ -548,20 +552,25 @@ static void encode_message(upb_encstate* e, const upb_Message* msg, size_t ext_count; const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &ext_count); if (ext_count) { - const upb_Message_Extension* end = ext + ext_count; - for (; ext != end; ext++) { - if (UPB_UNLIKELY(m->ext == kUpb_ExtMode_IsMessageSet)) { - encode_msgset_item(e, ext); - } else { - encode_field(e, &ext->data, &ext->ext->sub, &ext->ext->field); + if (e->options & kUpb_EncodeOption_Deterministic) { + _upb_sortedmap sorted; + _upb_mapsorter_pushexts(&e->sorter, ext, ext_count, &sorted); + while (_upb_sortedmap_nextext(&e->sorter, &sorted, &ext)) { + encode_ext(e, ext, m->ext == kUpb_ExtMode_IsMessageSet); + } + _upb_mapsorter_popmap(&e->sorter, &sorted); + } else { + const upb_Message_Extension* end = ext + ext_count; + for (; ext != end; ext++) { + encode_ext(e, ext, m->ext == kUpb_ExtMode_IsMessageSet); } } } } if (m->field_count) { - const upb_MiniTable_Field* f = &m->fields[m->field_count]; - const upb_MiniTable_Field* first = &m->fields[0]; + const upb_MiniTableField* f = &m->fields[m->field_count]; + const upb_MiniTableField* first = &m->fields[0]; while (f != first) { f--; if (encode_shouldencode(e, msg, m->subs, f)) { @@ -573,13 +582,43 @@ static void encode_message(upb_encstate* e, const upb_Message* msg, *size = (e->limit - e->ptr) - pre_len; } +static upb_EncodeStatus upb_Encoder_Encode(upb_encstate* const encoder, + const void* const msg, + const upb_MiniTable* const l, + char** const buf, + size_t* const size) { + // 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 (UPB_SETJMP(encoder->err) == 0) { + encode_message(encoder, msg, l, size); + *size = encoder->limit - encoder->ptr; + if (*size == 0) { + static char ch; + *buf = &ch; + } else { + UPB_ASSERT(encoder->ptr); + *buf = encoder->ptr; + } + } else { + UPB_ASSERT(encoder->status != kUpb_EncodeStatus_Ok); + *buf = NULL; + *size = 0; + } + + _upb_mapsorter_destroy(&encoder->sorter); + return encoder->status; +} + 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; - e.alloc = upb_Arena_Alloc(arena); + e.status = kUpb_EncodeStatus_Ok; + e.arena = arena; e.buf = NULL; e.limit = NULL; e.ptr = NULL; @@ -587,27 +626,5 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, e.options = options; _upb_mapsorter_init(&e.sorter); - 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; - *buf = &ch; - } else { - UPB_ASSERT(e.ptr); - *buf = e.ptr; - } - } else { - *buf = NULL; - *size = 0; - } - - _upb_mapsorter_destroy(&e.sorter); - return status; + return upb_Encoder_Encode(&e, msg, l, buf, size); } diff --git a/third_party/upb/upb/wire/encode.h b/third_party/upb/upb/wire/encode.h new file mode 100644 index 00000000000..8067fcbeb6f --- /dev/null +++ b/third_party/upb/upb/wire/encode.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// upb_Encode: parsing from a upb_Message using a upb_MiniTable. + +#ifndef UPB_WIRE_ENCODE_H_ +#define UPB_WIRE_ENCODE_H_ + +#include "upb/message/message.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + /* If set, the results of serializing will be deterministic across all + * instances of this binary. There are no guarantees across different + * binary builds. + * + * If your proto contains maps, the encoder will need to malloc()/free() + * memory during encode. */ + kUpb_EncodeOption_Deterministic = 1, + + /* When set, unknown fields are not printed. */ + kUpb_EncodeOption_SkipUnknown = 2, + + /* When set, the encode will fail if any required fields are missing. */ + kUpb_EncodeOption_CheckRequired = 4, +}; + +#define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16) + +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); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_WIRE_ENCODE_H_ */ diff --git a/third_party/upb/upb/wire/eps_copy_input_stream.c b/third_party/upb/upb/wire/eps_copy_input_stream.c new file mode 100644 index 00000000000..ebbe40adf8d --- /dev/null +++ b/third_party/upb/upb/wire/eps_copy_input_stream.c @@ -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. + */ + +#include "upb/wire/eps_copy_input_stream.h" + +static const char* _upb_EpsCopyInputStream_NoOpCallback( + upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) { + return new_start; +} + +const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback( + upb_EpsCopyInputStream* e, const char* ptr, int overrun) { + return _upb_EpsCopyInputStream_IsDoneFallbackInline( + e, ptr, overrun, _upb_EpsCopyInputStream_NoOpCallback); +} diff --git a/third_party/upb/upb/wire/eps_copy_input_stream.h b/third_party/upb/upb/wire/eps_copy_input_stream.h new file mode 100644 index 00000000000..9528649a3fc --- /dev/null +++ b/third_party/upb/upb/wire/eps_copy_input_stream.h @@ -0,0 +1,425 @@ +/* + * 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_WIRE_EPS_COPY_INPUT_STREAM_H_ +#define UPB_WIRE_EPS_COPY_INPUT_STREAM_H_ + +#include + +#include "upb/mem/arena.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// The maximum number of bytes a single protobuf field can take up in the +// wire format. We only want to do one bounds check per field, so the input +// stream guarantees that after upb_EpsCopyInputStream_IsDone() is called, +// the decoder can read this many bytes without performing another bounds +// check. The stream will copy into a patch buffer as necessary to guarantee +// this invariant. +#define kUpb_EpsCopyInputStream_SlopBytes 16 + +enum { + kUpb_EpsCopyInputStream_NoAliasing = 0, + kUpb_EpsCopyInputStream_OnPatch = 1, + kUpb_EpsCopyInputStream_NoDelta = 2 +}; + +typedef struct { + const char* end; // Can read up to SlopBytes bytes beyond this. + const char* limit_ptr; // For bounds checks, = end + UPB_MIN(limit, 0) + uintptr_t aliasing; + int limit; // Submessage limit relative to end + bool error; // To distinguish between EOF and error. + char patch[kUpb_EpsCopyInputStream_SlopBytes * 2]; +} upb_EpsCopyInputStream; + +// Returns true if the stream is in the error state. A stream enters the error +// state when the user reads past a limit (caught in IsDone()) or the +// ZeroCopyInputStream returns an error. +UPB_INLINE bool upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream* e) { + return e->error; +} + +typedef const char* upb_EpsCopyInputStream_BufferFlipCallback( + upb_EpsCopyInputStream* e, const char* old_end, const char* new_start); + +typedef const char* upb_EpsCopyInputStream_IsDoneFallbackFunc( + upb_EpsCopyInputStream* e, const char* ptr, int overrun); + +// Initializes a upb_EpsCopyInputStream using the contents of the buffer +// [*ptr, size]. Updates `*ptr` as necessary to guarantee that at least +// kUpb_EpsCopyInputStream_SlopBytes are available to read. +UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e, + const char** ptr, size_t size, + bool enable_aliasing) { + if (size <= kUpb_EpsCopyInputStream_SlopBytes) { + memset(&e->patch, 0, 32); + if (size) memcpy(&e->patch, *ptr, size); + e->aliasing = enable_aliasing ? (uintptr_t)*ptr - (uintptr_t)e->patch + : kUpb_EpsCopyInputStream_NoAliasing; + *ptr = e->patch; + e->end = *ptr + size; + e->limit = 0; + } else { + e->end = *ptr + size - kUpb_EpsCopyInputStream_SlopBytes; + e->limit = kUpb_EpsCopyInputStream_SlopBytes; + e->aliasing = enable_aliasing ? kUpb_EpsCopyInputStream_NoDelta + : kUpb_EpsCopyInputStream_NoAliasing; + } + e->limit_ptr = e->end; + e->error = false; +} + +typedef enum { + // The current stream position is at a limit. + kUpb_IsDoneStatus_Done, + + // The current stream position is not at a limit. + kUpb_IsDoneStatus_NotDone, + + // The current stream position is not at a limit, and the stream needs to + // be flipped to a new buffer before more data can be read. + kUpb_IsDoneStatus_NeedFallback, +} upb_IsDoneStatus; + +// Returns the status of the current stream position. This is a low-level +// function, it is simpler to call upb_EpsCopyInputStream_IsDone() if possible. +UPB_INLINE upb_IsDoneStatus upb_EpsCopyInputStream_IsDoneStatus( + upb_EpsCopyInputStream* e, const char* ptr, int* overrun) { + *overrun = ptr - e->end; + if (UPB_LIKELY(ptr < e->limit_ptr)) { + return kUpb_IsDoneStatus_NotDone; + } else if (UPB_LIKELY(*overrun == e->limit)) { + return kUpb_IsDoneStatus_Done; + } else { + return kUpb_IsDoneStatus_NeedFallback; + } +} + +// Returns true if the stream has hit a limit, either the current delimited +// limit or the overall end-of-stream. As a side effect, this function may flip +// the pointer to a new buffer if there are less than +// kUpb_EpsCopyInputStream_SlopBytes of data to be read in the current buffer. +// +// Postcondition: if the function returns false, there are at least +// kUpb_EpsCopyInputStream_SlopBytes of data available to read at *ptr. +UPB_INLINE bool upb_EpsCopyInputStream_IsDoneWithCallback( + upb_EpsCopyInputStream* e, const char** ptr, + upb_EpsCopyInputStream_IsDoneFallbackFunc* func) { + int overrun; + switch (upb_EpsCopyInputStream_IsDoneStatus(e, *ptr, &overrun)) { + case kUpb_IsDoneStatus_Done: + return true; + case kUpb_IsDoneStatus_NotDone: + return false; + case kUpb_IsDoneStatus_NeedFallback: + *ptr = func(e, *ptr, overrun); + return *ptr == NULL; + } + UPB_UNREACHABLE(); +} + +const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback( + upb_EpsCopyInputStream* e, const char* ptr, int overrun); + +// A simpler version of IsDoneWithCallback() that does not support a buffer flip +// callback. Useful in cases where we do not need to insert custom logic at +// every buffer flip. +// +// If this returns true, the user must call upb_EpsCopyInputStream_IsError() +// to distinguish between EOF and error. +UPB_INLINE bool upb_EpsCopyInputStream_IsDone(upb_EpsCopyInputStream* e, + const char** ptr) { + return upb_EpsCopyInputStream_IsDoneWithCallback( + e, ptr, _upb_EpsCopyInputStream_IsDoneFallbackNoCallback); +} + +// Returns the total number of bytes that are safe to read from the current +// buffer without reading uninitialized or unallocated memory. +// +// Note that this check does not respect any semantic limits on the stream, +// either limits from PushLimit() or the overall stream end, so some of these +// bytes may have unpredictable, nonsense values in them. The guarantee is only +// that the bytes are valid to read from the perspective of the C language +// (ie. you can read without triggering UBSAN or ASAN). +UPB_INLINE size_t upb_EpsCopyInputStream_BytesAvailable( + upb_EpsCopyInputStream* e, const char* ptr) { + return (e->end - ptr) + kUpb_EpsCopyInputStream_SlopBytes; +} + +// Returns true if the given delimited field size is valid (it does not extend +// beyond any previously-pushed limits). `ptr` should point to the beginning +// of the field data, after the delimited size. +// +// Note that this does *not* guarantee that all of the data for this field is in +// the current buffer. +UPB_INLINE bool upb_EpsCopyInputStream_CheckSize( + const upb_EpsCopyInputStream* e, const char* ptr, int size) { + UPB_ASSERT(size >= 0); + return ptr - e->end + size <= e->limit; +} + +UPB_INLINE bool _upb_EpsCopyInputStream_CheckSizeAvailable( + upb_EpsCopyInputStream* e, const char* ptr, int size, bool submessage) { + // This is one extra branch compared to the more normal: + // return (size_t)(end - ptr) < size; + // However it is one less computation if we are just about to use "ptr + len": + // https://godbolt.org/z/35YGPz + // In microbenchmarks this shows a small improvement. + uintptr_t uptr = (uintptr_t)ptr; + uintptr_t uend = (uintptr_t)e->limit_ptr; + uintptr_t res = uptr + (size_t)size; + if (!submessage) uend += kUpb_EpsCopyInputStream_SlopBytes; + // NOTE: this check depends on having a linear address space. This is not + // technically guaranteed by uintptr_t. + bool ret = res >= uptr && res <= uend; + if (size < 0) UPB_ASSERT(!ret); + return ret; +} + +// Returns true if the given delimited field size is valid (it does not extend +// beyond any previously-pushed limited) *and* all of the data for this field is +// available to be read in the current buffer. +// +// If the size is negative, this function will always return false. This +// property can be useful in some cases. +UPB_INLINE bool upb_EpsCopyInputStream_CheckDataSizeAvailable( + upb_EpsCopyInputStream* e, const char* ptr, int size) { + return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, false); +} + +// Returns true if the given sub-message size is valid (it does not extend +// beyond any previously-pushed limited) *and* all of the data for this +// sub-message is available to be parsed in the current buffer. +// +// This implies that all fields from the sub-message can be parsed from the +// current buffer while maintaining the invariant that we always have at least +// kUpb_EpsCopyInputStream_SlopBytes of data available past the beginning of +// any individual field start. +// +// If the size is negative, this function will always return false. This +// property can be useful in some cases. +UPB_INLINE bool upb_EpsCopyInputStream_CheckSubMessageSizeAvailable( + upb_EpsCopyInputStream* e, const char* ptr, int size) { + return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, true); +} + +// Returns true if aliasing_enabled=true was passed to +// upb_EpsCopyInputStream_Init() when this stream was initialized. +UPB_INLINE bool upb_EpsCopyInputStream_AliasingEnabled( + upb_EpsCopyInputStream* e) { + return e->aliasing != kUpb_EpsCopyInputStream_NoAliasing; +} + +// Returns true if aliasing_enabled=true was passed to +// upb_EpsCopyInputStream_Init() when this stream was initialized *and* we can +// alias into the region [ptr, size] in an input buffer. +UPB_INLINE bool upb_EpsCopyInputStream_AliasingAvailable( + upb_EpsCopyInputStream* e, const char* ptr, size_t size) { + // When EpsCopyInputStream supports streaming, this will need to become a + // runtime check. + return upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size) && + e->aliasing >= kUpb_EpsCopyInputStream_NoDelta; +} + +// Returns a pointer into an input buffer that corresponds to the parsing +// pointer `ptr`. The returned pointer may be the same as `ptr`, but also may +// be different if we are currently parsing out of the patch buffer. +// +// REQUIRES: Aliasing must be available for the given pointer. If the input is a +// flat buffer and aliasing is enabled, then aliasing will always be available. +UPB_INLINE const char* upb_EpsCopyInputStream_GetAliasedPtr( + upb_EpsCopyInputStream* e, const char* ptr) { + UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, ptr, 0)); + uintptr_t delta = + e->aliasing == kUpb_EpsCopyInputStream_NoDelta ? 0 : e->aliasing; + return (const char*)((uintptr_t)ptr + delta); +} + +// Reads string data from the input, aliasing into the input buffer instead of +// copying. The parsing pointer is passed in `*ptr`, and will be updated if +// necessary to point to the actual input buffer. Returns the new parsing +// pointer, which will be advanced past the string data. +// +// REQUIRES: Aliasing must be available for this data region (test with +// upb_EpsCopyInputStream_AliasingAvailable(). +UPB_INLINE const char* upb_EpsCopyInputStream_ReadStringAliased( + upb_EpsCopyInputStream* e, const char** ptr, size_t size) { + UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size)); + const char* ret = *ptr + size; + *ptr = upb_EpsCopyInputStream_GetAliasedPtr(e, *ptr); + UPB_ASSUME(ret != NULL); + return ret; +} + +// Skips `size` bytes of data from the input and returns a pointer past the end. +// Returns NULL on end of stream or error. +UPB_INLINE const char* upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream* e, + const char* ptr, int size) { + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL; + return ptr + size; +} + +// Copies `size` bytes of data from the input `ptr` into the buffer `to`, and +// returns a pointer past the end. Returns NULL on end of stream or error. +UPB_INLINE const char* upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream* e, + const char* ptr, void* to, + int size) { + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL; + memcpy(to, ptr, size); + return ptr + size; +} + +// Reads string data from the stream and advances the pointer accordingly. +// If aliasing was enabled when the stream was initialized, then the returned +// pointer will point into the input buffer if possible, otherwise new data +// will be allocated from arena and copied into. We may be forced to copy even +// if aliasing was enabled if the input data spans input buffers. +// +// Returns NULL if memory allocation failed, or we reached a premature EOF. +UPB_INLINE const char* upb_EpsCopyInputStream_ReadString( + upb_EpsCopyInputStream* e, const char** ptr, size_t size, + upb_Arena* arena) { + if (upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size)) { + return upb_EpsCopyInputStream_ReadStringAliased(e, ptr, size); + } else { + // We need to allocate and copy. + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, *ptr, size)) { + return NULL; + } + UPB_ASSERT(arena); + char* data = (char*)upb_Arena_Malloc(arena, size); + if (!data) return NULL; + const char* ret = upb_EpsCopyInputStream_Copy(e, *ptr, data, size); + *ptr = data; + return ret; + } +} + +UPB_INLINE void _upb_EpsCopyInputStream_CheckLimit(upb_EpsCopyInputStream* e) { + UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit)); +} + +// Pushes a limit onto the stack of limits for the current stream. The limit +// will extend for `size` bytes beyond the position in `ptr`. Future calls to +// upb_EpsCopyInputStream_IsDone() will return `true` when the stream position +// reaches this limit. +// +// Returns a delta that the caller must store and supply to PopLimit() below. +UPB_INLINE int upb_EpsCopyInputStream_PushLimit(upb_EpsCopyInputStream* e, + const char* ptr, int size) { + int limit = size + (int)(ptr - e->end); + int delta = e->limit - limit; + _upb_EpsCopyInputStream_CheckLimit(e); + UPB_ASSERT(limit <= e->limit); + e->limit = limit; + e->limit_ptr = e->end + UPB_MIN(0, limit); + _upb_EpsCopyInputStream_CheckLimit(e); + return delta; +} + +// Pops the last limit that was pushed on this stream. This may only be called +// once IsDone() returns true. The user must pass the delta that was returned +// from PushLimit(). +UPB_INLINE void upb_EpsCopyInputStream_PopLimit(upb_EpsCopyInputStream* e, + const char* ptr, + int saved_delta) { + UPB_ASSERT(ptr - e->end == e->limit); + _upb_EpsCopyInputStream_CheckLimit(e); + e->limit += saved_delta; + e->limit_ptr = e->end + UPB_MIN(0, e->limit); + _upb_EpsCopyInputStream_CheckLimit(e); +} + +UPB_INLINE const char* _upb_EpsCopyInputStream_IsDoneFallbackInline( + upb_EpsCopyInputStream* e, const char* ptr, int overrun, + upb_EpsCopyInputStream_BufferFlipCallback* callback) { + if (overrun < e->limit) { + // Need to copy remaining data into patch buffer. + UPB_ASSERT(overrun < kUpb_EpsCopyInputStream_SlopBytes); + const char* old_end = ptr; + const char* new_start = &e->patch[0] + overrun; + memset(e->patch + kUpb_EpsCopyInputStream_SlopBytes, 0, + kUpb_EpsCopyInputStream_SlopBytes); + memcpy(e->patch, e->end, kUpb_EpsCopyInputStream_SlopBytes); + ptr = new_start; + e->end = &e->patch[kUpb_EpsCopyInputStream_SlopBytes]; + e->limit -= kUpb_EpsCopyInputStream_SlopBytes; + e->limit_ptr = e->end + e->limit; + UPB_ASSERT(ptr < e->limit_ptr); + if (e->aliasing != kUpb_EpsCopyInputStream_NoAliasing) { + e->aliasing = (uintptr_t)old_end - (uintptr_t)new_start; + } + return callback(e, old_end, new_start); + } else { + UPB_ASSERT(overrun > e->limit); + e->error = true; + return callback(e, NULL, NULL); + } +} + +typedef const char* upb_EpsCopyInputStream_ParseDelimitedFunc( + upb_EpsCopyInputStream* e, const char* ptr, void* ctx); + +// Tries to perform a fast-path handling of the given delimited message data. +// If the sub-message beginning at `*ptr` and extending for `len` is short and +// fits within this buffer, calls `func` with `ctx` as a parameter, where the +// pushing and popping of limits is handled automatically and with lower cost +// than the normal PushLimit()/PopLimit() sequence. +static UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast( + upb_EpsCopyInputStream* e, const char** ptr, int len, + upb_EpsCopyInputStream_ParseDelimitedFunc* func, void* ctx) { + if (!upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(e, *ptr, len)) { + return false; + } + + // Fast case: Sub-message is <128 bytes and fits in the current buffer. + // This means we can preserve limit/limit_ptr verbatim. + const char* saved_limit_ptr = e->limit_ptr; + int saved_limit = e->limit; + e->limit_ptr = *ptr + len; + e->limit = e->limit_ptr - e->end; + UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit)); + *ptr = func(e, *ptr, ctx); + e->limit_ptr = saved_limit_ptr; + e->limit = saved_limit; + UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit)); + return true; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_ diff --git a/third_party/upb/upb/wire/eps_copy_input_stream_test.cc b/third_party/upb/upb/wire/eps_copy_input_stream_test.cc new file mode 100644 index 00000000000..3b900642292 --- /dev/null +++ b/third_party/upb/upb/wire/eps_copy_input_stream_test.cc @@ -0,0 +1,334 @@ +#include "upb/wire/eps_copy_input_stream.h" + +#include + +#include + +#include "gtest/gtest.h" +#include "upb/upb.hpp" +// begin:google_only +// #include "testing/fuzzing/fuzztest.h" +// end:google_only + +namespace { + +TEST(EpsCopyInputStreamTest, ZeroSize) { + upb_EpsCopyInputStream stream; + const char* ptr = NULL; + upb_EpsCopyInputStream_Init(&stream, &ptr, 0, false); + EXPECT_TRUE(upb_EpsCopyInputStream_IsDoneWithCallback(&stream, &ptr, NULL)); +} + +// begin:google_only +// +// // We create a simple, trivial implementation of the stream that we can test +// // our real implementation against. +// +// class FakeStream { +// public: +// FakeStream(const std::string& data) : data_(data), offset_(0) { +// limits_.push_back(data.size()); +// } +// +// // If we reached one or more limits correctly, returns the number of limits +// // ended. If we tried to read beyond the current limit, returns -1. +// // Otherwise, for simple success, returns 0. +// int ReadData(int n, std::string* data) { +// if (n > BytesUntilLimit()) return -1; +// +// data->assign(data_.data() + offset_, n); +// offset_ += n; +// +// int end_limit_count = 0; +// +// while (BytesUntilLimit() == 0) { +// if (PopLimit()) { +// end_limit_count++; +// } else { +// eof_ = true; +// break; +// } +// } +// +// return end_limit_count; +// } +// +// bool TryPushLimit(int limit) { +// if (!CheckSize(limit)) return false; +// limits_.push_back(offset_ + limit); +// return true; +// } +// +// bool IsEof() const { return eof_; } +// +// private: +// int BytesUntilLimit() const { return limits_.back() - offset_; } +// bool CheckSize(int size) const { return BytesUntilLimit() >= size; } +// +// // Return false on EOF. +// bool PopLimit() { +// limits_.pop_back(); +// return !limits_.empty(); +// } +// +// std::string data_; +// // Limits, specified in absolute stream terms. +// std::vector limits_; +// int offset_; +// bool eof_ = false; +// }; +// +// char tmp_buf[kUpb_EpsCopyInputStream_SlopBytes]; +// +// class EpsStream { +// public: +// EpsStream(const std::string& data, bool enable_aliasing) +// : data_(data), enable_aliasing_(enable_aliasing) { +// ptr_ = data_.data(); +// upb_EpsCopyInputStream_Init(&eps_, &ptr_, data_.size(), enable_aliasing); +// } +// +// // Returns false at EOF or error. +// int ReadData(int n, std::string* data) { +// EXPECT_LE(n, kUpb_EpsCopyInputStream_SlopBytes); +// if (enable_aliasing_) { +// EXPECT_TRUE(upb_EpsCopyInputStream_AliasingAvailable(&eps_, ptr_, n)); +// } +// // We want to verify that we can read kUpb_EpsCopyInputStream_SlopBytes +// // safely, even if we haven't actually been requested to read that much. +// // We copy to a global buffer so the copy can't be optimized away. +// memcpy(&tmp_buf, ptr_, kUpb_EpsCopyInputStream_SlopBytes); +// data->assign(tmp_buf, n); +// ptr_ += n; +// if (enable_aliasing_) { +// EXPECT_TRUE(upb_EpsCopyInputStream_AliasingAvailable(&eps_, ptr_, 0)); +// } +// return PopLimits(); +// } +// +// int ReadString(int n, std::string* data) { +// if (!upb_EpsCopyInputStream_CheckSize(&eps_, ptr_, n)) return -1; +// const char* str_data = ptr_; +// if (enable_aliasing_) { +// EXPECT_TRUE(upb_EpsCopyInputStream_AliasingAvailable(&eps_, ptr_, n)); +// } +// ptr_ = upb_EpsCopyInputStream_ReadString(&eps_, &str_data, n, arena_.ptr()); +// if (!ptr_) return -1; +// if (enable_aliasing_ && n) { +// EXPECT_GE(reinterpret_cast(str_data), +// reinterpret_cast(data_.data())); +// EXPECT_LT(reinterpret_cast(str_data), +// reinterpret_cast(data_.data() + data_.size())); +// EXPECT_TRUE(upb_EpsCopyInputStream_AliasingAvailable(&eps_, ptr_, 0)); +// } +// data->assign(str_data, n); +// return PopLimits(); +// } +// +// bool TryPushLimit(int limit) { +// if (!upb_EpsCopyInputStream_CheckSize(&eps_, ptr_, limit)) return false; +// deltas_.push_back(upb_EpsCopyInputStream_PushLimit(&eps_, ptr_, limit)); +// return true; +// } +// +// bool IsEof() const { return eof_; } +// +// private: +// int PopLimits() { +// int end_limit_count = 0; +// +// while (IsAtLimit()) { +// if (error_) return -1; +// if (PopLimit()) { +// end_limit_count++; +// } else { +// eof_ = true; // EOF. +// break; +// } +// } +// +// return error_ ? -1 : end_limit_count; +// } +// +// bool IsAtLimit() { +// return upb_EpsCopyInputStream_IsDoneWithCallback( +// &eps_, &ptr_, &EpsStream::IsDoneFallback); +// } +// +// // Return false on EOF. +// bool PopLimit() { +// if (deltas_.empty()) return false; +// upb_EpsCopyInputStream_PopLimit(&eps_, ptr_, deltas_.back()); +// deltas_.pop_back(); +// return true; +// } +// +// static const char* IsDoneFallback(upb_EpsCopyInputStream* e, const char* ptr, +// int overrun) { +// return _upb_EpsCopyInputStream_IsDoneFallbackInline( +// e, ptr, overrun, &EpsStream::BufferFlipCallback); +// } +// +// static const char* BufferFlipCallback(upb_EpsCopyInputStream* e, +// const char* old_end, +// const char* new_start) { +// EpsStream* stream = reinterpret_cast(e); +// if (!old_end) stream->error_ = true; +// return new_start; +// } +// +// upb_EpsCopyInputStream eps_; +// std::string data_; +// const char* ptr_; +// std::vector deltas_; +// upb::Arena arena_; +// bool error_ = false; +// bool eof_ = false; +// bool enable_aliasing_; +// }; +// +// // Reads N bytes from the given position. +// struct ReadOp { +// int bytes; // Must be <= kUpb_EpsCopyInputStream_SlopBytes. +// }; +// +// struct ReadStringOp { +// int bytes; +// }; +// +// // Pushes a new limit of N bytes from the current position. +// struct PushLimitOp { +// int bytes; +// }; +// +// typedef std::variant Op; +// +// struct EpsCopyTestScript { +// int data_size; +// bool enable_aliasing; +// std::vector ops; +// }; +// +// auto ArbitraryEpsCopyTestScript() { +// using ::fuzztest::Arbitrary; +// using ::fuzztest::InRange; +// using ::fuzztest::NonNegative; +// using ::fuzztest::StructOf; +// using ::fuzztest::VariantOf; +// using ::fuzztest::VectorOf; +// +// int max_data_size = 512; +// +// return StructOf( +// InRange(0, max_data_size), // data_size +// Arbitrary(), // enable_aliasing +// VectorOf(VariantOf( +// // ReadOp +// StructOf(InRange(0, kUpb_EpsCopyInputStream_SlopBytes)), +// // ReadStringOp +// StructOf(NonNegative()), +// // PushLimitOp +// StructOf(NonNegative())))); +// } +// +// // Run a test that creates both real stream and a fake stream, and validates +// // that they have the same behavior. +// void TestAgainstFakeStream(const EpsCopyTestScript& script) { +// std::string data(script.data_size, 'x'); +// for (int i = 0; i < script.data_size; ++i) { +// data[i] = static_cast(i & 0xff); +// } +// +// FakeStream fake_stream(data); +// EpsStream eps_stream(data, script.enable_aliasing); +// +// for (const auto& op : script.ops) { +// if (const ReadOp* read_op = std::get_if(&op)) { +// std::string data_fake; +// std::string data_eps; +// int fake_result = fake_stream.ReadData(read_op->bytes, &data_fake); +// int eps_result = eps_stream.ReadData(read_op->bytes, &data_eps); +// EXPECT_EQ(fake_result, eps_result); +// if (fake_result == -1) break; // Error +// EXPECT_EQ(data_fake, data_eps); +// EXPECT_EQ(fake_stream.IsEof(), eps_stream.IsEof()); +// if (fake_stream.IsEof()) break; +// } else if (const ReadStringOp* read_op = std::get_if(&op)) { +// std::string data_fake; +// std::string data_eps; +// int fake_result = fake_stream.ReadData(read_op->bytes, &data_fake); +// int eps_result = eps_stream.ReadString(read_op->bytes, &data_eps); +// EXPECT_EQ(fake_result, eps_result); +// if (fake_result == -1) break; // Error +// EXPECT_EQ(data_fake, data_eps); +// EXPECT_EQ(fake_stream.IsEof(), eps_stream.IsEof()); +// if (fake_stream.IsEof()) break; +// } else if (const PushLimitOp* push = std::get_if(&op)) { +// EXPECT_EQ(fake_stream.TryPushLimit(push->bytes), +// eps_stream.TryPushLimit(push->bytes)); +// } else { +// EXPECT_TRUE(false); // Unknown op. +// } +// } +// } +// +// // Test with: +// // $ blaze run --config=fuzztest third_party/upb:eps_copy_input_stream_test \ +// // -- --gunit_fuzz= +// FUZZ_TEST(EpsCopyFuzzTest, TestAgainstFakeStream) +// .WithDomains(ArbitraryEpsCopyTestScript()); +// +// TEST(EpsCopyFuzzTest, TestAgainstFakeStreamRegression) { +// TestAgainstFakeStream({299, +// false, +// { +// PushLimitOp{2}, +// ReadOp{14}, +// }}); +// } +// +// TEST(EpsCopyFuzzTest, AliasingEnabledZeroSizeReadString) { +// TestAgainstFakeStream({510, true, {ReadStringOp{0}}}); +// } +// +// TEST(EpsCopyFuzzTest, AliasingDisabledZeroSizeReadString) { +// TestAgainstFakeStream({510, false, {ReadStringOp{0}}}); +// } +// +// TEST(EpsCopyFuzzTest, ReadStringZero) { +// TestAgainstFakeStream({0, true, {ReadStringOp{0}}}); +// } +// +// TEST(EpsCopyFuzzTest, ReadZero) { +// TestAgainstFakeStream({0, true, {ReadOp{0}}}); +// } +// +// TEST(EpsCopyFuzzTest, ReadZeroTwice) { +// TestAgainstFakeStream({0, true, {ReadOp{0}, ReadOp{0}}}); +// } +// +// TEST(EpsCopyFuzzTest, ReadStringZeroThenRead) { +// TestAgainstFakeStream({0, true, {ReadStringOp{0}, ReadOp{0}}}); +// } +// +// TEST(EpsCopyFuzzTest, ReadStringOverflowsBufferButNotLimit) { +// TestAgainstFakeStream({351, +// false, +// { +// ReadOp{7}, +// PushLimitOp{2147483647}, +// ReadStringOp{344}, +// }}); +// } +// +// TEST(EpsCopyFuzzTest, LastBufferAliasing) { +// TestAgainstFakeStream({27, true, {ReadOp{12}, ReadStringOp{3}}}); +// } +// +// TEST(EpsCopyFuzzTest, FirstBufferAliasing) { +// TestAgainstFakeStream({7, true, {ReadStringOp{3}}}); +// } +// +// end:google_only + +} // namespace diff --git a/third_party/upb/upb/wire/reader.c b/third_party/upb/upb/wire/reader.c new file mode 100644 index 00000000000..a84fb0b9129 --- /dev/null +++ b/third_party/upb/upb/wire/reader.c @@ -0,0 +1,67 @@ +/* + * 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/wire/reader.h" + +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/types.h" + +// Must be last. +#include "upb/port/def.inc" + +UPB_NOINLINE _upb_WireReader_ReadLongVarintRet +_upb_WireReader_ReadLongVarint(const char* ptr, uint64_t val) { + _upb_WireReader_ReadLongVarintRet 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; +} + +const char* _upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, + int depth_limit, + upb_EpsCopyInputStream* stream) { + if (--depth_limit == 0) return NULL; + uint32_t end_group_tag = (tag & ~7ULL) | kUpb_WireType_EndGroup; + while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { + uint32_t tag; + ptr = upb_WireReader_ReadTag(ptr, &tag); + if (!ptr) return NULL; + if (tag == end_group_tag) return ptr; + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, stream); + if (!ptr) return NULL; + } + return ptr; +} diff --git a/third_party/upb/upb/wire/reader.h b/third_party/upb/upb/wire/reader.h new file mode 100644 index 00000000000..b9597440276 --- /dev/null +++ b/third_party/upb/upb/wire/reader.h @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_WIRE_READER_H_ +#define UPB_WIRE_READER_H_ + +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/swap_internal.h" +#include "upb/wire/types.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// The upb_WireReader interface is suitable for general-purpose parsing of +// protobuf binary wire format. It is designed to be used along with +// upb_EpsCopyInputStream for buffering, and all parsing routines in this file +// assume that at least kUpb_EpsCopyInputStream_SlopBytes worth of data is +// available to read without any bounds checks. + +#define kUpb_WireReader_WireTypeMask 7 +#define kUpb_WireReader_WireTypeBits 3 + +typedef struct { + const char* ptr; + uint64_t val; +} _upb_WireReader_ReadLongVarintRet; + +_upb_WireReader_ReadLongVarintRet _upb_WireReader_ReadLongVarint( + const char* ptr, uint64_t val); + +static UPB_FORCEINLINE const char* _upb_WireReader_ReadVarint(const char* ptr, + uint64_t* val, + int maxlen, + uint64_t maxval) { + uint64_t byte = (uint8_t)*ptr; + if (UPB_LIKELY((byte & 0x80) == 0)) { + *val = (uint32_t)byte; + return ptr + 1; + } + const char* start = ptr; + _upb_WireReader_ReadLongVarintRet res = + _upb_WireReader_ReadLongVarint(ptr, byte); + if (!res.ptr || (maxlen < 10 && res.ptr - start > maxlen) || + res.val > maxval) { + return NULL; // Malformed. + } + *val = res.val; + return res.ptr; +} + +// Parses a tag into `tag`, and returns a pointer past the end of the tag, or +// NULL if there was an error in the tag data. +// +// REQUIRES: there must be at least 10 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +static UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr, + uint32_t* tag) { + uint64_t val; + ptr = _upb_WireReader_ReadVarint(ptr, &val, 5, UINT32_MAX); + if (!ptr) return NULL; + *tag = val; + return ptr; +} + +// Given a tag, returns the field number. +UPB_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag) { + return tag >> kUpb_WireReader_WireTypeBits; +} + +// Given a tag, returns the wire type. +UPB_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag) { + return tag & kUpb_WireReader_WireTypeMask; +} + +UPB_INLINE const char* upb_WireReader_ReadVarint(const char* ptr, + uint64_t* val) { + return _upb_WireReader_ReadVarint(ptr, val, 10, UINT64_MAX); +} + +// Skips data for a varint, returning a pointer past the end of the varint, or +// NULL if there was an error in the varint data. +// +// REQUIRES: there must be at least 10 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +UPB_INLINE const char* upb_WireReader_SkipVarint(const char* ptr) { + uint64_t val; + return upb_WireReader_ReadVarint(ptr, &val); +} + +// Reads a varint indicating the size of a delimited field into `size`, or +// NULL if there was an error in the varint data. +// +// REQUIRES: there must be at least 10 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +UPB_INLINE const char* upb_WireReader_ReadSize(const char* ptr, int* size) { + uint64_t size64; + ptr = upb_WireReader_ReadVarint(ptr, &size64); + if (!ptr || size64 >= INT32_MAX) return NULL; + *size = size64; + return ptr; +} + +// Reads a fixed32 field, performing byte swapping if necessary. +// +// REQUIRES: there must be at least 4 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +UPB_INLINE const char* upb_WireReader_ReadFixed32(const char* ptr, void* val) { + uint32_t uval; + memcpy(&uval, ptr, 4); + uval = _upb_BigEndian_Swap32(uval); + memcpy(val, &uval, 4); + return ptr + 4; +} + +// Reads a fixed64 field, performing byte swapping if necessary. +// +// REQUIRES: there must be at least 4 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) { + uint64_t uval; + memcpy(&uval, ptr, 8); + uval = _upb_BigEndian_Swap64(uval); + memcpy(val, &uval, 8); + return ptr + 8; +} + +const char* _upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, + int depth_limit, + upb_EpsCopyInputStream* stream); + +// Skips data for a group, returning a pointer past the end of the group, or +// NULL if there was an error parsing the group. The `tag` argument should be +// the start group tag that begins the group. The `depth_limit` argument +// indicates how many levels of recursion the group is allowed to have before +// reporting a parse error (this limit exists to protect against stack +// overflow). +// +// TODO: evaluate how the depth_limit should be specified. Do users need +// control over this? +UPB_INLINE const char* upb_WireReader_SkipGroup( + const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) { + return _upb_WireReader_SkipGroup(ptr, tag, 100, stream); +} + +UPB_INLINE const char* _upb_WireReader_SkipValue( + const char* ptr, uint32_t tag, int depth_limit, + upb_EpsCopyInputStream* stream) { + switch (upb_WireReader_GetWireType(tag)) { + case kUpb_WireType_Varint: + return upb_WireReader_SkipVarint(ptr); + case kUpb_WireType_32Bit: + return ptr + 4; + case kUpb_WireType_64Bit: + return ptr + 8; + case kUpb_WireType_Delimited: { + int size; + ptr = upb_WireReader_ReadSize(ptr, &size); + if (!ptr) return NULL; + ptr += size; + return ptr; + } + case kUpb_WireType_StartGroup: + return _upb_WireReader_SkipGroup(ptr, tag, depth_limit, stream); + case kUpb_WireType_EndGroup: + return NULL; // Should be handled before now. + default: + return NULL; // Unknown wire type. + } +} + +// Skips data for a wire value of any type, returning a pointer past the end of +// the data, or NULL if there was an error parsing the group. The `tag` argument +// should be the tag that was just parsed. The `depth_limit` argument indicates +// how many levels of recursion a group is allowed to have before reporting a +// parse error (this limit exists to protect against stack overflow). +// +// REQUIRES: there must be at least 10 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +// +// TODO: evaluate how the depth_limit should be specified. Do users need +// control over this? +UPB_INLINE const char* upb_WireReader_SkipValue( + const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) { + return _upb_WireReader_SkipValue(ptr, tag, 100, stream); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif // UPB_WIRE_READER_H_ diff --git a/third_party/upb/upb/wire/swap_internal.h b/third_party/upb/upb/wire/swap_internal.h new file mode 100644 index 00000000000..d79d4c3c593 --- /dev/null +++ b/third_party/upb/upb/wire/swap_internal.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_WIRE_SWAP_INTERNAL_H_ +#define UPB_WIRE_SWAP_INTERNAL_H_ + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE bool _upb_IsLittleEndian(void) { + int x = 1; + return *(char*)&x == 1; +} + +UPB_INLINE uint32_t _upb_BigEndian_Swap32(uint32_t val) { + if (_upb_IsLittleEndian()) return val; + + return ((val & 0xff) << 24) | ((val & 0xff00) << 8) | + ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24); +} + +UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) { + if (_upb_IsLittleEndian()) return val; + + return ((uint64_t)_upb_BigEndian_Swap32((uint32_t)val) << 32) | + _upb_BigEndian_Swap32((uint32_t)(val >> 32)); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* UPB_WIRE_SWAP_INTERNAL_H_ */ diff --git a/third_party/upb/upb/wire/types.h b/third_party/upb/upb/wire/types.h new file mode 100644 index 00000000000..f719d7d776e --- /dev/null +++ b/third_party/upb/upb/wire/types.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_WIRE_TYPES_H_ +#define UPB_WIRE_TYPES_H_ + +// A list of types as they are encoded on the wire. +typedef enum { + kUpb_WireType_Varint = 0, + kUpb_WireType_64Bit = 1, + kUpb_WireType_Delimited = 2, + kUpb_WireType_StartGroup = 3, + kUpb_WireType_EndGroup = 4, + kUpb_WireType_32Bit = 5 +} upb_WireType; + +#endif /* UPB_WIRE_TYPES_H_ */ diff --git a/third_party/upb/upbc/BUILD b/third_party/upb/upbc/BUILD index d32ffa45a0a..d95d4175d75 100644 --- a/third_party/upb/upbc/BUILD +++ b/third_party/upb/upbc/BUILD @@ -25,6 +25,7 @@ load( "//bazel:build_defs.bzl", + "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) load( @@ -32,6 +33,12 @@ load( "upb_proto_library", "upb_proto_reflection_library", ) +load( + "//upbc:bootstrap_compiler.bzl", + "bootstrap_cc_binary", + "bootstrap_cc_library", + "bootstrap_upb_proto_library", +) licenses(["notice"]) @@ -54,10 +61,27 @@ upb_proto_reflection_library( deps = [":code_generator_request"], ) -upb_proto_library( +bootstrap_upb_proto_library( name = "plugin_upb_proto", + base_dir = "", + google3_src_files = [ + "src/google/protobuf/compiler/plugin.proto", + "net/proto2/compiler/proto/profile.proto", + ], + google3_src_rules = [ + "//net/proto2/proto:descriptor_proto_source", + "//net/proto2/compiler/proto:plugin.proto", + "//net/proto2/compiler/proto:profile.proto", + ], + oss_src_files = ["google/protobuf/compiler/plugin.proto"], + oss_src_rules = [ + "@com_google_protobuf//:descriptor_proto_srcs", + "@com_google_protobuf//src/google/protobuf/compiler:plugin_proto_src", + ], + oss_strip_prefix = "third_party/protobuf/github/bootstrap/src", + proto_lib_deps = ["@com_google_protobuf//:compiler_plugin_proto"], visibility = ["//:friends"], - deps = ["@com_google_protobuf//:compiler_plugin_proto"], + deps = ["//:descriptor_upb_proto"], ) upb_proto_reflection_library( @@ -66,33 +90,171 @@ upb_proto_reflection_library( deps = ["@com_google_protobuf//:compiler_plugin_proto"], ) -cc_library( - name = "common", - srcs = ["common.cc"], - hdrs = ["common.h"], - copts = UPB_DEFAULT_CPPOPTS, +cc_binary( + name = "upbc_so", + srcs = ["upbc_so.c"], + copts = UPB_DEFAULT_COPTS, + linkshared = 1, + linkstatic = 1, + visibility = ["//visibility:public"], deps = [ - "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", + "//:collections", + "//:mem", + "//:message", + "//:message_accessors", + "//:mini_table", + "//:port", + "//upbc:upbdev", ], ) -cc_binary( +bootstrap_cc_library( + name = "common", + srcs = [ + "common.cc", + ], + hdrs = [ + "common.h", + ], + bootstrap_deps = [ + "//:reflection", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//protos_generator:__pkg__"], + deps = [ + "@com_google_absl//absl/strings", + ], +) + +bootstrap_cc_library( + name = "file_layout", + srcs = [ + "file_layout.cc", + ], + hdrs = [ + "file_layout.h", + ], + bootstrap_deps = [ + ":common", + "//:reflection", + "//:descriptor_upb_proto", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//protos_generator:__pkg__"], + deps = [ + "//:mini_table", + "//:mini_table_internal", + "//:port", + "//:upb", + "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/strings", + ], +) + +cc_library( + name = "keywords", + srcs = [ + "keywords.cc", + ], + hdrs = [ + "keywords.h", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//protos_generator:__pkg__"], +) + +bootstrap_cc_library( + name = "plugin", + hdrs = [ + "plugin.h", + ], + bootstrap_deps = [ + ":plugin_upb_proto", + "//:descriptor_upb_proto", + "//:reflection", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//protos_generator:__pkg__"], + deps = [ + "//:port", + "@com_google_absl//absl/container:flat_hash_set", + "@com_google_absl//absl/log:absl_check", + "@com_google_absl//absl/log:absl_log", + "@com_google_absl//absl/strings", + ], +) + +bootstrap_cc_library( + name = "names", + srcs = [ + "names.cc", + ], + hdrs = [ + "names.h", + ], + bootstrap_deps = [ + "//:reflection", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//protos_generator:__pkg__"], + deps = [ + "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/strings", + "@com_google_protobuf//:protobuf", + "@com_google_protobuf//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( + name = "upbdev", + srcs = [ + "code_generator_request.c", + "code_generator_request.h", + "upbdev.c", + ], + hdrs = [ + "upbdev.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":code_generator_request_upb_proto", + ":code_generator_request_upb_proto_reflection", + ":plugin_upb_proto", + ":plugin_upb_proto_reflection", + "//:base", + "//:json", + "//:mem", + "//:port", + "//:reflection", + ], +) + +bootstrap_cc_binary( name = "protoc-gen-upb", srcs = ["protoc-gen-upb.cc"], + bootstrap_deps = [ + ":common", + ":file_layout", + ":names", + ":plugin", + ":plugin_upb_proto", + "//:descriptor_upb_proto", + "//:reflection", + ], copts = UPB_DEFAULT_CPPOPTS, visibility = ["//visibility:public"], deps = [ - ":common", - "//:mini_table", + "//:base", + "//:mem", + "//:mini_table_internal", "//:port", - "//:upb", - "@com_google_absl//absl/base:core_headers", + "//:wire_types", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", + "@com_google_absl//absl/log:absl_check", + "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - "@com_google_protobuf//:protoc_lib", ], ) @@ -102,39 +264,40 @@ cc_binary( "protoc-gen-upbdefs.cc", ], copts = UPB_DEFAULT_CPPOPTS, + # To work around the following link error from ABSL: + # /usr/bin/x86_64-linux-gnu-ld: bazel-out/k8-opt-exec-2B5CBBC6-ST-c1776f9924ec/bin/external/com_google_absl/absl/time/libtime.a(duration.o): undefined reference to symbol 'floor@@GLIBC_2.2.5' + # /usr/bin/x86_64-linux-gnu-ld: /opt/manylinux/2014/x86_64/lib64/libm.so.6: error adding symbols: DSO missing from command line + # clang-14: error: linker command failed with exit code 1 (use -v to see invocation) + linkopts = ["-lm"], visibility = ["//visibility:public"], deps = [ ":common", - "@com_google_absl//absl/base:core_headers", - "@com_google_absl//absl/container:flat_hash_map", - "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - "@com_google_protobuf//:protoc_lib", + ":file_layout", + ":plugin", + "//:descriptor_upb_proto", + "//:reflection", + "//upb/util:def_to_proto", ], ) 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, + target_compatible_with = select({ + "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], + "//conditions:default": [], + }), 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", + ":upbdev", "//:port", - "//:reflection", - "//:upb", + "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/strings", ], ) diff --git a/third_party/upb/upbc/bootstrap_compiler.bzl b/third_party/upb/upbc/bootstrap_compiler.bzl new file mode 100644 index 00000000000..3a9e645bd86 --- /dev/null +++ b/third_party/upb/upbc/bootstrap_compiler.bzl @@ -0,0 +1,166 @@ +"""Macros that implement bootstrapping for the upb code generator.""" + +load( + "//bazel:upb_proto_library.bzl", + "upb_proto_library", +) +load( + "//cmake:build_defs.bzl", + "staleness_test", +) + +_stages = ["_stage0", "_stage1", ""] +_protoc = "@com_google_protobuf//:protoc" +_upbc_base = "//upbc:protoc-gen-upb" + +# begin:google_only +# _is_google3 = True +# _extra_proto_path = "" +# end:google_only + +# begin:github_only +_is_google3 = False +_extra_proto_path = "-Iexternal/com_google_protobuf/src " +# end:github_only + +def _upbc(stage): + return _upbc_base + _stages[stage] + +def bootstrap_cc_library(name, visibility, deps, bootstrap_deps, **kwargs): + for stage in _stages: + stage_visibility = visibility if stage == "" else ["//upbc:__pkg__"] + native.cc_library( + name = name + stage, + deps = deps + [dep + stage for dep in bootstrap_deps], + visibility = stage_visibility, + **kwargs + ) + +def bootstrap_cc_binary(name, deps, bootstrap_deps, **kwargs): + for stage in _stages: + native.cc_binary( + name = name + stage, + deps = deps + [dep + stage for dep in bootstrap_deps], + **kwargs + ) + +def _generated_srcs_for_suffix(prefix, srcs, suffix): + return [prefix + "/" + src[:-len(".proto")] + suffix for src in srcs] + +def _generated_srcs(prefix, srcs): + return _generated_srcs_for_suffix(prefix, srcs, ".upb.h") + _generated_srcs_for_suffix(prefix, srcs, ".upb.c") + +def _stage0_proto_staleness_test(name, base_dir, src_files, src_rules, strip_prefix): + native.genrule( + name = name + "_generate_bootstrap", + srcs = src_rules, + outs = _generated_srcs("bootstrap_generated_sources/" + base_dir + "stage0", src_files), + tools = [_protoc, _upbc(0)], + cmd = + "$(location " + _protoc + ") " + + "-I$(GENDIR)/" + strip_prefix + " " + _extra_proto_path + + "--plugin=protoc-gen-upb=$(location " + _upbc(0) + ") " + + "--upb_out=bootstrap_upb:$(@D)/bootstrap_generated_sources/" + base_dir + "stage0 " + + " ".join(src_files), + ) + + staleness_test( + name = name + "_staleness_test", + outs = _generated_srcs(base_dir + "stage0", src_files), + generated_pattern = "bootstrap_generated_sources/%s", + target_files = native.glob([base_dir + "stage0/**"]), + # To avoid skew problems for descriptor.proto/pluging.proto between + # GitHub repos. It's not critical that the checked-in protos are up to + # date for every change, they just needs to be complete enough to have + # everything needed by the code generator itself. + tags = ["manual"], + ) + +def bootstrap_upb_proto_library( + name, + base_dir, + google3_src_files, + google3_src_rules, + oss_src_files, + oss_src_rules, + oss_strip_prefix, + proto_lib_deps, + visibility, + deps = [], + **kwargs): + """A version of upb_proto_library() that is augmented to allow for bootstrapping the compiler. + + Args: + name: Name of this rule. This name will resolve to a upb_proto_library(). + base_dir: The directory that all generated files should be placed under. + google3_src_files: Google3 filenames of .proto files that should be built by this rule. + The names should be relative to the depot base. + google3_src_rules: Target names of the Blaze rules that will provide these filenames. + oss_src_files: OSS filenames of .proto files that should be built by this rule. + oss_src_rules: Target names of the Bazel rules that will provide these filenames. + oss_strip_prefix: Prefix that should be stripped from OSS file names. + proto_lib_deps: proto_library() rules that we will use to build the protos when we are + not bootstrapping. + visibility: Visibility list for the final upb_proto_library() rule. Bootstrapping rules + will always be hidden, and will not honor the visibility parameter passed here. + deps: other bootstrap_upb_proto_library() rules that this one depends on. + **kwargs: Other arguments that will be passed through to cc_library(), genrule(), and + upb_proto_library(). + """ + _stage0_proto_staleness_test(name, base_dir, oss_src_files, oss_src_rules, oss_strip_prefix) + + # stage0 uses checked-in protos. + native.cc_library( + name = name + "_stage0", + srcs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.c"), + hdrs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.h"), + includes = [base_dir + "stage0"], + visibility = ["//upbc:__pkg__"], + # This macro signals to the runtime that it must use OSS APIs for descriptor.proto/plugin.proto. + defines = ["UPB_BOOTSTRAP_STAGE0"], + deps = [ + "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//:mini_table", + ] + [dep + "_stage0" for dep in deps], + **kwargs + ) + + src_files = google3_src_files if _is_google3 else oss_src_files + src_rules = google3_src_rules if _is_google3 else oss_src_rules + + # Generate stage1 protos using stage0 compiler. + native.genrule( + name = "gen_" + name + "_stage1", + srcs = src_rules, + outs = _generated_srcs(base_dir + "stage1", src_files), + cmd = "$(location " + _protoc + ") " + + "--plugin=protoc-gen-upb=$(location " + _upbc(0) + ") " + _extra_proto_path + + "--upb_out=$(@D)/" + base_dir + "stage1 " + + " ".join(src_files), + visibility = ["//upbc:__pkg__"], + tools = [ + _protoc, + _upbc(0), + ], + **kwargs + ) + + native.cc_library( + name = name + "_stage1", + srcs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb.c"), + hdrs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb.h"), + includes = [base_dir + "stage1"], + visibility = ["//upbc:__pkg__"], + deps = [ + "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + ] + [dep + "_stage1" for dep in deps], + **kwargs + ) + + # The final protos are generated via normal upb_proto_library(). + upb_proto_library( + name = name, + deps = proto_lib_deps, + visibility = visibility, + **kwargs + ) diff --git a/third_party/upb/upbc/code_generator_request.c b/third_party/upb/upbc/code_generator_request.c index 2591690f15e..8aad9ac9576 100644 --- a/third_party/upb/upbc/code_generator_request.c +++ b/third_party/upb/upbc/code_generator_request.c @@ -28,15 +28,12 @@ #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" +#include "upb/reflection/def.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" /******************************************************************************/ @@ -56,7 +53,8 @@ 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_NORETURN 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); @@ -83,52 +81,50 @@ static void upbc_State_Emit(upbc_State* s, const char* name, // 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_Enum(upbc_State* s, const upb_EnumDef* e) { + upb_StringView desc; + bool ok = upb_EnumDef_MiniDescriptorEncode(e, s->arena, &desc); + if (!ok) upbc_Error(s, __func__, "could not encode enum"); + + upbc_State_Emit(s, upb_EnumDef_FullName(e), desc); } -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_Extension(upbc_State* s, const upb_FieldDef* f) { + upb_StringView desc; + bool ok = upb_FieldDef_MiniDescriptorEncode(f, s->arena, &desc); + if (!ok) upbc_Error(s, __func__, "could not encode extension"); + + upbc_State_Emit(s, upb_FieldDef_FullName(f), desc); } -static void upbc_Scrape_FileEnums(upbc_State* s, const upb_FileDef* file_def) { - const size_t len = upb_FileDef_TopLevelEnumCount(file_def); +static void upbc_Scrape_FileEnums(upbc_State* s, const upb_FileDef* f) { + const size_t len = upb_FileDef_TopLevelEnumCount(f); + 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); + upbc_Scrape_Enum(s, upb_FileDef_TopLevelEnum(f, i)); } } -static void upbc_Scrape_FileExtensions(upbc_State* s, - const upb_FileDef* file_def) { - const size_t len = upb_FileDef_TopLevelExtensionCount(file_def); +static void upbc_Scrape_FileExtensions(upbc_State* s, const upb_FileDef* f) { + const size_t len = upb_FileDef_TopLevelExtensionCount(f); + 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); + upbc_Scrape_Extension(s, upb_FileDef_TopLevelExtension(f, i)); } } -static void upbc_Scrape_FileMessages(upbc_State* s, - const upb_FileDef* file_def) { - const size_t len = upb_FileDef_TopLevelMessageCount(file_def); +static void upbc_Scrape_FileMessages(upbc_State* s, const upb_FileDef* f) { + const size_t len = upb_FileDef_TopLevelMessageCount(f); + 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); + upbc_Scrape_Message(s, upb_FileDef_TopLevelMessage(f, i)); } } -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_File(upbc_State* s, const upb_FileDef* f) { + upbc_Scrape_FileEnums(s, f); + upbc_Scrape_FileExtensions(s, f); + upbc_Scrape_FileMessages(s, f); } static void upbc_Scrape_Files(upbc_State* s) { @@ -136,57 +132,63 @@ static void upbc_Scrape_Files(upbc_State* s) { upbc_CodeGeneratorRequest_request(s->out); size_t len = 0; - const google_protobuf_FileDescriptorProto* const* file_types = + const google_protobuf_FileDescriptorProto* const* files = 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"); + const upb_FileDef* f = upb_DefPool_AddFile(s->symtab, files[i], s->status); + if (!f) upbc_Error(s, __func__, "could not add file to def pool"); - upbc_Scrape_File(s, file_def); + upbc_Scrape_File(s, f); } } -static void upbc_Scrape_NestedEnums(upbc_State* s, - const upb_MessageDef* message_def) { - const size_t len = upb_MessageDef_NestedEnumCount(message_def); +static void upbc_Scrape_NestedEnums(upbc_State* s, const upb_MessageDef* m) { + const size_t len = upb_MessageDef_NestedEnumCount(m); + 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); + upbc_Scrape_Enum(s, upb_MessageDef_NestedEnum(m, i)); } } static void upbc_Scrape_NestedExtensions(upbc_State* s, - const upb_MessageDef* message_def) { - const size_t len = upb_MessageDef_NestedExtensionCount(message_def); + const upb_MessageDef* m) { + const size_t len = upb_MessageDef_NestedExtensionCount(m); + 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); + upbc_Scrape_Extension(s, upb_MessageDef_NestedExtension(m, i)); } } -static void upbc_Scrape_NestedMessages(upbc_State* s, - const upb_MessageDef* message_def) { - const size_t len = upb_MessageDef_NestedMessageCount(message_def); +static void upbc_Scrape_NestedMessages(upbc_State* s, const upb_MessageDef* m) { + const size_t len = upb_MessageDef_NestedMessageCount(m); + 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); + upbc_Scrape_Message(s, upb_MessageDef_NestedMessage(m, i)); } } -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); +static void upbc_Scrape_Message(upbc_State* s, const upb_MessageDef* m) { + upb_StringView desc; + bool ok = upb_MessageDef_MiniDescriptorEncode(m, s->arena, &desc); + if (!ok) upbc_Error(s, __func__, "could not encode message"); - upbc_Scrape_NestedEnums(s, message_def); - upbc_Scrape_NestedExtensions(s, message_def); - upbc_Scrape_NestedMessages(s, message_def); + upbc_State_Emit(s, upb_MessageDef_FullName(m), desc); + + upbc_Scrape_NestedEnums(s, m); + upbc_Scrape_NestedExtensions(s, m); + upbc_Scrape_NestedMessages(s, m); +} + +static upbc_CodeGeneratorRequest* upbc_State_MakeCodeGeneratorRequest( + upbc_State* const s, google_protobuf_compiler_CodeGeneratorRequest* const request) { + 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; } upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( @@ -199,11 +201,5 @@ upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( .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; + return upbc_State_MakeCodeGeneratorRequest(&s, request); } diff --git a/third_party/upb/upbc/code_generator_request.h b/third_party/upb/upbc/code_generator_request.h index 747d98d84d6..fc10e8a9e0a 100644 --- a/third_party/upb/upbc/code_generator_request.h +++ b/third_party/upb/upbc/code_generator_request.h @@ -28,12 +28,12 @@ #ifndef UPBC_CODE_GENERATOR_REQUEST_H_ #define UPBC_CODE_GENERATOR_REQUEST_H_ -#include "upb/def.h" -#include "upb/upb.h" +#include "upb/mem/arena.h" +#include "upb/reflection/def.h" #include "upbc/code_generator_request.upb.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -47,6 +47,6 @@ upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( } /* extern "C" */ #endif -#include "upb/port_undef.inc" +#include "upb/port/undef.inc" #endif /* UPBC_CODE_GENERATOR_REQUEST_H_ */ diff --git a/third_party/upb/upbc/common.cc b/third_party/upb/upbc/common.cc index a4e162d8142..b4942e6d7fe 100644 --- a/third_party/upb/upbc/common.cc +++ b/third_party/upb/upbc/common.cc @@ -26,13 +26,9 @@ #include "upbc/common.h" #include "absl/strings/str_replace.h" +#include "upb/reflection/def.hpp" namespace upbc { -namespace { - -namespace protobuf = ::google::protobuf; - -} // namespace std::string StripExtension(absl::string_view fname) { size_t lastdot = fname.find_last_of('.'); @@ -43,14 +39,14 @@ std::string StripExtension(absl::string_view fname) { } std::string ToCIdent(absl::string_view str) { - return absl::StrReplaceAll(str, {{".", "_"}, {"/", "_"}}); + return absl::StrReplaceAll(str, {{".", "_"}, {"/", "_"}, {"-", "_"}}); } std::string ToPreproc(absl::string_view str) { return absl::AsciiStrToUpper(ToCIdent(str)); } -void EmitFileWarning(const protobuf::FileDescriptor* file, Output& output) { +void EmitFileWarning(absl::string_view name, Output& output) { output( "/* This file was generated by upbc (the upb compiler) from the input\n" " * file:\n" @@ -59,19 +55,27 @@ void EmitFileWarning(const protobuf::FileDescriptor* file, Output& output) { " *\n" " * Do not edit -- your changes will be discarded when the file is\n" " * regenerated. */\n\n", - file->name()); + name); } -std::string MessageName(const protobuf::Descriptor* descriptor) { - return ToCIdent(descriptor->full_name()); +std::string MessageName(upb::MessageDefPtr descriptor) { + return ToCIdent(descriptor.full_name()); } -std::string FileLayoutName(const google::protobuf::FileDescriptor* file) { - return ToCIdent(file->name()) + "_upb_file_layout"; +std::string FileLayoutName(upb::FileDefPtr file) { + return ToCIdent(file.name()) + "_upb_file_layout"; } -std::string HeaderFilename(const google::protobuf::FileDescriptor* file) { - return StripExtension(file->name()) + ".upb.h"; +std::string HeaderFilename(upb::FileDefPtr file) { + return StripExtension(file.name()) + ".upb.h"; +} + +std::string MessageInit(absl::string_view full_name) { + return ToCIdent(full_name) + "_msg_init"; +} + +std::string EnumInit(upb::EnumDefPtr descriptor) { + return ToCIdent(descriptor.full_name()) + "_enum_init"; } } // namespace upbc diff --git a/third_party/upb/upbc/common.h b/third_party/upb/upbc/common.h index 08de2343830..aaa43a6c4d4 100644 --- a/third_party/upb/upbc/common.h +++ b/third_party/upb/upbc/common.h @@ -32,22 +32,19 @@ #include "absl/strings/str_replace.h" #include "absl/strings/substitute.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/io/zero_copy_stream.h" +#include "upb/reflection/def.hpp" namespace upbc { class Output { public: - Output(google::protobuf::io::ZeroCopyOutputStream* stream) - : stream_(stream) {} - ~Output() { stream_->BackUp((int)size_); } - template void operator()(absl::string_view format, const Arg&... arg) { Write(absl::Substitute(format, arg...)); } + absl::string_view output() const { return output_; } + private: void Write(absl::string_view data) { std::string stripped; @@ -70,42 +67,22 @@ class Output { data = stripped; } } - while (!data.empty()) { - RefreshOutput(); - size_t to_write = std::min(data.size(), size_); - memcpy(ptr_, data.data(), to_write); - data.remove_prefix(to_write); - ptr_ += to_write; - size_ -= to_write; - } + absl::StrAppend(&output_, data); } - void RefreshOutput() { - while (size_ == 0) { - void* ptr; - int size; - if (!stream_->Next(&ptr, &size)) { - fprintf(stderr, "upbc: Failed to write to to output\n"); - abort(); - } - ptr_ = static_cast(ptr); - size_ = size; - } - } - - google::protobuf::io::ZeroCopyOutputStream* stream_; - char* ptr_ = nullptr; - size_t size_ = 0; + std::string output_; }; std::string StripExtension(absl::string_view fname); std::string ToCIdent(absl::string_view str); std::string ToPreproc(absl::string_view str); -void EmitFileWarning(const google::protobuf::FileDescriptor* file, - Output& output); -std::string MessageName(const google::protobuf::Descriptor* descriptor); -std::string FileLayoutName(const google::protobuf::FileDescriptor* file); -std::string HeaderFilename(const google::protobuf::FileDescriptor* file); +void EmitFileWarning(absl::string_view name, Output& output); +std::string MessageName(upb::MessageDefPtr descriptor); +std::string FileLayoutName(upb::FileDefPtr file); +std::string HeaderFilename(upb::FileDefPtr file); + +std::string MessageInit(absl::string_view full_name); +std::string EnumInit(upb::EnumDefPtr descriptor); } // namespace upbc diff --git a/third_party/upb/upbc/file_layout.cc b/third_party/upb/upbc/file_layout.cc new file mode 100644 index 00000000000..f492d595d56 --- /dev/null +++ b/third_party/upb/upbc/file_layout.cc @@ -0,0 +1,139 @@ +// 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 "upbc/file_layout.h" + +#include +#include + +#include "upb/mini_table/extension_internal.h" +#include "upbc/common.h" + +namespace upbc { + +const char* kEnumsInit = "enums_layout"; +const char* kExtensionsInit = "extensions_layout"; +const char* kMessagesInit = "messages_layout"; + +void AddEnums(upb::MessageDefPtr message, std::vector* enums) { + enums->reserve(enums->size() + message.enum_type_count()); + for (int i = 0; i < message.enum_type_count(); i++) { + enums->push_back(message.enum_type(i)); + } + for (int i = 0; i < message.nested_message_count(); i++) { + AddEnums(message.nested_message(i), enums); + } +} + +std::vector SortedEnums(upb::FileDefPtr file) { + std::vector enums; + enums.reserve(file.toplevel_enum_count()); + for (int i = 0; i < file.toplevel_enum_count(); i++) { + enums.push_back(file.toplevel_enum(i)); + } + for (int i = 0; i < file.toplevel_message_count(); i++) { + AddEnums(file.toplevel_message(i), &enums); + } + std::sort(enums.begin(), enums.end(), + [](upb::EnumDefPtr a, upb::EnumDefPtr b) { + return strcmp(a.full_name(), b.full_name()) < 0; + }); + return enums; +} + +std::vector SortedUniqueEnumNumbers(upb::EnumDefPtr e) { + std::vector values; + values.reserve(e.value_count()); + for (int i = 0; i < e.value_count(); i++) { + values.push_back(static_cast(e.value(i).number())); + } + std::sort(values.begin(), values.end()); + auto last = std::unique(values.begin(), values.end()); + values.erase(last, values.end()); + return values; +} + +void AddMessages(upb::MessageDefPtr message, + std::vector* messages) { + messages->push_back(message); + for (int i = 0; i < message.nested_message_count(); i++) { + AddMessages(message.nested_message(i), messages); + } +} + +// Ordering must match upb/def.c! +// +// The ordering is significant because each upb_MessageDef* will point at the +// corresponding upb_MiniTable and we just iterate through the list without +// any search or lookup. +std::vector SortedMessages(upb::FileDefPtr file) { + std::vector messages; + for (int i = 0; i < file.toplevel_message_count(); i++) { + AddMessages(file.toplevel_message(i), &messages); + } + return messages; +} + +void AddExtensionsFromMessage(upb::MessageDefPtr message, + std::vector* exts) { + for (int i = 0; i < message.nested_extension_count(); i++) { + exts->push_back(message.nested_extension(i)); + } + for (int i = 0; i < message.nested_message_count(); i++) { + AddExtensionsFromMessage(message.nested_message(i), exts); + } +} + +// Ordering must match upb/def.c! +// +// The ordering is significant because each upb_FieldDef* will point at the +// corresponding upb_MiniTableExtension and we just iterate through the list +// without any search or lookup. +std::vector SortedExtensions(upb::FileDefPtr file) { + std::vector ret; + ret.reserve(file.toplevel_extension_count()); + for (int i = 0; i < file.toplevel_extension_count(); i++) { + ret.push_back(file.toplevel_extension(i)); + } + for (int i = 0; i < file.toplevel_message_count(); i++) { + AddExtensionsFromMessage(file.toplevel_message(i), &ret); + } + return ret; +} + +std::vector FieldNumberOrder(upb::MessageDefPtr message) { + std::vector fields; + fields.reserve(message.field_count()); + for (int i = 0; i < message.field_count(); i++) { + fields.push_back(message.field(i)); + } + std::sort(fields.begin(), fields.end(), + [](upb::FieldDefPtr a, upb::FieldDefPtr b) { + return a.number() < b.number(); + }); + return fields; +} + +} // namespace upbc diff --git a/third_party/upb/upbc/file_layout.h b/third_party/upb/upbc/file_layout.h new file mode 100644 index 00000000000..3acd3808cde --- /dev/null +++ b/third_party/upb/upbc/file_layout.h @@ -0,0 +1,123 @@ +// 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 +// 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_FILE_LAYOUT_H +#define UPBC_FILE_LAYOUT_H + +#include + +// begin:google_only +// #ifndef UPB_BOOTSTRAP_STAGE0 +// #include "net/proto2/proto/descriptor.upb.h" +// #else +// #include "google/protobuf/descriptor.upb.h" +// #endif +// end:google_only + +// begin:github_only +#include "google/protobuf/descriptor.upb.h" +// end:github_only + +#include "absl/container/flat_hash_map.h" +#include "upb/mini_table/decode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def.hpp" +#include "upb/upb.hpp" + +// Must be last +#include "upb/port/def.inc" + +namespace upbc { + +std::vector SortedEnums(upb::FileDefPtr file); + +// Ordering must match upb/def.c! +// +// The ordering is significant because each upb_MessageDef* will point at the +// corresponding upb_MiniTable and we just iterate through the list without +// any search or lookup. +std::vector SortedMessages(upb::FileDefPtr file); + +// Ordering must match upb/def.c! +// +// The ordering is significant because each upb_FieldDef* will point at the +// corresponding upb_MiniTableExtension and we just iterate through the list +// without any search or lookup. +std::vector SortedExtensions(upb::FileDefPtr file); + +std::vector FieldNumberOrder(upb::MessageDefPtr message); + +// DefPoolPair is a pair of DefPools: one for 32-bit and one for 64-bit. +class DefPoolPair { + public: + DefPoolPair() { + pool32_._SetPlatform(kUpb_MiniTablePlatform_32Bit); + pool64_._SetPlatform(kUpb_MiniTablePlatform_64Bit); + } + + upb::FileDefPtr AddFile(const UPB_DESC(FileDescriptorProto) * file_proto, + upb::Status* status) { + upb::FileDefPtr file32 = pool32_.AddFile(file_proto, status); + upb::FileDefPtr file64 = pool64_.AddFile(file_proto, status); + if (!file32) return file32; + return file64; + } + + const upb_MiniTable* GetMiniTable32(upb::MessageDefPtr m) const { + return pool32_.FindMessageByName(m.full_name()).mini_table(); + } + + const upb_MiniTable* GetMiniTable64(upb::MessageDefPtr m) const { + return pool64_.FindMessageByName(m.full_name()).mini_table(); + } + + const upb_MiniTableField* GetField32(upb::FieldDefPtr f) const { + return GetFieldFromPool(&pool32_, f); + } + + const upb_MiniTableField* GetField64(upb::FieldDefPtr f) const { + return GetFieldFromPool(&pool64_, f); + } + + private: + static const upb_MiniTableField* GetFieldFromPool(const upb::DefPool* pool, + upb::FieldDefPtr f) { + if (f.is_extension()) { + return pool->FindExtensionByName(f.full_name()).mini_table(); + } else { + return pool->FindMessageByName(f.containing_type().full_name()) + .FindFieldByNumber(f.number()) + .mini_table(); + } + } + + upb::DefPool pool32_; + upb::DefPool pool64_; +}; + +} // namespace upbc + +#include "upb/port/undef.inc" + +#endif // UPBC_FILE_LAYOUT_H diff --git a/third_party/upb/upbc/keywords.cc b/third_party/upb/upbc/keywords.cc new file mode 100644 index 00000000000..ed3a71341cc --- /dev/null +++ b/third_party/upb/upbc/keywords.cc @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2007-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 "upbc/keywords.h" + +#include +#include + +namespace upbc { + +static const char* const kKeywordList[] = { + // + "NULL", + "alignas", + "alignof", + "and", + "and_eq", + "asm", + "auto", + "bitand", + "bitor", + "bool", + "break", + "case", + "catch", + "char", + "class", + "compl", + "const", + "constexpr", + "const_cast", + "continue", + "decltype", + "default", + "delete", + "do", + "double", + "dynamic_cast", + "else", + "enum", + "explicit", + "export", + "extern", + "false", + "float", + "for", + "friend", + "goto", + "if", + "inline", + "int", + "long", + "mutable", + "namespace", + "new", + "noexcept", + "not", + "not_eq", + "nullptr", + "operator", + "or", + "or_eq", + "private", + "protected", + "public", + "register", + "reinterpret_cast", + "return", + "short", + "signed", + "sizeof", + "static", + "static_assert", + "static_cast", + "struct", + "switch", + "template", + "this", + "thread_local", + "throw", + "true", + "try", + "typedef", + "typeid", + "typename", + "union", + "unsigned", + "using", + "virtual", + "void", + "volatile", + "wchar_t", + "while", + "xor", + "xor_eq", + "char8_t", + "char16_t", + "char32_t", + "concept", + "consteval", + "constinit", + "co_await", + "co_return", + "co_yield", + "requires", +}; + +static std::unordered_set* MakeKeywordsMap() { + auto* result = new std::unordered_set(); + for (const auto keyword : kKeywordList) { + result->emplace(keyword); + } + return result; +} + +static std::unordered_set& kKeywords = *MakeKeywordsMap(); + +std::string ResolveKeywordConflict(const std::string& name) { + if (kKeywords.count(name) > 0) { + return name + "_"; + } + return name; +} + +} // namespace upbc diff --git a/third_party/upb/upbc/keywords.h b/third_party/upb/upbc/keywords.h new file mode 100644 index 00000000000..767c220f740 --- /dev/null +++ b/third_party/upb/upbc/keywords.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_PROTOS_GENERATOR_KEYWORDS_H +#define UPB_PROTOS_GENERATOR_KEYWORDS_H + +#include + +namespace upbc { + +// Resolves proto field name conflict with C++ reserved keywords. +std::string ResolveKeywordConflict(const std::string& name); + +} // namespace upbc + +#endif // UPB_PROTOS_GENERATOR_KEYWORDS_H diff --git a/third_party/upb/upbc/names.cc b/third_party/upb/upbc/names.cc new file mode 100644 index 00000000000..6a74c05784b --- /dev/null +++ b/third_party/upb/upbc/names.cc @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2007-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 "upbc/names.h" + +#include + +#include "absl/strings/match.h" +#include "google/protobuf/descriptor.h" +#include "upb/reflection/def.hpp" + +namespace upbc { + +namespace protobuf = ::google::protobuf; + +static constexpr absl::string_view kClearAccessor = "clear_"; +static constexpr absl::string_view kSetAccessor = "set_"; + +// List of generated accessor prefixes to check against. +// Example: +// optional repeated string phase = 236; +// optional bool clear_phase = 237; +static constexpr absl::string_view kAccessorPrefixes[] = { + kClearAccessor, "delete_", "add_", "resize_", kSetAccessor, +}; + +std::string ResolveFieldName(const protobuf::FieldDescriptor* field, + const NameToFieldDescriptorMap& field_names) { + absl::string_view field_name = field->name(); + for (const auto prefix : kAccessorPrefixes) { + // If field name starts with a prefix such as clear_ and the proto + // contains a field name with trailing end, depending on type of field + // (repeated, map, message) we have a conflict to resolve. + if (absl::StartsWith(field_name, prefix)) { + auto match = field_names.find(field_name.substr(prefix.size())); + if (match != field_names.end()) { + const auto* candidate = match->second; + if (candidate->is_repeated() || candidate->is_map() || + (candidate->cpp_type() == + protobuf::FieldDescriptor::CPPTYPE_STRING && + prefix == kClearAccessor) || + prefix == kSetAccessor) { + return absl::StrCat(field_name, "_"); + } + } + } + } + return std::string(field_name); +} + +// Returns field map by name to use for conflict checks. +NameToFieldDescriptorMap CreateFieldNameMap( + const protobuf::Descriptor* message) { + NameToFieldDescriptorMap field_names; + for (int i = 0; i < message->field_count(); i++) { + const protobuf::FieldDescriptor* field = message->field(i); + field_names.emplace(field->name(), field); + } + return field_names; +} + +NameToFieldDefMap CreateFieldNameMap(upb::MessageDefPtr message) { + NameToFieldDefMap field_names; + field_names.reserve(message.field_count()); + for (const auto& field : message.fields()) { + field_names.emplace(field.name(), field); + } + return field_names; +} + +std::string ResolveFieldName(upb::FieldDefPtr field, + const NameToFieldDefMap& field_names) { + absl::string_view field_name(field.name()); + for (absl::string_view prefix : kAccessorPrefixes) { + // If field name starts with a prefix such as clear_ and the proto + // contains a field name with trailing end, depending on type of field + // (repeated, map, message) we have a conflict to resolve. + if (absl::StartsWith(field_name, prefix)) { + auto match = field_names.find(field_name.substr(prefix.size())); + if (match != field_names.end()) { + const auto candidate = match->second; + if (candidate.IsSequence() || candidate.IsMap() || + (candidate.ctype() == kUpb_CType_String && + prefix == kClearAccessor) || + prefix == kSetAccessor) { + return absl::StrCat(field_name, "_"); + } + } + } + } + return std::string(field_name); +} + +} // namespace upbc diff --git a/third_party/upb/upbc/names.h b/third_party/upb/upbc/names.h new file mode 100644 index 00000000000..7a6897f3574 --- /dev/null +++ b/third_party/upb/upbc/names.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009-2021, Google LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google LLC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UPB_PROTOS_GENERATOR_NAMES_H +#define UPB_PROTOS_GENERATOR_NAMES_H + +#include + +#include "absl/container/flat_hash_map.h" +#include "google/protobuf/descriptor.h" +#include "upb/reflection/def.hpp" + +namespace upbc { + +using NameToFieldDescriptorMap = + absl::flat_hash_map; + +// Returns field name by resolving naming conflicts across +// proto field names (such as clear_ prefixes). +std::string ResolveFieldName(const google::protobuf::FieldDescriptor* field, + const NameToFieldDescriptorMap& field_names); + +// Returns field map by name to use for conflict checks. +NameToFieldDescriptorMap CreateFieldNameMap(const google::protobuf::Descriptor* message); + +using NameToFieldDefMap = + absl::flat_hash_map; + +// Returns field name by resolving naming conflicts across +// proto field names (such as clear_ prefixes). +std::string ResolveFieldName(upb::FieldDefPtr field, + const NameToFieldDefMap& field_names); + +// Returns field map by name to use for conflict checks. +NameToFieldDefMap CreateFieldNameMap(upb::MessageDefPtr message); + +} // namespace upbc + +#endif // UPB_PROTOS_GENERATOR_NAMES_H diff --git a/third_party/upb/upbc/plugin.h b/third_party/upb/upbc/plugin.h new file mode 100644 index 00000000000..2566593bcad --- /dev/null +++ b/third_party/upb/upbc/plugin.h @@ -0,0 +1,207 @@ +// 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_UPBC_PLUGIN_H_ +#define UPB_UPBC_PLUGIN_H_ + +#include + +#include +#include +#ifdef _WIN32 +#include +#include +#endif + +// begin:google_only +// #ifndef UPB_BOOTSTRAP_STAGE0 +// #include "net/proto2/compiler/proto/plugin.upb.h" +// #include "net/proto2/proto/descriptor.upb.h" +// #else +// #include "google/protobuf/compiler/plugin.upb.h" +// #include "google/protobuf/descriptor.upb.h" +// #endif +// end:google_only + +// begin:github_only +#include "google/protobuf/compiler/plugin.upb.h" +#include "google/protobuf/descriptor.upb.h" +// end:github_only + +#include "absl/container/flat_hash_set.h" +#include "absl/log/absl_log.h" +#include "absl/strings/str_split.h" +#include "absl/strings/string_view.h" +#include "upb/reflection/def.hpp" + +// Must be last. +#include "upb/port/def.inc" + +namespace upbc { + +inline std::vector> ParseGeneratorParameter( + const absl::string_view text) { + std::vector> ret; + for (absl::string_view sp : absl::StrSplit(text, ',', absl::SkipEmpty())) { + std::string::size_type equals_pos = sp.find_first_of('='); + std::pair value; + if (equals_pos == std::string::npos) { + value.first = std::string(sp); + } else { + value.first = std::string(sp.substr(0, equals_pos)); + value.second = std::string(sp.substr(equals_pos + 1)); + } + ret.push_back(std::move(value)); + } + return ret; +} + +class Plugin { + public: + Plugin() { ReadRequest(); } + ~Plugin() { WriteResponse(); } + + absl::string_view parameter() const { + return ToStringView( + UPB_DESC(compiler_CodeGeneratorRequest_parameter)(request_)); + } + + template + void GenerateFilesRaw(T&& func) { + absl::flat_hash_set files_to_generate; + size_t size; + const upb_StringView* file_to_generate = UPB_DESC( + compiler_CodeGeneratorRequest_file_to_generate)(request_, &size); + for (size_t i = 0; i < size; i++) { + files_to_generate.insert( + {file_to_generate[i].data, file_to_generate[i].size}); + } + + const UPB_DESC(FileDescriptorProto)* const* files = + UPB_DESC(compiler_CodeGeneratorRequest_proto_file)(request_, &size); + for (size_t i = 0; i < size; i++) { + upb::Status status; + absl::string_view name = + ToStringView(UPB_DESC(FileDescriptorProto_name)(files[i])); + func(files[i], files_to_generate.contains(name)); + } + } + + template + void GenerateFiles(T&& func) { + GenerateFilesRaw( + [this, &func](const UPB_DESC(FileDescriptorProto) * file_proto, + bool generate) { + upb::Status status; + upb::FileDefPtr file = pool_.AddFile(file_proto, &status); + if (!file) { + absl::string_view name = + ToStringView(UPB_DESC(FileDescriptorProto_name)(file_proto)); + ABSL_LOG(FATAL) << "Couldn't add file " << name + << " to DefPool: " << status.error_message(); + } + if (generate) func(file); + }); + } + + void SetError(absl::string_view error) { + char* data = + static_cast(upb_Arena_Malloc(arena_.ptr(), error.size())); + memcpy(data, error.data(), error.size()); + UPB_DESC(compiler_CodeGeneratorResponse_set_error) + (response_, upb_StringView_FromDataAndSize(data, error.size())); + } + + void AddOutputFile(absl::string_view filename, absl::string_view content) { + UPB_DESC(compiler_CodeGeneratorResponse_File)* file = UPB_DESC( + compiler_CodeGeneratorResponse_add_file)(response_, arena_.ptr()); + UPB_DESC(compiler_CodeGeneratorResponse_File_set_name) + (file, StringDup(filename)); + UPB_DESC(compiler_CodeGeneratorResponse_File_set_content) + (file, StringDup(content)); + } + + private: + upb::Arena arena_; + upb::DefPool pool_; + UPB_DESC(compiler_CodeGeneratorRequest) * request_; + UPB_DESC(compiler_CodeGeneratorResponse) * response_; + + static absl::string_view ToStringView(upb_StringView sv) { + return absl::string_view(sv.data, sv.size); + } + + upb_StringView StringDup(absl::string_view s) { + char* data = + reinterpret_cast(upb_Arena_Malloc(arena_.ptr(), s.size())); + memcpy(data, s.data(), s.size()); + return upb_StringView_FromDataAndSize(data, s.size()); + } + + std::string ReadAllStdinBinary() { + std::string data; +#ifdef _WIN32 + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); +#endif + char buf[4096]; + while (size_t len = fread(buf, 1, sizeof(buf), stdin)) { + data.append(buf, len); + } + return data; + } + + void ReadRequest() { + std::string data = ReadAllStdinBinary(); + request_ = UPB_DESC(compiler_CodeGeneratorRequest_parse)( + data.data(), data.size(), arena_.ptr()); + if (!request_) { + ABSL_LOG(FATAL) << "Failed to parse CodeGeneratorRequest"; + } + response_ = UPB_DESC(compiler_CodeGeneratorResponse_new)(arena_.ptr()); + UPB_DESC(compiler_CodeGeneratorResponse_set_supported_features) + (response_, + UPB_DESC(compiler_CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)); + } + + void WriteResponse() { + size_t size; + char* serialized = UPB_DESC(compiler_CodeGeneratorResponse_serialize)( + response_, arena_.ptr(), &size); + if (!serialized) { + ABSL_LOG(FATAL) << "Failed to serialize CodeGeneratorResponse"; + } + + if (fwrite(serialized, 1, size, stdout) != size) { + ABSL_LOG(FATAL) << "Failed to write response to stdout"; + } + } +}; + +} // namespace upbc + +#include "upb/port/undef.inc" + +#endif // UPB_UPBC_PLUGIN_H_ diff --git a/third_party/upb/upbc/protoc-gen-upb.cc b/third_party/upb/upbc/protoc-gen-upb.cc index c2968dcad7d..0433eccf002 100644 --- a/third_party/upb/upbc/protoc-gen-upb.cc +++ b/third_party/upb/upbc/protoc-gen-upb.cc @@ -23,715 +23,250 @@ // (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 #include +#include #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" -#include "absl/strings/ascii.h" +#include "absl/log/absl_check.h" +#include "absl/log/absl_log.h" +#include "absl/strings/escaping.h" +#include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "google/protobuf/compiler/code_generator.h" -#include "google/protobuf/compiler/plugin.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" -#include "google/protobuf/wire_format.h" -#include "upb/mini_table.hpp" -#include "upb/upb.hpp" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/mini_table/extension_internal.h" +#include "upb/reflection/def.hpp" +#include "upb/wire/types.h" #include "upbc/common.h" +#include "upbc/file_layout.h" +#include "upbc/names.h" +#include "upbc/plugin.h" // Must be last. -#include "upb/port_def.inc" +#include "upb/port/def.inc" namespace upbc { namespace { -namespace protoc = ::google::protobuf::compiler; -namespace protobuf = ::google::protobuf; +struct Options { + bool bootstrap = false; +}; // Returns fields in order of "hotness", eg. how frequently they appear in // serialized payloads. Ideally this will use a profile. When we don't have // that, we assume that fields with smaller numbers are used more frequently. -inline std::vector FieldHotnessOrder( - const google::protobuf::Descriptor* message) { - std::vector fields; - for (int i = 0; i < message->field_count(); i++) { - fields.push_back(message->field(i)); +inline std::vector FieldHotnessOrder( + upb::MessageDefPtr message) { + std::vector fields; + size_t field_count = message.field_count(); + fields.reserve(field_count); + for (size_t i = 0; i < field_count; i++) { + fields.push_back(message.field(i)); } std::sort(fields.begin(), fields.end(), - [](const google::protobuf::FieldDescriptor* a, - const google::protobuf::FieldDescriptor* b) { - return std::make_pair(!a->is_required(), a->number()) < - std::make_pair(!b->is_required(), b->number()); + [](upb::FieldDefPtr a, upb::FieldDefPtr b) { + return std::make_pair(!a.is_required(), a.number()) < + std::make_pair(!b.is_required(), b.number()); }); return fields; } -std::string SourceFilename(const google::protobuf::FileDescriptor* file) { - return StripExtension(file->name()) + ".upb.c"; +std::string SourceFilename(upb::FileDefPtr file) { + return StripExtension(file.name()) + ".upb.c"; } -std::string MessageInit(const protobuf::Descriptor* descriptor) { - return MessageName(descriptor) + "_msginit"; +std::string MessageInitName(upb::MessageDefPtr descriptor) { + return absl::StrCat(MessageName(descriptor), "_msg_init"); } -std::string EnumInit(const protobuf::EnumDescriptor* descriptor) { - return ToCIdent(descriptor->full_name()) + "_enuminit"; -} - -std::string ExtensionIdentBase(const protobuf::FieldDescriptor* ext) { - assert(ext->is_extension()); - std::string ext_scope; - if (ext->extension_scope()) { - return MessageName(ext->extension_scope()); +std::string MessageMiniTableRef(upb::MessageDefPtr descriptor, + const Options& options) { + if (options.bootstrap) { + return absl::StrCat(MessageInitName(descriptor), "()"); } else { - return ToCIdent(ext->file()->package()); + return absl::StrCat("&", MessageInitName(descriptor)); } } -std::string ExtensionLayout(const google::protobuf::FieldDescriptor* ext) { - return absl::StrCat(ExtensionIdentBase(ext), "_", ext->name(), "_ext"); +std::string EnumInitName(upb::EnumDefPtr descriptor) { + return ToCIdent(descriptor.full_name()) + "_enum_init"; +} + +std::string EnumMiniTableRef(upb::EnumDefPtr descriptor, + const Options& options) { + if (options.bootstrap) { + return absl::StrCat(EnumInitName(descriptor), "()"); + } else { + return absl::StrCat("&", EnumInitName(descriptor)); + } +} + +std::string ExtensionIdentBase(upb::FieldDefPtr ext) { + assert(ext.is_extension()); + std::string ext_scope; + if (ext.extension_scope()) { + return MessageName(ext.extension_scope()); + } else { + return ToCIdent(ext.file().package()); + } +} + +std::string ExtensionLayout(upb::FieldDefPtr ext) { + return absl::StrCat(ExtensionIdentBase(ext), "_", ext.name(), "_ext"); } const char* kEnumsInit = "enums_layout"; const char* kExtensionsInit = "extensions_layout"; const char* kMessagesInit = "messages_layout"; -void AddEnums(const protobuf::Descriptor* message, - std::vector* enums) { - enums->reserve(enums->size() + message->enum_type_count()); - for (int i = 0; i < message->enum_type_count(); i++) { - enums->push_back(message->enum_type(i)); - } - for (int i = 0; i < message->nested_type_count(); i++) { - AddEnums(message->nested_type(i), enums); - } +std::string EnumValueSymbol(upb::EnumValDefPtr value) { + return ToCIdent(value.full_name()); } -std::vector SortedEnums( - const protobuf::FileDescriptor* file) { - std::vector enums; - enums.reserve(file->enum_type_count()); - for (int i = 0; i < file->enum_type_count(); i++) { - enums.push_back(file->enum_type(i)); - } - for (int i = 0; i < file->message_type_count(); i++) { - AddEnums(file->message_type(i), &enums); - } - return enums; -} - -std::vector SortedUniqueEnumNumbers( - const protobuf::EnumDescriptor* e) { - std::vector values; - values.reserve(e->value_count()); - for (int i = 0; i < e->value_count(); i++) { - values.push_back(static_cast(e->value(i)->number())); - } - std::sort(values.begin(), values.end()); - auto last = std::unique(values.begin(), values.end()); - values.erase(last, values.end()); - return values; -} - -void AddMessages(const protobuf::Descriptor* message, - std::vector* messages) { - messages->push_back(message); - for (int i = 0; i < message->nested_type_count(); i++) { - AddMessages(message->nested_type(i), messages); - } -} - -// Ordering must match upb/def.c! -// -// The ordering is significant because each upb_MessageDef* will point at the -// corresponding upb_MiniTable and we just iterate through the list without -// any search or lookup. -std::vector SortedMessages( - const protobuf::FileDescriptor* file) { - std::vector messages; - for (int i = 0; i < file->message_type_count(); i++) { - AddMessages(file->message_type(i), &messages); - } - return messages; -} - -void AddExtensionsFromMessage( - const protobuf::Descriptor* message, - std::vector* exts) { - for (int i = 0; i < message->extension_count(); i++) { - exts->push_back(message->extension(i)); - } - for (int i = 0; i < message->nested_type_count(); i++) { - AddExtensionsFromMessage(message->nested_type(i), exts); - } -} - -// Ordering must match upb/def.c! -// -// The ordering is significant because each upb_FieldDef* will point at the -// corresponding upb_MiniTable_Extension and we just iterate through the list -// without any search or lookup. -std::vector SortedExtensions( - const protobuf::FileDescriptor* file) { - std::vector ret; - for (int i = 0; i < file->extension_count(); i++) { - ret.push_back(file->extension(i)); - } - for (int i = 0; i < file->message_type_count(); i++) { - AddExtensionsFromMessage(file->message_type(i), &ret); - } - return ret; -} - -std::vector FieldNumberOrder( - const protobuf::Descriptor* message) { - std::vector fields; - for (int i = 0; i < message->field_count(); i++) { - fields.push_back(message->field(i)); - } - std::sort(fields.begin(), fields.end(), - [](const protobuf::FieldDescriptor* a, - const protobuf::FieldDescriptor* b) { - return a->number() < b->number(); - }); - return fields; -} - -std::string EnumValueSymbol(const protobuf::EnumValueDescriptor* value) { - return ToCIdent(value->full_name()); -} - -std::string CTypeInternal(const protobuf::FieldDescriptor* field, - bool is_const) { +std::string CTypeInternal(upb::FieldDefPtr field, bool is_const) { std::string maybe_const = is_const ? "const " : ""; - switch (field->cpp_type()) { - case protobuf::FieldDescriptor::CPPTYPE_MESSAGE: { + switch (field.ctype()) { + case kUpb_CType_Message: { std::string maybe_struct = - field->file() != field->message_type()->file() ? "struct " : ""; - return maybe_const + maybe_struct + MessageName(field->message_type()) + + field.file() != field.message_type().file() ? "struct " : ""; + return maybe_const + maybe_struct + MessageName(field.message_type()) + "*"; } - case protobuf::FieldDescriptor::CPPTYPE_BOOL: + case kUpb_CType_Bool: return "bool"; - case protobuf::FieldDescriptor::CPPTYPE_FLOAT: + case kUpb_CType_Float: return "float"; - case protobuf::FieldDescriptor::CPPTYPE_INT32: - case protobuf::FieldDescriptor::CPPTYPE_ENUM: + case kUpb_CType_Int32: + case kUpb_CType_Enum: return "int32_t"; - case protobuf::FieldDescriptor::CPPTYPE_UINT32: + case kUpb_CType_UInt32: return "uint32_t"; - case protobuf::FieldDescriptor::CPPTYPE_DOUBLE: + case kUpb_CType_Double: return "double"; - case protobuf::FieldDescriptor::CPPTYPE_INT64: + case kUpb_CType_Int64: return "int64_t"; - case protobuf::FieldDescriptor::CPPTYPE_UINT64: + case kUpb_CType_UInt64: return "uint64_t"; - case protobuf::FieldDescriptor::CPPTYPE_STRING: + case kUpb_CType_String: + case kUpb_CType_Bytes: return "upb_StringView"; default: - fprintf(stderr, "Unexpected type"); abort(); } } -std::string SizeLg2(const protobuf::FieldDescriptor* field) { - switch (field->cpp_type()) { - case protobuf::FieldDescriptor::CPPTYPE_MESSAGE: - return "UPB_SIZE(2, 3)"; - case protobuf::FieldDescriptor::CPPTYPE_ENUM: - return std::to_string(2); - case protobuf::FieldDescriptor::CPPTYPE_BOOL: - return std::to_string(1); - case protobuf::FieldDescriptor::CPPTYPE_FLOAT: - return std::to_string(2); - case protobuf::FieldDescriptor::CPPTYPE_INT32: - return std::to_string(2); - case protobuf::FieldDescriptor::CPPTYPE_UINT32: - return std::to_string(2); - case protobuf::FieldDescriptor::CPPTYPE_DOUBLE: - return std::to_string(3); - case protobuf::FieldDescriptor::CPPTYPE_INT64: - return std::to_string(3); - case protobuf::FieldDescriptor::CPPTYPE_UINT64: - return std::to_string(3); - case protobuf::FieldDescriptor::CPPTYPE_STRING: - return "UPB_SIZE(3, 4)"; - default: - fprintf(stderr, "Unexpected type"); - abort(); +std::string FloatToCLiteral(float value) { + if (value == std::numeric_limits::infinity()) { + return "kUpb_FltInfinity"; + } else if (value == -std::numeric_limits::infinity()) { + return "-kUpb_FltInfinity"; + } else if (std::isnan(value)) { + return "kUpb_NaN"; + } else { + return absl::StrCat(value); } } -bool HasNonZeroDefault(const protobuf::FieldDescriptor* field) { - switch (field->cpp_type()) { - case protobuf::FieldDescriptor::CPPTYPE_MESSAGE: - return false; - case protobuf::FieldDescriptor::CPPTYPE_STRING: - return !field->default_value_string().empty(); - case protobuf::FieldDescriptor::CPPTYPE_INT32: - return field->default_value_int32() != 0; - case protobuf::FieldDescriptor::CPPTYPE_INT64: - return field->default_value_int64() != 0; - case protobuf::FieldDescriptor::CPPTYPE_UINT32: - return field->default_value_uint32() != 0; - case protobuf::FieldDescriptor::CPPTYPE_UINT64: - return field->default_value_uint64() != 0; - case protobuf::FieldDescriptor::CPPTYPE_FLOAT: - return field->default_value_float() != 0; - case protobuf::FieldDescriptor::CPPTYPE_DOUBLE: - return field->default_value_double() != 0; - case protobuf::FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() != false; - case protobuf::FieldDescriptor::CPPTYPE_ENUM: - // Use a number instead of a symbolic name so that we don't require - // this enum's header to be included. - return field->default_value_enum()->number() != 0; +std::string DoubleToCLiteral(double value) { + if (value == std::numeric_limits::infinity()) { + return "kUpb_Infinity"; + } else if (value == -std::numeric_limits::infinity()) { + return "-kUpb_Infinity"; + } else if (std::isnan(value)) { + return "kUpb_NaN"; + } else { + return absl::StrCat(value); } - ABSL_ASSERT(false); - return false; } -std::string FieldDefault(const protobuf::FieldDescriptor* field) { - switch (field->cpp_type()) { - case protobuf::FieldDescriptor::CPPTYPE_MESSAGE: +std::string FieldDefault(upb::FieldDefPtr field) { + switch (field.ctype()) { + case kUpb_CType_Message: return "NULL"; - case protobuf::FieldDescriptor::CPPTYPE_STRING: - return absl::Substitute("upb_StringView_FromString(\"$0\")", - absl::CEscape(field->default_value_string())); - case protobuf::FieldDescriptor::CPPTYPE_INT32: - return absl::Substitute("_upb_Int32_FromI($0)", - field->default_value_int32()); - case protobuf::FieldDescriptor::CPPTYPE_INT64: - return absl::Substitute("_upb_Int64_FromLL($0ll)", - field->default_value_int64()); - case protobuf::FieldDescriptor::CPPTYPE_UINT32: - return absl::Substitute("_upb_UInt32_FromU($0u)", - field->default_value_uint32()); - case protobuf::FieldDescriptor::CPPTYPE_UINT64: - return absl::Substitute("_upb_UInt64_FromULL($0ull)", - field->default_value_uint64()); - case protobuf::FieldDescriptor::CPPTYPE_FLOAT: - return absl::StrCat(field->default_value_float()); - case protobuf::FieldDescriptor::CPPTYPE_DOUBLE: - return absl::StrCat(field->default_value_double()); - case protobuf::FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() ? "true" : "false"; - case protobuf::FieldDescriptor::CPPTYPE_ENUM: + case kUpb_CType_Bytes: + case kUpb_CType_String: { + upb_StringView str = field.default_value().str_val; + return absl::Substitute( + "upb_StringView_FromString(\"$0\")", + absl::CEscape(absl::string_view(str.data, str.size))); + } + case kUpb_CType_Int32: + return absl::Substitute("(int32_t)$0", field.default_value().int32_val); + case kUpb_CType_Int64: + return absl::Substitute("(int64_t)$0ll", field.default_value().int64_val); + case kUpb_CType_UInt32: + return absl::Substitute("(uint32_t)$0u", + field.default_value().uint32_val); + case kUpb_CType_UInt64: + return absl::Substitute("(uint64_t)$0ull", + field.default_value().uint64_val); + case kUpb_CType_Float: + return FloatToCLiteral(field.default_value().float_val); + case kUpb_CType_Double: + return DoubleToCLiteral(field.default_value().double_val); + case kUpb_CType_Bool: + return field.default_value().bool_val ? "true" : "false"; + case kUpb_CType_Enum: // Use a number instead of a symbolic name so that we don't require // this enum's header to be included. - return absl::StrCat(field->default_value_enum()->number()); + return absl::StrCat(field.default_value().int32_val); } ABSL_ASSERT(false); return "XXX"; } -std::string CType(const protobuf::FieldDescriptor* field) { +std::string CType(upb::FieldDefPtr field) { return CTypeInternal(field, false); } -std::string CTypeConst(const protobuf::FieldDescriptor* field) { +std::string CTypeConst(upb::FieldDefPtr field) { return CTypeInternal(field, true); } -//////////////////////////////////////////////////////////////////////////////// -// FilePlatformLayout -//////////////////////////////////////////////////////////////////////////////// - -// FilePlatformLayout builds and vends upb MiniTables for a given platform (32 -// or 64 bit). -class FilePlatformLayout { - public: - FilePlatformLayout(const protobuf::FileDescriptor* fd, - upb_MiniTablePlatform platform) - : platform_(platform) { - BuildMiniTables(fd); - BuildExtensions(fd); - } - - // Retrieves a upb MiniTable or Extension given a protobuf descriptor. The - // descriptor must be from this layout's file. - upb_MiniTable* GetMiniTable(const protobuf::Descriptor* m) const; - upb_MiniTable_Enum* GetEnumTable(const protobuf::EnumDescriptor* d) const; - const upb_MiniTable_Extension* GetExtension( - const protobuf::FieldDescriptor* fd) const; - - // Get the initializer for the given sub-message/sub-enum link. - static std::string GetSub(upb_MiniTable_Sub sub); - - private: - // Functions to build mini-tables for this file's messages and extensions. - void BuildMiniTables(const protobuf::FileDescriptor* fd); - void BuildExtensions(const protobuf::FileDescriptor* fd); - upb_MiniTable* MakeMiniTable(const protobuf::Descriptor* m); - upb_MiniTable* MakeRegularMiniTable(const protobuf::Descriptor* m); - upb_MiniTable_Enum* MakeMiniTableEnum(const protobuf::EnumDescriptor* d); - uint64_t GetMessageModifiers(const protobuf::Descriptor* m); - uint64_t GetFieldModifiers(const protobuf::FieldDescriptor* f); - void ResolveIntraFileReferences(); - - // When we are generating code, tables are linked to sub-tables via name (ie. - // a string) rather than by pointer. We need to emit an initializer like - // `&foo_sub_table`. To do this, we store `const char*` strings in all the - // links that would normally be pointers: - // field -> sub-message - // field -> enum table (proto2 only) - // extension -> extendee - // - // This requires a bit of reinterpret_cast<>(), but it's confined to a few - // functions. We tag the pointer so we know which member of the union to - // initialize. - enum SubTag { - kNull = 0, - kMessage = 1, - kEnum = 2, - kMask = 3, - }; - - static upb_MiniTable_Sub PackSub(const char* data, SubTag tag); - static bool IsNull(upb_MiniTable_Sub sub); - void SetSubTableStrings(); - upb_MiniTable_Sub PackSubForField(const protobuf::FieldDescriptor* f, - const upb_MiniTable_Field* mt_f); - const char* AllocStr(absl::string_view str); - - private: - using TableMap = - absl::flat_hash_map; - 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_; -}; - -upb_MiniTable* FilePlatformLayout::GetMiniTable( - const protobuf::Descriptor* m) const { - auto it = table_map_.find(m); - assert(it != table_map_.end()); - return it->second; +std::string MapKeyCType(upb::FieldDefPtr map_field) { + return CType(map_field.message_type().map_key()); } -upb_MiniTable_Enum* FilePlatformLayout::GetEnumTable( - const protobuf::EnumDescriptor* d) const { - auto it = enum_map_.find(d); - assert(it != enum_map_.end()); - return it->second; +std::string MapValueCType(upb::FieldDefPtr map_field) { + return CType(map_field.message_type().map_value()); } -const upb_MiniTable_Extension* FilePlatformLayout::GetExtension( - const protobuf::FieldDescriptor* fd) const { - auto it = extension_map_.find(fd); - assert(it != extension_map_.end()); - return &it->second; +std::string MapKeySize(upb::FieldDefPtr map_field, absl::string_view expr) { + return map_field.message_type().map_key().ctype() == kUpb_CType_String + ? "0" + : absl::StrCat("sizeof(", expr, ")"); } -void FilePlatformLayout::ResolveIntraFileReferences() { - // This properly resolves references within a file, in order to set any - // necessary flags (eg. is a map). - for (const auto& pair : table_map_) { - upb_MiniTable* mt = pair.second; - // First we properly resolve for defs within the file. - for (const auto* f : FieldNumberOrder(pair.first)) { - if (f->message_type() && f->message_type()->file() == f->file()) { - // const_cast is safe because the mini-table is owned exclusively - // by us, and was allocated from an arena (known-writable memory). - upb_MiniTable_Field* mt_f = const_cast( - upb_MiniTable_FindFieldByNumber(mt, f->number())); - upb_MiniTable* sub_mt = GetMiniTable(f->message_type()); - upb_MiniTable_SetSubMessage(mt, mt_f, sub_mt); - } - // We don't worry about enums here, because resolving an enum will - // never alter the mini-table. - } - } +std::string MapValueSize(upb::FieldDefPtr map_field, absl::string_view expr) { + return map_field.message_type().map_value().ctype() == kUpb_CType_String + ? "0" + : absl::StrCat("sizeof(", expr, ")"); } -upb_MiniTable_Sub FilePlatformLayout::PackSub(const char* data, SubTag tag) { - uintptr_t val = reinterpret_cast(data); - assert((val & kMask) == 0); - upb_MiniTable_Sub sub; - sub.submsg = reinterpret_cast(val | tag); - return sub; -} +std::string FieldInitializer(const DefPoolPair& pools, upb::FieldDefPtr field, + const Options& options); -bool FilePlatformLayout::IsNull(upb_MiniTable_Sub sub) { - return reinterpret_cast(sub.subenum) == 0; -} - -std::string FilePlatformLayout::GetSub(upb_MiniTable_Sub sub) { - uintptr_t as_int = reinterpret_cast(sub.submsg); - const char* str = reinterpret_cast(as_int & ~SubTag::kMask); - switch (as_int & SubTag::kMask) { - case SubTag::kMessage: - return absl::Substitute("{.submsg = &$0}", str); - case SubTag::kEnum: - return absl::Substitute("{.subenum = &$0}", str); - default: - return std::string("{.submsg = NULL}"); - } - return std::string("ERROR in GetSub"); -} - -void FilePlatformLayout::SetSubTableStrings() { - for (const auto& pair : table_map_) { - upb_MiniTable* mt = pair.second; - for (const auto* f : FieldNumberOrder(pair.first)) { - upb_MiniTable_Field* mt_f = const_cast( - upb_MiniTable_FindFieldByNumber(mt, f->number())); - assert(mt_f); - upb_MiniTable_Sub sub = PackSubForField(f, mt_f); - if (IsNull(sub)) continue; - // const_cast is safe because the mini-table is owned exclusively - // by us, and was allocated from an arena (known-writable memory). - *const_cast(&mt->subs[mt_f->submsg_index]) = sub; - } - } -} - -upb_MiniTable_Sub FilePlatformLayout::PackSubForField( - const protobuf::FieldDescriptor* f, const upb_MiniTable_Field* mt_f) { - if (mt_f->submsg_index == kUpb_NoSub) { - return PackSub(nullptr, SubTag::kNull); - } else if (f->message_type()) { - return PackSub(AllocStr(MessageInit(f->message_type())), SubTag::kMessage); - } else { - ABSL_ASSERT(f->enum_type()); - return PackSub(AllocStr(EnumInit(f->enum_type())), SubTag::kEnum); - } -} - -const char* FilePlatformLayout::AllocStr(absl::string_view str) { - char* ret = - static_cast(upb_Arena_Malloc(arena_.ptr(), str.size() + 1)); - memcpy(ret, str.data(), str.size()); - ret[str.size()] = '\0'; - return ret; -} - -void FilePlatformLayout::BuildMiniTables(const protobuf::FileDescriptor* fd) { - for (const auto& m : SortedMessages(fd)) { - table_map_[m] = MakeMiniTable(m); - } - for (const auto& e : SortedEnums(fd)) { - enum_map_[e] = MakeMiniTableEnum(e); - } - ResolveIntraFileReferences(); - SetSubTableStrings(); -} - -void FilePlatformLayout::BuildExtensions(const protobuf::FileDescriptor* fd) { - std::vector sorted = SortedExtensions(fd); - upb::Status status; - for (const auto* f : sorted) { - upb::MtDataEncoder e; - e.StartMessage(0); - e.PutField(static_cast(f->type()), f->number(), - GetFieldModifiers(f)); - upb_MiniTable_Extension& ext = extension_map_[f]; - upb_MiniTable_Sub sub; - bool ok = upb_MiniTable_BuildExtension(e.data().data(), e.data().size(), - &ext, sub, status.ptr()); - if (!ok) { - // TODO(haberman): Use ABSL CHECK() when it is available. - fprintf(stderr, "Error building mini-table: %s\n", - status.error_message()); - } - ABSL_ASSERT(ok); - ext.extendee = reinterpret_cast( - AllocStr(MessageInit(f->containing_type()))); - ext.sub = PackSubForField(f, &ext.field); - } -} - -upb_MiniTable* FilePlatformLayout::MakeMiniTable( - const protobuf::Descriptor* m) { - if (m->options().message_set_wire_format()) { - return upb_MiniTable_BuildMessageSet(platform_, arena_.ptr()); - } else if (m->options().map_entry()) { - return upb_MiniTable_BuildMapEntry( - static_cast(m->map_key()->type()), - static_cast(m->map_value()->type()), - m->map_value()->enum_type() && - m->map_value()->enum_type()->file()->syntax() == - protobuf::FileDescriptor::SYNTAX_PROTO3, - platform_, arena_.ptr()); - } else { - return MakeRegularMiniTable(m); - } -} - -upb_MiniTable* FilePlatformLayout::MakeRegularMiniTable( - const protobuf::Descriptor* m) { - upb::MtDataEncoder e; - e.StartMessage(GetMessageModifiers(m)); - for (const auto* f : FieldNumberOrder(m)) { - e.PutField(static_cast(f->type()), f->number(), - GetFieldModifiers(f)); - } - for (int i = 0; i < m->real_oneof_decl_count(); i++) { - const protobuf::OneofDescriptor* oneof = m->oneof_decl(i); - e.StartOneof(); - for (int j = 0; j < oneof->field_count(); j++) { - const protobuf::FieldDescriptor* f = oneof->field(j); - e.PutOneofField(f->number()); - } - } - absl::string_view str = e.data(); - upb::Status status; - upb_MiniTable* ret = upb_MiniTable_Build(str.data(), str.size(), platform_, - arena_.ptr(), status.ptr()); - if (!ret) { - fprintf(stderr, "Error building mini-table: %s\n", status.error_message()); - } - assert(ret); - return ret; -} - -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; - - if (m->file()->syntax() == protobuf::FileDescriptor::SYNTAX_PROTO3) { - ret |= kUpb_MessageModifier_ValidateUtf8; - ret |= kUpb_MessageModifier_DefaultIsPacked; - } - - if (m->extension_range_count() > 0) { - ret |= kUpb_MessageModifier_IsExtendable; - } - - assert(!m->options().map_entry()); - return ret; -} - -uint64_t FilePlatformLayout::GetFieldModifiers( - const protobuf::FieldDescriptor* f) { - uint64_t ret = 0; - - if (f->is_repeated()) ret |= kUpb_FieldModifier_IsRepeated; - if (f->is_required()) ret |= kUpb_FieldModifier_IsRequired; - if (f->is_packed()) ret |= kUpb_FieldModifier_IsPacked; - if (f->enum_type() && f->enum_type()->file()->syntax() == - protobuf::FileDescriptor::SYNTAX_PROTO2) { - ret |= kUpb_FieldModifier_IsClosedEnum; - } - if (f->is_optional() && !f->has_presence()) { - ret |= kUpb_FieldModifier_IsProto3Singular; - } - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -// FileLayout -//////////////////////////////////////////////////////////////////////////////// - -// FileLayout is a pair of platform layouts: one for 32-bit and one for 64-bit. -class FileLayout { - public: - FileLayout(const protobuf::FileDescriptor* fd) - : descriptor_(fd), - layout32_(fd, kUpb_MiniTablePlatform_32Bit), - layout64_(fd, kUpb_MiniTablePlatform_64Bit) {} - - const protobuf::FileDescriptor* descriptor() const { return descriptor_; } - - const upb_MiniTable* GetMiniTable32(const protobuf::Descriptor* m) const { - return layout32_.GetMiniTable(m); - } - - const upb_MiniTable* GetMiniTable64(const protobuf::Descriptor* m) const { - return layout64_.GetMiniTable(m); - } - - 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()); - const upb_MiniTable_Field* f_64 = upb_MiniTable_FindFieldByNumber( - GetMiniTable64(f->containing_type()), f->number()); - return absl::Substitute("UPB_SIZE($0, $1)", f_32->offset, f_64->offset); - } - - std::string GetOneofCaseOffset(const protobuf::OneofDescriptor* o) const { - const protobuf::FieldDescriptor* f = o->field(0); - const upb_MiniTable_Field* f_32 = upb_MiniTable_FindFieldByNumber( - GetMiniTable32(f->containing_type()), f->number()); - const upb_MiniTable_Field* f_64 = upb_MiniTable_FindFieldByNumber( - GetMiniTable64(f->containing_type()), f->number()); - return absl::Substitute("UPB_SIZE($0, $1)", ~f_32->presence, - ~f_64->presence); - } - - std::string GetMessageSize(const protobuf::Descriptor* d) const { - return absl::Substitute("UPB_SIZE($0, $1)", GetMiniTable32(d)->size, - GetMiniTable64(d)->size); - } - - int GetHasbitIndex(const protobuf::FieldDescriptor* f) const { - const upb_MiniTable_Field* f_64 = upb_MiniTable_FindFieldByNumber( - GetMiniTable64(f->containing_type()), f->number()); - return f_64->presence; - } - - bool HasHasbit(const protobuf::FieldDescriptor* f) const { - return GetHasbitIndex(f) > 0; - } - - const upb_MiniTable_Extension* GetExtension( - const protobuf::FieldDescriptor* f) const { - return layout64_.GetExtension(f); - } - - private: - const protobuf::FileDescriptor* descriptor_; - FilePlatformLayout layout32_; - FilePlatformLayout layout64_; -}; - -void DumpEnumValues(const protobuf::EnumDescriptor* desc, Output& output) { - std::vector values; - for (int i = 0; i < desc->value_count(); i++) { - values.push_back(desc->value(i)); +void DumpEnumValues(upb::EnumDefPtr desc, Output& output) { + std::vector values; + values.reserve(desc.value_count()); + for (int i = 0; i < desc.value_count(); i++) { + values.push_back(desc.value(i)); } std::sort(values.begin(), values.end(), - [](const protobuf::EnumValueDescriptor* a, - const protobuf::EnumValueDescriptor* b) { - return a->number() < b->number(); + [](upb::EnumValDefPtr a, upb::EnumValDefPtr b) { + return a.number() < b.number(); }); for (size_t i = 0; i < values.size(); i++) { auto value = values[i]; - output(" $0 = $1", EnumValueSymbol(value), value->number()); + output(" $0 = $1", EnumValueSymbol(value), value.number()); if (i != values.size() - 1) { output(","); } @@ -739,79 +274,75 @@ void DumpEnumValues(const protobuf::EnumDescriptor* desc, Output& output) { } } -void GenerateExtensionInHeader(const protobuf::FieldDescriptor* ext, +std::string GetFieldRep(const DefPoolPair& pools, upb::FieldDefPtr field); + +void GenerateExtensionInHeader(const DefPoolPair& pools, upb::FieldDefPtr ext, Output& output) { output( R"cc( UPB_INLINE bool $0_has_$1(const struct $2* msg) { - return _upb_Message_Getext(msg, &$3) != NULL; + return _upb_Message_HasExtensionField(msg, &$3); } )cc", - ExtensionIdentBase(ext), ext->name(), MessageName(ext->containing_type()), + ExtensionIdentBase(ext), ext.name(), MessageName(ext.containing_type()), ExtensionLayout(ext)); output( R"cc( UPB_INLINE void $0_clear_$1(struct $2* msg) { - _upb_Message_Clearext(msg, &$3); + _upb_Message_ClearExtensionField(msg, &$3); } )cc", - ExtensionIdentBase(ext), ext->name(), MessageName(ext->containing_type()), + ExtensionIdentBase(ext), ext.name(), MessageName(ext.containing_type()), ExtensionLayout(ext)); - if (ext->is_repeated()) { - } else if (ext->message_type()) { - output( - R"cc( - UPB_INLINE $0 $1_$2(const struct $3* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &$4); - UPB_ASSERT(ext); - return *UPB_PTR_AT(&ext->data, 0, $0); - } - )cc", - CTypeConst(ext), ExtensionIdentBase(ext), ext->name(), - MessageName(ext->containing_type()), ExtensionLayout(ext), - FieldDefault(ext)); - output( - R"cc( - UPB_INLINE void $1_set_$2(struct $3* msg, $0 ext, upb_Arena* arena) { - const upb_Message_Extension* msg_ext = - _upb_Message_GetOrCreateExtension(msg, &$4, arena); - UPB_ASSERT(msg_ext); - *UPB_PTR_AT(&msg_ext->data, 0, $0) = ext; - } - )cc", - CTypeConst(ext), ExtensionIdentBase(ext), ext->name(), - MessageName(ext->containing_type()), ExtensionLayout(ext), - FieldDefault(ext)); + if (ext.IsSequence()) { + // TODO(b/259861668): We need generated accessors for repeated extensions. } else { - // Returns default if extension field is not a message. output( R"cc( UPB_INLINE $0 $1_$2(const struct $3* msg) { - const upb_Message_Extension* ext = _upb_Message_Getext(msg, &$4); - return ext ? *UPB_PTR_AT(&ext->data, 0, $0) : $5; + const upb_MiniTableExtension* ext = &$4; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == $5); + $0 default_val = $6; + $0 ret; + _upb_Message_GetExtensionField(msg, ext, &default_val, &ret); + return ret; } )cc", - CTypeConst(ext), ExtensionIdentBase(ext), ext->name(), - MessageName(ext->containing_type()), ExtensionLayout(ext), - FieldDefault(ext)); + CTypeConst(ext), ExtensionIdentBase(ext), ext.name(), + MessageName(ext.containing_type()), ExtensionLayout(ext), + GetFieldRep(pools, ext), FieldDefault(ext)); + output( + R"cc( + UPB_INLINE void $1_set_$2(struct $3* msg, $0 val, upb_Arena* arena) { + const upb_MiniTableExtension* ext = &$4; + UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field)); + UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == $5); + bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena); + UPB_ASSERT(ok); + } + )cc", + CTypeConst(ext), ExtensionIdentBase(ext), ext.name(), + MessageName(ext.containing_type()), ExtensionLayout(ext), + GetFieldRep(pools, ext)); } } -void GenerateMessageFunctionsInHeader(const protobuf::Descriptor* message, - Output& output) { +void GenerateMessageFunctionsInHeader(upb::MessageDefPtr message, + const Options& options, 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) { - return ($0*)_upb_Message_New(&$1, arena); + return ($0*)_upb_Message_New($1, arena); } UPB_INLINE $0* $0_parse(const char* buf, size_t size, upb_Arena* arena) { $0* ret = $0_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &$1, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + if (upb_Decode(buf, size, ret, $1, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { return NULL; } return ret; @@ -821,7 +352,7 @@ void GenerateMessageFunctionsInHeader(const protobuf::Descriptor* message, int options, upb_Arena* arena) { $0* ret = $0_new(arena); if (!ret) return NULL; - if (upb_Decode(buf, size, ret, &$1, extreg, options, arena) != + if (upb_Decode(buf, size, ret, $1, extreg, options, arena) != kUpb_DecodeStatus_Ok) { return NULL; } @@ -829,27 +360,27 @@ void GenerateMessageFunctionsInHeader(const protobuf::Descriptor* message, } UPB_INLINE char* $0_serialize(const $0* msg, upb_Arena* arena, size_t* len) { char* ptr; - (void)upb_Encode(msg, &$1, 0, arena, &ptr, len); + (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) { char* ptr; - (void)upb_Encode(msg, &$1, options, arena, &ptr, len); + (void)upb_Encode(msg, $1, options, arena, &ptr, len); return ptr; } )cc", - MessageName(message), MessageInit(message)); + MessageName(message), MessageMiniTableRef(message, options)); } -void GenerateOneofInHeader(const protobuf::OneofDescriptor* oneof, - const FileLayout& layout, absl::string_view msg_name, +void GenerateOneofInHeader(upb::OneofDefPtr oneof, const DefPoolPair& pools, + absl::string_view msg_name, const Options& options, Output& output) { - std::string fullname = ToCIdent(oneof->full_name()); + std::string fullname = ToCIdent(oneof.full_name()); output("typedef enum {\n"); - for (int j = 0; j < oneof->field_count(); j++) { - const protobuf::FieldDescriptor* field = oneof->field(j); - output(" $0_$1 = $2,\n", fullname, field->name(), field->number()); + for (int j = 0; j < oneof.field_count(); j++) { + upb::FieldDefPtr field = oneof.field(j); + output(" $0_$1 = $2,\n", fullname, field.name(), field.number()); } output( " $0_NOT_SET = 0\n" @@ -858,174 +389,112 @@ void GenerateOneofInHeader(const protobuf::OneofDescriptor* oneof, output( R"cc( UPB_INLINE $0_oneofcases $1_$2_case(const $1* msg) { - return ($0_oneofcases)*UPB_PTR_AT(msg, $3, int32_t); + const upb_MiniTableField field = $3; + return ($0_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field); } )cc", - fullname, msg_name, oneof->name(), layout.GetOneofCaseOffset(oneof)); + fullname, msg_name, oneof.name(), + FieldInitializer(pools, oneof.field(0), options)); } -void GenerateHazzer(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { - if (layout.HasHasbit(field)) { +void GenerateHazzer(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + std::string resolved_name = ResolveFieldName(field, field_names); + if (field.has_presence()) { output( R"cc( UPB_INLINE bool $0_has_$1(const $0* msg) { - return _upb_hasbit(msg, $2); + const upb_MiniTableField field = $2; + return _upb_Message_HasNonExtensionField(msg, &field); } )cc", - msg_name, field->name(), layout.GetHasbitIndex(field)); - } else if (field->real_containing_oneof()) { + msg_name, resolved_name, FieldInitializer(pools, field, options)); + } else if (field.IsMap()) { + // TODO(b/259616267): remove. output( R"cc( UPB_INLINE bool $0_has_$1(const $0* msg) { - return _upb_getoneofcase(msg, $2) == $3; + return $0_$1_size(msg) != 0; } )cc", - msg_name, field->name(), - layout.GetOneofCaseOffset(field->real_containing_oneof()), - field->number()); - } else if (field->message_type()) { + msg_name, resolved_name); + } else if (field.IsSequence()) { + // TODO(b/259616267): remove. output( R"cc( UPB_INLINE bool $0_has_$1(const $0* msg) { - return _upb_has_submsg_nohasbit(msg, $2); + size_t size; + $0_$1(msg, &size); + return size != 0; } )cc", - msg_name, field->name(), layout.GetFieldOffset(field)); + msg_name, resolved_name); } } -void GenerateClear(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, +void GenerateClear(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, const Options& options, Output& output) { - if (field == field->containing_type()->map_key() || - field == field->containing_type()->map_value()) { + if (field == field.containing_type().map_key() || + field == field.containing_type().map_value()) { // Cannot be cleared. return; } - - if (field->real_containing_oneof()) { - const protobuf::OneofDescriptor* oneof = field->real_containing_oneof(); - std::string oneof_fullname = ToCIdent(oneof->full_name()); - std::string default_value = - field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "upb_StringView_FromDataAndSize(NULL, 0)" - : "0"; - output( - R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - UPB_WRITE_ONEOF(msg, $2, $3, $7, $4, $6_NOT_SET); - } - )cc", - msg_name, field->name(), CType(field), layout.GetFieldOffset(field), - layout.GetOneofCaseOffset(field->real_containing_oneof()), - field->number(), oneof_fullname, default_value); - } else { - if (field->message_type()) { - output( - R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - *UPB_PTR_AT(msg, $2, const upb_Message*) = NULL; - } - )cc", - msg_name, field->name(), layout.GetFieldOffset(field)); - } else if (layout.HasHasbit(field)) { - if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) { - output( - R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - *UPB_PTR_AT(msg, $3, $2) = upb_StringView_FromDataAndSize(NULL, 0); - _upb_clearhas(msg, $4); - } - )cc", - msg_name, field->name(), CType(field), layout.GetFieldOffset(field), - layout.GetHasbitIndex(field)); - } else { - output( - R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - *UPB_PTR_AT(msg, $3, $2) = 0; - _upb_clearhas(msg, $4); - } - )cc", - msg_name, field->name(), CType(field), layout.GetFieldOffset(field), - layout.GetHasbitIndex(field)); - } - } else { - if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) { - output( - R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - *UPB_PTR_AT(msg, $3, $2) = upb_StringView_FromDataAndSize(NULL, 0); - } - )cc", - msg_name, field->name(), CType(field), - layout.GetFieldOffset(field)); - } else { - output( - R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - *UPB_PTR_AT(msg, $3, $2) = 0; - } - )cc", - msg_name, field->name(), CType(field), layout.GetFieldOffset(field), - layout.GetHasbitIndex(field)); - } - } - } -} - -void GenerateRepeatedClear(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { + std::string resolved_name = ResolveFieldName(field, field_names); output( R"cc( - UPB_INLINE void $0_clear_$1(const $0* msg) { - _upb_array_detach(msg, $2); + UPB_INLINE void $0_clear_$1($0* msg) { + const upb_MiniTableField field = $2; + _upb_Message_ClearNonExtensionField(msg, &field); } )cc", - msg_name, field->name(), layout.GetFieldOffset(field)); + msg_name, resolved_name, FieldInitializer(pools, field, options)); } -void GenerateMapGetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { - const protobuf::Descriptor* entry = field->message_type(); - const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1); - const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2); +void GenerateMapGetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + std::string resolved_name = ResolveFieldName(field, field_names); output( R"cc( UPB_INLINE size_t $0_$1_size(const $0* msg) { - return _upb_msg_map_size(msg, $2); + const upb_MiniTableField field = $2; + const upb_Map* map = upb_Message_GetMap(msg, &field); + return map ? _upb_Map_Size(map) : 0; } )cc", - msg_name, field->name(), layout.GetFieldOffset(field)); + msg_name, resolved_name, FieldInitializer(pools, field, options)); output( R"cc( UPB_INLINE bool $0_$1_get(const $0* msg, $2 key, $3* val) { - return _upb_msg_map_get(msg, $4, &key, $5, val, $6); + const upb_MiniTableField field = $4; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Get(map, &key, $5, val, $6); } )cc", - msg_name, field->name(), CType(key), CType(val), - layout.GetFieldOffset(field), - key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(key)", - val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(*val)"); + msg_name, resolved_name, MapKeyCType(field), MapValueCType(field), + FieldInitializer(pools, field, options), MapKeySize(field, "key"), + MapValueSize(field, "*val")); output( R"cc( UPB_INLINE $0 $1_$2_next(const $1* msg, size_t* iter) { - return ($0)_upb_msg_map_next(msg, $3, iter); + const upb_MiniTableField field = $3; + const upb_Map* map = upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return ($0)_upb_map_next(map, iter); } )cc", - CTypeConst(field), msg_name, field->name(), layout.GetFieldOffset(field)); + CTypeConst(field), msg_name, resolved_name, + FieldInitializer(pools, field, options)); } -void GenerateMapEntryGetters(const protobuf::FieldDescriptor* field, - absl::string_view msg_name, Output& output) { +void GenerateMapEntryGetters(upb::FieldDefPtr field, absl::string_view msg_name, + Output& output) { output( R"cc( UPB_INLINE $0 $1_$2(const $1* msg) { @@ -1034,394 +503,415 @@ void GenerateMapEntryGetters(const protobuf::FieldDescriptor* field, return ret; } )cc", - CTypeConst(field), msg_name, field->name(), CType(field), - field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(ret)"); + CTypeConst(field), msg_name, field.name(), CType(field), + field.ctype() == kUpb_CType_String ? "0" : "sizeof(ret)"); } -void GenerateRepeatedGetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, - absl::string_view msg_name, Output& output) { +void GenerateRepeatedGetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { output( R"cc( - UPB_INLINE $0 const* $1_$2(const $1* msg, size_t* len) { - return ($0 const*)_upb_array_accessor(msg, $3, len); + UPB_INLINE $0 const* $1_$2(const $1* msg, size_t* size) { + const upb_MiniTableField field = $3; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return ($0 const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } )cc", - CTypeConst(field), msg_name, field->name(), layout.GetFieldOffset(field)); + CTypeConst(field), msg_name, ResolveFieldName(field, field_names), + FieldInitializer(pools, field, options)); } -void GenerateOneofGetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { +void GenerateScalarGetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& Options, Output& output) { + std::string field_name = ResolveFieldName(field, field_names); output( R"cc( UPB_INLINE $0 $1_$2(const $1* msg) { - return UPB_READ_ONEOF(msg, $0, $3, $4, $5, $6); + $0 default_val = $3; + $0 ret; + const upb_MiniTableField field = $4; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; } )cc", - CTypeConst(field), msg_name, field->name(), layout.GetFieldOffset(field), - layout.GetOneofCaseOffset(field->real_containing_oneof()), - field->number(), FieldDefault(field)); + CTypeConst(field), msg_name, field_name, FieldDefault(field), + FieldInitializer(pools, field, Options)); } -void GenerateScalarGetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { - if (HasNonZeroDefault(field)) { - output( - R"cc( - UPB_INLINE $0 $1_$2(const $1* msg) { - return $1_has_$2(msg) ? *UPB_PTR_AT(msg, $3, $0) : $4; - } - )cc", - CTypeConst(field), msg_name, field->name(), - layout.GetFieldOffset(field), FieldDefault(field)); - } else { - output( - R"cc( - UPB_INLINE $0 $1_$2(const $1* msg) { - return *UPB_PTR_AT(msg, $3, $0); - } - )cc", - CTypeConst(field), msg_name, field->name(), - layout.GetFieldOffset(field)); - } -} - -void GenerateGetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { - if (field->is_map()) { - GenerateMapGetters(field, layout, msg_name, output); - } else if (field->containing_type()->options().map_entry()) { +void GenerateGetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + if (field.IsMap()) { + GenerateMapGetters(field, pools, msg_name, field_names, options, output); + } else if (UPB_DESC(MessageOptions_map_entry)( + field.containing_type().options())) { GenerateMapEntryGetters(field, msg_name, output); - } else if (field->is_repeated()) { - GenerateRepeatedGetters(field, layout, msg_name, output); - } else if (field->real_containing_oneof()) { - GenerateOneofGetters(field, layout, msg_name, output); + } else if (field.IsSequence()) { + GenerateRepeatedGetters(field, pools, msg_name, field_names, options, + output); } else { - GenerateScalarGetters(field, layout, msg_name, output); + GenerateScalarGetters(field, pools, msg_name, field_names, options, output); } } -void GenerateMapSetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { - const protobuf::Descriptor* entry = field->message_type(); - const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1); - const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2); +void GenerateMapSetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + std::string resolved_name = ResolveFieldName(field, field_names); output( R"cc( - UPB_INLINE void $0_$1_clear($0* msg) { _upb_msg_map_clear(msg, $2); } + UPB_INLINE void $0_$1_clear($0* msg) { + const upb_MiniTableField field = $2; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return; + _upb_Map_Clear(map); + } )cc", - msg_name, field->name(), layout.GetFieldOffset(field)); + msg_name, resolved_name, FieldInitializer(pools, field, options)); output( R"cc( UPB_INLINE bool $0_$1_set($0* msg, $2 key, $3 val, upb_Arena* a) { - return _upb_msg_map_set(msg, $4, &key, $5, &val, $6, a); + const upb_MiniTableField field = $4; + upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, $5, $6, a); + return _upb_Map_Insert(map, &key, $5, &val, $6, a) != + kUpb_MapInsertStatus_OutOfMemory; } )cc", - msg_name, field->name(), CType(key), CType(val), - layout.GetFieldOffset(field), - key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(key)", - val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(val)"); + msg_name, resolved_name, MapKeyCType(field), MapValueCType(field), + FieldInitializer(pools, field, options), MapKeySize(field, "key"), + MapValueSize(field, "val")); output( R"cc( UPB_INLINE bool $0_$1_delete($0* msg, $2 key) { - return _upb_msg_map_delete(msg, $3, &key, $4); + const upb_MiniTableField field = $3; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return false; + return _upb_Map_Delete(map, &key, $4, NULL); } )cc", - msg_name, field->name(), CType(key), layout.GetFieldOffset(field), - key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(key)"); + msg_name, resolved_name, MapKeyCType(field), + FieldInitializer(pools, field, options), MapKeySize(field, "key")); output( R"cc( UPB_INLINE $0 $1_$2_nextmutable($1* msg, size_t* iter) { - return ($0)_upb_msg_map_next(msg, $3, iter); + const upb_MiniTableField field = $3; + upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field); + if (!map) return NULL; + return ($0)_upb_map_next(map, iter); } )cc", - CType(field), msg_name, field->name(), layout.GetFieldOffset(field)); + CType(field), msg_name, resolved_name, + FieldInitializer(pools, field, options)); } -void GenerateRepeatedSetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, - absl::string_view msg_name, Output& output) { +void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + std::string resolved_name = ResolveFieldName(field, field_names); output( R"cc( - UPB_INLINE $0* $1_mutable_$2($1* msg, size_t* len) { - return ($0*)_upb_array_mutable_accessor(msg, $3, len); + UPB_INLINE $0* $1_mutable_$2($1* msg, size_t* size) { + upb_MiniTableField field = $3; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return ($0*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } } )cc", - CType(field), msg_name, field->name(), layout.GetFieldOffset(field)); + CType(field), msg_name, resolved_name, + FieldInitializer(pools, field, options)); output( R"cc( - UPB_INLINE $0* $1_resize_$2($1* msg, size_t len, upb_Arena* arena) { - return ($0*)_upb_Array_Resize_accessor2(msg, $3, len, $4, arena); + UPB_INLINE $0* $1_resize_$2($1* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = $3; + return ($0*)upb_Message_ResizeArray(msg, &field, size, arena); } )cc", - CType(field), msg_name, field->name(), layout.GetFieldOffset(field), - SizeLg2(field)); - if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + CType(field), msg_name, resolved_name, + FieldInitializer(pools, field, options)); + if (field.ctype() == kUpb_CType_Message) { output( R"cc( UPB_INLINE struct $0* $1_add_$2($1* msg, upb_Arena* arena) { - struct $0* sub = (struct $0*)_upb_Message_New(&$3, arena); - bool ok = _upb_Array_Append_accessor2(msg, $4, $5, &sub, arena); - if (!ok) return NULL; + upb_MiniTableField field = $4; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct $0* sub = (struct $0*)_upb_Message_New($3, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); return sub; } )cc", - MessageName(field->message_type()), msg_name, field->name(), - MessageInit(field->message_type()), layout.GetFieldOffset(field), - SizeLg2(field)); + MessageName(field.message_type()), msg_name, resolved_name, + MessageMiniTableRef(field.message_type(), options), + FieldInitializer(pools, field, options)); } else { output( R"cc( UPB_INLINE bool $1_add_$2($1* msg, $0 val, upb_Arena* arena) { - return _upb_Array_Append_accessor2(msg, $3, $4, &val, arena); + upb_MiniTableField field = $3; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; } )cc", - CType(field), msg_name, field->name(), layout.GetFieldOffset(field), - SizeLg2(field)); + CType(field), msg_name, resolved_name, + FieldInitializer(pools, field, options)); } } -void GenerateNonRepeatedSetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, - absl::string_view msg_name, Output& output) { - if (field == field->containing_type()->map_key()) { +void GenerateNonRepeatedSetters(upb::FieldDefPtr field, + const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + if (field == field.containing_type().map_key()) { // Key cannot be mutated. return; } - // The common function signature for all setters. Varying - // implementations follow. - output("UPB_INLINE void $0_set_$1($0 *msg, $2 value) {\n", msg_name, - field->name(), CType(field)); + std::string field_name = ResolveFieldName(field, field_names); - if (field == field->containing_type()->map_value()) { - output( - " _upb_msg_map_set_value(msg, &value, $0);\n" - "}\n", - field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING - ? "0" - : "sizeof(" + CType(field) + ")"); - } else if (field->real_containing_oneof()) { - output( - " UPB_WRITE_ONEOF(msg, $0, $1, value, $2, $3);\n" - "}\n", - CType(field), layout.GetFieldOffset(field), - layout.GetOneofCaseOffset(field->real_containing_oneof()), - field->number()); + if (field == field.containing_type().map_value()) { + output(R"cc( + UPB_INLINE void $0_set_$1($0 *msg, $2 value) { + _upb_msg_map_set_value(msg, &value, $3); + } + )cc", + msg_name, field_name, CType(field), + field.ctype() == kUpb_CType_String ? "0" + : "sizeof(" + CType(field) + ")"); } else { - if (layout.HasHasbit(field)) { - output(" _upb_sethas(msg, $0);\n", layout.GetHasbitIndex(field)); - } - output( - " *UPB_PTR_AT(msg, $1, $0) = value;\n" - "}\n", - CType(field), layout.GetFieldOffset(field)); + output(R"cc( + UPB_INLINE void $0_set_$1($0 *msg, $2 value) { + const upb_MiniTableField field = $3; + _upb_Message_SetNonExtensionField(msg, &field, &value); + } + )cc", + msg_name, field_name, CType(field), + FieldInitializer(pools, field, options)); } // Message fields also have a Msg_mutable_foo() accessor that will create // the sub-message if it doesn't already exist. - if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE && - !field->containing_type()->options().map_entry()) { + if (field.ctype() == kUpb_CType_Message && + !UPB_DESC(MessageOptions_map_entry)(field.containing_type().options())) { output( R"cc( UPB_INLINE struct $0* $1_mutable_$2($1* msg, upb_Arena* arena) { struct $0* sub = (struct $0*)$1_$2(msg); if (sub == NULL) { - sub = (struct $0*)_upb_Message_New(&$3, arena); - if (!sub) return NULL; - $1_set_$2(msg, sub); + sub = (struct $0*)_upb_Message_New($3, arena); + if (sub) $1_set_$2(msg, sub); } return sub; } )cc", - MessageName(field->message_type()), msg_name, field->name(), - MessageInit(field->message_type())); + MessageName(field.message_type()), msg_name, field_name, + MessageMiniTableRef(field.message_type(), options)); } } -void GenerateSetters(const protobuf::FieldDescriptor* field, - const FileLayout& layout, absl::string_view msg_name, - Output& output) { - if (field->is_map()) { - GenerateMapSetters(field, layout, msg_name, output); - } else if (field->is_repeated()) { - GenerateRepeatedSetters(field, layout, msg_name, output); +void GenerateSetters(upb::FieldDefPtr field, const DefPoolPair& pools, + absl::string_view msg_name, + const NameToFieldDefMap& field_names, + const Options& options, Output& output) { + if (field.IsMap()) { + GenerateMapSetters(field, pools, msg_name, field_names, options, output); + } else if (field.IsSequence()) { + GenerateRepeatedSetters(field, pools, msg_name, field_names, options, + output); } else { - GenerateNonRepeatedSetters(field, layout, msg_name, output); + GenerateNonRepeatedSetters(field, pools, msg_name, field_names, options, + output); } } -void GenerateMessageInHeader(const protobuf::Descriptor* message, - const FileLayout& layout, Output& output) { - output("/* $0 */\n\n", message->full_name()); - std::string msg_name = ToCIdent(message->full_name()); - - if (!message->options().map_entry()) { - GenerateMessageFunctionsInHeader(message, output); +void GenerateMessageInHeader(upb::MessageDefPtr message, + const DefPoolPair& pools, const Options& options, + Output& output) { + output("/* $0 */\n\n", message.full_name()); + std::string msg_name = ToCIdent(message.full_name()); + if (!UPB_DESC(MessageOptions_map_entry)(message.options())) { + GenerateMessageFunctionsInHeader(message, options, output); } - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - GenerateOneofInHeader(message->oneof_decl(i), layout, msg_name, output); + for (int i = 0; i < message.real_oneof_count(); i++) { + GenerateOneofInHeader(message.oneof(i), pools, msg_name, options, output); } + auto field_names = CreateFieldNameMap(message); for (auto field : FieldNumberOrder(message)) { - GenerateHazzer(field, layout, msg_name, output); - if (field->is_repeated()) { - GenerateRepeatedClear(field, layout, msg_name, output); - } else { - GenerateClear(field, layout, msg_name, output); - } - GenerateGetters(field, layout, msg_name, output); + GenerateClear(field, pools, msg_name, field_names, options, output); + GenerateGetters(field, pools, msg_name, field_names, options, output); + GenerateHazzer(field, pools, msg_name, field_names, options, output); } output("\n"); for (auto field : FieldNumberOrder(message)) { - GenerateSetters(field, layout, msg_name, output); + GenerateSetters(field, pools, msg_name, field_names, options, output); } output("\n"); } -void WriteHeader(const FileLayout& layout, Output& output) { - const protobuf::FileDescriptor* file = layout.descriptor(); - EmitFileWarning(file, output); +void ForwardDeclareMiniTableInit(upb::MessageDefPtr message, + const Options& options, Output& output) { + if (options.bootstrap) { + output("extern const upb_MiniTable* $0();\n", MessageInitName(message)); + } else { + output("extern const upb_MiniTable $0;\n", MessageInitName(message)); + } +} + +void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Output& output) { + EmitFileWarning(file.name(), output); output( "#ifndef $0_UPB_H_\n" "#define $0_UPB_H_\n\n" - "#include \"upb/msg_internal.h\"\n" - "#include \"upb/decode.h\"\n" - "#include \"upb/decode_fast.h\"\n" - "#include \"upb/encode.h\"\n\n", - ToPreproc(file->name())); + "#include \"upb/collections/array_internal.h\"\n" + "#include \"upb/collections/map_gencode_util.h\"\n" + "#include \"upb/message/accessors.h\"\n" + "#include \"upb/message/internal.h\"\n" + "#include \"upb/mini_table/enum_internal.h\"\n" + "#include \"upb/wire/decode.h\"\n" + "#include \"upb/wire/decode_fast.h\"\n" + "#include \"upb/wire/encode.h\"\n\n", + ToPreproc(file.name())); - for (int i = 0; i < file->public_dependency_count(); i++) { + for (int i = 0; i < file.public_dependency_count(); i++) { if (i == 0) { output("/* Public Imports. */\n"); } - output("#include \"$0\"\n", HeaderFilename(file)); - if (i == file->public_dependency_count() - 1) { + output("#include \"$0\"\n", HeaderFilename(file.public_dependency(i))); + if (i == file.public_dependency_count() - 1) { output("\n"); } } output( - "#include \"upb/port_def.inc\"\n" + "// Must be last. \n" + "#include \"upb/port/def.inc\"\n" "\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" "#endif\n" "\n"); - const std::vector this_file_messages = + const std::vector this_file_messages = SortedMessages(file); - const std::vector this_file_exts = - SortedExtensions(file); + const std::vector this_file_exts = SortedExtensions(file); // Forward-declare types defined in this file. for (auto message : this_file_messages) { - output("struct $0;\n", ToCIdent(message->full_name())); + output("typedef struct $0 $0;\n", ToCIdent(message.full_name())); } for (auto message : this_file_messages) { - output("typedef struct $0 $0;\n", ToCIdent(message->full_name())); - } - for (auto message : this_file_messages) { - output("extern const upb_MiniTable $0;\n", MessageInit(message)); + ForwardDeclareMiniTableInit(message, options, output); } for (auto ext : this_file_exts) { - output("extern const upb_MiniTable_Extension $0;\n", ExtensionLayout(ext)); + output("extern const upb_MiniTableExtension $0;\n", ExtensionLayout(ext)); } // Forward-declare types not in this file, but used as submessages. // Order by full name for consistent ordering. - std::map forward_messages; + std::map forward_messages; - for (auto* message : this_file_messages) { - for (int i = 0; i < message->field_count(); i++) { - const protobuf::FieldDescriptor* field = message->field(i); - if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE && - field->file() != field->message_type()->file()) { - forward_messages[field->message_type()->full_name()] = - field->message_type(); + for (auto message : this_file_messages) { + for (int i = 0; i < message.field_count(); i++) { + upb::FieldDefPtr field = message.field(i); + if (field.ctype() == kUpb_CType_Message && + field.file() != field.message_type().file()) { + forward_messages[field.message_type().full_name()] = + field.message_type(); } } } for (auto ext : this_file_exts) { - if (ext->file() != ext->containing_type()->file()) { - forward_messages[ext->containing_type()->full_name()] = - ext->containing_type(); + if (ext.file() != ext.containing_type().file()) { + forward_messages[ext.containing_type().full_name()] = + ext.containing_type(); } } for (const auto& pair : forward_messages) { output("struct $0;\n", MessageName(pair.second)); } for (const auto& pair : forward_messages) { - output("extern const upb_MiniTable $0;\n", MessageInit(pair.second)); + ForwardDeclareMiniTableInit(pair.second, options, output); } if (!this_file_messages.empty()) { output("\n"); } - std::vector this_file_enums = - SortedEnums(file); - std::sort( - this_file_enums.begin(), this_file_enums.end(), - [](const protobuf::EnumDescriptor* a, const protobuf::EnumDescriptor* b) { - return a->full_name() < b->full_name(); - }); + std::vector this_file_enums = SortedEnums(file); for (auto enumdesc : this_file_enums) { output("typedef enum {\n"); DumpEnumValues(enumdesc, output); - output("} $0;\n\n", ToCIdent(enumdesc->full_name())); + output("} $0;\n\n", ToCIdent(enumdesc.full_name())); } output("\n"); - if (file->syntax() == protobuf::FileDescriptor::SYNTAX_PROTO2) { - for (const auto* enumdesc : this_file_enums) { - output("extern const upb_MiniTable_Enum $0;\n", EnumInit(enumdesc)); + if (file.syntax() == kUpb_Syntax_Proto2) { + for (const auto enumdesc : this_file_enums) { + if (options.bootstrap) { + output("extern const upb_MiniTableEnum* $0();\n", EnumInit(enumdesc)); + } else { + output("extern const upb_MiniTableEnum $0;\n", EnumInit(enumdesc)); + } } } output("\n"); - for (auto message : this_file_messages) { - GenerateMessageInHeader(message, layout, output); + GenerateMessageInHeader(message, pools, options, output); } for (auto ext : this_file_exts) { - GenerateExtensionInHeader(ext, output); + GenerateExtensionInHeader(pools, ext, output); } - output("extern const upb_MiniTable_File $0;\n\n", FileLayoutName(file)); + output("extern const upb_MiniTableFile $0;\n\n", FileLayoutName(file)); - if (file->name() == - protobuf::FileDescriptorProto::descriptor()->file()->name()) { + if (absl::string_view(file.name()) == "google/protobuf/descriptor.proto" || + absl::string_view(file.name()) == "net/proto2/proto/descriptor.proto") { // This is gratuitously inefficient with how many times it rebuilds // MessageLayout objects for the same message. But we only do this for one // proto (descriptor.proto) so we don't worry about it. - const protobuf::Descriptor* max32_message = nullptr; - const protobuf::Descriptor* max64_message = nullptr; + upb::MessageDefPtr max32_message; + upb::MessageDefPtr max64_message; size_t max32 = 0; size_t max64 = 0; - for (const auto* message : this_file_messages) { - if (absl::EndsWith(message->name(), "Options")) { - size_t size32 = layout.GetMiniTable32(message)->size; - size_t size64 = layout.GetMiniTable64(message)->size; + for (const auto message : this_file_messages) { + if (absl::EndsWith(message.name(), "Options")) { + size_t size32 = pools.GetMiniTable32(message)->size; + size_t size64 = pools.GetMiniTable64(message)->size; if (size32 > max32) { max32 = size32; max32_message = message; @@ -1433,8 +923,8 @@ void WriteHeader(const FileLayout& layout, Output& output) { } } - output("/* Max size 32 is $0 */\n", max32_message->full_name()); - output("/* Max size 64 is $0 */\n", max64_message->full_name()); + output("/* Max size 32 is $0 */\n", max32_message.full_name()); + output("/* Max size 64 is $0 */\n", max64_message.full_name()); output("#define _UPB_MAXOPT_SIZE UPB_SIZE($0, $1)\n\n", max32, max64); } @@ -1443,29 +933,71 @@ void WriteHeader(const FileLayout& layout, Output& output) { "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/port_undef.inc\"\n" + "#include \"upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPB_H_ */\n", - ToPreproc(file->name())); + ToPreproc(file.name())); } typedef std::pair TableEntry; -uint64_t GetEncodedTag(const protobuf::FieldDescriptor* field) { - protobuf::internal::WireFormatLite::WireType wire_type = - protobuf::internal::WireFormat::WireTypeForField(field); - uint32_t unencoded_tag = - protobuf::internal::WireFormatLite::MakeTag(field->number(), wire_type); - uint8_t tag_bytes[10] = {0}; - protobuf::io::CodedOutputStream::WriteVarint32ToArray(unencoded_tag, - tag_bytes); +uint32_t GetWireTypeForField(upb::FieldDefPtr field) { + if (field.packed()) return kUpb_WireType_Delimited; + switch (field.type()) { + case kUpb_FieldType_Double: + case kUpb_FieldType_Fixed64: + case kUpb_FieldType_SFixed64: + return kUpb_WireType_64Bit; + case kUpb_FieldType_Float: + case kUpb_FieldType_Fixed32: + case kUpb_FieldType_SFixed32: + return kUpb_WireType_32Bit; + case kUpb_FieldType_Int64: + case kUpb_FieldType_UInt64: + case kUpb_FieldType_Int32: + case kUpb_FieldType_Bool: + case kUpb_FieldType_UInt32: + case kUpb_FieldType_Enum: + case kUpb_FieldType_SInt32: + case kUpb_FieldType_SInt64: + return kUpb_WireType_Varint; + case kUpb_FieldType_Group: + return kUpb_WireType_StartGroup; + case kUpb_FieldType_Message: + case kUpb_FieldType_String: + case kUpb_FieldType_Bytes: + return kUpb_WireType_Delimited; + } + UPB_UNREACHABLE(); +} + +uint32_t MakeTag(uint32_t field_number, uint32_t wire_type) { + return field_number << 3 | wire_type; +} + +size_t WriteVarint32ToArray(uint64_t val, char* buf) { + size_t i = 0; + do { + uint8_t byte = val & 0x7fU; + val >>= 7; + if (val) byte |= 0x80U; + buf[i++] = byte; + } while (val); + return i; +} + +uint64_t GetEncodedTag(upb::FieldDefPtr field) { + uint32_t wire_type = GetWireTypeForField(field); + uint32_t unencoded_tag = MakeTag(field.number(), wire_type); + char tag_bytes[10] = {0}; + WriteVarint32ToArray(unencoded_tag, tag_bytes); uint64_t encoded_tag = 0; memcpy(&encoded_tag, tag_bytes, sizeof(encoded_tag)); // TODO: byte-swap for big endian. return encoded_tag; } -int GetTableSlot(const protobuf::FieldDescriptor* field) { +int GetTableSlot(upb::FieldDefPtr field) { uint64_t tag = GetEncodedTag(field); if (tag > 0x7fff) { // Tag must fit within a two-byte varint. @@ -1474,12 +1006,11 @@ int GetTableSlot(const protobuf::FieldDescriptor* field) { return (tag & 0xf8) >> 3; } -bool TryFillTableEntry(const FileLayout& layout, - const protobuf::FieldDescriptor* field, +bool TryFillTableEntry(const DefPoolPair& pools, upb::FieldDefPtr field, TableEntry& ent) { - const upb_MiniTable* mt = layout.GetMiniTable64(field->containing_type()); - const upb_MiniTable_Field* mt_f = - upb_MiniTable_FindFieldByNumber(mt, field->number()); + const upb_MiniTable* mt = pools.GetMiniTable64(field.containing_type()); + const upb_MiniTableField* mt_f = + upb_MiniTable_FindFieldByNumber(mt, field.number()); std::string type = ""; std::string cardinality = ""; switch (mt_f->descriptortype) { @@ -1558,14 +1089,13 @@ bool TryFillTableEntry(const FileLayout& layout, uint64_t data = static_cast(mt_f->offset) << 48 | expected_tag; - if (field->is_repeated()) { + if (field.IsSequence()) { // No hasbit/oneof-related fields. } - if (field->real_containing_oneof()) { - size_t case_offset = ~mt_f->presence; - if (case_offset > 0xffff) return false; - assert(field->number() < 256); - data |= field->number() << 24; + if (field.real_containing_oneof()) { + uint64_t case_offset = ~mt_f->presence; + if (case_offset > 0xffff || field.number() > 0xff) return false; + data |= field.number() << 24; data |= case_offset << 32; } else { uint64_t hasbit_index = 63; // No hasbit (set a high, unused bit). @@ -1576,20 +1106,19 @@ bool TryFillTableEntry(const FileLayout& layout, data |= hasbit_index << 24; } - if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { + if (field.ctype() == kUpb_CType_Message) { uint64_t idx = mt_f->submsg_index; if (idx > 255) return false; data |= idx << 16; std::string size_ceil = "max"; size_t size = SIZE_MAX; - if (field->message_type()->file() == field->file()) { + if (field.message_type().file() == field.file()) { // We can only be guaranteed the size of the sub-message if it is in the // same file as us. We could relax this to increase the speed of // cross-file sub-message parsing if we are comfortable requiring that // users compile all messages at the same time. - const upb_MiniTable* sub_mt = - layout.GetMiniTable64(field->message_type()); + const upb_MiniTable* sub_mt = pools.GetMiniTable64(field.message_type()); size = sub_mt->size + 8; } std::vector breaks = {64, 128, 192, 256}; @@ -1610,8 +1139,8 @@ bool TryFillTableEntry(const FileLayout& layout, return true; } -std::vector FastDecodeTable(const protobuf::Descriptor* message, - const FileLayout& layout) { +std::vector FastDecodeTable(upb::MessageDefPtr message, + const DefPoolPair& pools) { std::vector table; for (const auto field : FieldHotnessOrder(message)) { TableEntry ent; @@ -1621,15 +1150,15 @@ std::vector FastDecodeTable(const protobuf::Descriptor* message, // Tag can't fit in the table. continue; } - if (!TryFillTableEntry(layout, field, ent)) { + if (!TryFillTableEntry(pools, field, ent)) { // Unsupported field type or offset, hasbit index, etc. doesn't fit. continue; } while ((size_t)slot >= table.size()) { size_t size = std::max(static_cast(1), table.size() * 2); - table.resize(size, TableEntry{"fastdecode_generic", 0}); + table.resize(size, TableEntry{"_upb_FastDecoder_DecodeGeneric", 0}); } - if (table[slot].first != "fastdecode_generic") { + if (table[slot].first != "_upb_FastDecoder_DecodeGeneric") { // A hotter field already filled this slot. continue; } @@ -1638,14 +1167,50 @@ std::vector FastDecodeTable(const protobuf::Descriptor* message, return table; } +std::string ArchDependentSize(int64_t size32, int64_t size64) { + if (size32 == size64) return absl::StrCat(size32); + return absl::Substitute("UPB_SIZE($0, $1)", size32, size64); +} + +std::string GetFieldRep(const upb_MiniTableField* field32, + const upb_MiniTableField* field64) { + switch (_upb_MiniTableField_GetRep(field32)) { + case kUpb_FieldRep_1Byte: + return "kUpb_FieldRep_1Byte"; + break; + case kUpb_FieldRep_4Byte: { + if (_upb_MiniTableField_GetRep(field64) == kUpb_FieldRep_4Byte) { + return "kUpb_FieldRep_4Byte"; + } else { + assert(_upb_MiniTableField_GetRep(field64) == kUpb_FieldRep_8Byte); + return "UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte)"; + } + break; + } + case kUpb_FieldRep_StringView: + return "kUpb_FieldRep_StringView"; + break; + case kUpb_FieldRep_8Byte: + return "kUpb_FieldRep_8Byte"; + break; + } + UPB_UNREACHABLE(); +} + +std::string GetFieldRep(const DefPoolPair& pools, upb::FieldDefPtr field) { + return GetFieldRep(pools.GetField32(field), pools.GetField64(field)); +} + // Returns the field mode as a string initializer. // // We could just emit this as a number (and we may yet go in that direction) but // for now emitting symbolic constants gives this better readability and // debuggability. -std::string GetModeInit(uint8_t mode) { +std::string GetModeInit(const upb_MiniTableField* field32, + const upb_MiniTableField* field64) { std::string ret; - switch (mode & kUpb_FieldMode_Mask) { + uint8_t mode32 = field32->mode; + switch (mode32 & kUpb_FieldMode_Mask) { case kUpb_FieldMode_Map: ret = "kUpb_FieldMode_Map"; break; @@ -1659,78 +1224,94 @@ std::string GetModeInit(uint8_t mode) { break; } - if (mode & kUpb_LabelFlags_IsPacked) { + if (mode32 & kUpb_LabelFlags_IsPacked) { absl::StrAppend(&ret, " | kUpb_LabelFlags_IsPacked"); } - if (mode & kUpb_LabelFlags_IsExtension) { + if (mode32 & kUpb_LabelFlags_IsExtension) { absl::StrAppend(&ret, " | kUpb_LabelFlags_IsExtension"); } - std::string rep; - switch (mode >> kUpb_FieldRep_Shift) { - case kUpb_FieldRep_1Byte: - rep = "kUpb_FieldRep_1Byte"; - break; - case kUpb_FieldRep_4Byte: - rep = "kUpb_FieldRep_4Byte"; - break; - case kUpb_FieldRep_Pointer: - rep = "kUpb_FieldRep_Pointer"; - break; - case kUpb_FieldRep_StringView: - rep = "kUpb_FieldRep_StringView"; - break; - case kUpb_FieldRep_8Byte: - rep = "kUpb_FieldRep_8Byte"; - break; + if (mode32 & kUpb_LabelFlags_IsAlternate) { + absl::StrAppend(&ret, " | kUpb_LabelFlags_IsAlternate"); } - absl::StrAppend(&ret, " | (", rep, " << kUpb_FieldRep_Shift)"); + absl::StrAppend(&ret, " | (", GetFieldRep(field32, field64), + " << kUpb_FieldRep_Shift)"); return ret; } -void WriteField(const upb_MiniTable_Field* field64, - const upb_MiniTable_Field* field32, Output& output) { - output("{$0, UPB_SIZE($1, $2), UPB_SIZE($3, $4), $5, $6, $7}", - field64->number, field32->offset, field64->offset, field32->presence, - field64->presence, - field64->submsg_index == kUpb_NoSub - ? "kUpb_NoSub" - : absl::StrCat(field64->submsg_index).c_str(), - field64->descriptortype, GetModeInit(field64->mode)); +std::string FieldInitializer(upb::FieldDefPtr field, + const upb_MiniTableField* field64, + const upb_MiniTableField* field32, + const Options& options) { + if (options.bootstrap) { + ABSL_CHECK(!field.is_extension()); + return absl::Substitute( + "*upb_MiniTable_FindFieldByNumber($0, $1)", + MessageMiniTableRef(field.containing_type(), options), field.number()); + } else { + return absl::Substitute( + "{$0, $1, $2, $3, $4, $5}", field64->number, + ArchDependentSize(field32->offset, field64->offset), + ArchDependentSize(field32->presence, field64->presence), + field64->submsg_index == kUpb_NoSub + ? "kUpb_NoSub" + : absl::StrCat(field64->submsg_index).c_str(), + field64->descriptortype, GetModeInit(field32, field64)); + } +} + +std::string FieldInitializer(const DefPoolPair& pools, upb::FieldDefPtr field, + const Options& options) { + return FieldInitializer(field, pools.GetField64(field), + pools.GetField32(field), options); } // Writes a single field into a .upb.c source file. -void WriteMessageField(const upb_MiniTable_Field* field64, - const upb_MiniTable_Field* field32, Output& output) { - output(" "); - WriteField(field64, field32, output); - output(",\n"); +void WriteMessageField(upb::FieldDefPtr field, + const upb_MiniTableField* field64, + const upb_MiniTableField* field32, + const Options& options, Output& output) { + output(" $0,\n", FieldInitializer(field, field64, field32, options)); +} + +std::string GetSub(upb::FieldDefPtr field) { + if (auto message_def = field.message_type()) { + return absl::Substitute("{.submsg = &$0}", MessageInitName(message_def)); + } + + if (auto enum_def = field.enum_subdef()) { + if (enum_def.is_closed()) { + return absl::Substitute("{.subenum = &$0}", EnumInit(enum_def)); + } + } + + return std::string("{.submsg = NULL}"); } // Writes a single message into a .upb.c source file. -void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout, - Output& output, bool fasttable_enabled) { - std::string msg_name = ToCIdent(message->full_name()); +void WriteMessage(upb::MessageDefPtr message, const DefPoolPair& pools, + const Options& options, Output& output) { + std::string msg_name = ToCIdent(message.full_name()); std::string fields_array_ref = "NULL"; std::string submsgs_array_ref = "NULL"; std::string subenums_array_ref = "NULL"; - const upb_MiniTable* mt_32 = layout.GetMiniTable32(message); - const upb_MiniTable* mt_64 = layout.GetMiniTable64(message); + const upb_MiniTable* mt_32 = pools.GetMiniTable32(message); + const upb_MiniTable* mt_64 = pools.GetMiniTable64(message); std::vector subs; for (int i = 0; i < mt_64->field_count; i++) { - const upb_MiniTable_Field* f = &mt_64->fields[i]; + const upb_MiniTableField* f = &mt_64->fields[i]; if (f->submsg_index != kUpb_NoSub) { - subs.push_back(FilePlatformLayout::GetSub(mt_64->subs[f->submsg_index])); + subs.push_back(GetSub(message.FindFieldByNumber(f->number))); } } if (!subs.empty()) { std::string submsgs_array_name = msg_name + "_submsgs"; submsgs_array_ref = "&" + submsgs_array_name + "[0]"; - output("static const upb_MiniTable_Sub $0[$1] = {\n", submsgs_array_name, + output("static const upb_MiniTableSub $0[$1] = {\n", submsgs_array_name, subs.size()); for (const auto& sub : subs) { @@ -1743,10 +1324,11 @@ void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout, if (mt_64->field_count > 0) { std::string fields_array_name = msg_name + "__fields"; fields_array_ref = "&" + fields_array_name + "[0]"; - output("static const upb_MiniTable_Field $0[$1] = {\n", fields_array_name, + output("static const upb_MiniTableField $0[$1] = {\n", fields_array_name, mt_64->field_count); for (int i = 0; i < mt_64->field_count; i++) { - WriteMessageField(&mt_64->fields[i], &mt_32->fields[i], output); + WriteMessageField(message.FindFieldByNumber(mt_64->fields[i].number), + &mt_64->fields[i], &mt_32->fields[i], options, output); } output("};\n\n"); } @@ -1754,9 +1336,7 @@ void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout, std::vector table; uint8_t table_mask = -1; - if (fasttable_enabled) { - table = FastDecodeTable(message, layout); - } + table = FastDecodeTable(message, pools); if (table.size() > 1) { assert((table.size() & (table.size() - 1)) == 0); @@ -1765,75 +1345,66 @@ void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout, std::string msgext = "kUpb_ExtMode_NonExtendable"; - if (message->extension_range_count()) { - if (message->options().message_set_wire_format()) { + if (message.extension_range_count()) { + if (UPB_DESC(MessageOptions_message_set_wire_format)(message.options())) { msgext = "kUpb_ExtMode_IsMessageSet"; } else { msgext = "kUpb_ExtMode_Extendable"; } } - output("const upb_MiniTable $0 = {\n", MessageInit(message)); + output("const upb_MiniTable $0 = {\n", MessageInitName(message)); output(" $0,\n", submsgs_array_ref); output(" $0,\n", fields_array_ref); - output(" $0, $1, $2, $3, $4, $5,\n", layout.GetMessageSize(message), - mt_64->field_count, msgext, mt_64->dense_below, table_mask, - mt_64->required_count); + output(" $0, $1, $2, $3, UPB_FASTTABLE_MASK($4), $5,\n", + ArchDependentSize(mt_32->size, mt_64->size), mt_64->field_count, + msgext, mt_64->dense_below, table_mask, mt_64->required_count); if (!table.empty()) { output(" UPB_FASTTABLE_INIT({\n"); for (const auto& ent : table) { output(" {0x$1, &$0},\n", ent.first, absl::StrCat(absl::Hex(ent.second, absl::kZeroPad16))); } - output(" }),\n"); + output(" })\n"); } output("};\n\n"); } -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"); +void WriteEnum(upb::EnumDefPtr e, Output& output) { + std::string values_init = "{\n"; + const upb_MiniTableEnum* mt = e.mini_table(); + uint32_t value_count = (mt->mask_limit / 32) + mt->value_count; + for (uint32_t i = 0; i < value_count; i++) { + absl::StrAppend(&values_init, " 0x", absl::Hex(mt->data[i]), + ",\n"); } + values_init += " }"; output( R"cc( - const upb_MiniTable_Enum $0 = { + const upb_MiniTableEnum $0 = { $1, $2, $3, }; )cc", - EnumInit(e), values_init, absl::StrCat("0x", absl::Hex(mt->mask), "ULL"), - mt->value_count); + EnumInit(e), mt->mask_limit, mt->value_count, values_init); output("\n"); } -int WriteEnums(const FileLayout& layout, Output& output) { - const protobuf::FileDescriptor* file = layout.descriptor(); +int WriteEnums(const DefPoolPair& pools, upb::FileDefPtr file, Output& output) { + if (file.syntax() != kUpb_Syntax_Proto2) return 0; - if (file->syntax() != protobuf::FileDescriptor::SYNTAX_PROTO2) { - return 0; - } + std::vector this_file_enums = SortedEnums(file); - std::vector this_file_enums = - SortedEnums(file); - - for (const auto* e : this_file_enums) { - WriteEnum(layout.GetEnumTable(e), e, output); + for (const auto e : this_file_enums) { + WriteEnum(e, output); } if (!this_file_enums.empty()) { - output("static const upb_MiniTable_Enum *$0[$1] = {\n", kEnumsInit, + output("static const upb_MiniTableEnum *$0[$1] = {\n", kEnumsInit, this_file_enums.size()); - for (const auto* e : this_file_enums) { + for (const auto e : this_file_enums) { output(" &$0,\n", EnumInit(e)); } output("};\n"); @@ -1843,64 +1414,62 @@ int WriteEnums(const FileLayout& layout, Output& output) { return this_file_enums.size(); } -int WriteMessages(const FileLayout& layout, Output& output, - bool fasttable_enabled) { - const protobuf::FileDescriptor* file = layout.descriptor(); - std::vector file_messages = SortedMessages(file); +int WriteMessages(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Output& output) { + std::vector file_messages = SortedMessages(file); if (file_messages.empty()) return 0; for (auto message : file_messages) { - WriteMessage(message, layout, output, fasttable_enabled); + WriteMessage(message, pools, options, output); } output("static const upb_MiniTable *$0[$1] = {\n", kMessagesInit, file_messages.size()); for (auto message : file_messages) { - output(" &$0,\n", MessageInit(message)); + output(" &$0,\n", MessageInitName(message)); } output("};\n"); output("\n"); return file_messages.size(); } -void WriteExtension(const upb_MiniTable_Extension* ext, Output& output) { - WriteField(&ext->field, &ext->field, output); - output(",\n"); - output(" &$0,\n", reinterpret_cast(ext->extendee)); - output(" $0,\n", FilePlatformLayout::GetSub(ext->sub)); +void WriteExtension(upb::FieldDefPtr ext, const DefPoolPair& pools, + const Options& options, Output& output) { + output("$0,\n", FieldInitializer(pools, ext, options)); + output(" &$0,\n", MessageInitName(ext.containing_type())); + output(" $0,\n", GetSub(ext)); } -int WriteExtensions(const FileLayout& layout, Output& output) { - auto exts = SortedExtensions(layout.descriptor()); - absl::flat_hash_set forward_decls; +int WriteExtensions(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Output& output) { + auto exts = SortedExtensions(file); if (exts.empty()) return 0; // Order by full name for consistent ordering. - std::map forward_messages; + std::map forward_messages; for (auto ext : exts) { - forward_messages[ext->containing_type()->full_name()] = - ext->containing_type(); - if (ext->message_type()) { - forward_messages[ext->message_type()->full_name()] = ext->message_type(); + forward_messages[ext.containing_type().full_name()] = ext.containing_type(); + if (ext.message_type()) { + forward_messages[ext.message_type().full_name()] = ext.message_type(); } } for (const auto& decl : forward_messages) { - output("extern const upb_MiniTable $0;\n", MessageInit(decl.second)); + ForwardDeclareMiniTableInit(decl.second, options, output); } for (auto ext : exts) { - output("const upb_MiniTable_Extension $0 = {\n ", ExtensionLayout(ext)); - WriteExtension(layout.GetExtension(ext), output); + output("const upb_MiniTableExtension $0 = {\n ", ExtensionLayout(ext)); + WriteExtension(ext, pools, options, output); output("\n};\n"); } output( "\n" - "static const upb_MiniTable_Extension *$0[$1] = {\n", + "static const upb_MiniTableExtension *$0[$1] = {\n", kExtensionsInit, exts.size()); for (auto ext : exts) { @@ -1913,32 +1482,33 @@ int WriteExtensions(const FileLayout& layout, Output& output) { return exts.size(); } -// Writes a .upb.c source file. -void WriteSource(const FileLayout& layout, Output& output, - bool fasttable_enabled) { - const protobuf::FileDescriptor* file = layout.descriptor(); - EmitFileWarning(file, output); +void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Output& output) { + EmitFileWarning(file.name(), output); output( "#include \n" - "#include \"upb/msg_internal.h\"\n" + "#include \"upb/collections/array_internal.h\"\n" + "#include \"upb/message/internal.h\"\n" + "#include \"upb/mini_table/enum_internal.h\"\n" "#include \"$0\"\n", HeaderFilename(file)); - for (int i = 0; i < file->dependency_count(); i++) { - output("#include \"$0\"\n", HeaderFilename(file->dependency(i))); + for (int i = 0; i < file.dependency_count(); i++) { + output("#include \"$0\"\n", HeaderFilename(file.dependency(i))); } output( "\n" - "#include \"upb/port_def.inc\"\n" + "// Must be last.\n" + "#include \"upb/port/def.inc\"\n" "\n"); - int msg_count = WriteMessages(layout, output, fasttable_enabled); - int ext_count = WriteExtensions(layout, output); - int enum_count = WriteEnums(layout, output); + int msg_count = WriteMessages(pools, file, options, output); + int ext_count = WriteExtensions(pools, file, options, output); + int enum_count = WriteEnums(pools, file, output); - output("const upb_MiniTable_File $0 = {\n", FileLayoutName(file)); + output("const upb_MiniTableFile $0 = {\n", FileLayoutName(file)); output(" $0,\n", msg_count ? kMessagesInit : "NULL"); output(" $0,\n", enum_count ? kEnumsInit : "NULL"); output(" $0,\n", ext_count ? kExtensionsInit : "NULL"); @@ -1947,57 +1517,159 @@ void WriteSource(const FileLayout& layout, Output& output, output(" $0,\n", ext_count); output("};\n\n"); - output("#include \"upb/port_undef.inc\"\n"); + output("#include \"upb/port/undef.inc\"\n"); output("\n"); } -class Generator : public protoc::CodeGenerator { - ~Generator() override {} - bool Generate(const protobuf::FileDescriptor* file, - const std::string& parameter, protoc::GeneratorContext* context, - std::string* error) const override; - uint64_t GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; +void WriteMessageMiniDescriptorInitializer(upb::MessageDefPtr msg, + const Options& options, + Output& output) { + Output resolve_calls; + for (int i = 0; i < msg.field_count(); i++) { + upb::FieldDefPtr field = msg.field(i); + if (!field.message_type() && !field.enum_subdef()) continue; + if (field.message_type()) { + resolve_calls( + "upb_MiniTable_SetSubMessage(mini_table, " + "(upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, " + "$0), $1);\n ", + field.number(), MessageMiniTableRef(field.message_type(), options)); + } else if (field.enum_subdef() && field.enum_subdef().is_closed()) { + resolve_calls( + "upb_MiniTable_SetSubEnum(mini_table, " + "(upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, " + "$0), $1);\n ", + field.number(), EnumMiniTableRef(field.enum_subdef(), options)); + } } -}; -bool Generator::Generate(const protobuf::FileDescriptor* file, - const std::string& parameter, - protoc::GeneratorContext* context, - std::string* error) const { - bool fasttable_enabled = false; - std::vector> params; - google::protobuf::compiler::ParseGeneratorParameter(parameter, ¶ms); + output( + R"cc( + const upb_MiniTable* $0() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + $2return mini_table; + } + )cc", + MessageInitName(msg), msg.MiniDescriptorEncode(), resolve_calls.output()); + output("\n"); +} - for (const auto& pair : params) { - if (pair.first == "fasttable") { - fasttable_enabled = true; +void WriteEnumMiniDescriptorInitializer(upb::EnumDefPtr enum_def, + const Options& options, + Output& output) { + output( + R"cc( + const upb_MiniTableEnum* $0() { + static const upb_MiniTableEnum* mini_table = NULL; + static const char* mini_descriptor = "$1"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTableEnum_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + return mini_table; + } + )cc", + EnumInitName(enum_def), enum_def.MiniDescriptorEncode()); + output("\n"); +} + +void WriteMiniDescriptorSource(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Output& output) { + output( + "#include \n" + "#include \"upb/collections/array_internal.h\"\n" + "#include \"upb/message/internal.h\"\n" + "#include \"upb/mini_table/decode.h\"\n" + "#include \"upb/mini_table/enum_internal.h\"\n" + "#include \"$0\"\n\n", + HeaderFilename(file)); + + for (int i = 0; i < file.dependency_count(); i++) { + output("#include \"$0\"\n", HeaderFilename(file.dependency(i))); + } + + output( + R"cc( + static upb_Arena* upb_BootstrapArena() { + static upb_Arena* arena = NULL; + if (!arena) arena = upb_Arena_New(); + return arena; + } + )cc"); + + output("\n"); + + for (const auto msg : SortedMessages(file)) { + WriteMessageMiniDescriptorInitializer(msg, options, output); + } + + for (const auto msg : SortedEnums(file)) { + WriteEnumMiniDescriptorInitializer(msg, options, output); + } +} + +void WriteSource(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Output& output) { + if (options.bootstrap) { + WriteMiniDescriptorSource(pools, file, options, output); + } else { + WriteMiniTableSource(pools, file, options, output); + } +} + +void GenerateFile(const DefPoolPair& pools, upb::FileDefPtr file, + const Options& options, Plugin* plugin) { + Output h_output; + WriteHeader(pools, file, options, h_output); + plugin->AddOutputFile(HeaderFilename(file), h_output.output()); + + Output c_output; + WriteSource(pools, file, options, c_output); + plugin->AddOutputFile(SourceFilename(file), c_output.output()); +} + +bool ParseOptions(Plugin* plugin, Options* options) { + for (const auto& pair : ParseGeneratorParameter(plugin->parameter())) { + if (pair.first == "bootstrap_upb") { + options->bootstrap = true; } else { - *error = "Unknown parameter: " + pair.first; + plugin->SetError(absl::Substitute("Unknown parameter: $0", pair.first)); return false; } } - FileLayout layout(file); - - std::unique_ptr h_output_stream( - context->Open(HeaderFilename(file))); - Output h_output(h_output_stream.get()); - WriteHeader(layout, h_output); - - std::unique_ptr c_output_stream( - context->Open(SourceFilename(file))); - Output c_output(c_output_stream.get()); - WriteSource(layout, c_output, fasttable_enabled); - return true; } +absl::string_view ToStringView(upb_StringView str) { + return absl::string_view(str.data, str.size); +} + } // namespace + } // namespace upbc int main(int argc, char** argv) { - std::unique_ptr generator( - new upbc::Generator()); - return google::protobuf::compiler::PluginMain(argc, argv, generator.get()); + upbc::DefPoolPair pools; + upbc::Plugin plugin; + upbc::Options options; + if (!ParseOptions(&plugin, &options)) return 0; + plugin.GenerateFilesRaw([&](const UPB_DESC(FileDescriptorProto) * file_proto, + bool generate) { + upb::Status status; + upb::FileDefPtr file = pools.AddFile(file_proto, &status); + if (!file) { + absl::string_view name = + upbc::ToStringView(UPB_DESC(FileDescriptorProto_name)(file_proto)); + ABSL_LOG(FATAL) << "Couldn't add file " << name + << " to DefPool: " << status.error_message(); + } + if (generate) GenerateFile(pools, file, options, &plugin); + }); + return 0; } diff --git a/third_party/upb/upbc/protoc-gen-upbdefs.cc b/third_party/upb/upbc/protoc-gen-upbdefs.cc index 51b3b959276..2d781a67a6e 100644 --- a/third_party/upb/upbc/protoc-gen-upbdefs.cc +++ b/third_party/upb/upbc/protoc-gen-upbdefs.cc @@ -25,67 +25,61 @@ #include -#include "google/protobuf/compiler/code_generator.h" -#include "google/protobuf/compiler/plugin.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/descriptor.upb.h" +#include "upb/reflection/def.hpp" +#include "upb/util/def_to_proto.h" #include "upbc/common.h" +#include "upbc/file_layout.h" +#include "upbc/plugin.h" namespace upbc { namespace { -namespace protoc = ::google::protobuf::compiler; -namespace protobuf = ::google::protobuf; - -std::string DefInitSymbol(const protobuf::FileDescriptor* file) { - return ToCIdent(file->name()) + "_upbdefinit"; +std::string DefInitSymbol(upb::FileDefPtr file) { + return ToCIdent(file.name()) + "_upbdefinit"; } -static std::string DefHeaderFilename(std::string proto_filename) { - return StripExtension(proto_filename) + ".upbdefs.h"; +static std::string DefHeaderFilename(upb::FileDefPtr file) { + return StripExtension(file.name()) + ".upbdefs.h"; } -static std::string DefSourceFilename(std::string proto_filename) { - return StripExtension(proto_filename) + ".upbdefs.c"; +static std::string DefSourceFilename(upb::FileDefPtr file) { + return StripExtension(file.name()) + ".upbdefs.c"; } -void GenerateMessageDefAccessor(const protobuf::Descriptor* d, Output& output) { +void GenerateMessageDefAccessor(upb::MessageDefPtr d, Output& output) { output("UPB_INLINE const upb_MessageDef *$0_getmsgdef(upb_DefPool *s) {\n", - ToCIdent(d->full_name())); - output(" _upb_DefPool_LoadDefInit(s, &$0);\n", DefInitSymbol(d->file())); - output(" return upb_DefPool_FindMessageByName(s, \"$0\");\n", - d->full_name()); + ToCIdent(d.full_name())); + output(" _upb_DefPool_LoadDefInit(s, &$0);\n", DefInitSymbol(d.file())); + output(" return upb_DefPool_FindMessageByName(s, \"$0\");\n", d.full_name()); output("}\n"); output("\n"); - - for (int i = 0; i < d->nested_type_count(); i++) { - GenerateMessageDefAccessor(d->nested_type(i), output); - } } -void WriteDefHeader(const protobuf::FileDescriptor* file, Output& output) { - EmitFileWarning(file, output); +void WriteDefHeader(upb::FileDefPtr file, Output& output) { + EmitFileWarning(file.name(), output); output( "#ifndef $0_UPBDEFS_H_\n" "#define $0_UPBDEFS_H_\n\n" - "#include \"upb/def.h\"\n" - "#include \"upb/port_def.inc\"\n" + "#include \"upb/reflection/def.h\"\n" + "#include \"upb/reflection/def_pool_internal.h\"\n" + "#include \"upb/port/def.inc\"\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" "#endif\n\n", - ToPreproc(file->name())); + ToPreproc(file.name())); - output("#include \"upb/def.h\"\n"); + output("#include \"upb/reflection/def.h\"\n"); output("\n"); - output("#include \"upb/port_def.inc\"\n"); + output("#include \"upb/port/def.inc\"\n"); output("\n"); output("extern _upb_DefPool_Init $0;\n", DefInitSymbol(file)); output("\n"); - for (int i = 0; i < file->message_type_count(); i++) { - GenerateMessageDefAccessor(file->message_type(i), output); + for (auto msg : SortedMessages(file)) { + GenerateMessageDefAccessor(msg, output); } output( @@ -93,38 +87,40 @@ void WriteDefHeader(const protobuf::FileDescriptor* file, Output& output) { "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/port_undef.inc\"\n" + "#include \"upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPBDEFS_H_ */\n", - ToPreproc(file->name())); + ToPreproc(file.name())); } -void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) { - EmitFileWarning(file, output); +void WriteDefSource(upb::FileDefPtr file, Output& output) { + EmitFileWarning(file.name(), output); - output("#include \"upb/def.h\"\n"); - output("#include \"$0\"\n", DefHeaderFilename(file->name())); + output("#include \"upb/reflection/def.h\"\n"); + output("#include \"$0\"\n", DefHeaderFilename(file)); output("#include \"$0\"\n", HeaderFilename(file)); output("\n"); - for (int i = 0; i < file->dependency_count(); i++) { - output("extern _upb_DefPool_Init $0;\n", - DefInitSymbol(file->dependency(i))); + for (int i = 0; i < file.dependency_count(); i++) { + output("extern _upb_DefPool_Init $0;\n", DefInitSymbol(file.dependency(i))); } - protobuf::FileDescriptorProto file_proto; - file->CopyTo(&file_proto); - std::string file_data; - file_proto.SerializeToString(&file_data); + upb::Arena arena; + google_protobuf_FileDescriptorProto* file_proto = + upb_FileDef_ToProto(file.ptr(), arena.ptr()); + size_t serialized_size; + const char* serialized = google_protobuf_FileDescriptorProto_serialize( + file_proto, arena.ptr(), &serialized_size); + absl::string_view file_data(serialized, serialized_size); - output("static const char descriptor[$0] = {", file_data.size()); + output("static const char descriptor[$0] = {", serialized_size); // C90 only guarantees that strings can be up to 509 characters, and some // implementations have limits here (for example, MSVC only allows 64k: // https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1091. // So we always emit an array instead of a string. - for (size_t i = 0; i < file_data.size();) { - for (size_t j = 0; j < 25 && i < file_data.size(); ++i, ++j) { + for (size_t i = 0; i < serialized_size;) { + for (size_t j = 0; j < 25 && i < serialized_size; ++i, ++j) { output("'$0', ", absl::CEscape(file_data.substr(i, 1))); } output("\n"); @@ -132,9 +128,9 @@ void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) { output("};\n\n"); output("static _upb_DefPool_Init *deps[$0] = {\n", - file->dependency_count() + 1); - for (int i = 0; i < file->dependency_count(); i++) { - output(" &$0,\n", DefInitSymbol(file->dependency(i))); + file.dependency_count() + 1); + for (int i = 0; i < file.dependency_count(); i++) { + output(" &$0,\n", DefInitSymbol(file.dependency(i))); } output(" NULL\n"); output("};\n"); @@ -143,51 +139,32 @@ void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) { output("_upb_DefPool_Init $0 = {\n", DefInitSymbol(file)); output(" deps,\n"); output(" &$0,\n", FileLayoutName(file)); - output(" \"$0\",\n", file->name()); + output(" \"$0\",\n", file.name()); output(" UPB_STRINGVIEW_INIT(descriptor, $0)\n", file_data.size()); output("};\n"); } -class Generator : public protoc::CodeGenerator { - ~Generator() override {} - bool Generate(const protobuf::FileDescriptor* file, - const std::string& parameter, protoc::GeneratorContext* context, - std::string* error) const override; - uint64_t GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; - } -}; - -bool Generator::Generate(const protobuf::FileDescriptor* file, - const std::string& parameter, - protoc::GeneratorContext* context, - std::string* error) const { - std::vector> params; - google::protobuf::compiler::ParseGeneratorParameter(parameter, ¶ms); - - for (const auto& pair : params) { - *error = "Unknown parameter: " + pair.first; - return false; - } - - std::unique_ptr h_output_stream( - context->Open(DefHeaderFilename(file->name()))); - Output h_def_output(h_output_stream.get()); +void GenerateFile(upb::FileDefPtr file, Plugin* plugin) { + Output h_def_output; WriteDefHeader(file, h_def_output); + plugin->AddOutputFile(DefHeaderFilename(file), h_def_output.output()); - std::unique_ptr c_output_stream( - context->Open(DefSourceFilename(file->name()))); - Output c_def_output(c_output_stream.get()); + Output c_def_output; WriteDefSource(file, c_def_output); - - return true; + plugin->AddOutputFile(DefSourceFilename(file), c_def_output.output()); } } // namespace } // namespace upbc int main(int argc, char** argv) { - std::unique_ptr generator( - new upbc::Generator()); - return google::protobuf::compiler::PluginMain(argc, argv, generator.get()); + upbc::Plugin plugin; + if (!plugin.parameter().empty()) { + plugin.SetError( + absl::StrCat("Expected no parameters, got: ", plugin.parameter())); + return 0; + } + plugin.GenerateFiles( + [&](upb::FileDefPtr file) { upbc::GenerateFile(file, &plugin); }); + return 0; } diff --git a/third_party/upb/upbc/protoc-gen-upbdev.cc b/third_party/upb/upbc/protoc-gen-upbdev.cc index e711ec75b53..5f7262294f3 100644 --- a/third_party/upb/upbc/protoc-gen-upbdev.cc +++ b/third_party/upb/upbc/protoc-gen-upbdev.cc @@ -23,75 +23,19 @@ // (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" +#include "upbc/upbdev.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(); + upb_Status status; + upb_Status_Clear(&status); // Read (binary) stdin into a string. const std::string input = {std::istreambuf_iterator(std::cin), @@ -108,22 +52,20 @@ int main() { 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); + // Wrap the request inside a upbc_CodeGeneratorRequest and JSON-encode it. + const upb_StringView sv = + upbdev_ProcessInput(input.data(), input.size(), 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. + const std::string json_request = std::string(sv.data, sv.size); std::string json_response, error; const bool ok = subprocess.Communicate(json_request, &json_response, &error); if (!ok) { @@ -132,12 +74,12 @@ int main() { 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; + // Decode, serialize, and write the JSON response. + upbdev_ProcessOutput(json_response.data(), json_response.size(), a, &status); + if (!upb_Status_IsOk(&status)) { + std::cerr << status.msg << std::endl; + return -1; + } upb_Arena_Free(a); return 0; diff --git a/third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c b/third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c new file mode 100644 index 00000000000..70ada66331e --- /dev/null +++ b/third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c @@ -0,0 +1,68 @@ +#include +#include "upb/collections/array_internal.h" +#include "upb/message/internal.h" +#include "upb/mini_table/decode.h" +#include "upb/mini_table/enum_internal.h" +#include "google/protobuf/compiler/plugin.upb.h" + +#include "google/protobuf/descriptor.upb.h" +static upb_Arena* upb_BootstrapArena() { + static upb_Arena* arena = NULL; + if (!arena) arena = upb_Arena_New(); + return arena; +} + +const upb_MiniTable* google_protobuf_compiler_Version_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$(((1"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + return mini_table; +} + +const upb_MiniTable* google_protobuf_compiler_CodeGeneratorRequest_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$E13kG"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 15), google_protobuf_FileDescriptorProto_msg_init()); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 3), google_protobuf_compiler_Version_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_compiler_CodeGeneratorResponse_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$1,lG"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 15), google_protobuf_compiler_CodeGeneratorResponse_File_msg_init()); + return mini_table; +} + +const upb_MiniTable* google_protobuf_compiler_CodeGeneratorResponse_File_msg_init() { + static upb_MiniTable* mini_table = NULL; + static const char* mini_descriptor = "$11l13"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 16), google_protobuf_GeneratedCodeInfo_msg_init()); + return mini_table; +} + +const upb_MiniTableEnum* google_protobuf_compiler_CodeGeneratorResponse_Feature_enum_init() { + static const upb_MiniTableEnum* mini_table = NULL; + static const char* mini_descriptor = "!$"; + if (mini_table) return mini_table; + mini_table = + upb_MiniTableEnum_Build(mini_descriptor, strlen(mini_descriptor), + upb_BootstrapArena(), NULL); + return mini_table; +} + diff --git a/third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h b/third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h new file mode 100644 index 00000000000..a7ae766e837 --- /dev/null +++ b/third_party/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h @@ -0,0 +1,585 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * google/protobuf/compiler/plugin.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ +#define GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ + +#include "upb/collections/array_internal.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal.h" +#include "upb/mini_table/enum_internal.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct google_protobuf_compiler_Version google_protobuf_compiler_Version; +typedef struct google_protobuf_compiler_CodeGeneratorRequest google_protobuf_compiler_CodeGeneratorRequest; +typedef struct google_protobuf_compiler_CodeGeneratorResponse google_protobuf_compiler_CodeGeneratorResponse; +typedef struct google_protobuf_compiler_CodeGeneratorResponse_File google_protobuf_compiler_CodeGeneratorResponse_File; +extern const upb_MiniTable* google_protobuf_compiler_Version_msg_init(); +extern const upb_MiniTable* google_protobuf_compiler_CodeGeneratorRequest_msg_init(); +extern const upb_MiniTable* google_protobuf_compiler_CodeGeneratorResponse_msg_init(); +extern const upb_MiniTable* google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(); +struct google_protobuf_FileDescriptorProto; +struct google_protobuf_GeneratedCodeInfo; +extern const upb_MiniTable* google_protobuf_FileDescriptorProto_msg_init(); +extern const upb_MiniTable* google_protobuf_GeneratedCodeInfo_msg_init(); + +typedef enum { + google_protobuf_compiler_CodeGeneratorResponse_FEATURE_NONE = 0, + google_protobuf_compiler_CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL = 1 +} google_protobuf_compiler_CodeGeneratorResponse_Feature; + + +extern const upb_MiniTableEnum* google_protobuf_compiler_CodeGeneratorResponse_Feature_enum_init(); + +/* google.protobuf.compiler.Version */ + +UPB_INLINE google_protobuf_compiler_Version* google_protobuf_compiler_Version_new(upb_Arena* arena) { + return (google_protobuf_compiler_Version*)_upb_Message_New(google_protobuf_compiler_Version_msg_init(), arena); +} +UPB_INLINE google_protobuf_compiler_Version* google_protobuf_compiler_Version_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_compiler_Version* ret = google_protobuf_compiler_Version_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_Version_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_compiler_Version* google_protobuf_compiler_Version_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_compiler_Version* ret = google_protobuf_compiler_Version_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_Version_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_compiler_Version_serialize(const google_protobuf_compiler_Version* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_Version_msg_init(), 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_compiler_Version_serialize_ex(const google_protobuf_compiler_Version* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_Version_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_compiler_Version_clear_major(google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_compiler_Version_major(const google_protobuf_compiler_Version* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_Version_has_major(const google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_Version_clear_minor(google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_compiler_Version_minor(const google_protobuf_compiler_Version* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_Version_has_minor(const google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_Version_clear_patch(google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_compiler_Version_patch(const google_protobuf_compiler_Version* msg) { + int32_t default_val = (int32_t)0; + int32_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_Version_has_patch(const google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_Version_clear_suffix(google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 4); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_compiler_Version_suffix(const google_protobuf_compiler_Version* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 4); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_Version_has_suffix(const google_protobuf_compiler_Version* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 4); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_compiler_Version_set_major(google_protobuf_compiler_Version *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_Version_set_minor(google_protobuf_compiler_Version *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_Version_set_patch(google_protobuf_compiler_Version *msg, int32_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_Version_set_suffix(google_protobuf_compiler_Version *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_Version_msg_init(), 4); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + +/* google.protobuf.compiler.CodeGeneratorRequest */ + +UPB_INLINE google_protobuf_compiler_CodeGeneratorRequest* google_protobuf_compiler_CodeGeneratorRequest_new(upb_Arena* arena) { + return (google_protobuf_compiler_CodeGeneratorRequest*)_upb_Message_New(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), arena); +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorRequest* google_protobuf_compiler_CodeGeneratorRequest_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_compiler_CodeGeneratorRequest* ret = google_protobuf_compiler_CodeGeneratorRequest_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_CodeGeneratorRequest_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorRequest* google_protobuf_compiler_CodeGeneratorRequest_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_compiler_CodeGeneratorRequest* ret = google_protobuf_compiler_CodeGeneratorRequest_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_CodeGeneratorRequest_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_compiler_CodeGeneratorRequest_serialize(const google_protobuf_compiler_CodeGeneratorRequest* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_compiler_CodeGeneratorRequest_serialize_ex(const google_protobuf_compiler_CodeGeneratorRequest* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_CodeGeneratorRequest_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_clear_file_to_generate(google_protobuf_compiler_CodeGeneratorRequest* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView const* google_protobuf_compiler_CodeGeneratorRequest_file_to_generate(const google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 1); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_has_file_to_generate(const google_protobuf_compiler_CodeGeneratorRequest* msg) { + size_t size; + google_protobuf_compiler_CodeGeneratorRequest_file_to_generate(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_clear_parameter(google_protobuf_compiler_CodeGeneratorRequest* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_compiler_CodeGeneratorRequest_parameter(const google_protobuf_compiler_CodeGeneratorRequest* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_has_parameter(const google_protobuf_compiler_CodeGeneratorRequest* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_clear_compiler_version(google_protobuf_compiler_CodeGeneratorRequest* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 3); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_compiler_Version* google_protobuf_compiler_CodeGeneratorRequest_compiler_version(const google_protobuf_compiler_CodeGeneratorRequest* msg) { + const google_protobuf_compiler_Version* default_val = NULL; + const google_protobuf_compiler_Version* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 3); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_has_compiler_version(const google_protobuf_compiler_CodeGeneratorRequest* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 3); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_clear_proto_file(google_protobuf_compiler_CodeGeneratorRequest* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 15); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_FileDescriptorProto* const* google_protobuf_compiler_CodeGeneratorRequest_proto_file(const google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 15); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const struct google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_has_proto_file(const google_protobuf_compiler_CodeGeneratorRequest* msg) { + size_t size; + google_protobuf_compiler_CodeGeneratorRequest_proto_file(msg, &size); + return size != 0; +} + +UPB_INLINE upb_StringView* google_protobuf_compiler_CodeGeneratorRequest_mutable_file_to_generate(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 1); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (upb_StringView*)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE upb_StringView* google_protobuf_compiler_CodeGeneratorRequest_resize_file_to_generate(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 1); + return (upb_StringView*)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_add_file_to_generate(google_protobuf_compiler_CodeGeneratorRequest* msg, upb_StringView val, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 1); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return false; + } + _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); + return true; +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_set_parameter(google_protobuf_compiler_CodeGeneratorRequest *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_set_compiler_version(google_protobuf_compiler_CodeGeneratorRequest *msg, google_protobuf_compiler_Version* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 3); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_compiler_Version* google_protobuf_compiler_CodeGeneratorRequest_mutable_compiler_version(google_protobuf_compiler_CodeGeneratorRequest* msg, upb_Arena* arena) { + struct google_protobuf_compiler_Version* sub = (struct google_protobuf_compiler_Version*)google_protobuf_compiler_CodeGeneratorRequest_compiler_version(msg); + if (sub == NULL) { + sub = (struct google_protobuf_compiler_Version*)_upb_Message_New(google_protobuf_compiler_Version_msg_init(), arena); + if (sub) google_protobuf_compiler_CodeGeneratorRequest_set_compiler_version(msg, sub); + } + return sub; +} +UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler_CodeGeneratorRequest_mutable_proto_file(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 15); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (struct google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler_CodeGeneratorRequest_resize_proto_file(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 15); + return (struct google_protobuf_FileDescriptorProto**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_compiler_CodeGeneratorRequest_add_proto_file(google_protobuf_compiler_CodeGeneratorRequest* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorRequest_msg_init(), 15); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(google_protobuf_FileDescriptorProto_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.compiler.CodeGeneratorResponse */ + +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse* google_protobuf_compiler_CodeGeneratorResponse_new(upb_Arena* arena) { + return (google_protobuf_compiler_CodeGeneratorResponse*)_upb_Message_New(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), arena); +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse* google_protobuf_compiler_CodeGeneratorResponse_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_compiler_CodeGeneratorResponse* ret = google_protobuf_compiler_CodeGeneratorResponse_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_CodeGeneratorResponse_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse* google_protobuf_compiler_CodeGeneratorResponse_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_compiler_CodeGeneratorResponse* ret = google_protobuf_compiler_CodeGeneratorResponse_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_CodeGeneratorResponse_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_compiler_CodeGeneratorResponse_serialize(const google_protobuf_compiler_CodeGeneratorResponse* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_compiler_CodeGeneratorResponse_serialize_ex(const google_protobuf_compiler_CodeGeneratorResponse* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_CodeGeneratorResponse_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_clear_error(google_protobuf_compiler_CodeGeneratorResponse* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_compiler_CodeGeneratorResponse_error(const google_protobuf_compiler_CodeGeneratorResponse* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_has_error(const google_protobuf_compiler_CodeGeneratorResponse* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_clear_supported_features(google_protobuf_compiler_CodeGeneratorResponse* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE uint64_t google_protobuf_compiler_CodeGeneratorResponse_supported_features(const google_protobuf_compiler_CodeGeneratorResponse* msg) { + uint64_t default_val = (uint64_t)0ull; + uint64_t ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_has_supported_features(const google_protobuf_compiler_CodeGeneratorResponse* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_clear_file(google_protobuf_compiler_CodeGeneratorResponse* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 15); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_compiler_CodeGeneratorResponse_File* const* google_protobuf_compiler_CodeGeneratorResponse_file(const google_protobuf_compiler_CodeGeneratorResponse* msg, size_t* size) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 15); + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_compiler_CodeGeneratorResponse_File* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_has_file(const google_protobuf_compiler_CodeGeneratorResponse* msg) { + size_t size; + google_protobuf_compiler_CodeGeneratorResponse_file(msg, &size); + return size != 0; +} + +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_set_error(google_protobuf_compiler_CodeGeneratorResponse *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_set_supported_features(google_protobuf_compiler_CodeGeneratorResponse *msg, uint64_t value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File** google_protobuf_compiler_CodeGeneratorResponse_mutable_file(google_protobuf_compiler_CodeGeneratorResponse* msg, size_t* size) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 15); + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_compiler_CodeGeneratorResponse_File**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File** google_protobuf_compiler_CodeGeneratorResponse_resize_file(google_protobuf_compiler_CodeGeneratorResponse* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 15); + return (google_protobuf_compiler_CodeGeneratorResponse_File**)upb_Message_ResizeArray(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_compiler_CodeGeneratorResponse_File* google_protobuf_compiler_CodeGeneratorResponse_add_file(google_protobuf_compiler_CodeGeneratorResponse* msg, upb_Arena* arena) { + upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_msg_init(), 15); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_compiler_CodeGeneratorResponse_File* sub = (struct google_protobuf_compiler_CodeGeneratorResponse_File*)_upb_Message_New(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} + +/* google.protobuf.compiler.CodeGeneratorResponse.File */ + +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File* google_protobuf_compiler_CodeGeneratorResponse_File_new(upb_Arena* arena) { + return (google_protobuf_compiler_CodeGeneratorResponse_File*)_upb_Message_New(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), arena); +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File* google_protobuf_compiler_CodeGeneratorResponse_File_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_compiler_CodeGeneratorResponse_File* ret = google_protobuf_compiler_CodeGeneratorResponse_File_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File* google_protobuf_compiler_CodeGeneratorResponse_File_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_compiler_CodeGeneratorResponse_File* ret = google_protobuf_compiler_CodeGeneratorResponse_File_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_compiler_CodeGeneratorResponse_File_serialize(const google_protobuf_compiler_CodeGeneratorResponse_File* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_compiler_CodeGeneratorResponse_File_serialize_ex(const google_protobuf_compiler_CodeGeneratorResponse_File* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_clear_name(google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 1); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_compiler_CodeGeneratorResponse_File_name(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 1); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_File_has_name(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 1); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_clear_insertion_point(google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 2); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_compiler_CodeGeneratorResponse_File_insertion_point(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 2); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_File_has_insertion_point(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 2); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_clear_content(google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 15); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_compiler_CodeGeneratorResponse_File_content(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 15); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_File_has_content(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 15); + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_clear_generated_code_info(google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 16); + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const struct google_protobuf_GeneratedCodeInfo* google_protobuf_compiler_CodeGeneratorResponse_File_generated_code_info(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const struct google_protobuf_GeneratedCodeInfo* default_val = NULL; + const struct google_protobuf_GeneratedCodeInfo* ret; + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 16); + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_compiler_CodeGeneratorResponse_File_has_generated_code_info(const google_protobuf_compiler_CodeGeneratorResponse_File* msg) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 16); + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_set_name(google_protobuf_compiler_CodeGeneratorResponse_File *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 1); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_set_insertion_point(google_protobuf_compiler_CodeGeneratorResponse_File *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 2); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_set_content(google_protobuf_compiler_CodeGeneratorResponse_File *msg, upb_StringView value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 15); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_compiler_CodeGeneratorResponse_File_set_generated_code_info(google_protobuf_compiler_CodeGeneratorResponse_File *msg, struct google_protobuf_GeneratedCodeInfo* value) { + const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google_protobuf_compiler_CodeGeneratorResponse_File_msg_init(), 16); + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_GeneratedCodeInfo* google_protobuf_compiler_CodeGeneratorResponse_File_mutable_generated_code_info(google_protobuf_compiler_CodeGeneratorResponse_File* msg, upb_Arena* arena) { + struct google_protobuf_GeneratedCodeInfo* sub = (struct google_protobuf_GeneratedCodeInfo*)google_protobuf_compiler_CodeGeneratorResponse_File_generated_code_info(msg); + if (sub == NULL) { + sub = (struct google_protobuf_GeneratedCodeInfo*)_upb_Message_New(google_protobuf_GeneratedCodeInfo_msg_init(), arena); + if (sub) google_protobuf_compiler_CodeGeneratorResponse_File_set_generated_code_info(msg, sub); + } + return sub; +} + +extern const upb_MiniTableFile google_protobuf_compiler_plugin_proto_upb_file_layout; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif /* GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ */ diff --git a/third_party/upb/upbc/subprocess.cc b/third_party/upb/upbc/subprocess.cc index e46abc86fca..08628b705eb 100644 --- a/third_party/upb/upbc/subprocess.cc +++ b/third_party/upb/upbc/subprocess.cc @@ -41,11 +41,11 @@ #include #endif +#include "absl/log/absl_log.h" #include "absl/strings/substitute.h" -#include "upb/upb.h" -/* Must be last. */ -#include "upb/port_def.inc" +// Must be last. +#include "upb/port/def.inc" namespace upbc { @@ -63,8 +63,8 @@ char* portable_strdup(const char* s) { static void CloseHandleOrDie(HANDLE handle) { if (!CloseHandle(handle)) { - GOOGLE_LOG(FATAL) << "CloseHandle: " - << Subprocess::Win32ErrorMessage(GetLastError()); + ABSL_LOG(FATAL) << "CloseHandle: " + << Subprocess::Win32ErrorMessage(GetLastError()); } } @@ -91,22 +91,22 @@ void Subprocess::Start(const std::string& program, SearchMode search_mode) { HANDLE stdout_pipe_write; if (!CreatePipe(&stdin_pipe_read, &stdin_pipe_write, nullptr, 0)) { - GOOGLE_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); + ABSL_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); } if (!CreatePipe(&stdout_pipe_read, &stdout_pipe_write, nullptr, 0)) { - GOOGLE_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); + ABSL_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()); + ABSL_LOG(FATAL) << "SetHandleInformation: " + << Win32ErrorMessage(GetLastError()); } if (!SetHandleInformation(stdout_pipe_write, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT)) { - GOOGLE_LOG(FATAL) << "SetHandleInformation: " - << Win32ErrorMessage(GetLastError()); + ABSL_LOG(FATAL) << "SetHandleInformation: " + << Win32ErrorMessage(GetLastError()); } // Setup STARTUPINFO to redirect handles. @@ -119,7 +119,7 @@ void Subprocess::Start(const std::string& program, SearchMode search_mode) { startup_info.hStdError = GetStdHandle(STD_ERROR_HANDLE); if (startup_info.hStdError == INVALID_HANDLE_VALUE) { - GOOGLE_LOG(FATAL) << "GetStdHandle: " << Win32ErrorMessage(GetLastError()); + ABSL_LOG(FATAL) << "GetStdHandle: " << Win32ErrorMessage(GetLastError()); } // Invoking cmd.exe allows for '.bat' files from the path as well as '.exe'. @@ -185,11 +185,11 @@ bool Subprocess::Communicate(const std::string& input_data, 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()); + ABSL_LOG(FATAL) << "WaitForMultipleObjects: " + << Win32ErrorMessage(GetLastError()); } else { - GOOGLE_LOG(FATAL) << "WaitForMultipleObjects: Unexpected return code: " - << wait_result; + ABSL_LOG(FATAL) << "WaitForMultipleObjects: Unexpected return code: " + << wait_result; } if (signaled_handle == child_stdin_) { @@ -232,17 +232,17 @@ bool Subprocess::Communicate(const std::string& input_data, DWORD wait_result = WaitForSingleObject(child_handle_, INFINITE); if (wait_result == WAIT_FAILED) { - GOOGLE_LOG(FATAL) << "WaitForSingleObject: " - << Win32ErrorMessage(GetLastError()); + ABSL_LOG(FATAL) << "WaitForSingleObject: " + << Win32ErrorMessage(GetLastError()); } else if (wait_result != WAIT_OBJECT_0) { - GOOGLE_LOG(FATAL) << "WaitForSingleObject: Unexpected return code: " - << wait_result; + ABSL_LOG(FATAL) << "WaitForSingleObject: Unexpected return code: " + << wait_result; } DWORD exit_code; if (!GetExitCodeProcess(child_handle_, &exit_code)) { - GOOGLE_LOG(FATAL) << "GetExitCodeProcess: " - << Win32ErrorMessage(GetLastError()); + ABSL_LOG(FATAL) << "GetExitCodeProcess: " + << Win32ErrorMessage(GetLastError()); } CloseHandleOrDie(child_handle_); diff --git a/third_party/upb/upbc/upbc_so.c b/third_party/upb/upbc/upbc_so.c new file mode 100644 index 00000000000..b40b9b645aa --- /dev/null +++ b/third_party/upb/upbc/upbc_so.c @@ -0,0 +1,82 @@ +/* + * 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. + */ + +// This disables inlining and forces all public functions to be exported to the +// linker. It is used to generate bindings for FFIs from other languages. +#ifndef UPB_BUILD_API +#define UPB_BUILD_API +#endif + +#include "upb/collections/array.h" +#include "upb/collections/map.h" +#include "upb/message/accessors.h" +#include "upb/message/message.h" +#include "upb/mini_table/decode.h" +#include "upbc/upbdev.h" + +// Must be last. +#include "upb/port/def.inc" + +// JavaScript doesn't directly support 64-bit ints so we must split them. + +UPB_API_INLINE uint32_t upb_Message_GetInt64Hi(const upb_Message* msg, + const upb_MiniTableField* field, + uint32_t default_value) { + return (uint32_t)(upb_Message_GetInt64(msg, field, default_value) >> 32); +} + +UPB_API_INLINE uint32_t upb_Message_GetInt64Lo(const upb_Message* msg, + const upb_MiniTableField* field, + uint32_t default_value) { + return (uint32_t)upb_Message_GetInt64(msg, field, default_value); +} + +UPB_API_INLINE bool upb_Message_SetInt64Split(upb_Message* msg, + const upb_MiniTableField* field, + uint32_t hi, uint32_t lo, + upb_Arena* a) { + return upb_Message_SetInt64(msg, field, ((int64_t)hi << 32) | lo, a); +} + +UPB_API_INLINE uint32_t upb_Message_GetUInt64Hi(const upb_Message* msg, + const upb_MiniTableField* field, + uint32_t default_value) { + return (uint32_t)(upb_Message_GetUInt64(msg, field, default_value) >> 32); +} + +UPB_API_INLINE uint32_t upb_Message_GetUInt64Lo(const upb_Message* msg, + const upb_MiniTableField* field, + uint32_t default_value) { + return (uint32_t)upb_Message_GetUInt64(msg, field, default_value); +} + +UPB_API_INLINE bool upb_Message_SetUInt64Split(upb_Message* msg, + const upb_MiniTableField* field, + uint32_t hi, uint32_t lo, + upb_Arena* a) { + return upb_Message_SetUInt64(msg, field, ((uint64_t)hi << 32) | lo, a); +} diff --git a/third_party/upb/upbc/upbdev.c b/third_party/upb/upbc/upbdev.c new file mode 100644 index 00000000000..f41d38f00fa --- /dev/null +++ b/third_party/upb/upbc/upbdev.c @@ -0,0 +1,120 @@ +// 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/upbdev.h" + +#include + +#include "google/protobuf/compiler/plugin.upb.h" +#include "google/protobuf/compiler/plugin.upbdefs.h" +#include "upb/base/status.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/mem/arena.h" +#include "upbc/code_generator_request.h" +#include "upbc/code_generator_request.upb.h" +#include "upbc/code_generator_request.upbdefs.h" + +static google_protobuf_compiler_CodeGeneratorResponse* upbc_JsonDecode( + const char* data, size_t size, upb_Arena* arena, upb_Status* status) { + google_protobuf_compiler_CodeGeneratorResponse* response = + google_protobuf_compiler_CodeGeneratorResponse_new(arena); + + upb_DefPool* s = upb_DefPool_New(); + const upb_MessageDef* m = google_protobuf_compiler_CodeGeneratorResponse_getmsgdef(s); + + (void)upb_JsonDecode(data, size, response, m, s, 0, arena, status); + if (!upb_Status_IsOk(status)) return NULL; + + upb_DefPool_Free(s); + + return response; +} + +static upb_StringView upbc_JsonEncode(const upbc_CodeGeneratorRequest* request, + upb_Arena* arena, upb_Status* status) { + upb_StringView out = {.data = NULL, .size = 0}; + + upb_DefPool* s = upb_DefPool_New(); + const upb_MessageDef* m = upbc_CodeGeneratorRequest_getmsgdef(s); + + out.size = upb_JsonEncode(request, m, s, 0, NULL, 0, status); + if (!upb_Status_IsOk(status)) goto done; + + char* data = (char*)upb_Arena_Malloc(arena, out.size + 1); + + (void)upb_JsonEncode(request, m, s, 0, data, out.size + 1, status); + if (!upb_Status_IsOk(status)) goto done; + + out.data = (const char*)data; + +done: + upb_DefPool_Free(s); + return out; +} + +upb_StringView upbdev_ProcessInput(const char* buf, size_t size, + upb_Arena* arena, upb_Status* status) { + upb_StringView out = {.data = NULL, .size = 0}; + + google_protobuf_compiler_CodeGeneratorRequest* inner_request = + google_protobuf_compiler_CodeGeneratorRequest_parse(buf, size, arena); + + const upbc_CodeGeneratorRequest* outer_request = + upbc_MakeCodeGeneratorRequest(inner_request, arena, status); + if (upb_Status_IsOk(status)) + out = upbc_JsonEncode(outer_request, arena, status); + + return out; +} + +upb_StringView upbdev_ProcessOutput(const char* buf, size_t size, + upb_Arena* arena, upb_Status* status) { + upb_StringView out = {.data = NULL, .size = 0}; + + const google_protobuf_compiler_CodeGeneratorResponse* response = + upbc_JsonDecode(buf, size, arena, status); + if (!upb_Status_IsOk(status)) return out; + + out.data = google_protobuf_compiler_CodeGeneratorResponse_serialize(response, arena, + &out.size); + return out; +} + +void upbdev_ProcessStdout(const char* buf, size_t size, upb_Arena* arena, + upb_Status* status) { + const upb_StringView sv = upbdev_ProcessOutput(buf, size, arena, status); + if (!upb_Status_IsOk(status)) return; + + const char* ptr = sv.data; + size_t len = sv.size; + while (len) { + int n = write(1, ptr, len); + if (n > 0) { + ptr += n; + len -= n; + } + } +} diff --git a/third_party/upb/upbc/upbdev.h b/third_party/upb/upbc/upbdev.h new file mode 100644 index 00000000000..b8c6b2deab4 --- /dev/null +++ b/third_party/upb/upbc/upbdev.h @@ -0,0 +1,63 @@ +/* + * 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_UPBDEV_H_ +#define UPBC_UPBDEV_H_ + +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" + +// Must be last. +#include "upb/port/def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Consume |buf|, deserialize it to a Code_Generator_Request proto, construct a +// upbc_Code_Generator_Request, and return it as a JSON-encoded string. +UPB_API upb_StringView upbdev_ProcessInput(const char* buf, size_t size, + upb_Arena* arena, + upb_Status* status); + +// Decode |buf| from JSON, serialize to wire format, and return it. +UPB_API upb_StringView upbdev_ProcessOutput(const char* buf, size_t size, + upb_Arena* arena, + upb_Status* status); + +// Decode |buf| from JSON, serialize to wire format, and write it to stdout. +UPB_API void upbdev_ProcessStdout(const char* buf, size_t size, + upb_Arena* arena, upb_Status* status); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port/undef.inc" + +#endif // UPBC_UPBDEV_H_ diff --git a/tools/buildgen/extract_metadata_from_bazel_xml.py b/tools/buildgen/extract_metadata_from_bazel_xml.py index c8810193c09..eb89e770406 100755 --- a/tools/buildgen/extract_metadata_from_bazel_xml.py +++ b/tools/buildgen/extract_metadata_from_bazel_xml.py @@ -123,6 +123,7 @@ def _rule_dict_from_xml_node(rule_xml_node): 'generator_function': None, 'size': None, 'flaky': False, + 'actual': None, # the real target name for aliases } for child in rule_xml_node: # all the metadata we want is stored under "list" tags @@ -138,6 +139,17 @@ def _rule_dict_from_xml_node(rule_xml_node): bool_name = child.attrib['name'] if bool_name in ['flaky']: result[bool_name] = child.attrib['value'] == 'true' + if child.tag == 'label': + # extract actual name for alias rules + label_name = child.attrib['name'] + if label_name in ['actual']: + actual_name = child.attrib.get('value', None) + if actual_name: + result['actual'] = actual_name + # HACK: since we do a lot of transitive dependency scanning, + # make it seem that the actual name is a dependency of the alias rule + # (aliases don't have dependencies themselves) + result['deps'].append(actual_name) return result @@ -158,6 +170,7 @@ def _extract_rules_from_bazel_xml(xml_tree): 'proto_library', 'upb_proto_library', 'upb_proto_reflection_library', + 'alias', ]: if rule_name in result: raise Exception('Rule %s already present' % rule_name) @@ -487,7 +500,7 @@ def _expand_upb_proto_library_rules(bazel_rules): # upb.h and upb.c files. GEN_UPB_ROOT = '//:src/core/ext/upb-generated/' GEN_UPBDEFS_ROOT = '//:src/core/ext/upbdefs-generated/' - EXTERNAL_LINKS = [('@com_google_protobuf//', ':src/'), + EXTERNAL_LINKS = [('@com_google_protobuf//', 'src/'), ('@com_google_googleapis//', ''), ('@com_github_cncf_udpa//', ''), ('@com_envoyproxy_protoc_gen_validate//', ''), @@ -520,8 +533,12 @@ def _expand_upb_proto_library_rules(bazel_rules): for proto_src in protos: for external_link in EXTERNAL_LINKS: if proto_src.startswith(external_link[0]): - proto_src = proto_src[len(external_link[0]) + - len(external_link[1]):] + prefix_to_strip = external_link[0] + external_link[1] + if not proto_src.startswith(prefix_to_strip): + raise Exception( + 'Source file "{0}" in upb rule {1} does not have the expected prefix "{2}"' + .format(proto_src, name, prefix_to_strip)) + proto_src = proto_src[len(prefix_to_strip):] break if proto_src.startswith('@'): raise Exception('"{0}" is unknown workspace.'.format(name)) diff --git a/tools/codegen/core/gen_upb_api_from_bazel_xml.py b/tools/codegen/core/gen_upb_api_from_bazel_xml.py index 54d62c89ca4..58b9be79005 100755 --- a/tools/codegen/core/gen_upb_api_from_bazel_xml.py +++ b/tools/codegen/core/gen_upb_api_from_bazel_xml.py @@ -56,6 +56,16 @@ def parse_bazel_rule(elem): for tag in child: if tag.tag == 'label': deps.append(tag.attrib['value']) + if child.tag == 'label': + # extract actual name for alias rules + label_name = child.attrib['name'] + if label_name in ['actual']: + actual_name = child.attrib.get('value', None) + if actual_name: + # HACK: since we do a lot of transitive dependency scanning, + # make it seem that the actual name is a dependency of the alias rule + # (aliases don't have dependencies themselves) + deps.append(actual_name) return Rule(elem.attrib['name'], elem.attrib['class'], srcs, deps, []) @@ -128,15 +138,18 @@ def get_bazel_bin_root_path(elink): BAZEL_BIN_ROOT = 'bazel-bin/' if elink[0].startswith('@'): # external - return os.path.join(BAZEL_BIN_ROOT, 'external', - elink[0].replace('@', '').replace('//', '')) + result = os.path.join(BAZEL_BIN_ROOT, 'external', + elink[0].replace('@', '').replace('//', '')) + if elink[1]: + result = os.path.join(result, elink[1]) + return result else: # internal return BAZEL_BIN_ROOT def get_external_link(file): - EXTERNAL_LINKS = [('@com_google_protobuf//', ':src/'), + EXTERNAL_LINKS = [('@com_google_protobuf//', 'src/'), ('@com_google_googleapis//', ''), ('@com_github_cncf_udpa//', ''), ('@com_envoyproxy_protoc_gen_validate//', ''), @@ -158,7 +171,12 @@ def copy_upb_generated_files(rules, args): output_dir = args.upbdefs_out for proto_file in rule.proto_files: elink = get_external_link(proto_file) - proto_file = proto_file[len(elink[0]) + len(elink[1]):] + prefix_to_strip = elink[0] + elink[1] + if not proto_file.startswith(prefix_to_strip): + raise Exception( + 'Source file "{0}" in does not have the expected prefix "{1}"' + .format(proto_file, prefix_to_strip)) + proto_file = proto_file[len(prefix_to_strip):] for ext in ('.h', '.c'): file = get_upb_path(proto_file, frag + ext) src = os.path.join(get_bazel_bin_root_path(elink), file) diff --git a/tools/distrib/fix_build_deps.py b/tools/distrib/fix_build_deps.py index 2e9bb2d3721..bac2be8246e 100755 --- a/tools/distrib/fix_build_deps.py +++ b/tools/distrib/fix_build_deps.py @@ -209,10 +209,16 @@ EXTERNAL_DEPS = { 're2', 'upb/arena.h': 'upb_lib', + 'upb/base/string_view.h': + 'upb_lib', + 'upb/collections/map.h': + 'upb_collections_lib', 'upb/def.h': 'upb_lib', 'upb/json_encode.h': 'upb_json_lib', + 'upb/mem/arena.h': + 'upb_lib', 'upb/text_encode.h': 'upb_textformat_lib', 'upb/def.hpp': diff --git a/tools/distrib/python/bazel_deps.sh b/tools/distrib/python/bazel_deps.sh index ce2c1147499..c5d232e862d 100755 --- a/tools/distrib/python/bazel_deps.sh +++ b/tools/distrib/python/bazel_deps.sh @@ -16,6 +16,5 @@ cd $(dirname $0)/../../../ -cd third_party/protobuf # use tools/bazel wrapper to make sure we use the right version of bazel -../../tools/bazel query 'deps('$1')' +tools/bazel query 'deps('$1')' diff --git a/tools/distrib/python/grpc_version.py b/tools/distrib/python/grpc_version.py index 02777a84ea7..43de950f13f 100644 --- a/tools/distrib/python/grpc_version.py +++ b/tools/distrib/python/grpc_version.py @@ -15,4 +15,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! VERSION = '1.55.0.dev0' -PROTOBUF_VERSION = '3.21.12' +PROTOBUF_VERSION = '3.22.2' diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 1db4708e067..14d6ec97b11 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -15,4 +15,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! VERSION = '1.55.0.dev0' -PROTOBUF_VERSION = '3.21.12' +PROTOBUF_VERSION = '3.22.2' diff --git a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py index b8e934017d3..b22f0229863 100644 --- a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py +++ b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py @@ -15,173 +15,260 @@ # AUTO-GENERATED BY make_grpcio_tools.py! CC_FILES=[ - 'google/protobuf/any.cc', - 'google/protobuf/any.pb.cc', - 'google/protobuf/any_lite.cc', - 'google/protobuf/api.pb.cc', - 'google/protobuf/arena.cc', - 'google/protobuf/arenastring.cc', - 'google/protobuf/arenaz_sampler.cc', - 'google/protobuf/compiler/code_generator.cc', - 'google/protobuf/compiler/command_line_interface.cc', - 'google/protobuf/compiler/cpp/enum.cc', - 'google/protobuf/compiler/cpp/enum_field.cc', - 'google/protobuf/compiler/cpp/extension.cc', - 'google/protobuf/compiler/cpp/field.cc', - 'google/protobuf/compiler/cpp/file.cc', - 'google/protobuf/compiler/cpp/generator.cc', - 'google/protobuf/compiler/cpp/helpers.cc', - 'google/protobuf/compiler/cpp/map_field.cc', - 'google/protobuf/compiler/cpp/message.cc', - 'google/protobuf/compiler/cpp/message_field.cc', - 'google/protobuf/compiler/cpp/padding_optimizer.cc', - 'google/protobuf/compiler/cpp/parse_function_generator.cc', - 'google/protobuf/compiler/cpp/primitive_field.cc', - 'google/protobuf/compiler/cpp/service.cc', - 'google/protobuf/compiler/cpp/string_field.cc', - 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', - 'google/protobuf/compiler/csharp/csharp_enum.cc', - 'google/protobuf/compiler/csharp/csharp_enum_field.cc', - 'google/protobuf/compiler/csharp/csharp_field_base.cc', - 'google/protobuf/compiler/csharp/csharp_generator.cc', - 'google/protobuf/compiler/csharp/csharp_helpers.cc', - 'google/protobuf/compiler/csharp/csharp_map_field.cc', - 'google/protobuf/compiler/csharp/csharp_message.cc', - 'google/protobuf/compiler/csharp/csharp_message_field.cc', - 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', - 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', - 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', - 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', - 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', - 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', - 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', - 'google/protobuf/compiler/importer.cc', - 'google/protobuf/compiler/java/context.cc', - 'google/protobuf/compiler/java/doc_comment.cc', - 'google/protobuf/compiler/java/enum.cc', - 'google/protobuf/compiler/java/enum_field.cc', - 'google/protobuf/compiler/java/enum_field_lite.cc', - 'google/protobuf/compiler/java/enum_lite.cc', - 'google/protobuf/compiler/java/extension.cc', - 'google/protobuf/compiler/java/extension_lite.cc', - 'google/protobuf/compiler/java/field.cc', - 'google/protobuf/compiler/java/file.cc', - 'google/protobuf/compiler/java/generator.cc', - 'google/protobuf/compiler/java/generator_factory.cc', - 'google/protobuf/compiler/java/helpers.cc', - 'google/protobuf/compiler/java/kotlin_generator.cc', - 'google/protobuf/compiler/java/map_field.cc', - 'google/protobuf/compiler/java/map_field_lite.cc', - 'google/protobuf/compiler/java/message.cc', - 'google/protobuf/compiler/java/message_builder.cc', - 'google/protobuf/compiler/java/message_builder_lite.cc', - 'google/protobuf/compiler/java/message_field.cc', - 'google/protobuf/compiler/java/message_field_lite.cc', - 'google/protobuf/compiler/java/message_lite.cc', - 'google/protobuf/compiler/java/name_resolver.cc', - 'google/protobuf/compiler/java/primitive_field.cc', - 'google/protobuf/compiler/java/primitive_field_lite.cc', - 'google/protobuf/compiler/java/service.cc', - 'google/protobuf/compiler/java/shared_code_generator.cc', - 'google/protobuf/compiler/java/string_field.cc', - 'google/protobuf/compiler/java/string_field_lite.cc', - 'google/protobuf/compiler/objectivec/objectivec_enum.cc', - 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', - 'google/protobuf/compiler/objectivec/objectivec_extension.cc', - 'google/protobuf/compiler/objectivec/objectivec_field.cc', - 'google/protobuf/compiler/objectivec/objectivec_file.cc', - 'google/protobuf/compiler/objectivec/objectivec_generator.cc', - 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', - 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', - 'google/protobuf/compiler/objectivec/objectivec_message.cc', - 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', - 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', - 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', - 'google/protobuf/compiler/parser.cc', - 'google/protobuf/compiler/php/php_generator.cc', - 'google/protobuf/compiler/plugin.cc', - 'google/protobuf/compiler/plugin.pb.cc', - 'google/protobuf/compiler/python/generator.cc', - 'google/protobuf/compiler/python/helpers.cc', - 'google/protobuf/compiler/python/pyi_generator.cc', - 'google/protobuf/compiler/ruby/ruby_generator.cc', - 'google/protobuf/compiler/subprocess.cc', - 'google/protobuf/compiler/zip_writer.cc', - 'google/protobuf/descriptor.cc', - 'google/protobuf/descriptor.pb.cc', - 'google/protobuf/descriptor_database.cc', - 'google/protobuf/duration.pb.cc', - 'google/protobuf/dynamic_message.cc', - 'google/protobuf/empty.pb.cc', - 'google/protobuf/extension_set.cc', - 'google/protobuf/extension_set_heavy.cc', - 'google/protobuf/field_mask.pb.cc', - 'google/protobuf/generated_enum_util.cc', - 'google/protobuf/generated_message_bases.cc', - 'google/protobuf/generated_message_reflection.cc', - 'google/protobuf/generated_message_tctable_full.cc', - 'google/protobuf/generated_message_tctable_lite.cc', - 'google/protobuf/generated_message_util.cc', - 'google/protobuf/implicit_weak_message.cc', - 'google/protobuf/inlined_string_field.cc', - 'google/protobuf/io/coded_stream.cc', - 'google/protobuf/io/gzip_stream.cc', - 'google/protobuf/io/io_win32.cc', - 'google/protobuf/io/printer.cc', - 'google/protobuf/io/strtod.cc', - 'google/protobuf/io/tokenizer.cc', - 'google/protobuf/io/zero_copy_stream.cc', - 'google/protobuf/io/zero_copy_stream_impl.cc', - 'google/protobuf/io/zero_copy_stream_impl_lite.cc', - 'google/protobuf/map.cc', - 'google/protobuf/map_field.cc', - 'google/protobuf/message.cc', - 'google/protobuf/message_lite.cc', - 'google/protobuf/parse_context.cc', - 'google/protobuf/reflection_ops.cc', - 'google/protobuf/repeated_field.cc', - 'google/protobuf/repeated_ptr_field.cc', - 'google/protobuf/service.cc', - 'google/protobuf/source_context.pb.cc', - 'google/protobuf/struct.pb.cc', - 'google/protobuf/stubs/bytestream.cc', - 'google/protobuf/stubs/common.cc', - 'google/protobuf/stubs/int128.cc', - 'google/protobuf/stubs/status.cc', - 'google/protobuf/stubs/statusor.cc', - 'google/protobuf/stubs/stringpiece.cc', - 'google/protobuf/stubs/stringprintf.cc', - 'google/protobuf/stubs/structurally_valid.cc', - 'google/protobuf/stubs/strutil.cc', - 'google/protobuf/stubs/substitute.cc', - 'google/protobuf/stubs/time.cc', - 'google/protobuf/text_format.cc', - 'google/protobuf/timestamp.pb.cc', - 'google/protobuf/type.pb.cc', - 'google/protobuf/unknown_field_set.cc', - 'google/protobuf/util/delimited_message_util.cc', - 'google/protobuf/util/field_comparator.cc', - 'google/protobuf/util/field_mask_util.cc', - 'google/protobuf/util/internal/datapiece.cc', - 'google/protobuf/util/internal/default_value_objectwriter.cc', - 'google/protobuf/util/internal/error_listener.cc', - 'google/protobuf/util/internal/field_mask_utility.cc', - 'google/protobuf/util/internal/json_escaping.cc', - 'google/protobuf/util/internal/json_objectwriter.cc', - 'google/protobuf/util/internal/json_stream_parser.cc', - 'google/protobuf/util/internal/object_writer.cc', - 'google/protobuf/util/internal/proto_writer.cc', - 'google/protobuf/util/internal/protostream_objectsource.cc', - 'google/protobuf/util/internal/protostream_objectwriter.cc', - 'google/protobuf/util/internal/type_info.cc', - 'google/protobuf/util/internal/utility.cc', - 'google/protobuf/util/json_util.cc', - 'google/protobuf/util/message_differencer.cc', - 'google/protobuf/util/time_util.cc', - 'google/protobuf/util/type_resolver_util.cc', - 'google/protobuf/wire_format.cc', - 'google/protobuf/wire_format_lite.cc', - 'google/protobuf/wrappers.pb.cc' + 'third_party/abseil-cpp/absl/base/internal/cycleclock.cc', + 'third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc', + 'third_party/abseil-cpp/absl/base/internal/raw_logging.cc', + 'third_party/abseil-cpp/absl/base/internal/spinlock.cc', + 'third_party/abseil-cpp/absl/base/internal/spinlock_wait.cc', + 'third_party/abseil-cpp/absl/base/internal/strerror.cc', + 'third_party/abseil-cpp/absl/base/internal/sysinfo.cc', + 'third_party/abseil-cpp/absl/base/internal/thread_identity.cc', + 'third_party/abseil-cpp/absl/base/internal/throw_delegate.cc', + 'third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc', + 'third_party/abseil-cpp/absl/base/log_severity.cc', + 'third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc', + 'third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc', + 'third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc', + 'third_party/abseil-cpp/absl/crc/crc32c.cc', + 'third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc', + 'third_party/abseil-cpp/absl/crc/internal/crc.cc', + 'third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc', + 'third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc', + 'third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc', + 'third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc', + 'third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc', + 'third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc', + 'third_party/abseil-cpp/absl/debugging/internal/demangle.cc', + 'third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc', + 'third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc', + 'third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc', + 'third_party/abseil-cpp/absl/debugging/stacktrace.cc', + 'third_party/abseil-cpp/absl/debugging/symbolize.cc', + 'third_party/abseil-cpp/absl/hash/internal/city.cc', + 'third_party/abseil-cpp/absl/hash/internal/hash.cc', + 'third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc', + 'third_party/abseil-cpp/absl/log/globals.cc', + 'third_party/abseil-cpp/absl/log/initialize.cc', + 'third_party/abseil-cpp/absl/log/internal/check_op.cc', + 'third_party/abseil-cpp/absl/log/internal/conditions.cc', + 'third_party/abseil-cpp/absl/log/internal/globals.cc', + 'third_party/abseil-cpp/absl/log/internal/log_format.cc', + 'third_party/abseil-cpp/absl/log/internal/log_message.cc', + 'third_party/abseil-cpp/absl/log/internal/log_sink_set.cc', + 'third_party/abseil-cpp/absl/log/internal/nullguard.cc', + 'third_party/abseil-cpp/absl/log/internal/proto.cc', + 'third_party/abseil-cpp/absl/log/log_entry.cc', + 'third_party/abseil-cpp/absl/log/log_sink.cc', + 'third_party/abseil-cpp/absl/numeric/int128.cc', + 'third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc', + 'third_party/abseil-cpp/absl/status/status.cc', + 'third_party/abseil-cpp/absl/status/status_payload_printer.cc', + 'third_party/abseil-cpp/absl/status/statusor.cc', + 'third_party/abseil-cpp/absl/strings/ascii.cc', + 'third_party/abseil-cpp/absl/strings/charconv.cc', + 'third_party/abseil-cpp/absl/strings/cord.cc', + 'third_party/abseil-cpp/absl/strings/cord_analysis.cc', + 'third_party/abseil-cpp/absl/strings/cord_buffer.cc', + 'third_party/abseil-cpp/absl/strings/escaping.cc', + 'third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc', + 'third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_internal.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc', + 'third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc', + 'third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc', + 'third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc', + 'third_party/abseil-cpp/absl/strings/internal/cordz_info.cc', + 'third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc', + 'third_party/abseil-cpp/absl/strings/internal/escaping.cc', + 'third_party/abseil-cpp/absl/strings/internal/memutil.cc', + 'third_party/abseil-cpp/absl/strings/internal/ostringstream.cc', + 'third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc', + 'third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc', + 'third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc', + 'third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc', + 'third_party/abseil-cpp/absl/strings/internal/str_format/output.cc', + 'third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc', + 'third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc', + 'third_party/abseil-cpp/absl/strings/internal/utf8.cc', + 'third_party/abseil-cpp/absl/strings/match.cc', + 'third_party/abseil-cpp/absl/strings/numbers.cc', + 'third_party/abseil-cpp/absl/strings/str_cat.cc', + 'third_party/abseil-cpp/absl/strings/str_replace.cc', + 'third_party/abseil-cpp/absl/strings/str_split.cc', + 'third_party/abseil-cpp/absl/strings/string_view.cc', + 'third_party/abseil-cpp/absl/strings/substitute.cc', + 'third_party/abseil-cpp/absl/synchronization/barrier.cc', + 'third_party/abseil-cpp/absl/synchronization/blocking_counter.cc', + 'third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc', + 'third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc', + 'third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc', + 'third_party/abseil-cpp/absl/synchronization/internal/waiter.cc', + 'third_party/abseil-cpp/absl/synchronization/mutex.cc', + 'third_party/abseil-cpp/absl/synchronization/notification.cc', + 'third_party/abseil-cpp/absl/time/civil_time.cc', + 'third_party/abseil-cpp/absl/time/clock.cc', + 'third_party/abseil-cpp/absl/time/duration.cc', + 'third_party/abseil-cpp/absl/time/format.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc', + 'third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc', + 'third_party/abseil-cpp/absl/time/time.cc', + 'third_party/abseil-cpp/absl/types/bad_optional_access.cc', + 'third_party/abseil-cpp/absl/types/bad_variant_access.cc', + 'third_party/protobuf/src/google/protobuf/any.cc', + 'third_party/protobuf/src/google/protobuf/any_lite.cc', + 'third_party/protobuf/src/google/protobuf/arena.cc', + 'third_party/protobuf/src/google/protobuf/arena_align.cc', + 'third_party/protobuf/src/google/protobuf/arena_config.cc', + 'third_party/protobuf/src/google/protobuf/arenastring.cc', + 'third_party/protobuf/src/google/protobuf/arenaz_sampler.cc', + 'third_party/protobuf/src/google/protobuf/compiler/code_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/enum.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/extension.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/field_generators/map_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/field_generators/message_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/field_generators/string_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/file.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/helpers.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/padding_optimizer.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/parse_function_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/service.cc', + 'third_party/protobuf/src/google/protobuf/compiler/cpp/tracker.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/csharp/names.cc', + 'third_party/protobuf/src/google/protobuf/compiler/importer.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/context.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/doc_comment.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/enum.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/enum_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/enum_field_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/enum_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/extension.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/extension_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/file.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/generator_factory.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/helpers.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/kotlin_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/map_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/map_field_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message_builder.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message_builder_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message_field_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/message_serialization.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/name_resolver.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/names.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/primitive_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/primitive_field_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/service.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/shared_code_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/string_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/java/string_field_lite.cc', + 'third_party/protobuf/src/google/protobuf/compiler/main.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/enum.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/enum_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/extension.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/file.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/helpers.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/import_writer.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/line_consumer.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/map_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/message.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/message_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/names.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/oneof.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/primitive_field.cc', + 'third_party/protobuf/src/google/protobuf/compiler/objectivec/text_format_decode_data.cc', + 'third_party/protobuf/src/google/protobuf/compiler/parser.cc', + 'third_party/protobuf/src/google/protobuf/compiler/php/names.cc', + 'third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/plugin.cc', + 'third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc', + 'third_party/protobuf/src/google/protobuf/compiler/python/generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/python/helpers.cc', + 'third_party/protobuf/src/google/protobuf/compiler/python/pyi_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/retention.cc', + 'third_party/protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc', + 'third_party/protobuf/src/google/protobuf/compiler/subprocess.cc', + 'third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc', + 'third_party/protobuf/src/google/protobuf/descriptor.cc', + 'third_party/protobuf/src/google/protobuf/descriptor.pb.cc', + 'third_party/protobuf/src/google/protobuf/descriptor_database.cc', + 'third_party/protobuf/src/google/protobuf/dynamic_message.cc', + 'third_party/protobuf/src/google/protobuf/extension_set.cc', + 'third_party/protobuf/src/google/protobuf/extension_set_heavy.cc', + 'third_party/protobuf/src/google/protobuf/generated_enum_util.cc', + 'third_party/protobuf/src/google/protobuf/generated_message_bases.cc', + 'third_party/protobuf/src/google/protobuf/generated_message_reflection.cc', + 'third_party/protobuf/src/google/protobuf/generated_message_tctable_full.cc', + 'third_party/protobuf/src/google/protobuf/generated_message_tctable_gen.cc', + 'third_party/protobuf/src/google/protobuf/generated_message_tctable_lite.cc', + 'third_party/protobuf/src/google/protobuf/generated_message_util.cc', + 'third_party/protobuf/src/google/protobuf/implicit_weak_message.cc', + 'third_party/protobuf/src/google/protobuf/inlined_string_field.cc', + 'third_party/protobuf/src/google/protobuf/io/coded_stream.cc', + 'third_party/protobuf/src/google/protobuf/io/gzip_stream.cc', + 'third_party/protobuf/src/google/protobuf/io/io_win32.cc', + 'third_party/protobuf/src/google/protobuf/io/printer.cc', + 'third_party/protobuf/src/google/protobuf/io/strtod.cc', + 'third_party/protobuf/src/google/protobuf/io/tokenizer.cc', + 'third_party/protobuf/src/google/protobuf/io/zero_copy_sink.cc', + 'third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc', + 'third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc', + 'third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc', + 'third_party/protobuf/src/google/protobuf/map.cc', + 'third_party/protobuf/src/google/protobuf/map_field.cc', + 'third_party/protobuf/src/google/protobuf/message.cc', + 'third_party/protobuf/src/google/protobuf/message_lite.cc', + 'third_party/protobuf/src/google/protobuf/parse_context.cc', + 'third_party/protobuf/src/google/protobuf/reflection_ops.cc', + 'third_party/protobuf/src/google/protobuf/repeated_field.cc', + 'third_party/protobuf/src/google/protobuf/repeated_ptr_field.cc', + 'third_party/protobuf/src/google/protobuf/service.cc', + 'third_party/protobuf/src/google/protobuf/stubs/common.cc', + 'third_party/protobuf/src/google/protobuf/text_format.cc', + 'third_party/protobuf/src/google/protobuf/unknown_field_set.cc', + 'third_party/protobuf/src/google/protobuf/wire_format.cc', + 'third_party/protobuf/src/google/protobuf/wire_format_lite.cc', + 'third_party/utf8_range/utf8_validity.cc' ] PROTO_FILES=[ @@ -199,7 +286,9 @@ PROTO_FILES=[ 'google/protobuf/wrappers.proto' ] -CC_INCLUDE='third_party/protobuf/src' +CC_INCLUDES=[ + 'third_party/abseil-cpp', 'third_party/protobuf/src', 'third_party/utf8_range' +] PROTO_INCLUDE='third_party/protobuf/src' -PROTOBUF_SUBMODULE_VERSION="f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c" +PROTOBUF_SUBMODULE_VERSION="5ddb1fc609d2416e8575c9e7435c608222c2edb2" diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index 0b5dc69591f..3c4e7ce99c1 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -195,7 +195,9 @@ CC_FILES = [os.path.normpath(cc_file) for cc_file in protoc_lib_deps.CC_FILES] PROTO_FILES = [ os.path.normpath(proto_file) for proto_file in protoc_lib_deps.PROTO_FILES ] -CC_INCLUDE = os.path.normpath(protoc_lib_deps.CC_INCLUDE) +CC_INCLUDES = [ + os.path.normpath(include_dir) for include_dir in protoc_lib_deps.CC_INCLUDES +] PROTO_INCLUDE = os.path.normpath(protoc_lib_deps.PROTO_INCLUDE) GRPC_PYTHON_TOOLS_PACKAGE = 'grpc_tools' @@ -258,7 +260,7 @@ def extension_modules(): os.path.join('grpc_tools', 'main.cc'), os.path.join('grpc_root', 'src', 'compiler', 'python_generator.cc'), os.path.join('grpc_root', 'src', 'compiler', 'proto_parser_helper.cc') - ] + [os.path.join(CC_INCLUDE, cc_file) for cc_file in CC_FILES] + ] + CC_FILES plugin_ext = extension.Extension( name='grpc_tools._protoc_compiler', @@ -267,8 +269,7 @@ def extension_modules(): '.', 'grpc_root', os.path.join('grpc_root', 'include'), - CC_INCLUDE, - ], + ] + CC_INCLUDES, language='c++', define_macros=list(DEFINE_MACROS), extra_compile_args=list(EXTRA_COMPILE_ARGS), diff --git a/tools/distrib/python/make_grpcio_tools.py b/tools/distrib/python/make_grpcio_tools.py index aced34a8fae..34132723d78 100755 --- a/tools/distrib/python/make_grpcio_tools.py +++ b/tools/distrib/python/make_grpcio_tools.py @@ -28,6 +28,7 @@ import sys import traceback import uuid +# the template for the content of protoc_lib_deps.py DEPS_FILE_CONTENT = """ # Copyright 2017 gRPC authors. # @@ -48,50 +49,71 @@ CC_FILES={cc_files} PROTO_FILES={proto_files} -CC_INCLUDE={cc_include} +CC_INCLUDES={cc_includes} PROTO_INCLUDE={proto_include} -{commit_hash} +{commit_hash_expr} """ +# expose commit hash suffix and prefix for check_grpcio_tools.py COMMIT_HASH_PREFIX = 'PROTOBUF_SUBMODULE_VERSION="' COMMIT_HASH_SUFFIX = '"' -# Bazel query result prefix for expected source files in protobuf. -PROTOBUF_CC_PREFIX = '//src/' -PROTOBUF_CC_PREFIX_PRE_22_X = '//:src/' -PROTOBUF_PROTO_PREFIX = '//src/' -PROTOBUF_PROTO_PREFIX_PRE_22_X = '//:src/' +EXTERNAL_LINKS = [ + ('@com_google_absl//', 'third_party/abseil-cpp/'), + ('@com_google_protobuf//', 'third_party/protobuf/'), + ('@utf8_range//:', 'third_party/utf8_range/'), +] +PROTOBUF_PROTO_PREFIX = '@com_google_protobuf//src/' + +# will be added to include path when building grpcio_tools +CC_INCLUDES = [ + os.path.join('third_party', 'abseil-cpp'), + os.path.join('third_party', 'protobuf', 'src'), + os.path.join('third_party', 'utf8_range'), +] + +# include path for .proto files +PROTO_INCLUDE = os.path.join('third_party', 'protobuf', 'src') + +# the target directory is relative to the grpcio_tools package root. +GRPCIO_TOOLS_ROOT_PREFIX = 'tools/distrib/python/grpcio_tools/' + +# Pairs of (source, target) directories to copy +# from the grpc repo root to the grpcio_tools build root. +COPY_FILES_SOURCE_TARGET_PAIRS = [ + ('include', 'grpc_root/include'), + ('src/compiler', 'grpc_root/src/compiler'), + ('third_party/abseil-cpp/absl', 'third_party/abseil-cpp/absl'), + ('third_party/protobuf/src', 'third_party/protobuf/src'), + ('third_party/utf8_range', 'third_party/utf8_range') +] + +# grpc repo root GRPC_ROOT = os.path.abspath( os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '..')) -GRPC_PYTHON_ROOT = os.path.join(GRPC_ROOT, 'tools', 'distrib', 'python', - 'grpcio_tools') - -GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT = os.path.join('third_party', 'protobuf', - 'src') -GRPC_PROTOBUF = os.path.join(GRPC_ROOT, GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT) +# the directory under which to probe for the current protobuf commit SHA GRPC_PROTOBUF_SUBMODULE_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'protobuf') -GRPC_PROTOC_PLUGINS = os.path.join(GRPC_ROOT, 'src', 'compiler') -GRPC_PYTHON_PROTOBUF = os.path.join(GRPC_PYTHON_ROOT, 'third_party', 'protobuf', - 'src') -GRPC_PYTHON_PROTOC_PLUGINS = os.path.join(GRPC_PYTHON_ROOT, 'grpc_root', 'src', - 'compiler') -GRPC_PYTHON_PROTOC_LIB_DEPS = os.path.join(GRPC_PYTHON_ROOT, + +# the file to generate +GRPC_PYTHON_PROTOC_LIB_DEPS = os.path.join(GRPC_ROOT, 'tools', 'distrib', + 'python', 'grpcio_tools', 'protoc_lib_deps.py') -GRPC_INCLUDE = os.path.join(GRPC_ROOT, 'include') -GRPC_PYTHON_INCLUDE = os.path.join(GRPC_PYTHON_ROOT, 'grpc_root', 'include') - +# the script to run for getting dependencies BAZEL_DEPS = os.path.join(GRPC_ROOT, 'tools', 'distrib', 'python', 'bazel_deps.sh') -BAZEL_DEPS_PROTOC_LIB_QUERY = '//:protoc_lib' + +# the bazel target to scrape to get list of sources for the build +BAZEL_DEPS_PROTOC_LIB_QUERY = '@com_google_protobuf//:protoc_lib' + BAZEL_DEPS_COMMON_PROTOS_QUERIES = [ - '//:well_known_type_protos', + '@com_google_protobuf//:well_known_type_protos', # has both plugin.proto and descriptor.proto - '//:compiler_plugin_proto', + '@com_google_protobuf//:compiler_plugin_proto', ] @@ -105,7 +127,8 @@ def protobuf_submodule_commit_hash(): return output.decode("ascii").splitlines()[0].strip() -def bazel_query(query): +def _bazel_query(query): + """Runs 'bazel query' to collect source file info.""" print('Running "bazel query %s"' % query) output = subprocess.check_output([BAZEL_DEPS, query]) return output.decode("ascii").splitlines() @@ -123,76 +146,105 @@ def _pretty_print_list(items): return formatted -def get_deps(): - """Write the result of the bazel query `query` against protobuf to - `out_file`.""" - cc_files_output = bazel_query(BAZEL_DEPS_PROTOC_LIB_QUERY) +def _bazel_name_to_file_path(name): + """Transform bazel reference to source file name.""" + for link in EXTERNAL_LINKS: + if name.startswith(link[0]): + filepath = link[1] + name[len(link[0]):].replace(':', '/') - cc_files = [ - name[len(PROTOBUF_CC_PREFIX):].replace(':', '/') - for name in cc_files_output - if name.endswith('.cc') and name.startswith(PROTOBUF_CC_PREFIX) - ] + [ - # compatibility with versions of protobuf 21.x and older - name[len(PROTOBUF_CC_PREFIX_PRE_22_X):] - for name in cc_files_output - if name.endswith('.cc') and name.startswith(PROTOBUF_CC_PREFIX_PRE_22_X) - ] + # For some reason, the WKT sources (such as wrappers.pb.cc) + # end up being reported by bazel as having an extra 'wkt/google/protobuf' + # in path. Removing it makes the compilation pass. + # TODO(jtattermusch) Get dir of this hack. + return filepath.replace('wkt/google/protobuf/', '') + return None + + +def _generate_deps_file_content(): + """Returns the data structure with dependencies of protoc as python code.""" + cc_files_output = _bazel_query(BAZEL_DEPS_PROTOC_LIB_QUERY) + + # Collect .cc files (that will be later included in the native extension build) + cc_files = [] + for name in cc_files_output: + if name.endswith('.cc'): + filepath = _bazel_name_to_file_path(name) + if filepath: + cc_files.append(filepath) + + # Collect list of .proto files that will be bundled in the grpcio_tools package. raw_proto_files = [] for target in BAZEL_DEPS_COMMON_PROTOS_QUERIES: - raw_proto_files += bazel_query(target) + raw_proto_files += _bazel_query(target) proto_files = [ name[len(PROTOBUF_PROTO_PREFIX):].replace(':', '/') for name in raw_proto_files if name.endswith('.proto') and name.startswith(PROTOBUF_PROTO_PREFIX) - ] + [ - # compatibility with versions of protobuf 21.x and older - name[len(PROTOBUF_PROTO_PREFIX_PRE_22_X):] - for name in raw_proto_files - if name.endswith('.proto') and - name.startswith(PROTOBUF_PROTO_PREFIX_PRE_22_X) ] + commit_hash = protobuf_submodule_commit_hash() + commit_hash_expr = COMMIT_HASH_PREFIX + commit_hash + COMMIT_HASH_SUFFIX + deps_file_content = DEPS_FILE_CONTENT.format( cc_files=_pretty_print_list(sorted(cc_files)), - proto_files=_pretty_print_list(sorted(proto_files)), - cc_include=repr(GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT), - proto_include=repr(GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT), - commit_hash=COMMIT_HASH_PREFIX + commit_hash + COMMIT_HASH_SUFFIX) + proto_files=_pretty_print_list(sorted(set(proto_files))), + cc_includes=_pretty_print_list(CC_INCLUDES), + proto_include=repr(PROTO_INCLUDE), + commit_hash_expr=commit_hash_expr) return deps_file_content -def long_path(path): - if os.name == 'nt': - return '\\\\?\\' + path - else: - return path +def _copy_source_tree(source, target): + """Copies source directory to a given target directory.""" + print('Copying contents of %s to %s' % (source, target)) + # TODO(jtattermusch): It is unclear why this legacy code needs to copy + # the source directory to the target via the following boilerplate. + # Should this code be simplified? + for source_dir, _, files in os.walk(source): + target_dir = os.path.abspath( + os.path.join(target, os.path.relpath(source_dir, source))) + try: + os.makedirs(target_dir) + except OSError as error: + if error.errno != errno.EEXIST: + raise + for relative_file in files: + source_file = os.path.abspath( + os.path.join(source_dir, relative_file)) + target_file = os.path.abspath( + os.path.join(target_dir, relative_file)) + shutil.copyfile(source_file, target_file) def main(): os.chdir(GRPC_ROOT) - for source, target in [(GRPC_PROTOBUF, GRPC_PYTHON_PROTOBUF), - (GRPC_PROTOC_PLUGINS, GRPC_PYTHON_PROTOC_PLUGINS), - (GRPC_INCLUDE, GRPC_PYTHON_INCLUDE)]: - for source_dir, _, files in os.walk(source): - target_dir = os.path.abspath( - os.path.join(target, os.path.relpath(source_dir, source))) - try: - os.makedirs(target_dir) - except OSError as error: - if error.errno != errno.EEXIST: - raise - for relative_file in files: - source_file = os.path.abspath( - os.path.join(source_dir, relative_file)) - target_file = os.path.abspath( - os.path.join(target_dir, relative_file)) - shutil.copyfile(source_file, target_file) + # Step 1: + # In order to be able to build the grpcio_tools package, we need the source code for the codegen plugins + # and its dependencies to be available under the build root of the grpcio_tools package. + # So we simply copy all the necessary files where the build will expect them to be. + for source, target in COPY_FILES_SOURCE_TARGET_PAIRS: + # convert the slashes in the relative path to platform-specific path dividers. + # All paths are relative to GRPC_ROOT + source_abs = os.path.join(GRPC_ROOT, os.path.join(*source.split('/'))) + # for targets, add grpcio_tools root prefix + target = GRPCIO_TOOLS_ROOT_PREFIX + target + target_abs = os.path.join(GRPC_ROOT, os.path.join(*target.split('/'))) + _copy_source_tree(source_abs, target_abs) + print( + 'The necessary source files were copied under the grpcio_tools package root.' + ) + print() + + # Step 2: + # Extract build metadata from bazel build (by running "bazel query") + # and populate the protoc_lib_deps.py file with python-readable data structure + # that will be used by grpcio_tools's setup.py (so it knows how to configure + # the native build for the codegen plugin) try: print('Invoking "bazel query" to gather the protobuf dependencies.') - protoc_lib_deps_content = get_deps() + protoc_lib_deps_content = _generate_deps_file_content() except Exception as error: # We allow this script to succeed even if we couldn't get the dependencies, # as then we can assume that even without a successful bazel run the diff --git a/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh b/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh index d368826e9a9..b92259cf452 100755 --- a/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh +++ b/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh @@ -28,6 +28,7 @@ bazel_binder_example_app/bazel_wrapper \ --bazelrc=tools/remote_build/include/test_locally_with_resultstore_results.bazelrc \ build \ --define=use_strict_warning=true \ + --copt=-Wno-unknown-warning-option \ --fat_apk_cpu=x86_64,arm64-v8a \ --extra_toolchains=@rules_python//python:autodetecting_toolchain_nonstrict \ //examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app \ diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 5dbd51afca8..54587dd2071 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -36,7 +36,7 @@ third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45 third_party/libuv 02a9e1be252b623ee032a3137c0b0c94afbe6809 third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89 third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df -third_party/protobuf f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c +third_party/protobuf 5ddb1fc609d2416e8575c9e7435c608222c2edb2 third_party/re2 0c5616df9c0aaa44c9440d87422012423d91c7d1 third_party/xds 32f1caf87195bf3390061c29f18987e51ca56a88 third_party/zlib 04f42ceca40f73e2978b50e93806c2a18c1281fc